1 #line 1 "java.c"
2 /*
3 * Copyright (c) 2002, 2004 Tama Communications Corporation
4 *
5 * This file is part of GNU GLOBAL.
6 *
7 * This program 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 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 /*
22 * scanner for java source code.
23 */
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27 #include <stdio.h>
28 #ifdef STDC_HEADERS
29 #include <stdlib.h>
30 #endif
31 #include "global.h"
32 #include "anchor.h"
33 #include "common.h"
34 #include "htags.h"
35 #include "../libparser/java_res.h"
36
37 #define lex_symbol_generation_rule(x) java_ ## x
38 #include "lexcommon.h"
39
40 #ifdef ECHO
41 #undef ECHO
42 #endif
43 #define ECHO echos(LEXTEXT)
44
45 #define YY_USER_ACTION DEFAULT_YY_USER_ACTION
46
47 #line 47 "java.c"
48
49 #define YY_INT_ALIGNED short int
50
51 /* A lexical scanner generated by flex */
52
53 #define yy_create_buffer java__create_buffer
54 #define yy_delete_buffer java__delete_buffer
55 #define yy_scan_buffer java__scan_buffer
56 #define yy_scan_string java__scan_string
57 #define yy_scan_bytes java__scan_bytes
58 #define yy_init_buffer java__init_buffer
59 #define yy_flush_buffer java__flush_buffer
60 #define yy_load_buffer_state java__load_buffer_state
61 #define yy_switch_to_buffer java__switch_to_buffer
62 #define yypush_buffer_state java_push_buffer_state
63 #define yypop_buffer_state java_pop_buffer_state
64 #define yyensure_buffer_stack java_ensure_buffer_stack
65 #define yy_flex_debug java__flex_debug
66 #define yyin java_in
67 #define yyleng java_leng
68 #define yylex java_lex
69 #define yylineno java_lineno
70 #define yyout java_out
71 #define yyrestart java_restart
72 #define yytext java_text
73 #define yywrap java_wrap
74 #define yyalloc java_alloc
75 #define yyrealloc java_realloc
76 #define yyfree java_free
77
78 #define FLEX_SCANNER
79 #define YY_FLEX_MAJOR_VERSION 2
80 #define YY_FLEX_MINOR_VERSION 6
81 #define YY_FLEX_SUBMINOR_VERSION 4
82 #if YY_FLEX_SUBMINOR_VERSION > 0
83 #define FLEX_BETA
84 #endif
85
86 #ifdef yy_create_buffer
87 #define java__create_buffer_ALREADY_DEFINED
88 #else
89 #define yy_create_buffer java__create_buffer
90 #endif
91
92 #ifdef yy_delete_buffer
93 #define java__delete_buffer_ALREADY_DEFINED
94 #else
95 #define yy_delete_buffer java__delete_buffer
96 #endif
97
98 #ifdef yy_scan_buffer
99 #define java__scan_buffer_ALREADY_DEFINED
100 #else
101 #define yy_scan_buffer java__scan_buffer
102 #endif
103
104 #ifdef yy_scan_string
105 #define java__scan_string_ALREADY_DEFINED
106 #else
107 #define yy_scan_string java__scan_string
108 #endif
109
110 #ifdef yy_scan_bytes
111 #define java__scan_bytes_ALREADY_DEFINED
112 #else
113 #define yy_scan_bytes java__scan_bytes
114 #endif
115
116 #ifdef yy_init_buffer
117 #define java__init_buffer_ALREADY_DEFINED
118 #else
119 #define yy_init_buffer java__init_buffer
120 #endif
121
122 #ifdef yy_flush_buffer
123 #define java__flush_buffer_ALREADY_DEFINED
124 #else
125 #define yy_flush_buffer java__flush_buffer
126 #endif
127
128 #ifdef yy_load_buffer_state
129 #define java__load_buffer_state_ALREADY_DEFINED
130 #else
131 #define yy_load_buffer_state java__load_buffer_state
132 #endif
133
134 #ifdef yy_switch_to_buffer
135 #define java__switch_to_buffer_ALREADY_DEFINED
136 #else
137 #define yy_switch_to_buffer java__switch_to_buffer
138 #endif
139
140 #ifdef yypush_buffer_state
141 #define java_push_buffer_state_ALREADY_DEFINED
142 #else
143 #define yypush_buffer_state java_push_buffer_state
144 #endif
145
146 #ifdef yypop_buffer_state
147 #define java_pop_buffer_state_ALREADY_DEFINED
148 #else
149 #define yypop_buffer_state java_pop_buffer_state
150 #endif
151
152 #ifdef yyensure_buffer_stack
153 #define java_ensure_buffer_stack_ALREADY_DEFINED
154 #else
155 #define yyensure_buffer_stack java_ensure_buffer_stack
156 #endif
157
158 #ifdef yylex
159 #define java_lex_ALREADY_DEFINED
160 #else
161 #define yylex java_lex
162 #endif
163
164 #ifdef yyrestart
165 #define java_restart_ALREADY_DEFINED
166 #else
167 #define yyrestart java_restart
168 #endif
169
170 #ifdef yylex_init
171 #define java_lex_init_ALREADY_DEFINED
172 #else
173 #define yylex_init java_lex_init
174 #endif
175
176 #ifdef yylex_init_extra
177 #define java_lex_init_extra_ALREADY_DEFINED
178 #else
179 #define yylex_init_extra java_lex_init_extra
180 #endif
181
182 #ifdef yylex_destroy
183 #define java_lex_destroy_ALREADY_DEFINED
184 #else
185 #define yylex_destroy java_lex_destroy
186 #endif
187
188 #ifdef yyget_debug
189 #define java_get_debug_ALREADY_DEFINED
190 #else
191 #define yyget_debug java_get_debug
192 #endif
193
194 #ifdef yyset_debug
195 #define java_set_debug_ALREADY_DEFINED
196 #else
197 #define yyset_debug java_set_debug
198 #endif
199
200 #ifdef yyget_extra
201 #define java_get_extra_ALREADY_DEFINED
202 #else
203 #define yyget_extra java_get_extra
204 #endif
205
206 #ifdef yyset_extra
207 #define java_set_extra_ALREADY_DEFINED
208 #else
209 #define yyset_extra java_set_extra
210 #endif
211
212 #ifdef yyget_in
213 #define java_get_in_ALREADY_DEFINED
214 #else
215 #define yyget_in java_get_in
216 #endif
217
218 #ifdef yyset_in
219 #define java_set_in_ALREADY_DEFINED
220 #else
221 #define yyset_in java_set_in
222 #endif
223
224 #ifdef yyget_out
225 #define java_get_out_ALREADY_DEFINED
226 #else
227 #define yyget_out java_get_out
228 #endif
229
230 #ifdef yyset_out
231 #define java_set_out_ALREADY_DEFINED
232 #else
233 #define yyset_out java_set_out
234 #endif
235
236 #ifdef yyget_leng
237 #define java_get_leng_ALREADY_DEFINED
238 #else
239 #define yyget_leng java_get_leng
240 #endif
241
242 #ifdef yyget_text
243 #define java_get_text_ALREADY_DEFINED
244 #else
245 #define yyget_text java_get_text
246 #endif
247
248 #ifdef yyget_lineno
249 #define java_get_lineno_ALREADY_DEFINED
250 #else
251 #define yyget_lineno java_get_lineno
252 #endif
253
254 #ifdef yyset_lineno
255 #define java_set_lineno_ALREADY_DEFINED
256 #else
257 #define yyset_lineno java_set_lineno
258 #endif
259
260 #ifdef yywrap
261 #define java_wrap_ALREADY_DEFINED
262 #else
263 #define yywrap java_wrap
264 #endif
265
266 #ifdef yyalloc
267 #define java_alloc_ALREADY_DEFINED
268 #else
269 #define yyalloc java_alloc
270 #endif
271
272 #ifdef yyrealloc
273 #define java_realloc_ALREADY_DEFINED
274 #else
275 #define yyrealloc java_realloc
276 #endif
277
278 #ifdef yyfree
279 #define java_free_ALREADY_DEFINED
280 #else
281 #define yyfree java_free
282 #endif
283
284 #ifdef yytext
285 #define java_text_ALREADY_DEFINED
286 #else
287 #define yytext java_text
288 #endif
289
290 #ifdef yyleng
291 #define java_leng_ALREADY_DEFINED
292 #else
293 #define yyleng java_leng
294 #endif
295
296 #ifdef yyin
297 #define java_in_ALREADY_DEFINED
298 #else
299 #define yyin java_in
300 #endif
301
302 #ifdef yyout
303 #define java_out_ALREADY_DEFINED
304 #else
305 #define yyout java_out
306 #endif
307
308 #ifdef yy_flex_debug
309 #define java__flex_debug_ALREADY_DEFINED
310 #else
311 #define yy_flex_debug java__flex_debug
312 #endif
313
314 #ifdef yylineno
315 #define java_lineno_ALREADY_DEFINED
316 #else
317 #define yylineno java_lineno
318 #endif
319
320 /* First, we deal with platform-specific or compiler-specific issues. */
321
322 /* begin standard C headers. */
323 #include <stdio.h>
324 #include <string.h>
325 #include <errno.h>
326 #include <stdlib.h>
327
328 /* end standard C headers. */
329
330 /* flex integer type definitions */
331
332 #ifndef FLEXINT_H
333 #define FLEXINT_H
334
335 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
336
337 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
338
339 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
340 * if you want the limit (max/min) macros for int types.
341 */
342 #ifndef __STDC_LIMIT_MACROS
343 #define __STDC_LIMIT_MACROS 1
344 #endif
345
346 #include <inttypes.h>
347 typedef int8_t flex_int8_t;
348 typedef uint8_t flex_uint8_t;
349 typedef int16_t flex_int16_t;
350 typedef uint16_t flex_uint16_t;
351 typedef int32_t flex_int32_t;
352 typedef uint32_t flex_uint32_t;
353 #else
354 typedef signed char flex_int8_t;
355 typedef short int flex_int16_t;
356 typedef int flex_int32_t;
357 typedef unsigned char flex_uint8_t;
358 typedef unsigned short int flex_uint16_t;
359 typedef unsigned int flex_uint32_t;
360
361 /* Limits of integral types. */
362 #ifndef INT8_MIN
363 #define INT8_MIN (-128)
364 #endif
365 #ifndef INT16_MIN
366 #define INT16_MIN (-32767-1)
367 #endif
368 #ifndef INT32_MIN
369 #define INT32_MIN (-2147483647-1)
370 #endif
371 #ifndef INT8_MAX
372 #define INT8_MAX (127)
373 #endif
374 #ifndef INT16_MAX
375 #define INT16_MAX (32767)
376 #endif
377 #ifndef INT32_MAX
378 #define INT32_MAX (2147483647)
379 #endif
380 #ifndef UINT8_MAX
381 #define UINT8_MAX (255U)
382 #endif
383 #ifndef UINT16_MAX
384 #define UINT16_MAX (65535U)
385 #endif
386 #ifndef UINT32_MAX
387 #define UINT32_MAX (4294967295U)
388 #endif
389
390 #ifndef SIZE_MAX
391 #define SIZE_MAX (~(size_t)0)
392 #endif
393
394 #endif /* ! C99 */
395
396 #endif /* ! FLEXINT_H */
397
398 /* begin standard C++ headers. */
399
400 /* TODO: this is always defined, so inline it */
401 #define yyconst const
402
403 #if defined(__GNUC__) && __GNUC__ >= 3
404 #define yynoreturn __attribute__((__noreturn__))
405 #else
406 #define yynoreturn
407 #endif
408
409 /* Returned upon end-of-file. */
410 #define YY_NULL 0
411
412 /* Promotes a possibly negative, possibly signed char to an
413 * integer in range [0..255] for use as an array index.
414 */
415 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
416
417 /* Enter a start condition. This macro really ought to take a parameter,
418 * but we do it the disgusting crufty way forced on us by the ()-less
419 * definition of BEGIN.
420 */
421 #define BEGIN (yy_start) = 1 + 2 *
422 /* Translate the current start state into a value that can be later handed
423 * to BEGIN to return to the state. The YYSTATE alias is for lex
424 * compatibility.
425 */
426 #define YY_START (((yy_start) - 1) / 2)
427 #define YYSTATE YY_START
428 /* Action number for EOF rule of a given start state. */
429 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
430 /* Special action meaning "start processing a new file". */
431 #define YY_NEW_FILE yyrestart( yyin )
432 #define YY_END_OF_BUFFER_CHAR 0
433
434 /* Size of default input buffer. */
435 #ifndef YY_BUF_SIZE
436 #ifdef __ia64__
437 /* On IA-64, the buffer size is 16k, not 8k.
438 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
439 * Ditto for the __ia64__ case accordingly.
440 */
441 #define YY_BUF_SIZE 32768
442 #else
443 #define YY_BUF_SIZE 16384
444 #endif /* __ia64__ */
445 #endif
446
447 /* The state buf must be large enough to hold one state per character in the main buffer.
448 */
449 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
450
451 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
452 #define YY_TYPEDEF_YY_BUFFER_STATE
453 typedef struct yy_buffer_state *YY_BUFFER_STATE;
454 #endif
455
456 #ifndef YY_TYPEDEF_YY_SIZE_T
457 #define YY_TYPEDEF_YY_SIZE_T
458 typedef size_t yy_size_t;
459 #endif
460
461 extern int yyleng;
462
463 extern FILE *yyin, *yyout;
464
465 #define EOB_ACT_CONTINUE_SCAN 0
466 #define EOB_ACT_END_OF_FILE 1
467 #define EOB_ACT_LAST_MATCH 2
468
469 #define YY_LESS_LINENO(n)
470 #define YY_LINENO_REWIND_TO(ptr)
471
472 /* Return all but the first "n" matched characters back to the input stream. */
473 #define yyless(n) \
474 do \
475 { \
476 /* Undo effects of setting up yytext. */ \
477 int yyless_macro_arg = (n); \
478 YY_LESS_LINENO(yyless_macro_arg);\
479 *yy_cp = (yy_hold_char); \
480 YY_RESTORE_YY_MORE_OFFSET \
481 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
482 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
483 } \
484 while ( 0 )
485 #define unput(c) yyunput( c, (yytext_ptr) )
486
487 #ifndef YY_STRUCT_YY_BUFFER_STATE
488 #define YY_STRUCT_YY_BUFFER_STATE
489 struct yy_buffer_state
490 {
491 FILE *yy_input_file;
492
493 char *yy_ch_buf; /* input buffer */
494 char *yy_buf_pos; /* current position in input buffer */
495
496 /* Size of input buffer in bytes, not including room for EOB
497 * characters.
498 */
499 int yy_buf_size;
500
501 /* Number of characters read into yy_ch_buf, not including EOB
502 * characters.
503 */
504 int yy_n_chars;
505
506 /* Whether we "own" the buffer - i.e., we know we created it,
507 * and can realloc() it to grow it, and should free() it to
508 * delete it.
509 */
510 int yy_is_our_buffer;
511
512 /* Whether this is an "interactive" input source; if so, and
513 * if we're using stdio for input, then we want to use getc()
514 * instead of fread(), to make sure we stop fetching input after
515 * each newline.
516 */
517 int yy_is_interactive;
518
519 /* Whether we're considered to be at the beginning of a line.
520 * If so, '^' rules will be active on the next match, otherwise
521 * not.
522 */
523 int yy_at_bol;
524
525 int yy_bs_lineno; /**< The line count. */
526 int yy_bs_column; /**< The column count. */
527
528 /* Whether to try to fill the input buffer when we reach the
529 * end of it.
530 */
531 int yy_fill_buffer;
532
533 int yy_buffer_status;
534
535 #define YY_BUFFER_NEW 0
536 #define YY_BUFFER_NORMAL 1
537 /* When an EOF's been seen but there's still some text to process
538 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
539 * shouldn't try reading from the input source any more. We might
540 * still have a bunch of tokens to match, though, because of
541 * possible backing-up.
542 *
543 * When we actually see the EOF, we change the status to "new"
544 * (via yyrestart()), so that the user can continue scanning by
545 * just pointing yyin at a new input file.
546 */
547 #define YY_BUFFER_EOF_PENDING 2
548
549 };
550 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
551
552 /* Stack of input buffers. */
553 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
554 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
555 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
556
557 /* We provide macros for accessing buffer states in case in the
558 * future we want to put the buffer states in a more general
559 * "scanner state".
560 *
561 * Returns the top of the stack, or NULL.
562 */
563 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
564 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
565 : NULL)
566 /* Same as previous macro, but useful when we know that the buffer stack is not
567 * NULL or when we need an lvalue. For internal use only.
568 */
569 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
570
571 /* yy_hold_char holds the character lost when yytext is formed. */
572 static char yy_hold_char;
573 static int yy_n_chars; /* number of characters read into yy_ch_buf */
574 int yyleng;
575
576 /* Points to current character in buffer. */
577 static char *yy_c_buf_p = NULL;
578 static int yy_init = 0; /* whether we need to initialize */
579 static int yy_start = 0; /* start state number */
580
581 /* Flag which is used to allow yywrap()'s to do buffer switches
582 * instead of setting up a fresh yyin. A bit of a hack ...
583 */
584 static int yy_did_buffer_switch_on_eof;
585
586 void yyrestart ( FILE *input_file );
587 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
588 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
589 void yy_delete_buffer ( YY_BUFFER_STATE b );
590 void yy_flush_buffer ( YY_BUFFER_STATE b );
591 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
592 void yypop_buffer_state ( void );
593
594 static void yyensure_buffer_stack ( void );
595 static void yy_load_buffer_state ( void );
596 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
597 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
598
599 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
600 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
601 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
602
603 void *yyalloc ( yy_size_t );
604 void *yyrealloc ( void *, yy_size_t );
605 void yyfree ( void * );
606
607 #define yy_new_buffer yy_create_buffer
608 #define yy_set_interactive(is_interactive) \
609 { \
610 if ( ! YY_CURRENT_BUFFER ){ \
611 yyensure_buffer_stack (); \
612 YY_CURRENT_BUFFER_LVALUE = \
613 yy_create_buffer( yyin, YY_BUF_SIZE ); \
614 } \
615 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
616 }
617 #define yy_set_bol(at_bol) \
618 { \
619 if ( ! YY_CURRENT_BUFFER ){\
620 yyensure_buffer_stack (); \
621 YY_CURRENT_BUFFER_LVALUE = \
622 yy_create_buffer( yyin, YY_BUF_SIZE ); \
623 } \
624 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
625 }
626 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
627
628 /* Begin user sect3 */
629
630 #define java_wrap() (/*CONSTCOND*/1)
631 #define YY_SKIP_YYWRAP
632 typedef flex_uint8_t YY_CHAR;
633
634 FILE *yyin = NULL, *yyout = NULL;
635
636 typedef int yy_state_type;
637
638 extern int yylineno;
639 int yylineno = 1;
640
641 extern char *yytext;
642 #ifdef yytext_ptr
643 #undef yytext_ptr
644 #endif
645 #define yytext_ptr yytext
646
647 static yy_state_type yy_get_previous_state ( void );
648 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
649 static int yy_get_next_buffer ( void );
650 static void yynoreturn yy_fatal_error ( const char* msg );
651
652 /* Done after the current pattern has been matched and before the
653 * corresponding action - sets up yytext.
654 */
655 #define YY_DO_BEFORE_ACTION \
656 (yytext_ptr) = yy_bp; \
657 yyleng = (int) (yy_cp - yy_bp); \
658 (yy_hold_char) = *yy_cp; \
659 *yy_cp = '\0'; \
660 (yy_c_buf_p) = yy_cp;
661 #define YY_NUM_RULES 17
662 #define YY_END_OF_BUFFER 18
663 /* This struct is not used in this scanner,
664 but its presence is necessary. */
665 struct yy_trans_info
666 {
667 flex_int32_t yy_verify;
668 flex_int32_t yy_nxt;
669 };
670 static const flex_int16_t yy_accept[60] =
671 { 0,
672 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
673 0, 0, 0, 0, 0, 0, 18, 16, 15, 5,
674 8, 16, 16, 16, 12, 13, 14, 13, 3, 3,
675 6, 16, 9, 16, 0, 12, 12, 1, 4, 0,
676 12, 13, 13, 2, 7, 10, 0, 12, 13, 0,
677 12, 0, 13, 0, 12, 13, 13, 11, 0
678 } ;
679
680 static const YY_CHAR yy_ec[256] =
681 { 0,
682 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
683 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
684 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
685 1, 2, 1, 4, 1, 1, 1, 1, 5, 1,
686 1, 6, 7, 1, 8, 9, 10, 11, 11, 11,
687 11, 11, 11, 11, 11, 11, 11, 1, 1, 1,
688 1, 1, 1, 1, 12, 12, 12, 12, 13, 12,
689 12, 12, 12, 12, 12, 14, 12, 12, 12, 12,
690 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
691 1, 15, 1, 1, 12, 1, 12, 12, 12, 12,
692
693 13, 12, 12, 12, 16, 12, 12, 12, 17, 12,
694 18, 19, 12, 20, 12, 21, 12, 12, 12, 12,
695 12, 12, 22, 1, 22, 1, 1, 12, 12, 12,
696 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
697 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
698 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
699 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
700 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
701 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
702 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
703
704 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
705 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
706 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
707 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
708 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
709 12, 12, 12, 12, 12
710 } ;
711
712 static const YY_CHAR yy_meta[23] =
713 { 0,
714 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
715 3, 3, 3, 3, 1, 3, 3, 3, 3, 3,
716 3, 1
717 } ;
718
719 static const flex_int16_t yy_base[65] =
720 { 0,
721 90, 89, 0, 75, 20, 21, 87, 86, 85, 84,
722 25, 27, 29, 30, 83, 82, 84, 94, 94, 94,
723 94, 27, 72, 31, 37, 0, 94, 65, 94, 71,
724 94, 0, 94, 0, 69, 38, 42, 94, 94, 68,
725 94, 0, 58, 94, 94, 94, 49, 48, 56, 54,
726 53, 55, 38, 43, 39, 22, 37, 94, 94, 66,
727 69, 22, 72, 75
728 } ;
729
730 static const flex_int16_t yy_def[65] =
731 { 0,
732 60, 60, 59, 3, 61, 61, 60, 60, 60, 60,
733 60, 60, 60, 60, 60, 60, 59, 59, 59, 59,
734 59, 59, 59, 59, 59, 62, 59, 62, 59, 59,
735 59, 63, 59, 64, 59, 59, 59, 59, 59, 59,
736 59, 62, 62, 59, 59, 59, 59, 59, 62, 59,
737 59, 59, 62, 59, 59, 62, 62, 59, 0, 59,
738 59, 59, 59, 59
739 } ;
740
741 static const flex_int16_t yy_nxt[117] =
742 { 0,
743 18, 18, 19, 20, 21, 18, 18, 22, 23, 24,
744 25, 26, 26, 26, 18, 26, 26, 26, 26, 26,
745 26, 27, 19, 19, 42, 30, 30, 19, 31, 19,
746 31, 19, 19, 33, 33, 35, 38, 36, 58, 32,
747 39, 32, 57, 34, 34, 40, 40, 36, 36, 55,
748 41, 41, 37, 55, 47, 50, 50, 56, 48, 51,
749 52, 54, 54, 51, 51, 55, 18, 18, 18, 29,
750 29, 29, 45, 53, 45, 46, 49, 46, 48, 37,
751 44, 43, 37, 59, 19, 19, 19, 19, 19, 19,
752 28, 19, 19, 17, 59, 59, 59, 59, 59, 59,
753
754 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
755 59, 59, 59, 59, 59, 59
756 } ;
757
758 static const flex_int16_t yy_chk[117] =
759 { 0,
760 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
761 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
762 3, 3, 5, 6, 62, 5, 6, 11, 11, 12,
763 12, 13, 14, 13, 14, 22, 24, 22, 57, 11,
764 24, 12, 56, 13, 14, 25, 36, 25, 36, 55,
765 25, 36, 37, 54, 37, 47, 47, 53, 48, 47,
766 48, 52, 52, 51, 50, 52, 60, 60, 60, 61,
767 61, 61, 63, 49, 63, 64, 43, 64, 40, 35,
768 30, 28, 23, 17, 16, 15, 10, 9, 8, 7,
769 4, 2, 1, 59, 59, 59, 59, 59, 59, 59,
770
771 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
772 59, 59, 59, 59, 59, 59
773 } ;
774
775 static yy_state_type yy_last_accepting_state;
776 static char *yy_last_accepting_cpos;
777
778 extern int yy_flex_debug;
779 int yy_flex_debug = 0;
780
781 /* The intent behind this definition is that it'll catch
782 * any uses of REJECT which flex missed.
783 */
784 #define REJECT reject_used_but_not_detected
785 #define yymore() yymore_used_but_not_detected
786 #define YY_MORE_ADJ 0
787 #define YY_RESTORE_YY_MORE_OFFSET
788 char *yytext;
789 #line 1 "java.l"
790
791 #line 49 "java.l"
792 /* Definitions */
793
794 #line 794 "java.c"
795
796 #define INITIAL 0
797 #define JAVA 1
798 #define C_COMMENT 2
799 #define CPP_COMMENT 3
800 #define SHELL_COMMENT 4
801 #define STRING 5
802 #define LITERAL 6
803 #define PREPROCESSOR_LINE 7
804
805 #ifndef YY_NO_UNISTD_H
806 /* Special case for "unistd.h", since it is non-ANSI. We include it way
807 * down here because we want the user's section 1 to have been scanned first.
808 * The user has a chance to override it with an option.
809 */
810 #include <unistd.h>
811 #endif
812
813 #ifndef YY_EXTRA_TYPE
814 #define YY_EXTRA_TYPE void *
815 #endif
816
817 static int yy_init_globals ( void );
818
819 /* Accessor methods to globals.
820 These are made visible to non-reentrant scanners for convenience. */
821
822 int yylex_destroy ( void );
823
824 int yyget_debug ( void );
825
826 void yyset_debug ( int debug_flag );
827
828 YY_EXTRA_TYPE yyget_extra ( void );
829
830 void yyset_extra ( YY_EXTRA_TYPE user_defined );
831
832 FILE *yyget_in ( void );
833
834 void yyset_in ( FILE * _in_str );
835
836 FILE *yyget_out ( void );
837
838 void yyset_out ( FILE * _out_str );
839
840 int yyget_leng ( void );
841
842 char *yyget_text ( void );
843
844 int yyget_lineno ( void );
845
846 void yyset_lineno ( int _line_number );
847
848 /* Macros after this point can all be overridden by user definitions in
849 * section 1.
850 */
851
852 #ifndef YY_SKIP_YYWRAP
853 #ifdef __cplusplus
854 extern "C" int yywrap ( void );
855 #else
856 extern int yywrap ( void );
857 #endif
858 #endif
859
860 #ifndef YY_NO_UNPUT
861
862 static void yyunput ( int c, char *buf_ptr );
863
864 #endif
865
866 #ifndef yytext_ptr
867 static void yy_flex_strncpy ( char *, const char *, int );
868 #endif
869
870 #ifdef YY_NEED_STRLEN
871 static int yy_flex_strlen ( const char * );
872 #endif
873
874 #ifndef YY_NO_INPUT
875 #ifdef __cplusplus
876 static int yyinput ( void );
877 #else
878 static int input ( void );
879 #endif
880
881 #endif
882
883 static int yy_start_stack_ptr = 0;
884 static int yy_start_stack_depth = 0;
885 static int *yy_start_stack = NULL;
886
887 static void yy_push_state ( int _new_state );
888
889 static void yy_pop_state ( void );
890
891 /* Amount of stuff to slurp up with each read. */
892 #ifndef YY_READ_BUF_SIZE
893 #ifdef __ia64__
894 /* On IA-64, the buffer size is 16k, not 8k */
895 #define YY_READ_BUF_SIZE 16384
896 #else
897 #define YY_READ_BUF_SIZE 8192
898 #endif /* __ia64__ */
899 #endif
900
901 /* Copy whatever the last rule matched to the standard output. */
902 #ifndef ECHO
903 /* This used to be an fputs(), but since the string might contain NUL's,
904 * we now use fwrite().
905 */
906 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
907 #endif
908
909 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
910 * is returned in "result".
911 */
912 #ifndef YY_INPUT
913 #define YY_INPUT(buf,result,max_size) \
914 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
915 { \
916 int c = '*'; \
917 int n; \
918 for ( n = 0; n < max_size && \
919 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
920 buf[n] = (char) c; \
921 if ( c == '\n' ) \
922 buf[n++] = (char) c; \
923 if ( c == EOF && ferror( yyin ) ) \
924 YY_FATAL_ERROR( "input in flex scanner failed" ); \
925 result = n; \
926 } \
927 else \
928 { \
929 errno=0; \
930 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
931 { \
932 if( errno != EINTR) \
933 { \
934 YY_FATAL_ERROR( "input in flex scanner failed" ); \
935 break; \
936 } \
937 errno=0; \
938 clearerr(yyin); \
939 } \
940 }\
941 \
942
943 #endif
944
945 /* No semi-colon after return; correct usage is to write "yyterminate();" -
946 * we don't want an extra ';' after the "return" because that will cause
947 * some compilers to complain about unreachable statements.
948 */
949 #ifndef yyterminate
950 #define yyterminate() return YY_NULL
951 #endif
952
953 /* Number of entries by which start-condition stack grows. */
954 #ifndef YY_START_STACK_INCR
955 #define YY_START_STACK_INCR 25
956 #endif
957
958 /* Report a fatal error. */
959 #ifndef YY_FATAL_ERROR
960 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
961 #endif
962
963 /* end tables serialization structures and prototypes */
964
965 /* Default declaration of generated scanner - a define so the user can
966 * easily add parameters.
967 */
968 #ifndef YY_DECL
969 #define YY_DECL_IS_OURS 1
970
971 extern int yylex (void);
972
973 #define YY_DECL int yylex (void)
974 #endif /* !YY_DECL */
975
976 /* Code executed at the beginning of each rule, after yytext and yyleng
977 * have been set up.
978 */
979 #ifndef YY_USER_ACTION
980 #define YY_USER_ACTION
981 #endif
982
983 /* Code executed at the end of each rule. */
984 #ifndef YY_BREAK
985 #define YY_BREAK /*LINTED*/break;
986 #endif
987
988 #define YY_RULE_SETUP \
989 if ( yyleng > 0 ) \
990 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
991 (yytext[yyleng - 1] == '\n'); \
992 YY_USER_ACTION
993
994 /** The main scanner function which does all the work.
995 */
996 YY_DECL
997 {
998 yy_state_type yy_current_state;
999 char *yy_cp, *yy_bp;
1000 int yy_act;
1001
1002 if ( !(yy_init) )
1003 {
1004 (yy_init) = 1;
1005
1006 #ifdef YY_USER_INIT
1007 YY_USER_INIT;
1008 #endif
1009
1010 if ( ! (yy_start) )
1011 (yy_start) = 1; /* first start state */
1012
1013 if ( ! yyin )
1014 yyin = stdin;
1015
1016 if ( ! yyout )
1017 yyout = stdout;
1018
1019 if ( ! YY_CURRENT_BUFFER ) {
1020 yyensure_buffer_stack ();
1021 YY_CURRENT_BUFFER_LVALUE =
1022 yy_create_buffer( yyin, YY_BUF_SIZE );
1023 }
1024
1025 yy_load_buffer_state( );
1026 }
1027
1028 {
1029 #line 62 "java.l"
1030
1031 /* Comment */
1032 #line 1032 "java.c"
1033
1034 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1035 {
1036 yy_cp = (yy_c_buf_p);
1037
1038 /* Support of yytext. */
1039 *yy_cp = (yy_hold_char);
1040
1041 /* yy_bp points to the position in yy_ch_buf of the start of
1042 * the current run.
1043 */
1044 yy_bp = yy_cp;
1045
1046 yy_current_state = (yy_start);
1047 yy_current_state += YY_AT_BOL();
1048 yy_match:
1049 do
1050 {
1051 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1052 if ( yy_accept[yy_current_state] )
1053 {
1054 (yy_last_accepting_state) = yy_current_state;
1055 (yy_last_accepting_cpos) = yy_cp;
1056 }
1057 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1058 {
1059 yy_current_state = (int) yy_def[yy_current_state];
1060 if ( yy_current_state >= 60 )
1061 yy_c = yy_meta[yy_c];
1062 }
1063 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1064 ++yy_cp;
1065 }
1066 while ( yy_current_state != 59 );
1067 yy_cp = (yy_last_accepting_cpos);
1068 yy_current_state = (yy_last_accepting_state);
1069
1070 yy_find_action:
1071 yy_act = yy_accept[yy_current_state];
1072
1073 YY_DO_BEFORE_ACTION;
1074
1075 do_action: /* This label is used only to access EOF actions. */
1076
1077 switch ( yy_act )
1078 { /* beginning of action switch */
1079 case 0: /* must back up */
1080 /* undo the effects of YY_DO_BEFORE_ACTION */
1081 *yy_cp = (yy_hold_char);
1082 yy_cp = (yy_last_accepting_cpos);
1083 yy_current_state = (yy_last_accepting_state);
1084 goto yy_find_action;
1085
1086 case 1:
1087 YY_RULE_SETUP
1088 #line 64 "java.l"
1089 { echos(comment_begin); ECHO; yy_push_state(C_COMMENT); }
1090 YY_BREAK
1091 case 2:
1092 YY_RULE_SETUP
1093 #line 65 "java.l"
1094 { ECHO; echos(comment_end); yy_pop_state(); }
1095 YY_BREAK
1096 case 3:
1097 YY_RULE_SETUP
1098 #line 66 "java.l"
1099 { put_char(LEXTEXT[0]); }
1100 YY_BREAK
1101 case 4:
1102 YY_RULE_SETUP
1103 #line 67 "java.l"
1104 { echos(comment_begin); ECHO; yy_push_state(CPP_COMMENT); }
1105 YY_BREAK
1106 /* String */
1107 case 5:
1108 YY_RULE_SETUP
1109 #line 70 "java.l"
1110 { ECHO; yy_push_state(STRING); }
1111 YY_BREAK
1112 case 6:
1113 YY_RULE_SETUP
1114 #line 71 "java.l"
1115 { ECHO; yy_pop_state(); }
1116 YY_BREAK
1117 case 7:
1118 YY_RULE_SETUP
1119 #line 72 "java.l"
1120 { put_char(LEXTEXT[0]); put_char(LEXTEXT[1]); }
1121 YY_BREAK
1122 /* Literal */
1123 case 8:
1124 YY_RULE_SETUP
1125 #line 75 "java.l"
1126 { ECHO; yy_push_state(LITERAL); }
1127 YY_BREAK
1128 case 9:
1129 YY_RULE_SETUP
1130 #line 76 "java.l"
1131 { ECHO; yy_pop_state(); }
1132 YY_BREAK
1133 case 10:
1134 YY_RULE_SETUP
1135 #line 77 "java.l"
1136 { put_char(LEXTEXT[0]); put_char(LEXTEXT[1]); }
1137 YY_BREAK
1138 case 11:
1139 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
1140 (yy_c_buf_p) = yy_cp = yy_bp + 6;
1141 YY_DO_BEFORE_ACTION; /* set up yytext again */
1142 YY_RULE_SETUP
1143 #line 79 "java.l"
1144 {
1145 int c = 0;
1146
1147 put_reserved_word(LEXTEXT);
1148 while ((c = input()) && c != EOF && c != '\n' && c != ';')
1149 echoc(c);
1150 if (c == EOF)
1151 c = '\n';
1152 if (c == '\n')
1153 unput(c);
1154 else if (c)
1155 echoc(c);
1156 }
1157 YY_BREAK
1158 case 12:
1159 YY_RULE_SETUP
1160 #line 93 "java.l"
1161 ECHO;
1162 YY_BREAK
1163 case 13:
1164 YY_RULE_SETUP
1165 #line 94 "java.l"
1166 {
1167 if (java_reserved_word(LEXTEXT, LEXLENG))
1168 put_reserved_word(LEXTEXT);
1169 else {
1170 struct anchor *a = anchor_get(LEXTEXT, LEXLENG, 0, LINENO);
1171 if (a) {
1172 put_anchor(gettag(a), a->type, LINENO);
1173 a->done = 1;
1174 } else if (grtags_is_empty) {
1175 put_anchor_force(LEXTEXT, LEXLENG, LINENO);
1176 } else {
1177 ECHO;
1178 }
1179 }
1180 }
1181 YY_BREAK
1182 case 14:
1183 YY_RULE_SETUP
1184 #line 109 "java.l"
1185 { put_brace(LEXTEXT); }
1186 YY_BREAK
1187 /* New line */
1188 case 15:
1189 /* rule 15 can match eol */
1190 YY_RULE_SETUP
1191 #line 111 "java.l"
1192 DEFAULT_END_OF_LINE_ACTION
1193 YY_BREAK
1194 case 16:
1195 YY_RULE_SETUP
1196 #line 112 "java.l"
1197 { put_char(LEXTEXT[0]); }
1198 YY_BREAK
1199 case 17:
1200 YY_RULE_SETUP
1201 #line 114 "java.l"
1202 ECHO;
1203 YY_BREAK
1204 #line 1204 "java.c"
1205 case YY_STATE_EOF(INITIAL):
1206 case YY_STATE_EOF(JAVA):
1207 case YY_STATE_EOF(C_COMMENT):
1208 case YY_STATE_EOF(CPP_COMMENT):
1209 case YY_STATE_EOF(SHELL_COMMENT):
1210 case YY_STATE_EOF(STRING):
1211 case YY_STATE_EOF(LITERAL):
1212 case YY_STATE_EOF(PREPROCESSOR_LINE):
1213 yyterminate();
1214
1215 case YY_END_OF_BUFFER:
1216 {
1217 /* Amount of text matched not including the EOB char. */
1218 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1219
1220 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1221 *yy_cp = (yy_hold_char);
1222 YY_RESTORE_YY_MORE_OFFSET
1223
1224 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1225 {
1226 /* We're scanning a new file or input source. It's
1227 * possible that this happened because the user
1228 * just pointed yyin at a new source and called
1229 * yylex(). If so, then we have to assure
1230 * consistency between YY_CURRENT_BUFFER and our
1231 * globals. Here is the right place to do so, because
1232 * this is the first action (other than possibly a
1233 * back-up) that will match for the new input source.
1234 */
1235 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1236 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1237 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1238 }
1239
1240 /* Note that here we test for yy_c_buf_p "<=" to the position
1241 * of the first EOB in the buffer, since yy_c_buf_p will
1242 * already have been incremented past the NUL character
1243 * (since all states make transitions on EOB to the
1244 * end-of-buffer state). Contrast this with the test
1245 * in input().
1246 */
1247 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1248 { /* This was really a NUL. */
1249 yy_state_type yy_next_state;
1250
1251 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1252
1253 yy_current_state = yy_get_previous_state( );
1254
1255 /* Okay, we're now positioned to make the NUL
1256 * transition. We couldn't have
1257 * yy_get_previous_state() go ahead and do it
1258 * for us because it doesn't know how to deal
1259 * with the possibility of jamming (and we don't
1260 * want to build jamming into it because then it
1261 * will run more slowly).
1262 */
1263
1264 yy_next_state = yy_try_NUL_trans( yy_current_state );
1265
1266 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1267
1268 if ( yy_next_state )
1269 {
1270 /* Consume the NUL. */
1271 yy_cp = ++(yy_c_buf_p);
1272 yy_current_state = yy_next_state;
1273 goto yy_match;
1274 }
1275
1276 else
1277 {
1278 yy_cp = (yy_last_accepting_cpos);
1279 yy_current_state = (yy_last_accepting_state);
1280 goto yy_find_action;
1281 }
1282 }
1283
1284 else switch ( yy_get_next_buffer( ) )
1285 {
1286 case EOB_ACT_END_OF_FILE:
1287 {
1288 (yy_did_buffer_switch_on_eof) = 0;
1289
1290 if ( yywrap( ) )
1291 {
1292 /* Note: because we've taken care in
1293 * yy_get_next_buffer() to have set up
1294 * yytext, we can now set up
1295 * yy_c_buf_p so that if some total
1296 * hoser (like flex itself) wants to
1297 * call the scanner after we return the
1298 * YY_NULL, it'll still work - another
1299 * YY_NULL will get returned.
1300 */
1301 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1302
1303 yy_act = YY_STATE_EOF(YY_START);
1304 goto do_action;
1305 }
1306
1307 else
1308 {
1309 if ( ! (yy_did_buffer_switch_on_eof) )
1310 YY_NEW_FILE;
1311 }
1312 break;
1313 }
1314
1315 case EOB_ACT_CONTINUE_SCAN:
1316 (yy_c_buf_p) =
1317 (yytext_ptr) + yy_amount_of_matched_text;
1318
1319 yy_current_state = yy_get_previous_state( );
1320
1321 yy_cp = (yy_c_buf_p);
1322 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1323 goto yy_match;
1324
1325 case EOB_ACT_LAST_MATCH:
1326 (yy_c_buf_p) =
1327 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1328
1329 yy_current_state = yy_get_previous_state( );
1330
1331 yy_cp = (yy_c_buf_p);
1332 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1333 goto yy_find_action;
1334 }
1335 break;
1336 }
1337
1338 default:
1339 YY_FATAL_ERROR(
1340 "fatal flex scanner internal error--no action found" );
1341 } /* end of action switch */
1342 } /* end of scanning one token */
1343 } /* end of user's declarations */
1344 } /* end of yylex */
1345
1346 /* yy_get_next_buffer - try to read in a new buffer
1347 *
1348 * Returns a code representing an action:
1349 * EOB_ACT_LAST_MATCH -
1350 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1351 * EOB_ACT_END_OF_FILE - end of file
1352 */
yy_get_next_buffer(void)1353 static int yy_get_next_buffer (void)
1354 {
1355 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1356 char *source = (yytext_ptr);
1357 int number_to_move, i;
1358 int ret_val;
1359
1360 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1361 YY_FATAL_ERROR(
1362 "fatal flex scanner internal error--end of buffer missed" );
1363
1364 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1365 { /* Don't try to fill the buffer, so this is an EOF. */
1366 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1367 {
1368 /* We matched a single character, the EOB, so
1369 * treat this as a final EOF.
1370 */
1371 return EOB_ACT_END_OF_FILE;
1372 }
1373
1374 else
1375 {
1376 /* We matched some text prior to the EOB, first
1377 * process it.
1378 */
1379 return EOB_ACT_LAST_MATCH;
1380 }
1381 }
1382
1383 /* Try to read more data. */
1384
1385 /* First move last chars to start of buffer. */
1386 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1387
1388 for ( i = 0; i < number_to_move; ++i )
1389 *(dest++) = *(source++);
1390
1391 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1392 /* don't do the read, it's not guaranteed to return an EOF,
1393 * just force an EOF
1394 */
1395 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1396
1397 else
1398 {
1399 int num_to_read =
1400 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1401
1402 while ( num_to_read <= 0 )
1403 { /* Not enough room in the buffer - grow it. */
1404
1405 /* just a shorter name for the current buffer */
1406 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1407
1408 int yy_c_buf_p_offset =
1409 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1410
1411 if ( b->yy_is_our_buffer )
1412 {
1413 int new_size = b->yy_buf_size * 2;
1414
1415 if ( new_size <= 0 )
1416 b->yy_buf_size += b->yy_buf_size / 8;
1417 else
1418 b->yy_buf_size *= 2;
1419
1420 b->yy_ch_buf = (char *)
1421 /* Include room in for 2 EOB chars. */
1422 yyrealloc( (void *) b->yy_ch_buf,
1423 (yy_size_t) (b->yy_buf_size + 2) );
1424 }
1425 else
1426 /* Can't grow it, we don't own it. */
1427 b->yy_ch_buf = NULL;
1428
1429 if ( ! b->yy_ch_buf )
1430 YY_FATAL_ERROR(
1431 "fatal error - scanner input buffer overflow" );
1432
1433 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1434
1435 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1436 number_to_move - 1;
1437
1438 }
1439
1440 if ( num_to_read > YY_READ_BUF_SIZE )
1441 num_to_read = YY_READ_BUF_SIZE;
1442
1443 /* Read in more data. */
1444 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1445 (yy_n_chars), num_to_read );
1446
1447 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1448 }
1449
1450 if ( (yy_n_chars) == 0 )
1451 {
1452 if ( number_to_move == YY_MORE_ADJ )
1453 {
1454 ret_val = EOB_ACT_END_OF_FILE;
1455 yyrestart( yyin );
1456 }
1457
1458 else
1459 {
1460 ret_val = EOB_ACT_LAST_MATCH;
1461 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1462 YY_BUFFER_EOF_PENDING;
1463 }
1464 }
1465
1466 else
1467 ret_val = EOB_ACT_CONTINUE_SCAN;
1468
1469 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1470 /* Extend the array by 50%, plus the number we really need. */
1471 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1472 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1473 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1474 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1475 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1476 /* "- 2" to take care of EOB's */
1477 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1478 }
1479
1480 (yy_n_chars) += number_to_move;
1481 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1482 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1483
1484 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1485
1486 return ret_val;
1487 }
1488
1489 /* yy_get_previous_state - get the state just before the EOB char was reached */
1490
yy_get_previous_state(void)1491 static yy_state_type yy_get_previous_state (void)
1492 {
1493 yy_state_type yy_current_state;
1494 char *yy_cp;
1495
1496 yy_current_state = (yy_start);
1497 yy_current_state += YY_AT_BOL();
1498
1499 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1500 {
1501 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1502 if ( yy_accept[yy_current_state] )
1503 {
1504 (yy_last_accepting_state) = yy_current_state;
1505 (yy_last_accepting_cpos) = yy_cp;
1506 }
1507 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1508 {
1509 yy_current_state = (int) yy_def[yy_current_state];
1510 if ( yy_current_state >= 60 )
1511 yy_c = yy_meta[yy_c];
1512 }
1513 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1514 }
1515
1516 return yy_current_state;
1517 }
1518
1519 /* yy_try_NUL_trans - try to make a transition on the NUL character
1520 *
1521 * synopsis
1522 * next_state = yy_try_NUL_trans( current_state );
1523 */
yy_try_NUL_trans(yy_state_type yy_current_state)1524 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1525 {
1526 int yy_is_jam;
1527 char *yy_cp = (yy_c_buf_p);
1528
1529 YY_CHAR yy_c = 1;
1530 if ( yy_accept[yy_current_state] )
1531 {
1532 (yy_last_accepting_state) = yy_current_state;
1533 (yy_last_accepting_cpos) = yy_cp;
1534 }
1535 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1536 {
1537 yy_current_state = (int) yy_def[yy_current_state];
1538 if ( yy_current_state >= 60 )
1539 yy_c = yy_meta[yy_c];
1540 }
1541 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1542 yy_is_jam = (yy_current_state == 59);
1543
1544 return yy_is_jam ? 0 : yy_current_state;
1545 }
1546
1547 #ifndef YY_NO_UNPUT
1548
yyunput(int c,char * yy_bp)1549 static void yyunput (int c, char * yy_bp )
1550 {
1551 char *yy_cp;
1552
1553 yy_cp = (yy_c_buf_p);
1554
1555 /* undo effects of setting up yytext */
1556 *yy_cp = (yy_hold_char);
1557
1558 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1559 { /* need to shift things up to make room */
1560 /* +2 for EOB chars. */
1561 int number_to_move = (yy_n_chars) + 2;
1562 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1563 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1564 char *source =
1565 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1566
1567 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1568 *--dest = *--source;
1569
1570 yy_cp += (int) (dest - source);
1571 yy_bp += (int) (dest - source);
1572 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1573 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1574
1575 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1576 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1577 }
1578
1579 *--yy_cp = (char) c;
1580
1581 (yytext_ptr) = yy_bp;
1582 (yy_hold_char) = *yy_cp;
1583 (yy_c_buf_p) = yy_cp;
1584 }
1585
1586 #endif
1587
1588 #ifndef YY_NO_INPUT
1589 #ifdef __cplusplus
yyinput(void)1590 static int yyinput (void)
1591 #else
1592 static int input (void)
1593 #endif
1594
1595 {
1596 int c;
1597
1598 *(yy_c_buf_p) = (yy_hold_char);
1599
1600 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1601 {
1602 /* yy_c_buf_p now points to the character we want to return.
1603 * If this occurs *before* the EOB characters, then it's a
1604 * valid NUL; if not, then we've hit the end of the buffer.
1605 */
1606 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1607 /* This was really a NUL. */
1608 *(yy_c_buf_p) = '\0';
1609
1610 else
1611 { /* need more input */
1612 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1613 ++(yy_c_buf_p);
1614
1615 switch ( yy_get_next_buffer( ) )
1616 {
1617 case EOB_ACT_LAST_MATCH:
1618 /* This happens because yy_g_n_b()
1619 * sees that we've accumulated a
1620 * token and flags that we need to
1621 * try matching the token before
1622 * proceeding. But for input(),
1623 * there's no matching to consider.
1624 * So convert the EOB_ACT_LAST_MATCH
1625 * to EOB_ACT_END_OF_FILE.
1626 */
1627
1628 /* Reset buffer status. */
1629 yyrestart( yyin );
1630
1631 /*FALLTHROUGH*/
1632
1633 case EOB_ACT_END_OF_FILE:
1634 {
1635 if ( yywrap( ) )
1636 return 0;
1637
1638 if ( ! (yy_did_buffer_switch_on_eof) )
1639 YY_NEW_FILE;
1640 #ifdef __cplusplus
1641 return yyinput();
1642 #else
1643 return input();
1644 #endif
1645 }
1646
1647 case EOB_ACT_CONTINUE_SCAN:
1648 (yy_c_buf_p) = (yytext_ptr) + offset;
1649 break;
1650 }
1651 }
1652 }
1653
1654 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1655 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1656 (yy_hold_char) = *++(yy_c_buf_p);
1657
1658 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1659
1660 return c;
1661 }
1662 #endif /* ifndef YY_NO_INPUT */
1663
1664 /** Immediately switch to a different input stream.
1665 * @param input_file A readable stream.
1666 *
1667 * @note This function does not reset the start condition to @c INITIAL .
1668 */
yyrestart(FILE * input_file)1669 void yyrestart (FILE * input_file )
1670 {
1671
1672 if ( ! YY_CURRENT_BUFFER ){
1673 yyensure_buffer_stack ();
1674 YY_CURRENT_BUFFER_LVALUE =
1675 yy_create_buffer( yyin, YY_BUF_SIZE );
1676 }
1677
1678 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1679 yy_load_buffer_state( );
1680 }
1681
1682 /** Switch to a different input buffer.
1683 * @param new_buffer The new input buffer.
1684 *
1685 */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)1686 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1687 {
1688
1689 /* TODO. We should be able to replace this entire function body
1690 * with
1691 * yypop_buffer_state();
1692 * yypush_buffer_state(new_buffer);
1693 */
1694 yyensure_buffer_stack ();
1695 if ( YY_CURRENT_BUFFER == new_buffer )
1696 return;
1697
1698 if ( YY_CURRENT_BUFFER )
1699 {
1700 /* Flush out information for old buffer. */
1701 *(yy_c_buf_p) = (yy_hold_char);
1702 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1703 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1704 }
1705
1706 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1707 yy_load_buffer_state( );
1708
1709 /* We don't actually know whether we did this switch during
1710 * EOF (yywrap()) processing, but the only time this flag
1711 * is looked at is after yywrap() is called, so it's safe
1712 * to go ahead and always set it.
1713 */
1714 (yy_did_buffer_switch_on_eof) = 1;
1715 }
1716
yy_load_buffer_state(void)1717 static void yy_load_buffer_state (void)
1718 {
1719 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1720 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1721 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1722 (yy_hold_char) = *(yy_c_buf_p);
1723 }
1724
1725 /** Allocate and initialize an input buffer state.
1726 * @param file A readable stream.
1727 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1728 *
1729 * @return the allocated buffer state.
1730 */
yy_create_buffer(FILE * file,int size)1731 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1732 {
1733 YY_BUFFER_STATE b;
1734
1735 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1736 if ( ! b )
1737 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1738
1739 b->yy_buf_size = size;
1740
1741 /* yy_ch_buf has to be 2 characters longer than the size given because
1742 * we need to put in 2 end-of-buffer characters.
1743 */
1744 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1745 if ( ! b->yy_ch_buf )
1746 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1747
1748 b->yy_is_our_buffer = 1;
1749
1750 yy_init_buffer( b, file );
1751
1752 return b;
1753 }
1754
1755 /** Destroy the buffer.
1756 * @param b a buffer created with yy_create_buffer()
1757 *
1758 */
yy_delete_buffer(YY_BUFFER_STATE b)1759 void yy_delete_buffer (YY_BUFFER_STATE b )
1760 {
1761
1762 if ( ! b )
1763 return;
1764
1765 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1766 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1767
1768 if ( b->yy_is_our_buffer )
1769 yyfree( (void *) b->yy_ch_buf );
1770
1771 yyfree( (void *) b );
1772 }
1773
1774 /* Initializes or reinitializes a buffer.
1775 * This function is sometimes called more than once on the same buffer,
1776 * such as during a yyrestart() or at EOF.
1777 */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)1778 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1779
1780 {
1781 int oerrno = errno;
1782
1783 yy_flush_buffer( b );
1784
1785 b->yy_input_file = file;
1786 b->yy_fill_buffer = 1;
1787
1788 /* If b is the current buffer, then yy_init_buffer was _probably_
1789 * called from yyrestart() or through yy_get_next_buffer.
1790 * In that case, we don't want to reset the lineno or column.
1791 */
1792 if (b != YY_CURRENT_BUFFER){
1793 b->yy_bs_lineno = 1;
1794 b->yy_bs_column = 0;
1795 }
1796
1797 b->yy_is_interactive = 0;
1798
1799 errno = oerrno;
1800 }
1801
1802 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1803 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1804 *
1805 */
yy_flush_buffer(YY_BUFFER_STATE b)1806 void yy_flush_buffer (YY_BUFFER_STATE b )
1807 {
1808 if ( ! b )
1809 return;
1810
1811 b->yy_n_chars = 0;
1812
1813 /* We always need two end-of-buffer characters. The first causes
1814 * a transition to the end-of-buffer state. The second causes
1815 * a jam in that state.
1816 */
1817 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1818 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1819
1820 b->yy_buf_pos = &b->yy_ch_buf[0];
1821
1822 b->yy_at_bol = 1;
1823 b->yy_buffer_status = YY_BUFFER_NEW;
1824
1825 if ( b == YY_CURRENT_BUFFER )
1826 yy_load_buffer_state( );
1827 }
1828
1829 /** Pushes the new state onto the stack. The new state becomes
1830 * the current state. This function will allocate the stack
1831 * if necessary.
1832 * @param new_buffer The new state.
1833 *
1834 */
yypush_buffer_state(YY_BUFFER_STATE new_buffer)1835 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1836 {
1837 if (new_buffer == NULL)
1838 return;
1839
1840 yyensure_buffer_stack();
1841
1842 /* This block is copied from yy_switch_to_buffer. */
1843 if ( YY_CURRENT_BUFFER )
1844 {
1845 /* Flush out information for old buffer. */
1846 *(yy_c_buf_p) = (yy_hold_char);
1847 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1848 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1849 }
1850
1851 /* Only push if top exists. Otherwise, replace top. */
1852 if (YY_CURRENT_BUFFER)
1853 (yy_buffer_stack_top)++;
1854 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1855
1856 /* copied from yy_switch_to_buffer. */
1857 yy_load_buffer_state( );
1858 (yy_did_buffer_switch_on_eof) = 1;
1859 }
1860
1861 /** Removes and deletes the top of the stack, if present.
1862 * The next element becomes the new top.
1863 *
1864 */
yypop_buffer_state(void)1865 void yypop_buffer_state (void)
1866 {
1867 if (!YY_CURRENT_BUFFER)
1868 return;
1869
1870 yy_delete_buffer(YY_CURRENT_BUFFER );
1871 YY_CURRENT_BUFFER_LVALUE = NULL;
1872 if ((yy_buffer_stack_top) > 0)
1873 --(yy_buffer_stack_top);
1874
1875 if (YY_CURRENT_BUFFER) {
1876 yy_load_buffer_state( );
1877 (yy_did_buffer_switch_on_eof) = 1;
1878 }
1879 }
1880
1881 /* Allocates the stack if it does not exist.
1882 * Guarantees space for at least one push.
1883 */
yyensure_buffer_stack(void)1884 static void yyensure_buffer_stack (void)
1885 {
1886 yy_size_t num_to_alloc;
1887
1888 if (!(yy_buffer_stack)) {
1889
1890 /* First allocation is just for 2 elements, since we don't know if this
1891 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1892 * immediate realloc on the next call.
1893 */
1894 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1895 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1896 (num_to_alloc * sizeof(struct yy_buffer_state*)
1897 );
1898 if ( ! (yy_buffer_stack) )
1899 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1900
1901 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1902
1903 (yy_buffer_stack_max) = num_to_alloc;
1904 (yy_buffer_stack_top) = 0;
1905 return;
1906 }
1907
1908 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1909
1910 /* Increase the buffer to prepare for a possible push. */
1911 yy_size_t grow_size = 8 /* arbitrary grow size */;
1912
1913 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1914 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1915 ((yy_buffer_stack),
1916 num_to_alloc * sizeof(struct yy_buffer_state*)
1917 );
1918 if ( ! (yy_buffer_stack) )
1919 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1920
1921 /* zero only the new slots.*/
1922 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1923 (yy_buffer_stack_max) = num_to_alloc;
1924 }
1925 }
1926
1927 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1928 * @param base the character buffer
1929 * @param size the size in bytes of the character buffer
1930 *
1931 * @return the newly allocated buffer state object.
1932 */
yy_scan_buffer(char * base,yy_size_t size)1933 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1934 {
1935 YY_BUFFER_STATE b;
1936
1937 if ( size < 2 ||
1938 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1939 base[size-1] != YY_END_OF_BUFFER_CHAR )
1940 /* They forgot to leave room for the EOB's. */
1941 return NULL;
1942
1943 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1944 if ( ! b )
1945 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1946
1947 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1948 b->yy_buf_pos = b->yy_ch_buf = base;
1949 b->yy_is_our_buffer = 0;
1950 b->yy_input_file = NULL;
1951 b->yy_n_chars = b->yy_buf_size;
1952 b->yy_is_interactive = 0;
1953 b->yy_at_bol = 1;
1954 b->yy_fill_buffer = 0;
1955 b->yy_buffer_status = YY_BUFFER_NEW;
1956
1957 yy_switch_to_buffer( b );
1958
1959 return b;
1960 }
1961
1962 /** Setup the input buffer state to scan a string. The next call to yylex() will
1963 * scan from a @e copy of @a str.
1964 * @param yystr a NUL-terminated string to scan
1965 *
1966 * @return the newly allocated buffer state object.
1967 * @note If you want to scan bytes that may contain NUL values, then use
1968 * yy_scan_bytes() instead.
1969 */
yy_scan_string(const char * yystr)1970 YY_BUFFER_STATE yy_scan_string (const char * yystr )
1971 {
1972
1973 return yy_scan_bytes( yystr, (int) strlen(yystr) );
1974 }
1975
1976 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1977 * scan from a @e copy of @a bytes.
1978 * @param yybytes the byte buffer to scan
1979 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1980 *
1981 * @return the newly allocated buffer state object.
1982 */
yy_scan_bytes(const char * yybytes,int _yybytes_len)1983 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1984 {
1985 YY_BUFFER_STATE b;
1986 char *buf;
1987 yy_size_t n;
1988 int i;
1989
1990 /* Get memory for full buffer, including space for trailing EOB's. */
1991 n = (yy_size_t) (_yybytes_len + 2);
1992 buf = (char *) yyalloc( n );
1993 if ( ! buf )
1994 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1995
1996 for ( i = 0; i < _yybytes_len; ++i )
1997 buf[i] = yybytes[i];
1998
1999 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2000
2001 b = yy_scan_buffer( buf, n );
2002 if ( ! b )
2003 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2004
2005 /* It's okay to grow etc. this buffer, and we should throw it
2006 * away when we're done.
2007 */
2008 b->yy_is_our_buffer = 1;
2009
2010 return b;
2011 }
2012
yy_push_state(int _new_state)2013 static void yy_push_state (int _new_state )
2014 {
2015 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
2016 {
2017 yy_size_t new_size;
2018
2019 (yy_start_stack_depth) += YY_START_STACK_INCR;
2020 new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int );
2021
2022 if ( ! (yy_start_stack) )
2023 (yy_start_stack) = (int *) yyalloc( new_size );
2024
2025 else
2026 (yy_start_stack) = (int *) yyrealloc(
2027 (void *) (yy_start_stack), new_size );
2028
2029 if ( ! (yy_start_stack) )
2030 YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2031 }
2032
2033 (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
2034
2035 BEGIN(_new_state);
2036 }
2037
yy_pop_state(void)2038 static void yy_pop_state (void)
2039 {
2040 if ( --(yy_start_stack_ptr) < 0 )
2041 YY_FATAL_ERROR( "start-condition stack underflow" );
2042
2043 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2044 }
2045
2046 #ifndef YY_EXIT_FAILURE
2047 #define YY_EXIT_FAILURE 2
2048 #endif
2049
yy_fatal_error(const char * msg)2050 static void yynoreturn yy_fatal_error (const char* msg )
2051 {
2052 fprintf( stderr, "%s\n", msg );
2053 exit( YY_EXIT_FAILURE );
2054 }
2055
2056 /* Redefine yyless() so it works in section 3 code. */
2057
2058 #undef yyless
2059 #define yyless(n) \
2060 do \
2061 { \
2062 /* Undo effects of setting up yytext. */ \
2063 int yyless_macro_arg = (n); \
2064 YY_LESS_LINENO(yyless_macro_arg);\
2065 yytext[yyleng] = (yy_hold_char); \
2066 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2067 (yy_hold_char) = *(yy_c_buf_p); \
2068 *(yy_c_buf_p) = '\0'; \
2069 yyleng = yyless_macro_arg; \
2070 } \
2071 while ( 0 )
2072
2073 /* Accessor methods (get/set functions) to struct members. */
2074
2075 /** Get the current line number.
2076 *
2077 */
yyget_lineno(void)2078 int yyget_lineno (void)
2079 {
2080
2081 return yylineno;
2082 }
2083
2084 /** Get the input stream.
2085 *
2086 */
yyget_in(void)2087 FILE *yyget_in (void)
2088 {
2089 return yyin;
2090 }
2091
2092 /** Get the output stream.
2093 *
2094 */
yyget_out(void)2095 FILE *yyget_out (void)
2096 {
2097 return yyout;
2098 }
2099
2100 /** Get the length of the current token.
2101 *
2102 */
yyget_leng(void)2103 int yyget_leng (void)
2104 {
2105 return yyleng;
2106 }
2107
2108 /** Get the current token.
2109 *
2110 */
2111
yyget_text(void)2112 char *yyget_text (void)
2113 {
2114 return yytext;
2115 }
2116
2117 /** Set the current line number.
2118 * @param _line_number line number
2119 *
2120 */
yyset_lineno(int _line_number)2121 void yyset_lineno (int _line_number )
2122 {
2123
2124 yylineno = _line_number;
2125 }
2126
2127 /** Set the input stream. This does not discard the current
2128 * input buffer.
2129 * @param _in_str A readable stream.
2130 *
2131 * @see yy_switch_to_buffer
2132 */
yyset_in(FILE * _in_str)2133 void yyset_in (FILE * _in_str )
2134 {
2135 yyin = _in_str ;
2136 }
2137
yyset_out(FILE * _out_str)2138 void yyset_out (FILE * _out_str )
2139 {
2140 yyout = _out_str ;
2141 }
2142
yyget_debug(void)2143 int yyget_debug (void)
2144 {
2145 return yy_flex_debug;
2146 }
2147
yyset_debug(int _bdebug)2148 void yyset_debug (int _bdebug )
2149 {
2150 yy_flex_debug = _bdebug ;
2151 }
2152
yy_init_globals(void)2153 static int yy_init_globals (void)
2154 {
2155 /* Initialization is the same as for the non-reentrant scanner.
2156 * This function is called from yylex_destroy(), so don't allocate here.
2157 */
2158
2159 (yy_buffer_stack) = NULL;
2160 (yy_buffer_stack_top) = 0;
2161 (yy_buffer_stack_max) = 0;
2162 (yy_c_buf_p) = NULL;
2163 (yy_init) = 0;
2164 (yy_start) = 0;
2165
2166 (yy_start_stack_ptr) = 0;
2167 (yy_start_stack_depth) = 0;
2168 (yy_start_stack) = NULL;
2169
2170 /* Defined in main.c */
2171 #ifdef YY_STDINIT
2172 yyin = stdin;
2173 yyout = stdout;
2174 #else
2175 yyin = NULL;
2176 yyout = NULL;
2177 #endif
2178
2179 /* For future reference: Set errno on error, since we are called by
2180 * yylex_init()
2181 */
2182 return 0;
2183 }
2184
2185 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(void)2186 int yylex_destroy (void)
2187 {
2188
2189 /* Pop the buffer stack, destroying each element. */
2190 while(YY_CURRENT_BUFFER){
2191 yy_delete_buffer( YY_CURRENT_BUFFER );
2192 YY_CURRENT_BUFFER_LVALUE = NULL;
2193 yypop_buffer_state();
2194 }
2195
2196 /* Destroy the stack itself. */
2197 yyfree((yy_buffer_stack) );
2198 (yy_buffer_stack) = NULL;
2199
2200 /* Destroy the start condition stack. */
2201 yyfree( (yy_start_stack) );
2202 (yy_start_stack) = NULL;
2203
2204 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2205 * yylex() is called, initialization will occur. */
2206 yy_init_globals( );
2207
2208 return 0;
2209 }
2210
2211 /*
2212 * Internal utility routines.
2213 */
2214
2215 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,const char * s2,int n)2216 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2217 {
2218
2219 int i;
2220 for ( i = 0; i < n; ++i )
2221 s1[i] = s2[i];
2222 }
2223 #endif
2224
2225 #ifdef YY_NEED_STRLEN
yy_flex_strlen(const char * s)2226 static int yy_flex_strlen (const char * s )
2227 {
2228 int n;
2229 for ( n = 0; s[n]; ++n )
2230 ;
2231
2232 return n;
2233 }
2234 #endif
2235
yyalloc(yy_size_t size)2236 void *yyalloc (yy_size_t size )
2237 {
2238 return malloc(size);
2239 }
2240
yyrealloc(void * ptr,yy_size_t size)2241 void *yyrealloc (void * ptr, yy_size_t size )
2242 {
2243
2244 /* The cast to (char *) in the following accommodates both
2245 * implementations that use char* generic pointers, and those
2246 * that use void* generic pointers. It works with the latter
2247 * because both ANSI C and C++ allow castless assignment from
2248 * any pointer type to void*, and deal with argument conversions
2249 * as though doing an assignment.
2250 */
2251 return realloc(ptr, size);
2252 }
2253
yyfree(void * ptr)2254 void yyfree (void * ptr )
2255 {
2256 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2257 }
2258
2259 #define YYTABLES_NAME "yytables"
2260
2261 #line 114 "java.l"
2262
2263 void
java_parser_init(FILE * ip)2264 java_parser_init(FILE *ip)
2265 {
2266 DEFAULT_BEGIN_OF_FILE_ACTION
2267 BEGIN JAVA;
2268 }
2269
2270