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