3 " Maintainer: John Cook <john.cook@kla-tencor.com>
4 " Last Change: 2001 Sep 2
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 " this language is oblivious to case
18 syn keyword abelHeader module title device options
19 syn keyword abelSection declarations equations test_vectors end
20 syn keyword abelDeclaration state truth_table state_diagram property
21 syn keyword abelType pin node attribute constant macro library
23 syn keyword abelTypeId com reg neg pos buffer dc reg_d reg_t contained
24 syn keyword abelTypeId reg_sr reg_jk reg_g retain xor invert contained
26 syn keyword abelStatement when then else if with endwith case endcase
27 syn keyword abelStatement fuses expr trace
29 " option to omit obsolete statements
30 if exists("abel_obsolete_ok")
31 syn keyword abelStatement enable flag in
33 syn keyword abelError enable flag in
37 syn match abelDirective "@alternate"
38 syn match abelDirective "@standard"
39 syn match abelDirective "@const"
40 syn match abelDirective "@dcset"
41 syn match abelDirective "@include"
42 syn match abelDirective "@page"
43 syn match abelDirective "@radix"
44 syn match abelDirective "@repeat"
45 syn match abelDirective "@irp"
46 syn match abelDirective "@expr"
47 syn match abelDirective "@if"
48 syn match abelDirective "@ifb"
49 syn match abelDirective "@ifnb"
50 syn match abelDirective "@ifdef"
51 syn match abelDirective "@ifndef"
52 syn match abelDirective "@ifiden"
53 syn match abelDirective "@ifniden"
55 syn keyword abelTodo contained TODO XXX FIXME
57 " wrap up type identifiers to differentiate them from normal strings
58 syn region abelSpecifier start='istype' end=';' contains=abelTypeIdChar,abelTypeId,abelTypeIdEnd keepend
59 syn match abelTypeIdChar "[,']" contained
60 syn match abelTypeIdEnd ";" contained
62 " string contstants and special characters within them
63 syn match abelSpecial contained "\\['\\]"
64 syn region abelString start=+'+ skip=+\\"+ end=+'+ contains=abelSpecial
66 " valid integer number formats (decimal, binary, octal, hex)
67 syn match abelNumber "\<[-+]\=[0-9]\+\>"
68 syn match abelNumber "\^d[0-9]\+\>"
69 syn match abelNumber "\^b[01]\+\>"
70 syn match abelNumber "\^o[0-7]\+\>"
71 syn match abelNumber "\^h[0-9a-f]\+\>"
74 " (define these after abelOperator so ?= overrides ?)
75 syn match abelSpecialChar "[\[\](){},;:?]"
78 syn match abelLogicalOperator "[!#&$]"
79 syn match abelRangeOperator "\.\."
80 syn match abelAlternateOperator "[/*+]"
81 syn match abelAlternateOperator ":[+*]:"
82 syn match abelArithmeticOperator "[-%]"
83 syn match abelArithmeticOperator "<<"
84 syn match abelArithmeticOperator ">>"
85 syn match abelRelationalOperator "[<>!=]="
86 syn match abelRelationalOperator "[<>]"
87 syn match abelAssignmentOperator "[:?]\=="
88 syn match abelAssignmentOperator "?:="
89 syn match abelTruthTableOperator "->"
92 syn match abelExtension "\.aclr\>"
93 syn match abelExtension "\.aset\>"
94 syn match abelExtension "\.clk\>"
95 syn match abelExtension "\.clr\>"
96 syn match abelExtension "\.com\>"
97 syn match abelExtension "\.fb\>"
98 syn match abelExtension "\.[co]e\>"
99 syn match abelExtension "\.l[eh]\>"
100 syn match abelExtension "\.fc\>"
101 syn match abelExtension "\.pin\>"
102 syn match abelExtension "\.set\>"
103 syn match abelExtension "\.[djksrtq]\>"
104 syn match abelExtension "\.pr\>"
105 syn match abelExtension "\.re\>"
106 syn match abelExtension "\.a[pr]\>"
107 syn match abelExtension "\.s[pr]\>"
110 syn match abelConstant "\.[ckudfpxz]\."
111 syn match abelConstant "\.sv[2-9]\."
114 syn region abelComment start=+"+ end=+"\|$+ contains=abelNumber,abelTodo
115 " option to prevent C++ style comments
116 if !exists("abel_cpp_comments_illegal")
117 syn region abelComment start=+//+ end=+$+ contains=abelNumber,abelTodo
122 " Define the default highlighting.
123 " For version 5.7 and earlier: only when not done already
124 " For version 5.8 and later: only when an item doesn't have highlighting yet
125 if version >= 508 || !exists("did_abel_syn_inits")
127 let did_abel_syn_inits = 1
128 command -nargs=+ HiLink hi link <args>
130 command -nargs=+ HiLink hi def link <args>
133 " The default highlighting.
134 HiLink abelHeader abelStatement
135 HiLink abelSection abelStatement
136 HiLink abelDeclaration abelStatement
137 HiLink abelLogicalOperator abelOperator
138 HiLink abelRangeOperator abelOperator
139 HiLink abelAlternateOperator abelOperator
140 HiLink abelArithmeticOperator abelOperator
141 HiLink abelRelationalOperator abelOperator
142 HiLink abelAssignmentOperator abelOperator
143 HiLink abelTruthTableOperator abelOperator
144 HiLink abelSpecifier abelStatement
145 HiLink abelOperator abelStatement
146 HiLink abelStatement Statement
147 HiLink abelIdentifier Identifier
148 HiLink abelTypeId abelType
149 HiLink abelTypeIdChar abelType
151 HiLink abelNumber abelString
152 HiLink abelString String
153 HiLink abelConstant Constant
154 HiLink abelComment Comment
155 HiLink abelExtension abelSpecial
156 HiLink abelSpecialChar abelSpecial
157 HiLink abelTypeIdEnd abelSpecial
158 HiLink abelSpecial Special
159 HiLink abelDirective PreProc
161 HiLink abelError Error
166 let b:current_syntax = "abel"