xref: /vim-8.2.3635/runtime/syntax/specman.vim (revision 89a9c159)
1" Vim syntax file
2" Language:	SPECMAN E-LANGUAGE
3" Maintainer:	Or Freund <[email protected] ;[email protected]; [email protected]>
4" Last Update: Wed Oct 24 2001
5
6"---------------------------------------------------------
7"| If anyone found an error or fix the parenthesis part  |
8"| I will be happy to hear about it			 |
9"| Thanks Or.						 |
10"---------------------------------------------------------
11
12" Remove any old syntax stuff hanging around
13" quit when a syntax file was already loaded
14if exists("b:current_syntax")
15  finish
16endif
17
18syn keyword  specmanTodo	contained TODO todo ToDo FIXME XXX
19
20syn keyword specmanStatement   var instance on compute start event expect check that routine
21syn keyword specmanStatement   specman is also first only with like
22syn keyword specmanStatement   list of all radix hex dec bin ignore illegal
23syn keyword specmanStatement   traceable untraceable
24syn keyword specmanStatement   cover using count_only trace_only at_least transition item ranges
25syn keyword specmanStatement   cross text call task within
26
27syn keyword specmanMethod      initialize non_terminal testgroup delayed exit finish
28syn keyword specmanMethod      out append print outf appendf
29syn keyword specmanMethod      post_generate pre_generate setup_test finalize_test extract_test
30syn keyword specmanMethod      init run copy as_a set_config dut_error add clear lock quit
31syn keyword specmanMethod      lock unlock release swap quit to_string value stop_run
32syn keyword specmanMethod      crc_8 crc_32 crc_32_flip get_config add0 all_indices and_all
33syn keyword specmanMethod      apply average count delete exists first_index get_indices
34syn keyword specmanMethod      has insert is_a_permutation is_empty key key_exists key_index
35syn keyword specmanMethod      last last_index max max_index max_value min min_index
36syn keyword specmanMethod      min_value or_all pop pop0 push push0 product resize reverse
37syn keyword specmanMethod      sort split sum top top0 unique clear is_all_iterations
38syn keyword specmanMethod      get_enclosing_unit hdl_path exec deep_compare deep_compare_physical
39syn keyword specmanMethod      pack unpack warning error fatal
40syn match   specmanMethod      "size()"
41syn keyword specmanPacking     packing low high
42syn keyword specmanType        locker address
43syn keyword specmanType        body code vec chars
44syn keyword specmanType        integer real bool int long uint byte bits bit time string
45syn keyword specmanType        byte_array external_pointer
46syn keyword specmanBoolean     TRUE FALSE
47syn keyword specmanPreCondit   #ifdef #ifndef #else
48
49syn keyword specmanConditional choose matches
50syn keyword specmanConditional if then else when try
51
52
53
54syn keyword specmanLabel  case casex casez default
55
56syn keyword specmanLogical     and or not xor
57
58syn keyword specmanRepeat      until repeat while for from to step each do break continue
59syn keyword specmanRepeat      before next sequence always -kind network
60syn keyword specmanRepeat      index it me in new return result select
61
62syn keyword specmanTemporal    cycle sample events forever
63syn keyword specmanTemporal    wait  change  negedge rise fall delay sync sim true detach eventually emit
64
65syn keyword specmanConstant    MAX_INT MIN_INT NULL UNDEF
66
67syn keyword specmanDefine       define as computed type extend
68syn keyword specmanDefine       verilog vhdl variable global sys
69syn keyword specmanStructure    struct unit
70syn keyword specmanInclude     import
71syn keyword specmanConstraint  gen keep keeping soft	before
72
73syn keyword specmanSpecial     untyped symtab ECHO DOECHO
74syn keyword specmanFile        files load module ntv source_ref script read write
75syn keyword specmanFSM	       initial idle others posedge clock cycles
76
77
78syn match   specmanOperator    "[&|~><!)(*%@+/=?:;}{,.\^\-\[\]]"
79syn match   specmanOperator    "+="
80syn match   specmanOperator    "-="
81syn match   specmanOperator    "*="
82
83syn match   specmanComment     "//.*"  contains=specmanTodo
84syn match   specmanComment     "--.*"
85syn region  specmanComment     start="^'>"hs=s+2 end="^<'"he=e-2
86
87syn match   specmanHDL	       "'[`.a-zA-Z0-9_@\[\]]\+\>'"
88
89
90syn match   specmanCompare    "=="
91syn match   specmanCompare    "!==="
92syn match   specmanCompare    "==="
93syn match   specmanCompare    "!="
94syn match   specmanCompare    ">="
95syn match   specmanCompare    "<="
96syn match   specmanNumber "[0-9]:[0-9]"
97syn match   specmanNumber "\(\<\d\+\|\)'[bB]\s*[0-1_xXzZ?]\+\>"
98syn match   specmanNumber "0[bB]\s*[0-1_xXzZ?]\+\>"
99syn match   specmanNumber "\(\<\d\+\|\)'[oO]\s*[0-7_xXzZ?]\+\>"
100syn match   specmanNumber "0[oO]\s*[0-9a-fA-F_xXzZ?]\+\>"
101syn match   specmanNumber "\(\<\d\+\|\)'[dD]\s*[0-9_xXzZ?]\+\>"
102syn match   specmanNumber "\(\<\d\+\|\)'[hH]\s*[0-9a-fA-F_xXzZ?]\+\>"
103syn match   specmanNumber "0[xX]\s*[0-9a-fA-F_xXzZ?]\+\>"
104syn match   specmanNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)\>"
105
106syn region  specmanString start=+"+  end=+"+
107
108
109
110"**********************************************************************
111" I took this section from c.vim but I didnt succeded to make it work
112" ANY one who dare jumping to this deep watter is more than welocome!
113"**********************************************************************
114""catch errors caused by wrong parenthesis and brackets
115
116"syn cluster     specmanParenGroup     contains=specmanParenError
117"" ,specmanNumbera,specmanComment
118"if exists("specman_no_bracket_error")
119"syn region    specmanParen	     transparent start='(' end=')' contains=ALLBUT,@specmanParenGroup
120"syn match     specmanParenError     ")"
121"syn match     specmanErrInParen     contained "[{}]"
122"else
123"syn region    specmanParen	     transparent start='(' end=')' contains=ALLBUT,@specmanParenGroup,specmanErrInBracket
124"syn match     specmanParenError     "[\])]"
125"syn match     specmanErrInParen     contained "[\]{}]"
126"syn region    specmanBracket	     transparent start='\[' end=']' contains=ALLBUT,@specmanParenGroup,specmanErrInParen
127"syn match     specmanErrInBracket   contained "[);{}]"
128"endif
129"
130
131"Modify the following as needed.  The trade-off is performance versus
132"functionality.
133
134syn sync lines=50
135
136" Define the default highlighting.
137" Only when an item doesn't have highlighting yet
138" The default methods for highlighting.  Can be overridden later
139hi def link specmanConditional	Conditional
140hi def link specmanConstraint	Conditional
141hi def link specmanRepeat		Repeat
142hi def link specmanString		String
143hi def link specmanComment		Comment
144hi def link specmanConstant		Macro
145hi def link specmanNumber		Number
146hi def link specmanCompare		Operator
147hi def link specmanOperator		Operator
148hi def link specmanLogical		Operator
149hi def link specmanStatement	Statement
150hi def link specmanHDL		SpecialChar
151hi def link specmanMethod		Function
152hi def link specmanInclude		Include
153hi def link specmanStructure	Structure
154hi def link specmanBoolean		Boolean
155hi def link specmanFSM		Label
156hi def link specmanSpecial		Special
157hi def link specmanType		Type
158hi def link specmanTemporal		Type
159hi def link specmanFile		Include
160hi def link specmanPreCondit	Include
161hi def link specmanDefine		Typedef
162hi def link specmanLabel		Label
163hi def link specmanPacking		keyword
164hi def link specmanTodo		Todo
165hi def link specmanParenError	Error
166hi def link specmanErrInParen	Error
167hi def link specmanErrInBracket	Error
168
169let b:current_syntax = "specman"
170