specman.vim (7349B)
1 " Vim syntax file 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 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 14 if exists("b:current_syntax") 15 finish 16 endif 17 18 syn keyword specmanTodo contained TODO todo ToDo FIXME XXX 19 20 syn keyword specmanStatement var instance on compute start event expect check that routine 21 syn keyword specmanStatement specman is also first only with like 22 syn keyword specmanStatement list of all radix hex dec bin ignore illegal 23 syn keyword specmanStatement traceable untraceable 24 syn keyword specmanStatement cover using count_only trace_only at_least transition item ranges 25 syn keyword specmanStatement cross text call task within 26 27 syn keyword specmanMethod initialize non_terminal testgroup delayed exit finish 28 syn keyword specmanMethod out append print outf appendf 29 syn keyword specmanMethod post_generate pre_generate setup_test finalize_test extract_test 30 syn keyword specmanMethod init run copy as_a set_config dut_error add clear lock quit 31 syn keyword specmanMethod lock unlock release swap quit to_string value stop_run 32 syn keyword specmanMethod crc_8 crc_32 crc_32_flip get_config add0 all_indices and_all 33 syn keyword specmanMethod apply average count delete exists first_index get_indices 34 syn keyword specmanMethod has insert is_a_permutation is_empty key key_exists key_index 35 syn keyword specmanMethod last last_index max max_index max_value min min_index 36 syn keyword specmanMethod min_value or_all pop pop0 push push0 product resize reverse 37 syn keyword specmanMethod sort split sum top top0 unique clear is_all_iterations 38 syn keyword specmanMethod get_enclosing_unit hdl_path exec deep_compare deep_compare_physical 39 syn keyword specmanMethod pack unpack warning error fatal 40 syn match specmanMethod "size()" 41 syn keyword specmanPacking packing low high 42 syn keyword specmanType locker address 43 syn keyword specmanType body code vec chars 44 syn keyword specmanType integer real bool int long uint byte bits bit time string 45 syn keyword specmanType byte_array external_pointer 46 syn keyword specmanBoolean TRUE FALSE 47 syn keyword specmanPreCondit #ifdef #ifndef #else 48 49 syn keyword specmanConditional choose matches 50 syn keyword specmanConditional if then else when try 51 52 53 54 syn keyword specmanLabel case casex casez default 55 56 syn keyword specmanLogical and or not xor 57 58 syn keyword specmanRepeat until repeat while for from to step each do break continue 59 syn keyword specmanRepeat before next sequence always -kind network 60 syn keyword specmanRepeat index it me in new return result select 61 62 syn keyword specmanTemporal cycle sample events forever 63 syn keyword specmanTemporal wait change negedge rise fall delay sync sim true detach eventually emit 64 65 syn keyword specmanConstant MAX_INT MIN_INT NULL UNDEF 66 67 syn keyword specmanDefine define as computed type extend 68 syn keyword specmanDefine verilog vhdl variable global sys 69 syn keyword specmanStructure struct unit 70 syn keyword specmanInclude import 71 syn keyword specmanConstraint gen keep keeping soft before 72 73 syn keyword specmanSpecial untyped symtab ECHO DOECHO 74 syn keyword specmanFile files load module ntv source_ref script read write 75 syn keyword specmanFSM initial idle others posedge clock cycles 76 77 78 syn match specmanOperator "[&|~><!)(*%@+/=?:;}{,.\^\-\[\]]" 79 syn match specmanOperator "+=" 80 syn match specmanOperator "-=" 81 syn match specmanOperator "*=" 82 83 syn match specmanComment "//.*" contains=specmanTodo 84 syn match specmanComment "--.*" 85 syn region specmanComment start="^'>"hs=s+2 end="^<'"he=e-2 86 87 syn match specmanHDL "'[`.a-zA-Z0-9_@\[\]]\+\>'" 88 89 90 syn match specmanCompare "==" 91 syn match specmanCompare "!===" 92 syn match specmanCompare "===" 93 syn match specmanCompare "!=" 94 syn match specmanCompare ">=" 95 syn match specmanCompare "<=" 96 syn match specmanNumber "[0-9]:[0-9]" 97 syn match specmanNumber "\(\<\d\+\|\)'[bB]\s*[0-1_xXzZ?]\+\>" 98 syn match specmanNumber "0[bB]\s*[0-1_xXzZ?]\+\>" 99 syn match specmanNumber "\(\<\d\+\|\)'[oO]\s*[0-7_xXzZ?]\+\>" 100 syn match specmanNumber "0[oO]\s*[0-9a-fA-F_xXzZ?]\+\>" 101 syn match specmanNumber "\(\<\d\+\|\)'[dD]\s*[0-9_xXzZ?]\+\>" 102 syn match specmanNumber "\(\<\d\+\|\)'[hH]\s*[0-9a-fA-F_xXzZ?]\+\>" 103 syn match specmanNumber "0[xX]\s*[0-9a-fA-F_xXzZ?]\+\>" 104 syn match specmanNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)\>" 105 106 syn region specmanString start=+"+ end=+"+ 107 108 109 110 "********************************************************************** 111 " I took this section from c.vim, but I didn't succeed in making it work 112 " ANY one who dares to jump into this deep water is more than welcome! 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 134 syn 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 139 hi def link specmanConditional Conditional 140 hi def link specmanConstraint Conditional 141 hi def link specmanRepeat Repeat 142 hi def link specmanString String 143 hi def link specmanComment Comment 144 hi def link specmanConstant Macro 145 hi def link specmanNumber Number 146 hi def link specmanCompare Operator 147 hi def link specmanOperator Operator 148 hi def link specmanLogical Operator 149 hi def link specmanStatement Statement 150 hi def link specmanHDL SpecialChar 151 hi def link specmanMethod Function 152 hi def link specmanInclude Include 153 hi def link specmanStructure Structure 154 hi def link specmanBoolean Boolean 155 hi def link specmanFSM Label 156 hi def link specmanSpecial Special 157 hi def link specmanType Type 158 hi def link specmanTemporal Type 159 hi def link specmanFile Include 160 hi def link specmanPreCondit Include 161 hi def link specmanDefine Typedef 162 hi def link specmanLabel Label 163 hi def link specmanPacking keyword 164 hi def link specmanTodo Todo 165 hi def link specmanParenError Error 166 hi def link specmanErrInParen Error 167 hi def link specmanErrInBracket Error 168 169 let b:current_syntax = "specman"