xref: /vim-8.2.3635/runtime/syntax/lotos.vim (revision 2bf24176)
1" Vim syntax file
2" Language:	LOTOS (Language Of Temporal Ordering Specifications, IS8807)
3" Maintainer:	Daniel Amyot <[email protected]>
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
12if version < 600
13  syntax clear
14elseif exists("b:current_syntax")
15  finish
16endif
17
18syn case ignore
19
20"Comments in LOTOS are between (* and *)
21syn region lotosComment	start="(\*"  end="\*)" contains=lotosTodo
22
23"Operators [], [...], >>, ->, |||, |[...]|, ||, ;, !, ?, :, =, ,, :=
24syn match  lotosDelimiter       "[][]"
25syn match  lotosDelimiter	">>"
26syn match  lotosDelimiter	"->"
27syn match  lotosDelimiter	"\[>"
28syn match  lotosDelimiter	"[|;!?:=,]"
29
30"Regular keywords
31syn keyword lotosStatement	specification endspec process endproc
32syn keyword lotosStatement	where behaviour behavior
33syn keyword lotosStatement      any let par accept choice hide of in
34syn keyword lotosStatement	i stop exit noexit
35
36"Operators from the Abstract Data Types in IS8807
37syn keyword lotosOperator	eq ne succ and or xor implies iff
38syn keyword lotosOperator	not true false
39syn keyword lotosOperator	Insert Remove IsIn NotIn Union Ints
40syn keyword lotosOperator	Minus Includes IsSubsetOf
41syn keyword lotosOperator	lt le ge gt 0
42
43"Sorts in IS8807
44syn keyword lotosSort		Boolean Bool FBoolean FBool Element
45syn keyword lotosSort		Set String NaturalNumber Nat HexString
46syn keyword lotosSort		HexDigit DecString DecDigit
47syn keyword lotosSort		OctString OctDigit BitString Bit
48syn keyword lotosSort		Octet OctetString
49
50"Keywords for ADTs
51syn keyword lotosType	type endtype library endlib sorts formalsorts
52syn keyword lotosType	eqns formaleqns opns formalopns forall ofsort is
53syn keyword lotosType   for renamedby actualizedby sortnames opnnames
54syn keyword lotosType   using
55
56syn 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
61if 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
78endif
79
80let b:current_syntax = "lotos"
81
82" vim: ts=8
83