1# $MirOS: contrib/code/jupp/syntax/verilog.jsf.in,v 1.2 2008/05/13 16:17:46 tg Exp $
2#-
3# JOE syntax highlight file for Verilog
4
5# Define colors
6
7=Idle
8=Preproc bold blue
9=Comment green
10=Constant cyan
11=Escape bold cyan
12=Type bold
13=Keyword bold
14
15# Skip whitespace at start of line
16:reset Idle
17	*		first		noeat
18	" 	"	reset
19
20:first Idle
21	*		idle		noeat
22	"`"		pre		recolor=-1
23
24:pre Preproc
25	*		idle		noeat
26	"a-zA-Z_"	preident	recolor=-1 buffer
27
28:preident Idle
29	*		idle		noeat strings
30	"ifdef"		preproc
31	"else"		preproc
32	"endif"		preproc
33	"timescale"	preproc
34	"define"	preproc
35	"include"	preproc
36done
37	"a-zA-Z0-9_"	preident
38
39:preproc Preproc
40	*		idle		noeat
41
42# All following states are for when we're not in a preprocessor line
43
44:idle Idle
45	*		idle
46	"\n"		reset
47	"/"		slash
48	"0-9"		first_digit	recolor=-1
49	"."		maybe_float
50	"\""		string		recolor=-1
51	"'"		sized_number	recolor=-1
52	"a-zA-Z_"	ident		buffer
53
54:slash Idle
55	*		idle		noeat
56	"*"		comment		recolor=-2
57	"/"		line_comment	recolor=-2
58
59:comment Comment
60	*		comment
61	"*"		maybe_end_comment
62
63:maybe_end_comment Comment
64	*		comment
65	"/"		idle
66	"*"		maybe_end_comment
67
68:line_comment Comment
69	*		line_comment
70	"\n"		reset
71
72# Integer constants
73
74:first_digit Constant
75	*		idle	noeat
76	"'"		sized_number
77	"."		float
78	"0-9"		first_digit
79
80:sized_number Constant
81	*		idle	noeat
82	"hH"		hex_number
83	"oO"		octal_number
84	"bB"		binary_number
85	"dD"		decimal_number
86
87:hex_number Constant
88	*		idle	noeat
89	"0-9A-Fa-f_xz"	hex_number
90
91:binary_number Constant
92	*		idle	noeat
93	"01_xz"		binary_number
94
95:octal_number Constant
96	*		idle	noeat
97	"0-7_xz"	octal_number
98
99:decimal_number Constant
100	*		idle	noeat
101	"0-9_"		decimal_number
102
103# Floating point
104
105:maybe_float Constant
106	*		idle	recolor=-2	noeat
107	"0-9"		float		recolor=-2
108
109:float Constant
110	*		idle	noeat
111	"eE"		epart
112	"0-9"		float
113
114:epart	Constant
115	*		idle	noeat
116	"0-9+\-"	enum
117
118:enum	Constant
119	*		idle	noeat
120	"0-9"		enum
121
122# Strings
123
124:string	Constant
125	*		string
126	"\n"		reset
127	"\""		idle
128	"\\"		string_escape	recolor=-1
129	"%"		string_control	recolor=-1
130
131:string_escape Escape
132	*		string
133	"\n"		string		recolor=-2
134
135:string_control Escape
136	*		string_control
137	"\n"		reset
138	"diouxXeEfFgGaAcspn%SC"	string
139
140# Identifiers
141
142:ident	Idle
143	*		idle		noeat strings
144	"always"	kw
145	"assign"	kw
146	"begin"		kw
147	"case"		kw
148	"casex"		kw
149	"casez"		kw
150	"default"	kw
151	"defparam"	kw
152	"else"		kw
153	"end"		kw
154	"endcase"	kw
155	"endfunction"	kw
156	"endmodule"	kw
157	"endtask"	kw
158	"for"		kw
159	"function"	kw
160	"if"		kw
161	"module"	kw
162	"parameter"	kw
163	"repeat"	kw
164	"task"		kw
165	"while"		kw
166	"forever"	kw
167	"initial"	kw
168	"integer"	type
169	"inout"		type
170	"input"		type
171	"output"	type
172	"reg"		type
173	"real"		type
174	"wire"		type
175	"wor"		type
176	"wand"		type
177	"and"		kw
178	"attribute"	kw
179	"buf"		kw
180	"bufif0"	kw
181	"bufif1"	kw
182	"cmos"		kw
183	"deassign"	kw
184	"disable"	kw
185	"edge"		kw
186	"endattribute"	kw
187	"endprimitive"	kw
188	"endspecify"	kw
189	"endtable"	kw
190	"event"		kw
191	"force"		kw
192	"fork"		kw
193	"highz0"	kw
194	"highz1"	kw
195	"join"		kw
196	"large"		kw
197	"macromodule"	kw
198	"medium"	kw
199	"nand"		kw
200	"negedge"	kw
201	"nmos"		kw
202	"nor"		kw
203	"not"		kw
204	"notif0"	kw
205	"notif1"	kw
206	"or"		kw
207	"pmos"		kw
208	"posedge"	kw
209	"primitive"	kw
210	"pull0"		kw
211	"pull1"		kw
212	"pulldown"	kw
213	"pullup"	kw
214	"rcmos"		kw
215	"realtime"	kw
216	"release"	kw
217	"rnmos"		kw
218	"rpmos"		kw
219	"rtran"		kw
220	"rtranif0"	kw
221	"rtranif1"	kw
222	"scalared"	kw
223	"signed"	kw
224	"small"		kw
225	"specify"	kw
226	"specparam"	kw
227	"strength"	kw
228	"strong0"	kw
229	"strong1"	kw
230	"supply0"	kw
231	"supply1"	kw
232	"table"		kw
233	"time"		kw
234	"tran"		kw
235	"tranif0"	kw
236	"tranif1"	kw
237	"tri"		kw
238	"tri0"		kw
239	"tri1"		kw
240	"triand"	kw
241	"trior"		kw
242	"trireg"	kw
243	"unsigned"	kw
244	"vectored"	kw
245	"wait"		kw
246	"weak0"		kw
247	"weak1"		kw
248	"xnor"		kw
249	"xor"		kw
250done
251	"a-zA-Z0-9_"	ident
252
253:type Type
254	*	idle	noeat
255
256:kw Keyword
257	*	idle	noeat
258