Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: LOTOS (Language Of Temporal Ordering Specifications, IS8807) |
| 3 | " Maintainer: Daniel Amyot <damyot@csi.uottawa.ca> |
| 4 | " Last Change: Wed Aug 19 1998 |
| 5 | " URL: http://lotos.csi.uottawa.ca/~damyot/vim/lotos.vim |
| 6 | " This file is an adaptation of pascal.vim by Mario Eusebio |
| 7 | " I'm not sure I understand all of the syntax highlight language, |
| 8 | " but this file seems to do the job for standard LOTOS. |
| 9 | |
| 10 | " For version 5.x: Clear all syntax items |
| 11 | " For version 6.x: Quit when a syntax file was already loaded |
| 12 | if version < 600 |
| 13 | syntax clear |
| 14 | elseif exists("b:current_syntax") |
| 15 | finish |
| 16 | endif |
| 17 | |
| 18 | syn case ignore |
| 19 | |
| 20 | "Comments in LOTOS are between (* and *) |
| 21 | syn region lotosComment start="(\*" end="\*)" contains=lotosTodo |
| 22 | |
| 23 | "Operators [], [...], >>, ->, |||, |[...]|, ||, ;, !, ?, :, =, ,, := |
| 24 | syn match lotosDelimiter "[][]" |
| 25 | syn match lotosDelimiter ">>" |
| 26 | syn match lotosDelimiter "->" |
| 27 | syn match lotosDelimiter "\[>" |
| 28 | syn match lotosDelimiter "[|;!?:=,]" |
| 29 | |
| 30 | "Regular keywords |
| 31 | syn keyword lotosStatement specification endspec process endproc |
| 32 | syn keyword lotosStatement where behaviour behavior |
| 33 | syn keyword lotosStatement any let par accept choice hide of in |
| 34 | syn keyword lotosStatement i stop exit noexit |
| 35 | |
| 36 | "Operators from the Abstract Data Types in IS8807 |
| 37 | syn keyword lotosOperator eq ne succ and or xor implies iff |
| 38 | syn keyword lotosOperator not true false |
| 39 | syn keyword lotosOperator Insert Remove IsIn NotIn Union Ints |
| 40 | syn keyword lotosOperator Minus Includes IsSubsetOf |
| 41 | syn keyword lotosOperator lt le ge gt 0 |
| 42 | |
| 43 | "Sorts in IS8807 |
| 44 | syn keyword lotosSort Boolean Bool FBoolean FBool Element |
| 45 | syn keyword lotosSort Set String NaturalNumber Nat HexString |
| 46 | syn keyword lotosSort HexDigit DecString DecDigit |
| 47 | syn keyword lotosSort OctString OctDigit BitString Bit |
| 48 | syn keyword lotosSort Octet OctetString |
| 49 | |
| 50 | "Keywords for ADTs |
| 51 | syn keyword lotosType type endtype library endlib sorts formalsorts |
| 52 | syn keyword lotosType eqns formaleqns opns formalopns forall ofsort is |
| 53 | syn keyword lotosType for renamedby actualizedby sortnames opnnames |
| 54 | syn keyword lotosType using |
| 55 | |
| 56 | syn sync lines=250 |
| 57 | |
| 58 | " Define the default highlighting. |
| 59 | " For version 5.7 and earlier: only when not done already |
| 60 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 61 | if version >= 508 || !exists("did_lotos_syntax_inits") |
| 62 | if version < 508 |
| 63 | let did_lotos_syntax_inits = 1 |
| 64 | command -nargs=+ HiLink hi link <args> |
| 65 | else |
| 66 | command -nargs=+ HiLink hi def link <args> |
| 67 | endif |
| 68 | |
| 69 | HiLink lotosStatement Statement |
| 70 | HiLink lotosProcess Label |
| 71 | HiLink lotosOperator Operator |
| 72 | HiLink lotosSort Function |
| 73 | HiLink lotosType Type |
| 74 | HiLink lotosComment Comment |
| 75 | HiLink lotosDelimiter String |
| 76 | |
| 77 | delcommand HiLink |
| 78 | endif |
| 79 | |
| 80 | let b:current_syntax = "lotos" |
| 81 | |
| 82 | " vim: ts=8 |