OSDN Git Service

* jcf-parse.c (init_jcf_parse): Register current_file_list root.
[pf3gnuchains/gcc-fork.git] / gcc / java / lex.h
1 /* Language lexer definitions for the GNU compiler for the Java(TM) language.
2    Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
3    Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
21
22 Java and all Java-based marks are trademarks or registered trademarks
23 of Sun Microsystems, Inc. in the United States and other countries.
24 The Free Software Foundation is independent of Sun Microsystems, Inc.  */
25
26 #ifndef JV_LEX_H
27 #define JV_LEX_H
28
29 #include <setjmp.h>             /* set_float_handler argument uses it */
30
31 /* Extern global variables declarations  */
32 extern FILE *finput;
33 extern int   lineno;
34
35 /* A Unicode character, as read from the input file  */
36 typedef unsigned short unicode_t;
37
38 #ifdef HAVE_ICONV_H
39 #include <iconv.h>
40 #endif /* HAVE_ICONV */
41
42 /* Default encoding to use if no encoding is specified.  */
43 #define DEFAULT_ENCODING "UTF-8"
44
45 /* Debug macro to print-out what we match  */
46 #ifdef JAVA_LEX_DEBUG
47 #ifdef JAVA_LEX_DEBUG_CHAR
48 #define JAVA_LEX_CHAR(c)      printf ("java_lex:%d: char '%c'.%d\n",    \
49                                       lineno, (c < 128 ? c : '.'), c);
50 #else
51 #define JAVA_LEX_CHAR(c)
52 #endif
53 #define JAVA_LEX_KW(c)        printf ("java_lex:%d: keyword: '%s'\n", lineno,c)
54 #define JAVA_LEX_ID(s)        printf ("java_lex:%d: ID: '%s'\n",        \
55                                       lineno,                           \
56                                       (all_ascii ? s : "<U>"))
57 #define JAVA_LEX_LIT(s, r)    printf ("java_lex:%d: literal '%s'_%d\n", \
58                                       lineno, s, r)
59 #define JAVA_LEX_CHAR_LIT(s)  printf ("java_lex:%d: literal '%d'\n", lineno, s)
60 #define JAVA_LEX_STR_LIT(s)   {                                          \
61                                  int i;                                  \
62                                  printf ("java_lex:%d: literal '%s'\n",  \
63                                          lineno, s);                     \
64                                }
65 #define JAVA_LEX_SEP(c)       printf ("java_lex:%d: separator '%c'\n",lineno,c)
66 #define JAVA_LEX_OP(c)        printf ("java_lex:%d: operator '%s'\n", lineno,c)
67 #else
68 #define JAVA_LEX_CHAR(c)
69 #define JAVA_LEX_KW(c)
70 #define JAVA_LEX_ID(s)
71 #define JAVA_LEX_LIT(s,r)
72 #define JAVA_LEX_CHAR_LIT(s)
73 #define JAVA_LEX_STR_LIT(s)
74 #define JAVA_LEX_SEP(c)
75 #define JAVA_LEX_OP(s)
76 #endif
77
78 /* Line information containers  */
79 struct java_line {
80   unicode_t *line;              /* The line's unicode */
81   char      *unicode_escape_p;  /* The maching char was a unicode escape */
82   unicode_t ahead[1];           /* Character ahead */
83   char unicode_escape_ahead_p;  /* Character ahead is a unicode escape */
84   int max;                      /* buffer's max size */
85   int size;                     /* number of unicodes */
86   int current;                  /* Current position, unicode based */
87   int char_col;                 /* Current position, input char based */
88   int lineno;                   /* Its line number */
89   int white_space_only;         /* If it contains only white spaces */
90 };
91 #define JAVA_COLUMN_DELTA(p)                                            \
92   (ctxp->c_line->unicode_escape_p [ctxp->c_line->current+(p)] ? 6 :     \
93    (ctxp->c_line->line [ctxp->c_line->current+(p)] == '\t' ? 8 : 1))
94
95 struct java_error {
96   struct java_line *line;
97   int error;
98 };
99
100 typedef struct _java_lc {
101   int line;
102   int prev_col;
103   int col;
104 } java_lc;
105
106 typedef struct java_lexer
107 {
108   /* The file from which we're reading.  */
109   FILE *finput;
110
111   /* Number of consecutive backslashes we've read.  */
112   int bs_count;
113
114   /* If nonzero, a value that was pushed back.  */
115   unicode_t unget_value;
116
117 #ifdef HAVE_ICONV
118   /* Nonzero if we've read any bytes.  We only recognize the
119      byte-order-marker (BOM) as the first word.  */
120   int read_anything : 1;
121
122   /* Nonzero if we have to byte swap.  */
123   int byte_swap : 1;
124
125   /* Nonzero if we're using the fallback decoder.  */
126   int use_fallback : 1;
127
128   /* The handle for the iconv converter we're using.  */
129   iconv_t handle;
130
131   /* Bytes we've read from the file but have not sent to iconv.  */
132   char buffer[1024];
133
134   /* Index of first valid character in buffer, -1 if no valid
135      characters.  */
136   int first;
137
138   /* Index of last valid character in buffer, plus one.  -1 if no
139      valid characters in buffer.  */
140   int last;
141
142   /* This is a buffer of characters already converted by iconv.  We
143      use `char' here because we're assuming that iconv() converts to
144      big-endian UCS-2, and then we convert it ourselves.  */
145   unsigned char out_buffer[1024];
146
147   /* Index of first valid output character.  -1 if no valid
148      characters.  */
149   int out_first;
150
151   /* Index of last valid output character, plus one.  -1 if no valid
152      characters.  */
153   int out_last;
154
155 #endif /* HAVE_ICONV */
156 } java_lexer;
157
158 /* Destroy a lexer object.  */
159 extern void java_destroy_lexer PARAMS ((java_lexer *));
160
161 #define JAVA_LINE_MAX 80
162
163 /* Build a location compound integer */
164 #define BUILD_LOCATION() ((ctxp->elc.line << 12) | (ctxp->elc.col & 0xfff))
165
166 /* Those macros are defined differently if we compile jc1-lite
167    (JC1_LITE defined) or jc1.  */
168 #ifdef JC1_LITE
169
170 #define DCONST0 0
171 #define REAL_VALUE_TYPE int
172 #define SET_FLOAT_HANDLER(H)
173 #define GET_IDENTIFIER(S) xstrdup ((S))
174 #define REAL_VALUE_ATOF(LIT,MODE) 0
175 #define REAL_VALUE_ISINF(VALUE)   0
176 #define REAL_VALUE_ISNAN(VALUE)   0
177 #define SET_REAL_VALUE_ATOF(TARGET,SOURCE)
178 #define FLOAT_TYPE_NODE 0
179 #define DOUBLE_TYPE_NODE 0
180 #define SET_MODIFIER_CTX(TOKEN) java_lval->value = (TOKEN)
181 #define GET_TYPE_PRECISION(NODE) 4
182 #define BUILD_OPERATOR(TOKEN)   return TOKEN
183 #define BUILD_OPERATOR2(TOKEN)  return ASSIGN_ANY_TK
184 #define SET_LVAL_NODE(NODE)
185 #define SET_LVAL_NODE_TYPE(NODE, TYPE)
186 #define BUILD_ID_WFL(EXP) (EXP)
187 #define JAVA_FLOAT_RANGE_ERROR(S) {}
188 #define JAVA_INTEGRAL_RANGE_ERROR(S) {}
189
190 #else
191
192 extern void set_float_handler PARAMS ((jmp_buf));
193 #define SET_FLOAT_HANDLER(H) set_float_handler ((H))
194 #define DCONST0 dconst0
195 #define GET_IDENTIFIER(S) get_identifier ((S))
196 #define SET_REAL_VALUE_ATOF(TARGET,SOURCE) (TARGET) = (SOURCE)
197 #define FLOAT_TYPE_NODE float_type_node
198 #define DOUBLE_TYPE_NODE double_type_node
199 /* Set modifier_ctx according to TOKEN */
200 #define SET_MODIFIER_CTX(TOKEN)                                            \
201   {                                                                        \
202     ctxp->modifier_ctx [(TOKEN)-PUBLIC_TK] = build_wfl_node (NULL_TREE); \
203     java_lval->value = (TOKEN)-PUBLIC_TK;                                  \
204   }
205 /* Type precision for long */
206 #define GET_TYPE_PRECISION(NODE) TYPE_PRECISION (long_type_node) / 8;
207 /* Build an operator tree node and return TOKEN */
208 #define BUILD_OPERATOR(TOKEN)                           \
209   {                                                     \
210     java_lval->operator.token = (TOKEN);                \
211     java_lval->operator.location = BUILD_LOCATION();    \
212     return (TOKEN);                                     \
213   }
214
215 /* Build an operator tree node but return ASSIGN_ANY_TK */
216 #define BUILD_OPERATOR2(TOKEN)                          \
217   {                                                     \
218     java_lval->operator.token = (TOKEN);                \
219     java_lval->operator.location = BUILD_LOCATION();    \
220     return ASSIGN_ANY_TK;                               \
221   }
222 /* Set java_lval->node and TREE_TYPE(java_lval->node) in macros */
223 #define SET_LVAL_NODE(NODE) java_lval->node = (NODE)
224 #define SET_LVAL_NODE_TYPE(NODE,TYPE)           \
225   {                                             \
226     java_lval->node = (NODE);                   \
227     TREE_TYPE (java_lval->node) = (TYPE);       \
228   }
229 /* Wrap identifier around a wfl */
230 #define BUILD_ID_WFL(EXP) build_wfl_node ((EXP))
231 /* Special ways to report error on numeric literals  */
232 #define JAVA_FLOAT_RANGE_ERROR(m)                                         \
233   {                                                                       \
234     char msg [1024];                                                      \
235     int i = ctxp->c_line->current;                                        \
236     ctxp->c_line->current = number_beginning;                             \
237     sprintf (msg, "Floating point literal exceeds range of `%s'", (m)); \
238     java_lex_error (msg, 0);                                              \
239     ctxp->c_line->current = i;                                            \
240   }
241 #define JAVA_INTEGRAL_RANGE_ERROR(m)            \
242   {                                             \
243     int i = ctxp->c_line->current;              \
244     ctxp->c_line->current = number_beginning;   \
245     java_lex_error (m, 0);                      \
246     ctxp->c_line->current = i;                  \
247   }
248
249 #endif /* Definitions for jc1 compilation only */
250
251 /* Macros to decode character ranges */
252 #define RANGE(c, l, h)           (((c) >= l && (c) <= h))
253 #define JAVA_WHITE_SPACE_P(c) (c == ' ' || c == '\t' || c == '\f')
254 #define JAVA_ID_CHAR_P(c)     ((c < 128 && (RANGE (c, 'A', 'Z') ||      \
255                                             RANGE (c, 'a', 'z') ||      \
256                                             RANGE (c, '0', '9') ||      \
257                                             c == '_'         ||         \
258                                             c == '$'))       ||         \
259                                java_ignorable_control_p (c)  ||         \
260                                (c > 127 && java_letter_or_digit_p (c)))
261 #define JAVA_ASCII_DIGIT(c)    RANGE(c,'0', '9')
262 #define JAVA_ASCII_OCTDIGIT(c) RANGE(c,'0', '7')
263 #define JAVA_ASCII_HEXDIGIT(c) (RANGE(c,'0', '9') ||    \
264                                 RANGE(c,'a', 'f') ||    \
265                                 RANGE(c,'A', 'F'))
266 #define JAVA_ASCII_FPCHAR(c)   (RANGE(c,'d', 'f') || RANGE(c,'D', 'F') || \
267                                 c == '.' || JAVA_ASCII_DIGIT (c))
268 #define JAVA_FP_SUFFIX(c)      (c == 'D' || c == 'd' || c == 'f' || c == 'F')
269 #define JAVA_FP_EXP(c)         (c == 'E' || c == 'F')
270 #define JAVA_FP_PM(c)          (c == '-' || c == '+')
271 #define JAVA_ASCII_LETTER(c)   (RANGE(c,'a', 'z') || RANGE(c,'A', 'Z'))
272 #define JAVA_DIGIT_P(c)                                                       \
273    (RANGE (c, 0x030, 0x039) || /* ISO-Latin-1 (and ASCII) digits ('0'-'9') */ \
274     RANGE (c, 0x660, 0x669) || /* Arabic-Indic digits */                      \
275     RANGE (c, 0x6F0, 0x6F9) || /* Eastern Arabic-Indic digits */              \
276     RANGE (c, 0x966, 0x96F) || /* Devanagari digits */                        \
277     RANGE (c, 0x9E6, 0x9EF) || /* Bengali digits */                           \
278     RANGE (c, 0xA66, 0xA6F) || /* Gurmukhi digits */                          \
279     RANGE (c, 0xAE6, 0xAEF) || /* Gujarati digits */                          \
280     RANGE (c, 0xB66, 0xB6F) || /* Oriya digits */                             \
281     RANGE (c, 0xBE7, 0xBEF) || /* Tamil digits */                             \
282     RANGE (c, 0xC66, 0xC6F) || /* Telugu digits */                            \
283     RANGE (c, 0xCE6, 0xCEF) || /* Kannada digits */                           \
284     RANGE (c, 0xD66, 0xD6F) || /* Malayalam digits */                         \
285     RANGE (c, 0xE50, 0xE59) || /* Thai digits */                              \
286     RANGE (c, 0xED0, 0xED9))   /* Lao digits */
287
288 /* This is not to be used as a stand alone macro. Use JAVA_ID_CHAR_P()
289    or the forcoming JAVA_LETTER_OR_DIGIT_P() instead.
290    It need to be split by region. FIXME.  */
291 #define _JAVA_LETTER_OR_DIGIT_P(c)              \
292    (RANGE (c, 0x00C0, 0x00D6) ||                \
293     RANGE (c, 0x00D8, 0x00F6) ||                \
294     RANGE (c, 0x00F8, 0x01F5) ||                \
295     RANGE (c, 0x01FA, 0x0217) ||                \
296     RANGE (c, 0x0250, 0x02A8) ||                \
297     RANGE (c, 0x02B0, 0x02DE) ||                \
298     RANGE (c, 0x02E0, 0x02E9) ||                \
299     RANGE (c, 0x0300, 0x0345) ||                \
300     RANGE (c, 0x0360, 0x0361) ||                \
301     RANGE (c, 0x0374, 0x0375) ||                \
302     c == 0x037A            ||                   \
303     c == 0x037E            ||                   \
304     RANGE (c, 0x0384, 0x038A) ||                \
305     c == 0x038C            ||                   \
306     c == 0x038E            ||                   \
307     RANGE (c, 0x038F, 0x03A1) ||                \
308     RANGE (c, 0x03A3, 0x03CE) ||                \
309     RANGE (c, 0x03D0, 0x03D6) ||                \
310     RANGE (c, 0x03DA, 0x03E2) ||                \
311     c == 0x03DA            ||                   \
312     c == 0x03DC            ||                   \
313     c == 0x03DE            ||                   \
314     c == 0x03E0            ||                   \
315     RANGE (c, 0x03E2, 0x03F3) ||                \
316     RANGE (c, 0x0401, 0x040C) ||                \
317     RANGE (c, 0x040E, 0x044F) ||                \
318     RANGE (c, 0x0451, 0x045C) ||                \
319     RANGE (c, 0x045E, 0x0486) ||                \
320     RANGE (c, 0x0490, 0x04C4) ||                \
321     RANGE (c, 0x04C7, 0x04C8) ||                \
322     RANGE (c, 0x04CB, 0x04CC) ||                \
323     RANGE (c, 0x04D0, 0x04EB) ||                \
324     RANGE (c, 0x04EE, 0x04F5) ||                \
325     RANGE (c, 0x04F8, 0x04F9) ||                \
326     RANGE (c, 0x0531, 0x0556) ||                \
327     RANGE (c, 0x0559, 0x055F) ||                \
328     RANGE (c, 0x0561, 0x0587) ||                \
329     c == 0x0589            ||                   \
330     RANGE (c, 0x05B0, 0x05B9) ||                \
331     RANGE (c, 0x05BB, 0x05C3) ||                \
332     RANGE (c, 0x05D0, 0x05EA) ||                \
333     RANGE (c, 0x05F0, 0x05F4) ||                \
334     c == 0x060C            ||                   \
335     c == 0x061B            ||                   \
336     c == 0x061F            ||                   \
337     c == 0x0621            ||                   \
338     RANGE (c, 0x0622, 0x063A) ||                \
339     RANGE (c, 0x0640, 0x0652) ||                \
340     RANGE (c, 0x0660, 0x066D) ||                \
341     RANGE (c, 0x0670, 0x06B7) ||                \
342     RANGE (c, 0x06BA, 0x06BE) ||                \
343     RANGE (c, 0x06C0, 0x06CE) ||                \
344     RANGE (c, 0x06D0, 0x06ED) ||                \
345     RANGE (c, 0x06F0, 0x06F9) ||                \
346     RANGE (c, 0x0901, 0x0903) ||                \
347     RANGE (c, 0x0905, 0x0939) ||                \
348     RANGE (c, 0x093C, 0x094D) ||                \
349     RANGE (c, 0x0950, 0x0954) ||                \
350     RANGE (c, 0x0958, 0x0970) ||                \
351     RANGE (c, 0x0981, 0x0983) ||                \
352     RANGE (c, 0x0985, 0x098C) ||                \
353     RANGE (c, 0x098F, 0x0990) ||                \
354     RANGE (c, 0x0993, 0x09A8) ||                \
355     RANGE (c, 0x09AA, 0x09B0) ||                \
356     c == 0x09B2            ||                   \
357     RANGE (c, 0x09B6, 0x09B9) ||                \
358     c == 0x09BC            ||                   \
359     c == 0x09BE            ||                   \
360     RANGE (c, 0x09BF, 0x09C4) ||                \
361     RANGE (c, 0x09C7, 0x09C8) ||                \
362     RANGE (c, 0x09CB, 0x09CD) ||                \
363     c == 0x09D7            ||                   \
364     RANGE (c, 0x09DC, 0x09DD) ||                \
365     RANGE (c, 0x09DF, 0x09E3) ||                \
366     RANGE (c, 0x09E6, 0x09FA) ||                \
367     c == 0x0A02            ||                   \
368     RANGE (c, 0x0A05, 0x0A0A) ||                \
369     RANGE (c, 0x0A0F, 0x0A10) ||                \
370     RANGE (c, 0x0A13, 0x0A28) ||                \
371     RANGE (c, 0x0A2A, 0x0A30) ||                \
372     RANGE (c, 0x0A32, 0x0A33) ||                \
373     RANGE (c, 0x0A35, 0x0A36) ||                \
374     RANGE (c, 0x0A38, 0x0A39) ||                \
375     c == 0x0A3C            ||                   \
376     c == 0x0A3E            ||                   \
377     RANGE (c, 0x0A3F, 0x0A42) ||                \
378     RANGE (c, 0x0A47, 0x0A48) ||                \
379     RANGE (c, 0x0A4B, 0x0A4D) ||                \
380     RANGE (c, 0x0A59, 0x0A5C) ||                \
381     c == 0x0A5E            ||                   \
382     RANGE (c, 0x0A66, 0x0A74) ||                \
383     RANGE (c, 0x0A81, 0x0A83) ||                \
384     RANGE (c, 0x0A85, 0x0A8B) ||                \
385     c == 0x0A8D            ||                   \
386     c == 0x0A8F            ||                   \
387     RANGE (c, 0x0A90, 0x0A91) ||                \
388     RANGE (c, 0x0A93, 0x0AA8) ||                \
389     RANGE (c, 0x0AAA, 0x0AB0) ||                \
390     RANGE (c, 0x0AB2, 0x0AB3) ||                \
391     RANGE (c, 0x0AB5, 0x0AB9) ||                \
392     RANGE (c, 0x0ABC, 0x0AC5) ||                \
393     RANGE (c, 0x0AC7, 0x0AC9) ||                \
394     RANGE (c, 0x0ACB, 0x0ACD) ||                \
395     c == 0x0AD0            ||                   \
396     c == 0x0AE0            ||                   \
397     RANGE (c, 0x0AE6, 0x0AEF) ||                \
398     RANGE (c, 0x0B01, 0x0B03) ||                \
399     RANGE (c, 0x0B05, 0x0B0C) ||                \
400     RANGE (c, 0x0B0F, 0x0B10) ||                \
401     RANGE (c, 0x0B13, 0x0B28) ||                \
402     RANGE (c, 0x0B2A, 0x0B30) ||                \
403     RANGE (c, 0x0B32, 0x0B33) ||                \
404     RANGE (c, 0x0B36, 0x0B39) ||                \
405     RANGE (c, 0x0B3C, 0x0B43) ||                \
406     RANGE (c, 0x0B47, 0x0B48) ||                \
407     RANGE (c, 0x0B4B, 0x0B4D) ||                \
408     RANGE (c, 0x0B56, 0x0B57) ||                \
409     RANGE (c, 0x0B5C, 0x0B5D) ||                \
410     RANGE (c, 0x0B5F, 0x0B61) ||                \
411     RANGE (c, 0x0B66, 0x0B70) ||                \
412     RANGE (c, 0x0B82, 0x0B83) ||                \
413     RANGE (c, 0x0B85, 0x0B8A) ||                \
414     RANGE (c, 0x0B8E, 0x0B90) ||                \
415     RANGE (c, 0x0B92, 0x0B95) ||                \
416     RANGE (c, 0x0B99, 0x0B9A) ||                \
417     c == 0x0B9C            ||                   \
418     c == 0x0B9E            ||                   \
419     c == 0x0B9F            ||                   \
420     RANGE (c, 0x0BA3, 0x0BA4) ||                \
421     RANGE (c, 0x0BA8, 0x0BAA) ||                \
422     RANGE (c, 0x0BAE, 0x0BB5) ||                \
423     RANGE (c, 0x0BB7, 0x0BB9) ||                \
424     RANGE (c, 0x0BBE, 0x0BC2) ||                \
425     RANGE (c, 0x0BC6, 0x0BC8) ||                \
426     RANGE (c, 0x0BCA, 0x0BCD) ||                \
427     c == 0x0BD7            ||                   \
428     RANGE (c, 0x0BE7, 0x0BF2) ||                \
429     RANGE (c, 0x0C01, 0x0C03) ||                \
430     RANGE (c, 0x0C05, 0x0C0C) ||                \
431     RANGE (c, 0x0C0E, 0x0C10) ||                \
432     RANGE (c, 0x0C12, 0x0C28) ||                \
433     RANGE (c, 0x0C2A, 0x0C33) ||                \
434     RANGE (c, 0x0C35, 0x0C39) ||                \
435     RANGE (c, 0x0C3E, 0x0C44) ||                \
436     RANGE (c, 0x0C46, 0x0C48) ||                \
437     RANGE (c, 0x0C4A, 0x0C4D) ||                \
438     RANGE (c, 0x0C55, 0x0C56) ||                \
439     RANGE (c, 0x0C60, 0x0C61) ||                \
440     RANGE (c, 0x0C66, 0x0C6F) ||                \
441     RANGE (c, 0x0C82, 0x0C83) ||                \
442     RANGE (c, 0x0C85, 0x0C8C) ||                \
443     RANGE (c, 0x0C8E, 0x0C90) ||                \
444     RANGE (c, 0x0C92, 0x0CA8) ||                \
445     RANGE (c, 0x0CAA, 0x0CB3) ||                \
446     RANGE (c, 0x0CB5, 0x0CB9) ||                \
447     RANGE (c, 0x0CBE, 0x0CC4) ||                \
448     RANGE (c, 0x0CC6, 0x0CC8) ||                \
449     RANGE (c, 0x0CCA, 0x0CCD) ||                \
450     RANGE (c, 0x0CD5, 0x0CD6) ||                \
451     c == 0x0CDE            ||                   \
452     c == 0x0CE0            ||                   \
453     c == 0x0CE1            ||                   \
454     RANGE (c, 0x0CE6, 0x0CEF) ||                \
455     RANGE (c, 0x0D02, 0x0D03) ||                \
456     RANGE (c, 0x0D05, 0x0D0C) ||                \
457     RANGE (c, 0x0D0E, 0x0D10) ||                \
458     RANGE (c, 0x0D12, 0x0D28) ||                \
459     RANGE (c, 0x0D2A, 0x0D39) ||                \
460     RANGE (c, 0x0D3E, 0x0D43) ||                \
461     RANGE (c, 0x0D46, 0x0D48) ||                \
462     RANGE (c, 0x0D4A, 0x0D4D) ||                \
463     c == 0x0D57            ||                   \
464     RANGE (c, 0x0D60, 0x0D61) ||                \
465     RANGE (c, 0x0D66, 0x0D6F) ||                \
466     RANGE (c, 0x0E01, 0x0E3A) ||                \
467     RANGE (c, 0x0E3F, 0x0E5B) ||                \
468     RANGE (c, 0x0E81, 0x0E82) ||                \
469     c == 0x0E84            ||                   \
470     RANGE (c, 0x0E87, 0x0E88) ||                \
471     c == 0x0E8A            ||                   \
472     c == 0x0E8D            ||                   \
473     RANGE (c, 0x0E94, 0x0E97) ||                \
474     RANGE (c, 0x0E99, 0x0E9F) ||                \
475     RANGE (c, 0x0EA1, 0x0EA3) ||                \
476     c == 0x0EA5            ||                   \
477     c == 0x0EA7            ||                   \
478     RANGE (c, 0x0EAA, 0x0EAB) ||                \
479     RANGE (c, 0x0EAD, 0x0EB9) ||                \
480     RANGE (c, 0x0EBB, 0x0EBD) ||                \
481     RANGE (c, 0x0EC0, 0x0EC4) ||                \
482     c == 0x0EC6            ||                   \
483     c == 0x0EC8            ||                   \
484     RANGE (c, 0x0EC9, 0x0ECD) ||                \
485     RANGE (c, 0x0ED0, 0x0ED9) ||                \
486     RANGE (c, 0x0EDC, 0x0EDD) ||                \
487     RANGE (c, 0x10A0, 0x10C5) ||                \
488     RANGE (c, 0x10D0, 0x10F6) ||                \
489     c == 0x10FB            ||                   \
490     RANGE (c, 0x1100, 0x1159) ||                \
491     RANGE (c, 0x115F, 0x11A2) ||                \
492     RANGE (c, 0x11A8, 0x11F9) ||                \
493     RANGE (c, 0x1E00, 0x1E9A) ||                \
494     RANGE (c, 0x1EA0, 0x1EF9) ||                \
495     RANGE (c, 0x1F00, 0x1F15) ||                \
496     RANGE (c, 0x1F18, 0x1F1D) ||                \
497     RANGE (c, 0x1F20, 0x1F45) ||                \
498     RANGE (c, 0x1F48, 0x1F4D) ||                \
499     RANGE (c, 0x1F50, 0x1F57) ||                \
500     c == 0x1F59            ||                   \
501     c == 0x1F5B            ||                   \
502     c == 0x1F5D            ||                   \
503     RANGE (c, 0x1F5F, 0x1F7D) ||                \
504     RANGE (c, 0x1F80, 0x1FB4) ||                \
505     RANGE (c, 0x1FB6, 0x1FC4) ||                \
506     RANGE (c, 0x1FC6, 0x1FD3) ||                \
507     RANGE (c, 0x1FD6, 0x1FDB) ||                \
508     RANGE (c, 0x1FDD, 0x1FEF) ||                \
509     RANGE (c, 0x1FF2, 0x1FF4) ||                \
510     RANGE (c, 0x1FF6, 0x1FFE) ||                \
511     RANGE (c, 0x3041, 0x3094) ||                \
512     RANGE (c, 0x3099, 0x309E) ||                \
513     RANGE (c, 0x30A1, 0x30FE) ||                \
514     RANGE (c, 0x3105, 0x312C) ||                \
515     RANGE (c, 0x3131, 0x318E) ||                \
516     RANGE (c, 0x3190, 0x319F) ||                \
517     RANGE (c, 0x3200, 0x321C) ||                \
518     RANGE (c, 0x3220, 0x3243) ||                \
519     RANGE (c, 0x3260, 0x327B) ||                \
520     RANGE (c, 0x327F, 0x32B0) ||                \
521     RANGE (c, 0x32C0, 0x32CB) ||                \
522     RANGE (c, 0x32D0, 0x32FE) ||                \
523     RANGE (c, 0x3300, 0x3376) ||                \
524     RANGE (c, 0x337B, 0x33DD) ||                \
525     RANGE (c, 0x33E0, 0x33FE) ||                \
526     RANGE (c, 0x3400, 0x9FA5) ||                \
527     RANGE (c, 0xF900, 0xFA2D) ||                \
528     RANGE (c, 0xFB00, 0xFB06) ||                \
529     RANGE (c, 0xFB13, 0xFB17) ||                \
530     RANGE (c, 0xFB1E, 0xFB36) ||                \
531     RANGE (c, 0xFB38, 0xFB3C) ||                \
532     c == 0xFB3E            ||                   \
533     c == 0xFB40            ||                   \
534     c == 0xFB41            ||                   \
535     c == 0xFB43            ||                   \
536     c == 0xFB44            ||                   \
537     c == 0xFB46            ||                   \
538     RANGE (c, 0xFB47, 0xFBB1) ||                \
539     RANGE (c, 0xFBD3, 0xFD3F) ||                \
540     RANGE (c, 0xFD50, 0xFD8F) ||                \
541     RANGE (c, 0xFD92, 0xFDC7) ||                \
542     RANGE (c, 0xFDF0, 0xFDFB) ||                \
543     RANGE (c, 0xFE70, 0xFE72) ||                \
544     c == 0xFE74            ||                   \
545     c == 0xFE76            ||                   \
546     RANGE (c, 0xFE77, 0xFEFC) ||                \
547     RANGE (c, 0xFF10, 0xFF19) ||                \
548     RANGE (c, 0xFF21, 0xFF3A) ||                \
549     RANGE (c, 0xFF41, 0xFF5A) ||                \
550     RANGE (c, 0xFF66, 0xFFBE) ||                \
551     RANGE (c, 0xFFC2, 0xFFC7) ||                \
552     RANGE (c, 0xFFCA, 0xFFCF) ||                \
553     RANGE (c, 0xFFD2, 0xFFD7) ||                \
554     RANGE (c, 0xFFDA, 0xFFDC))
555
556 /* Identifier-ignorable characters.  This should not be used
557    standalone.  Note that the JCL says 200a->200e.  That is a typo.
558    The correct values are 202a->202e.  Note also that we test against
559    0x0000 separately to avoid a warning.  */
560 #define _JAVA_IDENTIFIER_IGNORABLE(c)                                         \
561   (c == 0x0000                                                                \
562    || RANGE (c, 0x0001, 0x0008)                                               \
563    || RANGE (c, 0x000e, 0x001b)                                               \
564    || RANGE (c, 0x007f, 0x009f)                                               \
565    || RANGE (c, 0x200c, 0x200f)                                               \
566    || RANGE (c, 0x202a, 0x202e)                                               \
567    || RANGE (c, 0x206a, 0x206f)                                               \
568    || c == 0xfeff)
569
570 /* Constants  */
571 #define JAVA_CHAR_ERROR 0xFFC1  /* This is an illegal unicode!?! FIXME */
572 #define JAVA_READ_BUFFER 256
573 #define UEOF (unicode_t)0xffff
574
575 #endif