(file) Return to states.st CVS log (file) (dir) Up to [RizwankCVS] / testProject / share / enscript / hl

 1 rizwank 1.1 /**
 2              * Name: states
 3              * Description: States program's definition files.
 4              * Author: Markku Rossi <mtr@iki.fi>
 5              */
 6             
 7             state states_regexp extends Highlight
 8             {
 9               /\\\\./ {
10                 language_print ($0);
11               }
12               /\// {
13                 language_print ($0);
14                 return;
15               }
16             }
17             
18             state states extends HighlightEntry
19             {
20               /* Comments. */
21               /\/\*/ {
22 rizwank 1.1     comment_face (true);
23                 language_print ($0);
24                 call (c_comment);
25                 comment_face (false);
26               }
27             
28               /* String constants. */
29               /\"/ {
30                 string_face (true);
31                 language_print ($0);
32                 call (c_string);
33                 string_face (false);
34               }
35             
36               /* Regular expressions. */
37               /\\\// {
38                 string_face (true);
39                 language_print ($0);
40                 call (states_regexp);
41                 string_face (false);
42               }
43 rizwank 1.1 
44               /* Subroutine definitions. */
45               /\b(sub)([ \t]+)([$a-zA-Z_][$a-zA-Z_0-9]*)([ \t]*\()/ {
46                 keyword_face (true);
47                 language_print ($1);
48                 keyword_face (false);
49             
50                 language_print ($2);
51             
52                 function_name_face (true);
53                 language_print ($3);
54                 function_name_face (false);
55             
56                 language_print ($4);
57               }
58             
59               /* Keywords.
60                  (build-re '(BEGIN END div else extends for if local namerules
61                  return start startrules state sub while))
62                */
63               /\b(BEGIN|END|div|e(lse|xtends)|for|if|local|namerules|return\
64 rizwank 1.1 |s(ta(rt(|rules)|te)|ub)|while)\b/ {
65                 keyword_face (true);
66                 language_print ($0);
67                 keyword_face (false);
68               }
69             
70               /* Build-ins:
71                  (build-re '(call calln check_namerules check_startrules concat
72                  getenv int length list panic prereq print regmatch regsub
73                  regsuball require_state sprintf strcmp string strncmp substring))
74                */
75               /\b(c(all(|n)|heck_(namerules|startrules)|oncat)|getenv|int|l(ength|ist)\
76             |p(anic|r(ereq|int))|re(g(match|sub(|all))|quire_state)\
77             |s(printf|tr(cmp|ing|ncmp)|ubstring))([ \t]*\()/ {
78                 builtin_face (true);
79                 language_print ($1);
80                 builtin_face (false);
81                 language_print (substring ($0, length ($1), length ($0)));
82               }
83             }
84             
85 rizwank 1.1 
86             /*
87             Local variables:
88             mode: c
89             End:
90             */

Rizwan Kassim
Powered by
ViewCVS 0.9.2