update from MirBSD CVS
[alioth/jupp.git] / syntax / java.jsf.in
1 # $MirOS: contrib/code/jupp/syntax/java.jsf.in,v 1.4 2017/12/02 05:38:05 tg Exp $
2 #-
3 # JOE syntax highlight file for JAVA
4
5 # Needs: \uXXXX for unicode in strings
6 # improve escape parsing
7
8
9 # Always reparse from beginning
10 -
11
12
13 =Idle
14 =Preproc        yellow
15 =Define         bold blue
16 =Comment        green
17 =Constant       cyan
18 =Escape         bold cyan
19 =Type           bold
20 =Keyword        bold
21 =Operator       bold
22 =Bad            bold red
23 =Brace          magenta
24 =Control
25
26 :idle Idle
27         *               idle
28         "\n"            idle
29         "/"             slash
30         "0"             first_digit     recolor=-1
31         "1-9"           decimal recolor=-1
32         "."             maybe_float
33         "\""            string          recolor=-1
34         "'"             char            recolor=-1
35         "a-zA-Z_"       ident           buffer
36         "{}"            brace           recolor=-1
37         ",:;=()><[]*&|!~+\-%^"  control         recolor=-1
38
39 :brace Brace
40         *       idle    noeat
41
42 :control Control
43         *       idle    noeat
44
45 :slash Idle
46         *               idle            noeat
47         "*"             comment         recolor=-2
48         "/"             line_comment    recolor=-2
49
50 :comment Comment
51         *               comment
52         "*"             maybe_end_comment
53
54 :maybe_end_comment Comment
55         *               comment
56         "/"             idle
57         "*"             maybe_end_comment
58
59 :line_comment Comment
60         *               line_comment
61         "\n"            idle
62
63 :first_digit Constant
64         *               idle    noeat
65         "xX"            hex
66         "."             float
67         "eE"            epart
68         "0-7"           octal
69         "89"            bad_number      recolor=-1
70
71 :bad_number Bad
72         *               idle    noeat
73         "0-9"           bad_number
74
75 :octal Constant
76         *               idle    noeat
77         "0-7"           octal
78         "89"            bad_number      recolor=-1
79
80 :hex Constant
81         *               idle    noeat
82         "0-9A-Fa-f"     hex
83
84 :decimal Constant
85         *               idle    noeat
86         "0-9"           decimal
87         "eE"            epart
88         "."             float
89
90 :maybe_float Constant
91         *               idle    recolor=-2      noeat
92         "0-9"           float           recolor=-2
93
94 :float Constant
95         *               idle    noeat
96         "eE"            epart
97         "0-9"           float
98
99 :epart Constant
100         *               idle    noeat
101         "0-9+\-"        enum
102
103 :enum Constant
104         *               idle    noeat
105         "0-9"           enum
106
107 :string Constant
108         *               string
109         "\""            idle
110         "\\"            string_escape   recolor=-1
111         "%"             string_control  recolor=-1
112
113 :string_escape Escape
114         *               string
115         "x"             string_hex1
116         "0-7"           string_octal2
117         "\n"            string          recolor=-2
118
119 :string_hex1 Escape
120         *               string          noeat
121         "0-9a-fA-F"     string_hex2
122
123 :string_hex2 Escape
124         *               string          noeat
125         "0-9a-fA-F"     string
126
127 :string_octal2 Escape
128         *               string          noeat
129         "0-7"           string_octal3
130
131 :string_octal3 Escape
132         *               string          noeat
133         "0-7"           string
134
135 :string_control Escape
136         *               string_control
137         "\n"            reset
138         "diouxXeEfFgGaAcspn%SC" string
139
140 :char Constant
141         *               char
142         "\n"            reset
143         "'"             idle
144         "\\"            char_escape     recolor=-1
145
146 :char_escape    Escape
147         *               char
148         "x"             char_hex1
149         "0-7"           char_octal2
150         "\n"            char            recolor=-2
151
152 :char_hex1 Escape
153         *               char            noeat
154         "0-9a-fA-F"     char_hex2
155
156 :char_hex2 Escape
157         *               char            noeat
158         "0-9a-fA-F"     char
159
160 :char_octal2 Escape
161         *               char            noeat
162         "0-7"           char_octal3
163
164 :char_octal3 Escape
165         *               char            noeat
166         "0-7"           char
167
168 :ident Idle
169         *               idle            noeat strings
170         "abstract"      kw
171         "boolean"       type
172         "break"         kw
173         "byte"          type
174         "case"          kw
175         "catch"         kw
176         "char"          type
177         "class"         kw
178         "const"         kw
179         "continue"      kw
180         "default"       kw
181         "do"            kw
182         "double"        type
183         "else"          kw
184         "extends"       kw
185         "final"         kw
186         "finally"       kw
187         "float"         type
188         "for"           kw
189         "goto"          kw
190         "if"            kw
191         "implements"    kw
192         "import"        kw
193         "instanceof"    operator
194         "int"           type
195         "interface"     kw
196         "long"          type
197         "native"        kw
198         "new"           operator
199         "null"          lit
200         "package"       kw
201         "private"       kw
202         "protected"     kw
203         "public"        kw
204         "return"        kw
205         "short"         type
206         "static"        kw
207         "super"         kw
208         "switch"        kw
209         "synchronized"  kw
210         "this"          kw
211         "throw"         kw
212         "throws"        kw
213         "transient"     kw
214         "try"           kw
215         "void"          kw
216         "volatile"      kw
217         "while"         kw
218         "true"          lit
219         "false"         lit
220 done
221         "a-zA-Z0-9_"    ident
222
223 :type Type
224         *       idle    noeat
225
226 :kw Keyword
227         *       idle    noeat
228
229 :lit Constant
230         *       idle    noeat
231
232 :operator Operator
233         *       idle    noeat