home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / syntax / vhdl.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  5.7 KB  |  159 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:    VHDL
  3. " Maintainer:    Czo <Olivier.Sirol@lip6.fr>
  4. " Credits:    Stephan Hegel <ea273@fen.baynet.de>
  5. " $Id: vhdl.vim,v 1.5 1999/06/28 15:08:41 czo Exp $
  6.  
  7. " Remove any old syntax stuff hanging around
  8. syn clear
  9.  
  10. " This is not VHDL. I use the C-Preprocessor cpp to generate different binaries
  11. " from one VHDL source file. Unfortunately there is no preprocessor for VHDL
  12. " available. If you don't like this, please remove the following lines.
  13. syn match cDefine "^#ifdef[ ]\+[A-Za-z_]\+"
  14. syn match cDefine "^#endif"
  15.  
  16. " case is not significant
  17. syn case ignore
  18.  
  19. " VHDL keywords
  20. syn keyword vhdlStatement access after alias all assert
  21. syn keyword vhdlStatement architecture array attribute
  22. syn keyword vhdlStatement begin block body buffer bus
  23. syn keyword vhdlStatement case component configuration constant
  24. syn keyword vhdlStatement disconnect downto
  25. syn keyword vhdlStatement else elsif end entity exit
  26. syn keyword vhdlStatement file for function
  27. syn keyword vhdlStatement generate generic group guarded
  28. syn keyword vhdlStatement if impure in inertial inout is
  29. syn keyword vhdlStatement label library linkage literal loop
  30. syn keyword vhdlStatement map
  31. syn keyword vhdlStatement new next null
  32. syn keyword vhdlStatement of on open others out
  33. syn keyword vhdlStatement package port postponed procedure process pure
  34. syn keyword vhdlStatement range record register reject report return
  35. syn keyword vhdlStatement select severity signal shared
  36. syn keyword vhdlStatement subtype
  37. syn keyword vhdlStatement then to transport type
  38. syn keyword vhdlStatement unaffected units until use
  39. syn keyword vhdlStatement variable wait when while with
  40. syn keyword vhdlStatement note warning error failure
  41.  
  42. " Predifined VHDL types
  43. syn keyword vhdlType bit bit_vector
  44. syn keyword vhdlType character boolean integer real time
  45. syn keyword vhdlType string severity_level
  46. " Predifined standard ieee VHDL types
  47. syn keyword vhdlType natural signed unsigned
  48. syn keyword vhdlType line text
  49. syn keyword vhdlType std_logic std_logic_vector
  50. syn keyword vhdlType std_ulogic std_ulogic_vector
  51. " Predefined non standard VHDL types for Mentor Graphics Sys1076/QuickHDL
  52. syn keyword vhdlType qsim_state qsim_state_vector
  53. syn keyword vhdlType qsim_12state qsim_12state_vector
  54. syn keyword vhdlType qsim_strength
  55.  
  56. " array attributes
  57. syn match vhdlAttribute "\'high"
  58. syn match vhdlAttribute "\'left"
  59. syn match vhdlAttribute "\'length"
  60. syn match vhdlAttribute "\'low"
  61. syn match vhdlAttribute "\'range"
  62. syn match vhdlAttribute "\'reverse_range"
  63. syn match vhdlAttribute "\'right"
  64. syn match vhdlAttribute "\'ascending"
  65. " block attributes
  66. syn match vhdlAttribute "\'behaviour"
  67. syn match vhdlAttribute "\'structure"
  68. syn match vhdlAttribute "\'simple_name"
  69. syn match vhdlAttribute "\'instance_name"
  70. syn match vhdlAttribute "\'path_name"
  71. syn match vhdlAttribute "\'foreign"
  72. " signal attribute
  73. syn match vhdlAttribute "\'active"
  74. syn match vhdlAttribute "\'delayed"
  75. syn match vhdlAttribute "\'event"
  76. syn match vhdlAttribute "\'last_active"
  77. syn match vhdlAttribute "\'last_event"
  78. syn match vhdlAttribute "\'last_value"
  79. syn match vhdlAttribute "\'quiet"
  80. syn match vhdlAttribute "\'stable"
  81. syn match vhdlAttribute "\'transaction"
  82. syn match vhdlAttribute "\'driving"
  83. syn match vhdlAttribute "\'driving_value"
  84. " type attributes
  85. syn match vhdlAttribute "\'base"
  86. syn match vhdlAttribute "\'high"
  87. syn match vhdlAttribute "\'left"
  88. syn match vhdlAttribute "\'leftof"
  89. syn match vhdlAttribute "\'low"
  90. syn match vhdlAttribute "\'pos"
  91. syn match vhdlAttribute "\'pred"
  92. syn match vhdlAttribute "\'rightof"
  93. syn match vhdlAttribute "\'succ"
  94. syn match vhdlAttribute "\'val"
  95. syn match vhdlAttribute "\'image"
  96. syn match vhdlAttribute "\'value"
  97.  
  98. syn keyword vhdlBoolean true false
  99.  
  100. " for this vector values case is significant
  101. syn case match
  102. " Values for standard VHDL types
  103. syn match vhdlVector "\'[0L1HXWZU\-\?]\'"
  104. " Values for non standard VHDL types qsim_12state for Mentor Graphics Sys1076/QuickHDL
  105. syn keyword vhdlVector S0S S1S SXS S0R S1R SXR S0Z S1Z SXZ S0I S1I SXI
  106. syn case ignore
  107.  
  108. syn match  vhdlVector "B\"[01_]\+\""
  109. syn match  vhdlVector "O\"[0-7_]\+\""
  110. syn match  vhdlVector "X\"[0-9a-f_]\+\""
  111. syn match  vhdlCharacter "\'[&><=:+\-*\/().,;\'$#|~!%@?\^\[\]{}\\a-z0-9 ]\'"
  112. syn region vhdlString start=+"+  end=+"+
  113.  
  114. " floating numbers
  115. syn match vhdlNumber "-\=\<\d\+\.\d\+\(E[+\-]\=\d\+\)\>"
  116. syn match vhdlNumber "-\=\<\d\+\.\d\+\>"
  117. syn match vhdlNumber "0*2#[01_]\+\.[01_]\+#\(E[+\-]\=\d\+\)\="
  118. syn match vhdlNumber "0*16#[0-9a-f_]\+\.[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
  119. " integer numbers
  120. syn match vhdlNumber "-\=\<\d\+\(E[+\-]\=\d\+\)\>"
  121. syn match vhdlNumber "-\=\<\d\+\>"
  122. syn match vhdlNumber "0*2#[01_]\+#\(E[+\-]\=\d\+\)\="
  123. syn match vhdlNumber "0*16#[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
  124. " operators
  125. syn keyword vhdlOperator and nand or nor xor xnor
  126. syn keyword vhdlOperator rol ror sla sll sra srl
  127. syn keyword vhdlOperator mod rem abs not
  128. syn match   vhdlOperator "[&><=:+\-*\/|]"
  129. syn match   vhdlSpecial  "[().,;]"
  130. " time
  131. syn match vhdlTime "\<\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
  132. syn match vhdlTime "\<\d\+\.\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
  133.  
  134. syn match vhdlComment "--.*$"
  135. " syn match vhdlGlobal "[\'$#~!%@?\^\[\]{}\\]"
  136.  
  137. if !exists("did_vhdl_syntax_inits")
  138.   let did_vhdl_syntax_inits = 1
  139.   " The default methods for highlighting. Can be overridden later
  140.   hi link cDefine       PreProc
  141.   hi link vhdlSpecial   Special
  142.   hi link vhdlStatement Statement
  143.   hi link vhdlCharacter String
  144.   hi link vhdlString    String
  145.   hi link vhdlVector    String
  146.   hi link vhdlBoolean   String
  147.   hi link vhdlComment   Comment
  148.   hi link vhdlNumber    String
  149.   hi link vhdlTime      String
  150.   hi link vhdlType      Type
  151.   hi link vhdlOperator  Type
  152.   hi link vhdlGlobal    Error
  153.   hi link vhdlAttribute Type
  154. endif
  155.  
  156. let b:current_syntax = "vhdl"
  157.  
  158. " vim: ts=8
  159.