specman.vim 7.2 KB

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