1##### << comment & keyword processor >> ####
2#
3#   cmtdefs
4#                                                   Dec 03 1991
5#                                       mod:        Feb 04 1994
6################################################### tonooka ############
7#+
8#	@(#)Copyright (c) 1992 Yasuhiro Tonooka
9#	@(#)cmtdefs 2.2 (Y.Tonooka) 3/28/94
10#
11#   Language Definition Database File for "cmt"
12#
13#   "cmt"�Ѥθ�������ǡ����١���
14#-
15
16#+######################################################################
17#
18#   TYPE
19#	file format
20#   NAME
21#	Regular Expression - regular expression used in "cmtdefs" and
22#			"cmtsufs".
23#   DESCRIPTION
24#	"Primary Regular Expressions"
25#	    c	An ordinary character matches that character.
26#
27#	    \c	A backslash followed by an arbitrary character matches
28#		the character itself except for special escape
29#		sequences listed below:
30#		    \t		tab
31#		    \s		space
32#		    \b		backspace
33#		    \v		horisontal tab
34#		    \f		formfeed
35#		    \r		charrage return
36#		    \ooo	a character as three octal digits after
37#				a backslash like \123
38#
39#	    .	Matches any character except newline.
40#
41#	    ^	Matches the beginning of a line.
42#
43#	    $	Matches the end of a line (newline).
44#
45#	    (expr)
46#		A regular expression enclosed in parentheses
47#		matches a match for the regular expression.
48#
49#	    [string]
50#		Character class:  Matches any one character in that
51#		string.  If the first character of the string is a `^',
52#		matches any character except newline and the remaining
53#		characters in the string.  The `-' may be used to
54#		indicate a range of consecutive characters.  The `-'
55#		and `]' loses their special meaning if it occurs first
56#		(after an initial `^', if any) in the string; i.e.,
57#		[]a-f] matches either `]' (a right square bracket ) or
58#		one of the letters `a' through `f' inclusive.  An
59#		escape sequence (preceded by a backslash) is available.
60#
61#	"Operators"
62#	    |	Alternation:  Two regular expressions separated by `|'
63#		match either a match for the first or a match for the
64#		second.
65#
66#	    *	Closure:  Matches zero or more occurences.
67#
68#	    +	Closure:  Matches one or more occurences.
69#
70#	    ?	Closure:  Matches zero or one occurence.
71#
72#	"Concatenation"
73#	    The concatenation of regular expressions is a regular
74#	    expression that matches the concatenation of the strings
75#	    matched by each component of the regular expression.
76#
77#	"The Order of Precedence"
78#           The order of precedence of operators at the same
79#	    parenthesis level:
80#		*	+	?
81#		concatenation
82#		|
83#   NOTE
84#	If it is necessary to place a : in a regular expression, it
85#	must be escaped in octal as \072.
86#
87#-######################################################################
88
89#+######################################################################
90#
91#   TYPE
92#	file format
93#   NAME
94#	cmtdefs - language definition database
95#   DESCRIPTION
96#	nm	    ---	reg expr for language name
97#	fn	    ---	reg expr for file name
98#
99#	cb & ab	    ---	reg expr introducing a comment
100#	ce & ae	    ---	reg expr ending a comment
101#			(comments are underlined)
102#
103#	sb & hb	    ---	reg expr introducing a string or char const
104#	sn & hn	    ---	string matched is ignored
105#	se & he	    ---	reg expr ending a string or char const
106#			(strings or char consts are unchanged)
107#
108#	pb	    ---	reg expr introducing preprocessor mode
109#	pn	    ---	string matched is ignored
110#	pe	    ---	reg expr ending preprocessor mode
111#
112#	id	    ---	identifier pattern (for the both mode)
113#	nc	    ---	numeric constant pattern (just ignored)
114#
115#	oc	    ---	case-insensitive flag
116#	al	    ---	"all identifiers" flag (make all identifiers
117#			boldfaced)
118#
119#	kw	    ---	keyword list for normal mode
120#	pw	    ---	keyword list for preprocessor mode
121#			(keywords are made boldfaced)
122#
123#-######################################################################
124
125PASCAL:\
126	:nm=p|pascal|PASCAL:\
127	:fn=.*\.p(\.(BAK|bak|~[0-9]+~)|~)?:\
128	:cb={:ce=}:\
129	:ab=\(\*:ae=\*\):\
130	:sb=':se=':\
131	:oc:\
132	:nc=[0-9]+(\.[0-9])?(e[-+]?[0-9]+)?:\
133	:id=[a-z][a-z0-9]*:\
134	:kw=and array begin case const div do downto else end file for\
135	forward function goto if in label mod nil not of or packed\
136	procedure program record repeat set then to type until var\
137	while with:
138#	assert oct hex external
139
140C:\
141	:nm=c|C:\
142	:fn=.*\.[ch](\.(BAK|bak|~[0-9]+~)|~)?:\
143	:cb=/\*:ce=\*/:\
144	:sb=":se="|$:sn=\\(.|$):\
145	:hb=':he='|$:hn=\\(.|$):\
146	:pb=^#:pe=$:pn=\\(.|$)|<.*>:\
147	:nc=(0x[0-9a-fA-F]+|([0-9]+(\.[0-9]*)?|\.[0-9]+)\
148([eE][-+]?[0-9]+)?)[fluFLU]*:\
149	:id=[a-zA-Z_][a-zA-Z0-9_]*:\
150	:kw=asm auto break case char const continue default do double\
151	else enum extern float for fortran goto if int long register\
152	return short signed sizeof static struct switch typedef union\
153	unsigned void volatile while:\
154	:pw=define defined elif else endif error if ifdef ifndef\
155	include line pragma undef:
156
157yacc:\
158	:nm=y|yacc:\
159	:fn=.*\.y(\.(BAK|bak|~[0-9]+~)|~)?:\
160	:cb=/\*:ce=\*/:\
161	:sb=":se="|$:sn=\\(.|$):\
162	:hb=':he='|$:hn=\\(.|$):\
163	:pb=^#:pe=$:pn=\\(.|$)|<.*>:\
164	:nc=(0x[0-9a-fA-F]+|([0-9]+(\.[0-9]*)?|\.[0-9]+)\
165([eE][-+]?[0-9]+)?)[fluFLU]*:\
166	:id=%?[a-zA-Z_][a-zA-Z0-9_]*|%[%{}]:\
167	:kw=asm auto break case char const continue default do double\
168	else enum extern float for fortran goto if int long register\
169	return short signed sizeof static struct switch typedef union\
170	unsigned void volatile while\
171	%% %left %nonassoc %prec %right %start %token\
172	%type %union %{ %}:\
173	:pw=define defined elif else endif error if ifdef ifndef\
174	include line pragma undef:
175
176lex:\
177	:nm=l|lex:\
178	:fn=.*\.l(\.(BAK|bak|~[0-9]+~)|~)?:\
179	:cb=/\*:ce=\*/:\
180	:sb=":se="|$:sn=\\(.|$):\
181	:hb=':he='|$:hn=\\(.|$):\
182	:pb=^#:pe=$:pn=\\(.|$)|<.*>:\
183	:nc=(0x[0-9a-fA-F]+|([0-9]+(\.[0-9]*)?|\.[0-9]+)\
184([eE][-+]?[0-9]+)?)[fluFLU]*:\
185	:id=%?[a-zA-Z_][a-zA-Z0-9_]*|%[%{}]:\
186	:kw=asm auto break case char const continue default do double\
187	else enum extern float for fortran goto if int long register\
188	return short signed sizeof static struct switch typedef union\
189	unsigned void volatile while\
190	%% %p %n %n %e %a %k %o %{ %}:\
191	:pw=define defined elif else endif error if ifdef ifndef\
192	include line pragma undef:
193
194C++:\
195	:nm=cc|c++|C++:\
196	:fn=.*\.(c++|cc|C)(\.(BAK|bak|~[0-9]+~)|~)?:\
197	:cb=/\*:ce=\*/:\
198	:ab=//:ae=$:\
199	:sb=":se="|$:sn=\\(.|$):\
200	:hb=':he='|$:hn=\\(.|$):\
201	:pb=^#:pe=$:pn=\\(.|$)|<.*>:\
202	:nc=(0x[0-9a-fA-F]+|([0-9]+(\.[0-9]*)?|\.[0-9]+)\
203([eE][-+]?[0-9]+)?)[fluFLU]*:\
204	:id=[a-zA-Z_][a-zA-Z0-9_]*:\
205	:kw=asm auto break case char const continue default do double\
206	else enum extern float for fortran goto if int long register\
207	return short signed sizeof static struct switch typedef union\
208	unsigned void volatile while\
209	class delete friend inline new operator overload private\
210	protected public virtual:\
211	:pw=define defined elif else endif error if ifdef ifndef\
212	include line pragma undef:
213
214FORTRAN:\
215	:nm=f|f77|fortran|FORTRAN:\
216	:fn=.*\.f(\.(BAK|bak|~[0-9]+~)|~)?:\
217	:cb=^[c\*]:ce=$:\
218	:sb=':se='|^.....[\s0]:sn=\\.:\
219	:hb=":he="|^.....[\s0]:hn=\\.:\
220	:oc:\
221	:nc=([0-9]+(\.[0-9]*)?|\.[0-9]+)([eE][-+]?[0-9]+)?:\
222	:id=[a-z][a-z0-9]*|\.[a-z]+\.:\
223	:kw=assign backspace block call character close common complex\
224	continue data dimension do double else elseif end endfile endif\
225	entry equivalence external file format function go goto if\
226	implicit inquire integer intrinsic logical open parameter pause\
227	precision print program read real return rewind save stop\
228	subroutine then to write\
229	.and. .eq. .eqv. .false. .ge. .gt. .le. .lt. .ne. .neqv. .not.\
230	.or. .true. .xor.\
231	include:
232#	:pb=\(:pe=\)|^.....[\s0]:\
233#	:pw=.and. .eq. .eqv. .false. .ge. .gt. .le. .lt. .ne. .neqv.\
234#	.not. .or. .true. .xor.:
235
236ratfor:\
237	:nm=r|ratfor:\
238	:fn=.*\.r(\.(BAK|bak|~[0-9]+~)|~)?:\
239	:cb=#:ce=$:\
240	:sb=':se=':sn=\\.:\
241	:hb=":he=":hn=\\.:\
242	:pb=%:pe=$:\
243	:oc:\
244	:nc=([0-9]+(\.[0-9]*)?|\.[0-9]+)([eE][-+]?[0-9]+)?:\
245	:id=[a-z][a-z0-9]*|\.[a-z]+\.:\
246	:kw=break case dafault do else for if next repeat return\
247	switch until while\
248	assign backspace block call character close common complex\
249	continue data dimension double end endfile entry\
250	equivalence external file format function go goto implicit\
251	inquire integer intrinsic logical open parameter pause\
252	precision print program read real rewind save stop\
253	subroutine to write\
254	.and. .eq. .eqv. .false. .ge. .gt. .le. .lt. .ne. .neqv. .not.\
255	.or. .true. .xor.\
256	include:
257	:pw=assign backspace block call character close common complex\
258	continue data dimension do double else elseif end endfile endif\
259	entry equivalence external file format function go goto if\
260	implicit inquire integer intrinsic logical open parameter pause\
261	precision print program read real return rewind save stop\
262	subroutine then to write\
263	.and. .eq. .eqv. .false. .ge. .gt. .le. .lt. .ne. .neqv. .not.\
264	.or. .true. .xor.\
265	include:
266
267# UIL keywords include nonreserved keywords.
268UIL:\
269	:nm=uil|UIL:\
270	:fn=.*\.uil(\.(BAK|bak|~[0-9]+~)|~)?:\
271	:cb=!:ce=$:\
272	:ab=/\*:ae=\*/:\
273	:sb=(#[a-zA-Z_$][a-zA-Z0-9_$]*)?":se=":sn=\\([0-9]+\\|.):\
274	:hb=':he=':hn=\\([0-9]+\\|.):\
275	:nc=([0-9]+\.[0-9]*|\.[0-9]+)([eE][-+]?[0-9]+)?|[0-9]+:\
276	:id=[a-zA-Z_$][a-zA-Z0-9_$]*:\
277	:kw=arguments callbacks controls end exported false gadget\
278	identifier include list module off on object private procedure\
279	procedures true value widget\
280	any argument asciz_string_table asciz_table background boolean\
281	case_insensitive case_sensitive character_set color color_table\
282	compound_string compound_string_table file float font\
283	font_table foreground icon imported integer integer_table\
284	managed names objects reason right_to_left string string_table\
285	translation_table unmanaged version xbitmapfile\
286	keysym rgb single_float user_defined:
287
288PostScript:\
289	:nm=ps|postscript|PostScript|POSTSCRIPT:\
290	:fn=.*\.(ps|eps|epsf)(\.(BAK|bak|~[0-9]+~)|~)?:\
291	:cb=%:ce=$:\
292	:sb=\(:se=\):sn=\\.:\
293	:hb=<:he=>:\
294	:id=[()<>\[\]{}/]|[^\s\t()<>\[\]{}/%]+:\
295	:kw== == [ ]\
296	FontDirectory StandardEncoding VMerror\
297	abs add aload anchorsearch and arc arcn arcto array ashow\
298	astore atan awidthshow banddevice begin bind bitshift\
299	bytesavailable cachestatus ceiling charpath clear cleartomark\
300	clip clippath closefile closepath concat concatmatrix copy\
301	copypage cos count countdictstack countexecstack counttomark\
302	currentcacheparams currentdash currentdict currentfile\
303	currentflat currentfont currentgray currenthsbcolor\
304	currentlinecap currentlinejoin currentlinewidth currentmatrix\
305	currentmiterlimit currentpacking currentpoint currentrgbcolor\
306	currentscreen currenttransfer curveto cvi cvlit cvn cvr cvrs\
307	cvs cvx def defaultmatrix definefont dict dictfull dictstack\
308	dictstackoverflow dictstackunderflow div dtransform dup echo\
309	end eoclip eofill eq erasepage errordict exch exec execstack\
310	execstackoverflow executeonly exit exp false file fill\
311	findfont flattenpath floor flush flushfile for forall\
312	framedevice ge get getinterval grestore grestoreall gsave gt\
313	handleerror identmatrix idiv idtransform if ifelse image\
314	imagemask index initclip initgraphics initmatrix interrupt\
315	invalidaccess invalidexit invalidfileaccess invalidfont\
316	invalidrestore invertmatrix ioerror itransform known kshow\
317	le length limitcheck lineto ln load log loop lt makefont mark\
318	matrix maxlength mod moveto mul ne neg newpath noaccess\
319	nocurrentpoint not null nulldevice or packedarray pathbbox\
320	pathforall pop print prompt pstack put putinterval quit rand\
321	rangecheck rcheck rcurveto read readhexstring readline\
322	readonly readstring renderbands repeat resetfile restore\
323	reversepath rlineto rmoveto roll rotate round rrand run save\
324	scale scalefont search setcachedevice setcachelimit\
325	setcacheparams setcharwidth setdash setflat setfont setgray\
326	sethsbcolor setlinecap setlinejoin setlinewidth setmatrix\
327	setmiterlimit setpacking setrgbcolor setscreen settransfer\
328	show showpage sin sqrt srand stack stackoverflow\
329	stackunderflow start status stop stopped store string\
330	stringwidth stroke strokepath sub syntaxerror systemdict\
331	timeout token transform translate true truncate type\
332	typecheck undefined undefinedfilename undefinedresult\
333	unmatchedmark unregistered userdict usertime version vmstatus\
334	wcheck where widthshow write writehexstring writestring\
335	xcheck xor:
336
337LaTeX or TeX:\
338	:nm=latex|LaTeX|tex|TeX:\
339	:fn=.*\.(tex|ind|idx)(\.(BAK|bak|~[0-9]+~)|~)?:\
340	:cb=%:ce=$:\
341	:.sb=\\begin{verbatim}:.se=\\end{verbatim}:\
342	:.nc=\\[\\%]:\
343	:al:\
344	:id=[{}\[\]#$&_~^]|\\([a-zA-Z��-��]+|.)\*?:
345
346LaTeX style file:\
347	:nm=sty|latex-sty|LaTeX-sty:\
348	:fn=.*\.sty(\.(BAK|bak|~[0-9]+~)|~)?:\
349	:cb=%:ce=$:\
350	:al:\
351	:id=[{}\[\]#$&_~^]|\\([@a-zA-Z��-��]+|.)\*?:
352
353#TeX|tex|LaTeX|latex:\
354#	:cb=%:ce=$:\
355#	:sb=\\begin{verbatim}:se=\\end{verbatim}:\
356#	:nc=\\[\\%]:
357#	:al:\
358#	:id=[#$&_~^]|\\([a-zA-Z]+|.)\*?:
359
360SIMPL:\
361	:nm=simpl|SIMPL:\
362	:cb=/\*:ce=\*/:\
363	:sb=":se=":\
364	:hb=':he=':\
365	:nc=([0-9]+(\.[0-9]*)?|\.[0-9]+)([eE][-+]?[0-9]+)?:\
366	:id=[a-zA-Z][a-zA-Z0-9]*|\.[a-zA-Z]+\.:\
367	:kw=ARRAY CALL CASE CHAR DO DEFINE ELSE END ENTRY EXIT EXT\
368	FILE FOR FUNC IF INT LONG OF OTHER PROC REAL REC REF REPEAT\
369	RETURN START STEP STRING THEN UNTIL WHILE\
370	.A. .ABS. .AND. .C. .CON. .EQ. .GE. .GT. .LC. .LE. .LL. .LT.\
371	.MAX. .MIN. .NE. .NOT. .OR. .RA. .REM. .RL. .V. .X.:
372
373CCL ((c) M.S.I.):\
374	:nm=ccl|CCL:\
375	:fn=.*\.ccl(\.(BAK|bak|~[0-9]+~)|~)?:\
376	:cb=#/:ce=/#:\
377	:ab=#:ae=$:\
378	:sb=":se="|$:sn=\\(.|$):\
379	:nc=([0-9]*\.[0-9]+|[0-9]+\.?)([eE][-+]?[0-9]+)?\
380(da|EPTGMkhdcmunpfa])?:\
381	:id=[a-zA-Z_][a-zA-Z0-9_]*:\
382	:kw=any auto break clear cont define edit else error exit\
383	extern file for goto if include input next numeric on print\
384	repeat resume return run shell stop string until while:
385
386make file:\
387	:nm=make|makefile|Makefile:\
388	:fn=[Mm]akefile.*:\
389	:cb=#:ce=$:
390
391C shell:\
392	:nm=csh|C-shell:\
393	:fn=.*\.csh(\.(BAK|bak|~[0-9]+~)|~)?:\
394	:cb=#:ce=$:\
395	:sb=":se="|$:sn=\\$:\
396	:hb=':he='|$:hn=\\$:\
397	:pb=\$#:pe=:\
398	:pb=\${?[#?<$]:pe=:\
399	:id=(\\.|[^\s\t!;&|<>()`'"$#])*(\\.|[^\s\t!;&|<>()`'"$#\072]):\
400	:kw=% @ alias bg break breaksw case cd chdir continue\
401	default dirs echo else end endif endsw eval exec exit fg\
402	foreach glob goto hashstat history if jobs kill limit login\
403	logout nice nohup notify onintr popd pushd rehash repeat set\
404	setenv shift source stop suspend switch then time umask unalias\
405	unhash unlimit unset unsetenv wait while:
406# shell variables
407#	argv cdpath cwd echo fignore filec hardpaths histchars history
408#	home ignoreeof mail nobeep noclobber noglob nonomatch notify
409#	path prompt savehist shell status time verbose
410#	user term
411
412Born shell:\
413	:nm=sh|shell|B-shell:\
414	:.fn=.*\.sh(\.(BAK|bak|~[0-9]+~)|~)?:\
415	:fn=.*:\
416	:cb=#:ce=$:\
417	:sb=":se=":sn=\\("|\\):\
418	:hb=':he=':\
419	:pb=\${?[-#?$!]:pe=:\
420	:id=[a-zA-Z_](\\.|[^\s\t;&|<>()^`'"$=])*|\
421(\\.|[^\s\t;&|<>()^`'"$])+:\
422	:kw=break case cd continue do done echo elif else esac eval\
423	exec exit export fi for getopts hash if in login newgrp pwd\
424	read readonly return set shift test then times trap type umask\
425	unset until wait while:
426