3 " Maintainer: John Cook <john.cook@kla-tencor.com>
4 " Last Change: 2001 Apr 25
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
118 " Define the default highlighting.
119 " For version 5.7 and earlier: only when not done already
120 " For version 5.8 and later: only when an item doesn't have highlighting yet
121 if version >= 508 || !exists("did_abel_syn_inits")
123 let did_abel_syn_inits = 1
124 command -nargs=+ HiLink hi link <args>
126 command -nargs=+ HiLink hi def link <args>
129 " The default highlighting.
130 HiLink abelHeader abelStatement
131 HiLink abelSection abelStatement
132 HiLink abelDeclaration abelStatement
133 HiLink abelLogicalOperator abelOperator
134 HiLink abelRangeOperator abelOperator
135 HiLink abelAlternateOperator abelOperator
136 HiLink abelArithmeticOperator abelOperator
137 HiLink abelRelationalOperator abelOperator
138 HiLink abelAssignmentOperator abelOperator
139 HiLink abelTruthTableOperator abelOperator
140 HiLink abelSpecifier abelStatement
141 HiLink abelOperator abelStatement
142 HiLink abelStatement Statement
143 HiLink abelIdentifier Identifier
144 HiLink abelTypeId abelType
145 HiLink abelTypeIdChar abelType
147 HiLink abelNumber abelString
148 HiLink abelString String
149 HiLink abelConstant Constant
150 HiLink abelComment Comment
151 HiLink abelExtension abelSpecial
152 HiLink abelSpecialChar abelSpecial
153 HiLink abelTypeIdEnd abelSpecial
154 HiLink abelSpecial Special
155 HiLink abelDirective PreProc
157 HiLink abelError Error
162 let b:current_syntax = "abel"