Fix file mode.
[llvm-testsuite.git] / MultiSource / Applications / kimwitu++ / kimwl.cc
blob77e94f6ee575298ceb8060021f81a4bc2c3e7f89
3 #define YY_INT_ALIGNED short int
5 /* A lexical scanner generated by flex */
7 #define FLEX_SCANNER
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
10 #define YY_FLEX_SUBMINOR_VERSION 31
11 #if YY_FLEX_SUBMINOR_VERSION > 0
12 #define FLEX_BETA
13 #endif
15 /* First, we deal with platform-specific or compiler-specific issues. */
17 /* begin standard C headers. */
18 #include <stdio.h>
19 #include <string.h>
20 #include <errno.h>
21 #include <stdlib.h>
23 /* end standard C headers. */
25 /* flex integer type definitions */
27 #ifndef FLEXINT_H
28 #define FLEXINT_H
30 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
33 #include <inttypes.h>
34 typedef int8_t flex_int8_t;
35 typedef uint8_t flex_uint8_t;
36 typedef int16_t flex_int16_t;
37 typedef uint16_t flex_uint16_t;
38 typedef int32_t flex_int32_t;
39 typedef uint32_t flex_uint32_t;
40 #else
41 typedef signed char flex_int8_t;
42 typedef short int flex_int16_t;
43 typedef int flex_int32_t;
44 typedef unsigned char flex_uint8_t;
45 typedef unsigned short int flex_uint16_t;
46 typedef unsigned int flex_uint32_t;
47 #endif /* ! C99 */
49 /* Limits of integral types. */
50 #ifndef INT8_MIN
51 #define INT8_MIN (-128)
52 #endif
53 #ifndef INT16_MIN
54 #define INT16_MIN (-32767-1)
55 #endif
56 #ifndef INT32_MIN
57 #define INT32_MIN (-2147483647-1)
58 #endif
59 #ifndef INT8_MAX
60 #define INT8_MAX (127)
61 #endif
62 #ifndef INT16_MAX
63 #define INT16_MAX (32767)
64 #endif
65 #ifndef INT32_MAX
66 #define INT32_MAX (2147483647)
67 #endif
68 #ifndef UINT8_MAX
69 #define UINT8_MAX (255U)
70 #endif
71 #ifndef UINT16_MAX
72 #define UINT16_MAX (65535U)
73 #endif
74 #ifndef UINT32_MAX
75 #define UINT32_MAX (4294967295U)
76 #endif
78 #endif /* ! FLEXINT_H */
80 #ifdef __cplusplus
82 /* The "const" storage-class-modifier is valid. */
83 #define YY_USE_CONST
85 #else /* ! __cplusplus */
87 #if __STDC__
89 #define YY_USE_CONST
91 #endif /* __STDC__ */
92 #endif /* ! __cplusplus */
94 #ifdef YY_USE_CONST
95 #define yyconst const
96 #else
97 #define yyconst
98 #endif
100 /* Returned upon end-of-file. */
101 #define YY_NULL 0
103 /* Promotes a possibly negative, possibly signed char to an unsigned
104 * integer for use as an array index. If the signed char is negative,
105 * we want to instead treat it as an 8-bit unsigned char, hence the
106 * double cast.
108 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
110 /* Enter a start condition. This macro really ought to take a parameter,
111 * but we do it the disgusting crufty way forced on us by the ()-less
112 * definition of BEGIN.
114 #define BEGIN (yy_start) = 1 + 2 *
116 /* Translate the current start state into a value that can be later handed
117 * to BEGIN to return to the state. The YYSTATE alias is for lex
118 * compatibility.
120 #define YY_START (((yy_start) - 1) / 2)
121 #define YYSTATE YY_START
123 /* Action number for EOF rule of a given start state. */
124 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
126 /* Special action meaning "start processing a new file". */
127 #define YY_NEW_FILE yyrestart(yyin )
129 #define YY_END_OF_BUFFER_CHAR 0
131 /* Size of default input buffer. */
132 #ifndef YY_BUF_SIZE
133 #define YY_BUF_SIZE 16384
134 #endif
136 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
137 #define YY_TYPEDEF_YY_BUFFER_STATE
138 typedef struct yy_buffer_state *YY_BUFFER_STATE;
139 #endif
141 extern int yyleng;
143 extern FILE *yyin, *yyout;
145 #define EOB_ACT_CONTINUE_SCAN 0
146 #define EOB_ACT_END_OF_FILE 1
147 #define EOB_ACT_LAST_MATCH 2
149 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
150 * access to the local variable yy_act. Since yyless() is a macro, it would break
151 * existing scanners that call yyless() from OUTSIDE yylex.
152 * One obvious solution it to make yy_act a global. I tried that, and saw
153 * a 5% performance hit in a non-yylineno scanner, because yy_act is
154 * normally declared as a register variable-- so it is not worth it.
156 #define YY_LESS_LINENO(n) \
157 do { \
158 int yyl;\
159 for ( yyl = n; yyl < yyleng; ++yyl )\
160 if ( yytext[yyl] == '\n' )\
161 --yylineno;\
162 }while(0)
164 /* Return all but the first "n" matched characters back to the input stream. */
165 #define yyless(n) \
166 do \
168 /* Undo effects of setting up yytext. */ \
169 int yyless_macro_arg = (n); \
170 YY_LESS_LINENO(yyless_macro_arg);\
171 *yy_cp = (yy_hold_char); \
172 YY_RESTORE_YY_MORE_OFFSET \
173 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
174 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
176 while ( 0 )
178 #define unput(c) yyunput( c, (yytext_ptr) )
180 /* The following is because we cannot portably get our hands on size_t
181 * (without autoconf's help, which isn't available because we want
182 * flex-generated scanners to compile on their own).
185 #ifndef YY_TYPEDEF_YY_SIZE_T
186 #define YY_TYPEDEF_YY_SIZE_T
187 typedef unsigned int yy_size_t;
188 #endif
190 #ifndef YY_STRUCT_YY_BUFFER_STATE
191 #define YY_STRUCT_YY_BUFFER_STATE
192 struct yy_buffer_state
194 FILE *yy_input_file;
196 char *yy_ch_buf; /* input buffer */
197 char *yy_buf_pos; /* current position in input buffer */
199 /* Size of input buffer in bytes, not including room for EOB
200 * characters.
202 yy_size_t yy_buf_size;
204 /* Number of characters read into yy_ch_buf, not including EOB
205 * characters.
207 int yy_n_chars;
209 /* Whether we "own" the buffer - i.e., we know we created it,
210 * and can realloc() it to grow it, and should free() it to
211 * delete it.
213 int yy_is_our_buffer;
215 /* Whether this is an "interactive" input source; if so, and
216 * if we're using stdio for input, then we want to use getc()
217 * instead of fread(), to make sure we stop fetching input after
218 * each newline.
220 int yy_is_interactive;
222 /* Whether we're considered to be at the beginning of a line.
223 * If so, '^' rules will be active on the next match, otherwise
224 * not.
226 int yy_at_bol;
228 int yy_bs_lineno; /**< The line count. */
229 int yy_bs_column; /**< The column count. */
231 /* Whether to try to fill the input buffer when we reach the
232 * end of it.
234 int yy_fill_buffer;
236 int yy_buffer_status;
238 #define YY_BUFFER_NEW 0
239 #define YY_BUFFER_NORMAL 1
240 /* When an EOF's been seen but there's still some text to process
241 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
242 * shouldn't try reading from the input source any more. We might
243 * still have a bunch of tokens to match, though, because of
244 * possible backing-up.
246 * When we actually see the EOF, we change the status to "new"
247 * (via yyrestart()), so that the user can continue scanning by
248 * just pointing yyin at a new input file.
250 #define YY_BUFFER_EOF_PENDING 2
253 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
255 /* Stack of input buffers. */
256 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
257 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
258 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
260 /* We provide macros for accessing buffer states in case in the
261 * future we want to put the buffer states in a more general
262 * "scanner state".
264 * Returns the top of the stack, or NULL.
266 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
267 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
268 : NULL)
270 /* Same as previous macro, but useful when we know that the buffer stack is not
271 * NULL or when we need an lvalue. For internal use only.
273 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
275 /* yy_hold_char holds the character lost when yytext is formed. */
276 static char yy_hold_char;
277 static int yy_n_chars; /* number of characters read into yy_ch_buf */
278 int yyleng;
280 /* Points to current character in buffer. */
281 static char *yy_c_buf_p = (char *) 0;
282 static int yy_init = 1; /* whether we need to initialize */
283 static int yy_start = 0; /* start state number */
285 /* Flag which is used to allow yywrap()'s to do buffer switches
286 * instead of setting up a fresh yyin. A bit of a hack ...
288 static int yy_did_buffer_switch_on_eof;
290 void yyrestart (FILE *input_file );
291 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
292 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
293 void yy_delete_buffer (YY_BUFFER_STATE b );
294 void yy_flush_buffer (YY_BUFFER_STATE b );
295 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
296 void yypop_buffer_state (void );
298 static void yyensure_buffer_stack (void );
299 static void yy_load_buffer_state (void );
300 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
302 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
304 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
305 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
306 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
308 void *yyalloc (yy_size_t );
309 void *yyrealloc (void *,yy_size_t );
310 void yyfree (void * );
312 #define yy_new_buffer yy_create_buffer
314 #define yy_set_interactive(is_interactive) \
316 if ( ! YY_CURRENT_BUFFER ){ \
317 yyensure_buffer_stack (); \
318 YY_CURRENT_BUFFER_LVALUE = \
319 yy_create_buffer(yyin,YY_BUF_SIZE ); \
321 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
324 #define yy_set_bol(at_bol) \
326 if ( ! YY_CURRENT_BUFFER ){\
327 yyensure_buffer_stack (); \
328 YY_CURRENT_BUFFER_LVALUE = \
329 yy_create_buffer(yyin,YY_BUF_SIZE ); \
331 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
334 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
336 /* Begin user sect3 */
338 #define yywrap(n) 1
339 #define YY_SKIP_YYWRAP
341 typedef unsigned char YY_CHAR;
343 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
345 typedef int yy_state_type;
347 #define YY_FLEX_LEX_COMPAT
348 extern int yylineno;
350 int yylineno = 1;
352 extern char yytext[];
354 static yy_state_type yy_get_previous_state (void );
355 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
356 static int yy_get_next_buffer (void );
357 static void yy_fatal_error (yyconst char msg[] );
359 /* Done after the current pattern has been matched and before the
360 * corresponding action - sets up yytext.
362 #define YY_DO_BEFORE_ACTION \
363 (yytext_ptr) = yy_bp; \
364 yyleng = (size_t) (yy_cp - yy_bp); \
365 (yy_hold_char) = *yy_cp; \
366 *yy_cp = '\0'; \
367 if ( yyleng + (yy_more_offset) >= YYLMAX ) \
368 YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \
369 yy_flex_strncpy( &yytext[(yy_more_offset)], (yytext_ptr), yyleng + 1 ); \
370 yyleng += (yy_more_offset); \
371 (yy_prev_more_offset) = (yy_more_offset); \
372 (yy_more_offset) = 0; \
373 (yy_c_buf_p) = yy_cp;
375 #define YY_NUM_RULES 93
376 #define YY_END_OF_BUFFER 94
377 /* This struct is not used in this scanner,
378 but its presence is necessary. */
379 struct yy_trans_info
381 flex_int32_t yy_verify;
382 flex_int32_t yy_nxt;
384 static yyconst flex_int16_t yy_acclist[414] =
385 { 0,
386 42, 42, 82, 82, 94, 81, 93, 93, 1, 81,
387 93, 1, 93, 54, 81, 93, 81, 93, 81, 93,
388 55, 81, 93, 81, 93, 81, 93, 81, 93, 23,
389 81, 93, 81, 93, 45, 81, 93, 45, 81, 93,
390 45, 81, 93, 45, 81, 93, 45, 81, 93, 45,
391 81, 93, 45, 81, 93, 45, 81, 93, 45, 81,
392 93, 45, 81, 93, 45, 81, 93, 45, 81, 93,
393 45, 81, 93, 81, 93, 13, 81, 93, 13, 93,
394 13, 81, 93, 11, 81, 93, 12, 93, 10, 81,
395 93, 46, 81, 93, 51, 93, 50, 81, 93, 58,
397 81, 93, 59, 81, 93, 57, 81, 93, 46, 81,
398 93, 56, 81, 93, 60, 81, 93, 52, 81, 93,
399 61, 81, 93, 62, 81, 93, 63, 81, 93, 52,
400 81, 93, 67, 81, 93, 65, 81, 93, 52, 81,
401 93, 76, 81, 93, 76, 81, 93, 51, 93, 73,
402 81, 93, 77, 81, 93, 75, 81, 93, 70, 81,
403 93, 75, 81, 93, 42, 81, 93, 42, 93, 43,
404 81, 93, 43, 81, 93, 43, 81, 93, 81, 93,
405 43, 81, 93, 43, 81, 93, 43, 81, 93, 43,
406 81, 93, 43, 81, 93, 43, 81, 93, 43, 81,
408 93, 43, 81, 93, 44, 81, 93, 81, 93, 43,
409 81, 93, 44, 81, 93, 44, 81, 93, 43, 81,
410 93, 92, 93, 82, 92, 93, 83, 93, 92, 93,
411 92, 93, 92, 93, 92, 93, 47, 48, 49, 23,
412 20, 17, 19, 41, 45, 45, 45, 45, 45, 45,
413 45, 45, 45, 45, 45, 45, 45, 45, 9, 14,
414 10, 46, 16, 46, 18, 46, 53, 62, 64, 67,
415 66, 76, 76, 68, 73, 71, 72, 16, 18, 75,
416 69, 75, 42, 43, 43, 43, 43, 44, 44, 44,
417 82, 40, 45, 45, 45, 45, 45, 45, 45, 45,
419 45, 45, 45, 45, 45, 9, 14, 15, 75, 44,
420 43, 44, 26, 45, 45, 45, 45, 24, 45, 45,
421 45, 45, 45, 45, 45, 45, 45, 75, 44, 30,
422 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
423 45, 38, 39, 35, 36, 75, 44, 43, 45, 28,
424 45, 45, 45, 45, 25, 45, 45, 45, 45, 45,
425 4, 2, 75, 43, 44, 22, 45, 45, 45, 45,
426 29, 45, 45, 33, 45, 45, 37, 8, 75, 84,
427 34, 45, 21, 45, 27, 45, 32, 45, 31, 45,
428 75, 43, 85, 5, 3, 7, 78, 75, 75, 87,
430 86, 75, 88, 75,16458, 91, 6,16458, 80, 8266,
431 89, 90, 79
434 static yyconst flex_int16_t yy_accept[439] =
435 { 0,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 2, 3, 4,
438 5, 6, 8, 9, 12, 14, 17, 19, 21, 24,
439 26, 28, 30, 33, 35, 38, 41, 44, 47, 50,
440 53, 56, 59, 62, 65, 68, 71, 74, 76, 79,
441 81, 84, 87, 89, 92, 95, 97, 100, 103, 106,
442 109, 112, 115, 118, 121, 124, 127, 130, 133, 136,
443 139, 142, 145, 148, 150, 153, 156, 159, 162, 165,
444 168, 170, 173, 176, 179, 181, 184, 187, 190, 193,
445 196, 199, 202, 205, 208, 210, 213, 216, 219, 222,
447 224, 227, 229, 231, 233, 235, 237, 238, 239, 240,
448 240, 240, 241, 242, 242, 243, 244, 245, 246, 247,
449 248, 249, 250, 251, 252, 253, 254, 255, 256, 257,
450 258, 259, 259, 259, 259, 259, 259, 259, 259, 259,
451 259, 259, 260, 261, 261, 262, 263, 265, 267, 268,
452 269, 270, 271, 272, 273, 274, 274, 274, 275, 276,
453 277, 278, 279, 280, 281, 282, 283, 284, 285, 286,
454 287, 288, 289, 290, 291, 292, 292, 292, 292, 292,
455 292, 292, 293, 294, 295, 296, 297, 298, 299, 300,
456 301, 302, 303, 304, 305, 306, 306, 306, 306, 306,
458 306, 306, 306, 306, 306, 306, 307, 308, 308, 309,
459 309, 309, 309, 309, 309, 310, 311, 313, 313, 313,
460 313, 313, 313, 313, 315, 316, 317, 318, 320, 321,
461 322, 323, 324, 325, 326, 327, 328, 328, 328, 328,
462 328, 328, 328, 328, 328, 328, 328, 328, 328, 328,
463 328, 329, 330, 330, 330, 330, 330, 330, 330, 330,
464 330, 330, 330, 330, 332, 333, 334, 335, 336, 337,
465 338, 339, 340, 341, 342, 343, 344, 345, 346, 346,
466 346, 346, 346, 346, 346, 346, 346, 346, 346, 347,
467 348, 349, 349, 349, 349, 349, 349, 349, 349, 349,
469 349, 349, 350, 352, 353, 354, 355, 357, 358, 359,
470 360, 361, 361, 361, 361, 362, 362, 363, 363, 363,
471 363, 363, 364, 366, 366, 366, 366, 366, 366, 366,
472 366, 366, 366, 366, 368, 369, 370, 371, 373, 374,
473 376, 377, 377, 378, 379, 379, 379, 379, 379, 379,
474 380, 380, 380, 380, 380, 380, 380, 380, 380, 381,
475 381, 381, 383, 385, 387, 389, 391, 391, 391, 391,
476 391, 391, 391, 391, 392, 393, 394, 394, 394, 394,
477 394, 394, 394, 395, 396, 397, 397, 397, 398, 398,
478 398, 399, 399, 399, 399, 399, 399, 399, 399, 399,
480 399, 399, 400, 400, 400, 401, 402, 402, 402, 402,
481 402, 402, 402, 402, 403, 403, 404, 404, 404, 404,
482 404, 404, 404, 404, 406, 406, 406, 407, 408, 409,
483 409, 409, 410, 411, 412, 413, 414, 414
486 static yyconst flex_int32_t yy_ec[256] =
487 { 0,
488 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
489 4, 4, 1, 1, 1, 1, 1, 1, 1, 1,
490 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
491 1, 2, 5, 6, 1, 7, 8, 9, 10, 11,
492 12, 13, 14, 15, 16, 17, 18, 19, 19, 19,
493 19, 19, 19, 19, 19, 19, 19, 20, 21, 22,
494 23, 24, 1, 1, 25, 26, 27, 28, 29, 26,
495 26, 30, 26, 26, 26, 26, 31, 32, 33, 34,
496 26, 35, 36, 37, 38, 26, 26, 26, 39, 26,
497 40, 41, 42, 43, 44, 1, 45, 46, 47, 48,
499 49, 50, 51, 52, 53, 26, 54, 55, 56, 57,
500 58, 59, 26, 60, 61, 62, 63, 64, 65, 66,
501 67, 26, 68, 69, 70, 71, 1, 1, 1, 1,
502 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
503 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
504 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
505 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
507 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
508 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
510 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
511 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
512 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
513 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
514 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
515 1, 1, 1, 1, 1
518 static yyconst flex_int32_t yy_meta[72] =
519 { 0,
520 1, 1, 2, 1, 1, 3, 4, 1, 1, 5,
521 6, 6, 1, 1, 6, 1, 1, 7, 8, 1,
522 6, 1, 1, 1, 9, 9, 9, 9, 9, 9,
523 9, 9, 9, 9, 9, 9, 9, 9, 9, 6,
524 2, 6, 1, 9, 9, 9, 9, 9, 9, 9,
525 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
526 9, 9, 9, 9, 9, 9, 9, 7, 1, 7,
530 static yyconst flex_int16_t yy_base[453] =
531 { 0,
532 846, 845, 0, 839, 843, 69, 77, 0, 146, 186,
533 159, 165, 167, 169, 228, 0, 299, 0, 148, 157,
534 845, 850, 850, 850, 850, 850, 155, 13, 850, 154,
535 827, 162, 824, 822, 0, 778, 782, 790, 772, 784,
536 777, 775, 785, 771, 765, 774, 123, 326, 850, 850,
537 114, 850, 850, 0, 0, 850, 811, 850, 850, 850,
538 172, 850, 850, 788, 850, 0, 850, 369, 0, 850,
539 153, 0, 374, 388, 376, 198, 0, 787, 777, 217,
540 394, 803, 802, 146, 812, 800, 189, 850, 377, 799,
541 52, 798, 356, 0, 778, 796, 769, 768, 362, 850,
543 814, 850, 757, 758, 764, 745, 792, 850, 850, 746,
544 745, 789, 850, 790, 850, 850, 850, 0, 744, 748,
545 754, 741, 741, 752, 742, 748, 753, 738, 735, 735,
546 739, 731, 747, 729, 728, 744, 739, 728, 722, 723,
547 720, 781, 780, 400, 0, 0, 0, 0, 850, 0,
548 850, 0, 850, 0, 402, 405, 731, 850, 761, 850,
549 850, 386, 850, 0, 850, 717, 409, 850, 765, 754,
550 753, 0, 720, 709, 771, 756, 726, 725, 708, 715,
551 714, 850, 708, 704, 719, 714, 700, 701, 696, 706,
552 696, 708, 703, 693, 709, 691, 691, 693, 692, 692,
554 692, 685, 693, 687, 691, 741, 740, 414, 850, 679,
555 419, 709, 706, 700, 688, 687, 695, 376, 674, 679,
556 670, 682, 681, 0, 667, 665, 667, 0, 681, 672,
557 663, 670, 674, 670, 657, 657, 658, 668, 656, 655,
558 663, 667, 659, 662, 650, 660, 659, 673, 669, 671,
559 644, 641, 660, 640, 655, 639, 649, 640, 634, 679,
560 627, 628, 627, 0, 636, 633, 627, 640, 625, 639,
561 636, 627, 638, 629, 850, 850, 850, 850, 618, 631,
562 621, 613, 632, 611, 615, 637, 638, 638, 621, 621,
563 850, 618, 607, 614, 601, 606, 648, 604, 603, 597,
565 596, 597, 0, 600, 608, 607, 0, 605, 605, 598,
566 597, 606, 590, 592, 584, 596, 582, 595, 605, 614,
567 607, 583, 600, 586, 586, 580, 576, 590, 575, 575,
568 583, 586, 573, 0, 556, 567, 554, 0, 565, 0,
569 558, 553, 850, 850, 547, 537, 189, 565, 560, 528,
570 545, 528, 460, 459, 467, 459, 460, 464, 850, 456,
571 455, 0, 0, 0, 0, 0, 465, 466, 452, 412,
572 493, 483, 473, 459, 850, 850, 462, 458, 443, 443,
573 450, 445, 850, 850, 850, 446, 451, 850, 469, 458,
574 448, 446, 433, 441, 440, 431, 425, 441, 440, 455,
576 164, 436, 427, 419, 850, 850, 418, 425, 393, 406,
577 424, 418, 430, 393, 393, 850, 385, 366, 363, 347,
578 425, 427, 199, 455, 138, 135, 850, 850, 0, 428,
579 136, 850, 850, 850, 850, 850, 850, 526, 535, 544,
580 553, 562, 571, 573, 575, 584, 593, 602, 611, 612,
581 614, 623
584 static yyconst flex_int16_t yy_def[453] =
585 { 0,
586 438, 438, 437, 3, 439, 439, 437, 7, 440, 440,
587 441, 441, 442, 442, 437, 15, 437, 17, 443, 443,
588 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
589 437, 437, 437, 437, 444, 444, 444, 444, 444, 444,
590 444, 444, 444, 444, 444, 444, 444, 437, 437, 437,
591 437, 437, 437, 445, 446, 437, 437, 437, 437, 437,
592 446, 437, 437, 437, 437, 447, 437, 437, 448, 437,
593 437, 449, 449, 437, 437, 437, 450, 437, 450, 437,
594 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
595 437, 437, 437, 451, 437, 437, 451, 451, 437, 437,
597 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
598 437, 437, 437, 437, 437, 437, 437, 444, 444, 444,
599 444, 444, 444, 444, 444, 444, 444, 444, 444, 444,
600 444, 437, 437, 437, 437, 437, 437, 437, 437, 437,
601 437, 437, 437, 437, 445, 446, 446, 446, 437, 447,
602 437, 448, 437, 449, 449, 437, 437, 437, 437, 437,
603 437, 437, 437, 450, 437, 450, 437, 437, 437, 437,
604 437, 451, 451, 451, 437, 437, 437, 437, 437, 437,
605 437, 437, 444, 444, 444, 444, 444, 444, 444, 444,
606 444, 444, 444, 444, 444, 437, 437, 437, 437, 437,
608 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
609 437, 437, 437, 437, 450, 451, 451, 437, 437, 437,
610 437, 437, 437, 444, 444, 444, 444, 444, 444, 444,
611 444, 444, 444, 444, 444, 444, 437, 437, 437, 437,
612 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
613 450, 451, 437, 437, 437, 437, 437, 437, 437, 437,
614 437, 437, 437, 444, 444, 444, 444, 444, 444, 444,
615 444, 444, 444, 444, 437, 437, 437, 437, 437, 437,
616 437, 437, 437, 437, 437, 437, 437, 437, 450, 451,
617 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
619 437, 444, 444, 444, 444, 444, 444, 444, 444, 444,
620 444, 437, 437, 437, 437, 437, 437, 437, 437, 437,
621 437, 450, 451, 437, 437, 437, 437, 437, 437, 437,
622 437, 437, 437, 444, 444, 444, 444, 444, 444, 444,
623 444, 437, 437, 437, 437, 437, 437, 437, 437, 450,
624 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
625 437, 444, 444, 444, 444, 444, 437, 437, 437, 437,
626 437, 437, 437, 450, 437, 437, 437, 437, 437, 437,
627 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
628 450, 437, 437, 437, 437, 437, 437, 437, 437, 437,
630 437, 450, 437, 437, 437, 437, 437, 437, 437, 437,
631 437, 437, 437, 450, 437, 437, 437, 437, 437, 437,
632 437, 437, 437, 450, 437, 437, 437, 437, 452, 437,
633 437, 437, 437, 437, 437, 437, 0, 437, 437, 437,
634 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
635 437, 437
638 static yyconst flex_int16_t yy_nxt[922] =
639 { 0,
640 22, 24, 25, 24, 22, 26, 27, 28, 22, 29,
641 22, 22, 22, 22, 22, 30, 31, 32, 33, 34,
642 22, 22, 22, 22, 35, 35, 35, 35, 35, 35,
643 35, 35, 35, 35, 35, 35, 35, 35, 35, 22,
644 22, 22, 22, 35, 36, 35, 37, 38, 39, 35,
645 35, 35, 35, 35, 40, 35, 35, 41, 42, 43,
646 44, 45, 46, 47, 35, 35, 35, 22, 22, 22,
647 22, 50, 110, 170, 168, 111, 51, 22, 52, 53,
648 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
649 22, 22, 22, 22, 32, 22, 22, 22, 22, 22,
651 22, 54, 54, 54, 54, 54, 54, 54, 54, 54,
652 54, 54, 54, 54, 54, 54, 22, 22, 22, 22,
653 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
654 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
655 54, 54, 54, 54, 22, 22, 22, 22, 56, 101,
656 102, 26, 57, 436, 168, 29, 58, 59, 101, 102,
657 60, 56, 153, 61, 67, 412, 62, 56, 168, 56,
658 67, 56, 112, 107, 115, 130, 70, 113, 70, 116,
659 131, 143, 413, 144, 147, 63, 64, 65, 56, 148,
660 370, 26, 57, 149, 435, 29, 58, 59, 434, 68,
662 60, 371, 168, 61, 103, 68, 62, 71, 104, 71,
663 162, 168, 105, 103, 106, 163, 432, 104, 167, 167,
664 167, 105, 108, 106, 109, 63, 64, 65, 72, 73,
665 74, 73, 72, 26, 75, 72, 72, 29, 72, 72,
666 72, 72, 72, 72, 72, 76, 72, 72, 72, 72,
667 72, 72, 77, 77, 77, 77, 77, 77, 77, 77,
668 77, 77, 77, 77, 77, 77, 77, 72, 78, 72,
669 72, 77, 79, 77, 77, 77, 77, 77, 77, 77,
670 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
671 77, 77, 77, 77, 77, 22, 72, 22, 72, 22,
673 80, 81, 80, 82, 22, 22, 83, 84, 22, 85,
674 22, 86, 87, 88, 89, 22, 90, 22, 22, 22,
675 91, 92, 93, 94, 94, 94, 94, 94, 94, 94,
676 94, 94, 94, 94, 94, 94, 94, 94, 95, 22,
677 22, 96, 94, 94, 94, 94, 97, 94, 94, 94,
678 94, 94, 94, 94, 94, 98, 94, 94, 94, 94,
679 94, 94, 94, 94, 94, 94, 22, 99, 22, 88,
680 132, 133, 134, 135, 151, 155, 156, 155, 168, 171,
681 136, 137, 158, 138, 168, 139, 140, 211, 141, 156,
682 156, 156, 168, 142, 159, 167, 167, 167, 429, 168,
684 169, 208, 209, 155, 156, 155, 156, 156, 156, 149,
685 167, 167, 167, 370, 212, 208, 209, 213, 157, 412,
686 211, 214, 254, 428, 371, 427, 430, 255, 422, 430,
687 168, 422, 157, 426, 256, 257, 413, 431, 258, 423,
688 431, 425, 423, 160, 424, 161, 157, 212, 413, 157,
689 213, 421, 420, 419, 214, 433, 433, 433, 433, 433,
690 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
691 433, 433, 433, 418, 433, 433, 433, 433, 433, 417,
692 416, 415, 414, 411, 410, 409, 408, 407, 406, 405,
693 404, 403, 402, 401, 433, 433, 433, 433, 400, 399,
695 398, 397, 396, 395, 394, 393, 392, 391, 390, 389,
696 388, 387, 386, 385, 384, 383, 382, 381, 380, 379,
697 378, 377, 433, 433, 433, 433, 22, 22, 22, 22,
698 22, 22, 22, 22, 22, 49, 49, 49, 49, 49,
699 49, 49, 49, 49, 55, 55, 55, 55, 55, 55,
700 55, 55, 55, 66, 66, 66, 66, 66, 66, 66,
701 66, 66, 69, 69, 69, 69, 69, 69, 69, 69,
702 69, 100, 100, 100, 100, 100, 100, 100, 100, 100,
703 118, 118, 145, 145, 146, 376, 375, 374, 373, 372,
704 146, 146, 146, 150, 369, 368, 150, 150, 150, 150,
706 150, 150, 152, 367, 152, 152, 366, 152, 152, 152,
707 152, 154, 365, 364, 363, 362, 154, 361, 154, 164,
708 164, 172, 172, 433, 433, 433, 433, 433, 433, 433,
709 360, 359, 358, 357, 356, 355, 354, 353, 352, 351,
710 350, 349, 348, 347, 346, 333, 345, 332, 344, 343,
711 342, 341, 340, 339, 338, 337, 336, 335, 334, 333,
712 332, 331, 330, 329, 328, 327, 326, 325, 324, 323,
713 322, 321, 320, 319, 318, 317, 316, 315, 314, 313,
714 312, 311, 310, 309, 308, 307, 306, 305, 304, 303,
715 302, 301, 300, 299, 298, 297, 296, 295, 294, 293,
717 292, 291, 290, 289, 288, 287, 286, 285, 284, 283,
718 282, 281, 280, 279, 278, 277, 276, 275, 274, 273,
719 272, 271, 270, 269, 268, 267, 266, 265, 264, 263,
720 262, 261, 260, 259, 253, 252, 251, 250, 249, 248,
721 247, 207, 206, 246, 245, 244, 243, 242, 241, 240,
722 239, 238, 237, 236, 235, 234, 233, 232, 231, 230,
723 229, 228, 227, 226, 225, 224, 223, 222, 221, 220,
724 219, 218, 175, 217, 216, 168, 168, 168, 215, 159,
725 210, 207, 206, 205, 204, 203, 202, 201, 200, 199,
726 198, 197, 196, 195, 194, 193, 192, 191, 190, 189,
728 188, 187, 186, 185, 184, 183, 182, 112, 181, 180,
729 107, 179, 178, 177, 176, 175, 174, 173, 168, 168,
730 168, 168, 168, 168, 168, 168, 166, 165, 149, 107,
731 129, 128, 127, 126, 125, 124, 123, 122, 121, 120,
732 119, 117, 112, 114, 437, 50, 48, 23, 23, 21,
733 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
734 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
735 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
736 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
737 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
739 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
740 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
744 static yyconst flex_int16_t yy_chk[922] =
745 { 0,
746 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
747 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
748 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
749 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
750 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
751 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
752 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
753 3, 6, 28, 91, 91, 28, 6, 7, 7, 7,
754 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
755 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
757 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
758 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
759 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
760 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
761 7, 7, 7, 7, 7, 7, 7, 7, 9, 19,
762 19, 9, 9, 431, 84, 9, 9, 9, 20, 20,
763 9, 11, 71, 9, 11, 401, 9, 12, 84, 13,
764 12, 14, 30, 27, 32, 47, 13, 30, 14, 32,
765 47, 51, 401, 51, 61, 9, 9, 9, 10, 61,
766 347, 10, 10, 71, 426, 10, 10, 10, 425, 11,
768 10, 347, 87, 10, 19, 12, 10, 13, 19, 14,
769 76, 87, 19, 20, 19, 76, 423, 20, 80, 80,
770 80, 20, 27, 20, 27, 10, 10, 10, 15, 15,
771 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
772 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
773 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
774 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
775 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
776 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
777 15, 15, 15, 15, 15, 15, 15, 15, 15, 17,
779 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
780 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
781 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
782 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
783 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
784 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
785 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
786 48, 48, 48, 48, 68, 73, 73, 73, 93, 93,
787 48, 48, 75, 48, 99, 48, 48, 162, 48, 74,
788 74, 74, 89, 48, 75, 81, 81, 81, 420, 89,
790 89, 144, 144, 155, 155, 155, 156, 156, 156, 68,
791 167, 167, 167, 370, 162, 208, 208, 162, 73, 412,
792 211, 162, 218, 419, 370, 418, 421, 218, 422, 430,
793 99, 413, 74, 417, 218, 218, 412, 421, 218, 422,
794 430, 415, 413, 75, 414, 75, 155, 211, 413, 156,
795 211, 411, 410, 409, 211, 424, 424, 424, 424, 424,
796 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
797 424, 424, 424, 408, 424, 424, 424, 424, 424, 407,
798 404, 403, 402, 400, 399, 398, 397, 396, 395, 394,
799 393, 392, 391, 390, 424, 424, 424, 424, 389, 387,
801 386, 382, 381, 380, 379, 378, 377, 374, 373, 372,
802 371, 369, 368, 367, 361, 360, 358, 357, 356, 355,
803 354, 353, 424, 424, 424, 424, 438, 438, 438, 438,
804 438, 438, 438, 438, 438, 439, 439, 439, 439, 439,
805 439, 439, 439, 439, 440, 440, 440, 440, 440, 440,
806 440, 440, 440, 441, 441, 441, 441, 441, 441, 441,
807 441, 441, 442, 442, 442, 442, 442, 442, 442, 442,
808 442, 443, 443, 443, 443, 443, 443, 443, 443, 443,
809 444, 444, 445, 445, 446, 352, 351, 350, 349, 348,
810 446, 446, 446, 447, 346, 345, 447, 447, 447, 447,
812 447, 447, 448, 342, 448, 448, 341, 448, 448, 448,
813 448, 449, 339, 337, 336, 335, 449, 333, 449, 450,
814 450, 451, 451, 452, 452, 452, 452, 452, 452, 452,
815 332, 331, 330, 329, 328, 327, 326, 325, 324, 323,
816 322, 321, 320, 319, 318, 317, 316, 315, 314, 313,
817 312, 311, 310, 309, 308, 306, 305, 304, 302, 301,
818 300, 299, 298, 297, 296, 295, 294, 293, 292, 290,
819 289, 288, 287, 286, 285, 284, 283, 282, 281, 280,
820 279, 274, 273, 272, 271, 270, 269, 268, 267, 266,
821 265, 263, 262, 261, 260, 259, 258, 257, 256, 255,
823 254, 253, 252, 251, 250, 249, 248, 247, 246, 245,
824 244, 243, 242, 241, 240, 239, 238, 237, 236, 235,
825 234, 233, 232, 231, 230, 229, 227, 226, 225, 223,
826 222, 221, 220, 219, 217, 216, 215, 214, 213, 212,
827 210, 207, 206, 205, 204, 203, 202, 201, 200, 199,
828 198, 197, 196, 195, 194, 193, 192, 191, 190, 189,
829 188, 187, 186, 185, 184, 183, 181, 180, 179, 178,
830 177, 176, 175, 174, 173, 171, 170, 169, 166, 159,
831 157, 143, 142, 141, 140, 139, 138, 137, 136, 135,
832 134, 133, 132, 131, 130, 129, 128, 127, 126, 125,
834 124, 123, 122, 121, 120, 119, 114, 112, 111, 110,
835 107, 106, 105, 104, 103, 101, 98, 97, 96, 95,
836 92, 90, 86, 85, 83, 82, 79, 78, 64, 57,
837 46, 45, 44, 43, 42, 41, 40, 39, 38, 37,
838 36, 34, 33, 31, 21, 5, 4, 2, 1, 437,
839 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
840 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
841 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
842 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
843 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
845 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
846 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
850 /* Table of booleans, true if rule could match eol. */
851 static yyconst flex_int32_t yy_rule_can_match_eol[94] =
852 { 0,
853 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0,
854 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
855 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
856 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
857 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
859 extern int yy_flex_debug;
860 int yy_flex_debug = 0;
862 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
863 static char *yy_full_match;
864 static int yy_lp;
865 static int yy_looking_for_trail_begin = 0;
866 static int yy_full_lp;
867 static int *yy_full_state;
868 #define YY_TRAILING_MASK 0x2000
869 #define YY_TRAILING_HEAD_MASK 0x4000
870 #define REJECT \
872 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
873 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
874 (yy_lp) = yy_full_lp; /* restore orig. accepting pos. */ \
875 (yy_state_ptr) = yy_full_state; /* restore orig. state */ \
876 yy_current_state = *(yy_state_ptr); /* restore curr. state */ \
877 ++(yy_lp); \
878 goto find_rule; \
881 static int yy_more_offset = 0;
882 static int yy_prev_more_offset = 0;
883 #define yymore() ((yy_more_offset) = yy_flex_strlen( yytext ))
884 #define YY_NEED_STRLEN
885 #define YY_MORE_ADJ 0
886 #define YY_RESTORE_YY_MORE_OFFSET \
888 (yy_more_offset) = (yy_prev_more_offset); \
889 yyleng -= (yy_more_offset); \
891 #ifndef YYLMAX
892 #define YYLMAX 8192
893 #endif
895 char yytext[YYLMAX];
896 char *yytext_ptr;
898 // The Termprocessor Kimwitu++
900 // Copyright (C) 1991 University of Twente, Dept TIOS.
901 // Copyright (C) 1997-2003 Humboldt-University at Berlin, Institute of Informatics
902 // All rights reserved.
904 // Kimwitu++ is free software; you can redistribute it and/or modify
905 // it under the terms of the GNU General Public License as published by
906 // the Free Software Foundation; either version 2 of the License, or
907 // (at your option) any later version.
909 // Kimwitu++ is distributed in the hope that it will be useful,
910 // but WITHOUT ANY WARRANTY; without even the implied warranty of
911 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
912 // GNU General Public License for more details.
914 // You should have received a copy of the GNU General Public License
915 // along with Kimwitu++; if not, write to the Free Software
916 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
919 * kimwl.l
921 static char kimwl_lAccesSid[] = "@(#)$Id$";
923 /* For windows (NT at least) we need to redefine fileno */
924 #if defined(_WIN32) && ! defined (__GNUC__)
925 # define fileno _fileno
926 #endif
929 /***************************************************************************/
931 * Name conventions: tokens and states are in CAPITALS
932 * operators are capitalized
937 #include <cstdlib>
938 #include <string>
940 #include "k.h"
941 #include "yystype.h"
942 #include "kimwy.h"
944 namespace {
945 std::string cinclude("");
946 int cinit_paren_nesting =0;
947 int cinit_array_nesting =0;
948 void reset_nestcount();
950 int eat_comment(casestring);
951 void eat_line_comment();
952 void count(bool = true);
953 } // namespace
955 #define INITIAL 0
956 #define NORMAL 1
957 #define INCL 2
958 #define INCLSTART 3
959 #define CEXPR 4
960 #define CEXPRDQ 5
961 #define CEXPRSQ 6
962 #define C 7
963 #define OPNAME 8
964 #define OPTION 9
966 #ifndef YY_NO_UNISTD_H
967 /* Special case for "unistd.h", since it is non-ANSI. We include it way
968 * down here because we want the user's section 1 to have been scanned first.
969 * The user has a chance to override it with an option.
971 #include <unistd.h>
972 #endif
974 #ifndef YY_EXTRA_TYPE
975 #define YY_EXTRA_TYPE void *
976 #endif
978 /* Macros after this point can all be overridden by user definitions in
979 * section 1.
982 #ifndef YY_SKIP_YYWRAP
983 #ifdef __cplusplus
984 extern "C" int yywrap (void );
985 #else
986 extern int yywrap (void );
987 #endif
988 #endif
990 static void yyunput (int c,char *buf_ptr );
992 #ifndef yytext_ptr
993 static void yy_flex_strncpy (char *,yyconst char *,int );
994 #endif
996 #ifdef YY_NEED_STRLEN
997 static int yy_flex_strlen (yyconst char * );
998 #endif
1000 #ifndef YY_NO_INPUT
1002 #ifdef __cplusplus
1003 static int yyinput (void );
1004 #else
1005 static int input (void );
1006 #endif
1008 #endif
1010 /* Amount of stuff to slurp up with each read. */
1011 #ifndef YY_READ_BUF_SIZE
1012 #define YY_READ_BUF_SIZE 8192
1013 #endif
1015 /* Copy whatever the last rule matched to the standard output. */
1016 #ifndef ECHO
1017 /* This used to be an fputs(), but since the string might contain NUL's,
1018 * we now use fwrite().
1020 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1021 #endif
1023 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1024 * is returned in "result".
1026 #ifndef YY_INPUT
1027 #define YY_INPUT(buf,result,max_size) \
1028 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1030 int c = '*'; \
1031 size_t n; \
1032 for ( n = 0; n < max_size && \
1033 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1034 buf[n] = (char) c; \
1035 if ( c == '\n' ) \
1036 buf[n++] = (char) c; \
1037 if ( c == EOF && ferror( yyin ) ) \
1038 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1039 result = n; \
1041 else \
1043 errno=0; \
1044 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1046 if( errno != EINTR) \
1048 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1049 break; \
1051 errno=0; \
1052 clearerr(yyin); \
1057 #endif
1059 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1060 * we don't want an extra ';' after the "return" because that will cause
1061 * some compilers to complain about unreachable statements.
1063 #ifndef yyterminate
1064 #define yyterminate() return YY_NULL
1065 #endif
1067 /* Number of entries by which start-condition stack grows. */
1068 #ifndef YY_START_STACK_INCR
1069 #define YY_START_STACK_INCR 25
1070 #endif
1072 /* Report a fatal error. */
1073 #ifndef YY_FATAL_ERROR
1074 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1075 #endif
1077 /* end tables serialization structures and prototypes */
1079 /* Default declaration of generated scanner - a define so the user can
1080 * easily add parameters.
1082 #ifndef YY_DECL
1083 #define YY_DECL_IS_OURS 1
1085 extern int yylex (void);
1087 #define YY_DECL int yylex (void)
1088 #endif /* !YY_DECL */
1090 /* Code executed at the beginning of each rule, after yytext and yyleng
1091 * have been set up.
1093 #ifndef YY_USER_ACTION
1094 #define YY_USER_ACTION
1095 #endif
1097 /* Code executed at the end of each rule. */
1098 #ifndef YY_BREAK
1099 #define YY_BREAK break;
1100 #endif
1102 #define YY_RULE_SETUP \
1103 if ( yyleng > 0 ) \
1104 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1105 (yytext[yyleng - 1] == '\n'); \
1106 YY_USER_ACTION
1108 /** The main scanner function which does all the work.
1110 YY_DECL
1112 register yy_state_type yy_current_state;
1113 register char *yy_cp, *yy_bp;
1114 register int yy_act;
1118 if ( (yy_init) )
1120 (yy_init) = 0;
1122 #ifdef YY_USER_INIT
1123 YY_USER_INIT;
1124 #endif
1126 if ( ! (yy_state_buf) )
1127 (yy_state_buf) = (yy_state_type *)yyalloc(YY_BUF_SIZE + 2 );
1129 if ( ! (yy_start) )
1130 (yy_start) = 1; /* first start state */
1132 if ( ! yyin )
1133 yyin = stdin;
1135 if ( ! yyout )
1136 yyout = stdout;
1138 if ( ! YY_CURRENT_BUFFER ) {
1139 yyensure_buffer_stack ();
1140 YY_CURRENT_BUFFER_LVALUE =
1141 yy_create_buffer(yyin,YY_BUF_SIZE );
1144 yy_load_buffer_state( );
1147 while ( 1 ) /* loops until end-of-file is reached */
1149 yy_cp = (yy_c_buf_p);
1151 /* Support of yytext. */
1152 *yy_cp = (yy_hold_char);
1154 /* yy_bp points to the position in yy_ch_buf of the start of
1155 * the current run.
1157 yy_bp = yy_cp;
1159 yy_current_state = (yy_start);
1160 yy_current_state += YY_AT_BOL();
1162 (yy_state_ptr) = (yy_state_buf);
1163 *(yy_state_ptr)++ = yy_current_state;
1165 yy_match:
1168 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1169 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1171 yy_current_state = (int) yy_def[yy_current_state];
1172 if ( yy_current_state >= 438 )
1173 yy_c = yy_meta[(unsigned int) yy_c];
1175 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1176 *(yy_state_ptr)++ = yy_current_state;
1177 ++yy_cp;
1179 while ( yy_current_state != 437 );
1181 yy_find_action:
1182 yy_current_state = *--(yy_state_ptr);
1183 (yy_lp) = yy_accept[yy_current_state];
1184 find_rule: /* we branch to this label when backing up */
1185 for ( ; ; ) /* until we find what rule we matched */
1187 if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
1189 yy_act = yy_acclist[(yy_lp)];
1190 if ( yy_act & YY_TRAILING_HEAD_MASK ||
1191 yy_looking_for_trail_begin )
1193 if ( yy_act == yy_looking_for_trail_begin )
1195 yy_looking_for_trail_begin = 0;
1196 yy_act &= ~YY_TRAILING_HEAD_MASK;
1197 break;
1200 else if ( yy_act & YY_TRAILING_MASK )
1202 yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
1203 yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
1204 (yy_full_match) = yy_cp;
1205 yy_full_state = (yy_state_ptr);
1206 yy_full_lp = (yy_lp);
1208 else
1210 (yy_full_match) = yy_cp;
1211 yy_full_state = (yy_state_ptr);
1212 yy_full_lp = (yy_lp);
1213 break;
1215 ++(yy_lp);
1216 goto find_rule;
1218 --yy_cp;
1219 yy_current_state = *--(yy_state_ptr);
1220 (yy_lp) = yy_accept[yy_current_state];
1223 YY_DO_BEFORE_ACTION;
1225 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1227 int yyl;
1228 for ( yyl = (yy_prev_more_offset); yyl < yyleng; ++yyl )
1229 if ( yytext[yyl] == '\n' )
1231 yylineno++;
1235 do_action: /* This label is used only to access EOF actions. */
1237 switch ( yy_act )
1238 { /* beginning of action switch */
1239 case 1:
1240 /* rule 1 can match eol */
1241 YY_RULE_SETUP
1242 { count(false); }
1243 YY_BREAK
1244 case 2:
1245 YY_RULE_SETUP
1246 { count(); return T_PERCENTUVIEW; }
1247 YY_BREAK
1248 case 3:
1249 YY_RULE_SETUP
1250 { count(); return T_PERCENTUVIEWVAR; }
1251 YY_BREAK
1252 case 4:
1253 YY_RULE_SETUP
1254 { count(); return T_PERCENTRVIEW; }
1255 YY_BREAK
1256 case 5:
1257 YY_RULE_SETUP
1258 { count(); return T_PERCENTRVIEWVAR; }
1259 YY_BREAK
1260 case 6:
1261 YY_RULE_SETUP
1262 { count(); return T_PERCENTSTORAGECLASS; }
1263 YY_BREAK
1264 case 7:
1265 YY_RULE_SETUP
1266 { count(); return T_PERCENTLANGUAGE; }
1267 YY_BREAK
1268 case 8:
1269 YY_RULE_SETUP
1270 { count(); BEGIN OPTION; }
1271 YY_BREAK
1272 case 9:
1273 YY_RULE_SETUP
1274 { count(); BEGIN INCLSTART; return T_INCLUDESTART; }
1275 YY_BREAK
1276 case 10:
1277 YY_RULE_SETUP
1278 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_ID; }
1279 YY_BREAK
1280 case 11:
1281 YY_RULE_SETUP
1282 { count(false); }
1283 YY_BREAK
1284 case 12:
1285 /* rule 12 can match eol */
1286 YY_RULE_SETUP
1287 { count(); cinclude = ""; cinclude.reserve(1024); BEGIN INCL; return T_ENDOFINCLUDESTART; }
1288 YY_BREAK
1289 case 13:
1290 /* rule 13 can match eol */
1291 YY_RULE_SETUP
1292 { count(); cinclude += yytext[0]; }
1293 YY_BREAK
1294 case 14:
1295 YY_RULE_SETUP
1296 { count(); v_report(Warning(FileLine(pg_filename, pg_lineno), Problem1S("Opening '%{' (nested C++ includes; preceding closing '%}' not found)"))); cinclude += yytext; }
1297 YY_BREAK
1298 case 15:
1299 /* rule 15 can match eol */
1300 YY_RULE_SETUP
1301 { count(); BEGIN NORMAL; yylval.yt_casestring = mkcasestring(cinclude.c_str()); return T_INCLUDEEND; }
1302 YY_BREAK
1303 case 16:
1304 YY_RULE_SETUP
1305 { count(); yylval.yt_integer = mkinteger(eat_comment(pg_filename)); return T_CNEWLINES; }
1306 YY_BREAK
1307 case 17:
1308 YY_RULE_SETUP
1309 { count(); eat_comment(pg_filename); }
1310 YY_BREAK
1311 case 18:
1312 YY_RULE_SETUP
1313 { count(); eat_line_comment(); yylval.yt_integer = mkinteger(1); return T_CNEWLINES; }
1314 YY_BREAK
1315 case 19:
1316 YY_RULE_SETUP
1317 { count(); eat_line_comment(); }
1318 YY_BREAK
1319 case 20:
1320 YY_RULE_SETUP
1321 { count(); return T_ARROW; }
1322 YY_BREAK
1323 case 21:
1324 YY_RULE_SETUP
1325 { count(); return T_PROVIDED; }
1326 YY_BREAK
1327 case 22:
1328 YY_RULE_SETUP
1329 { count(); return T_DEFAULT; }
1330 YY_BREAK
1331 case 23:
1332 YY_RULE_SETUP
1333 { count(); yylval.yt_integer = mkinteger(atoi(yytext)); return T_INT; }
1334 YY_BREAK
1335 case 24:
1336 YY_RULE_SETUP
1337 { count(); return T_LIST; }
1338 YY_BREAK
1339 case 25:
1340 YY_RULE_SETUP
1341 { count(); return T_STATIC; }
1342 YY_BREAK
1343 case 26:
1344 YY_RULE_SETUP
1345 { count(); return T_AUTO; }
1346 YY_BREAK
1347 case 27:
1348 YY_RULE_SETUP
1349 { count(); return T_REGISTER; }
1350 YY_BREAK
1351 case 28:
1352 YY_RULE_SETUP
1353 { count(); return T_EXTERN; }
1354 YY_BREAK
1355 case 29:
1356 YY_RULE_SETUP
1357 { count(); return T_TYPEDEF; }
1358 YY_BREAK
1359 case 30:
1360 YY_RULE_SETUP
1361 { count(); return T_CONST; }
1362 YY_BREAK
1363 case 31:
1364 YY_RULE_SETUP
1365 { count(); return T_VOLATILE; }
1366 YY_BREAK
1367 case 32:
1368 YY_RULE_SETUP
1369 { count(); return T_UNSIGNED; }
1370 YY_BREAK
1371 case 33:
1372 YY_RULE_SETUP
1373 { count(); return T_VIRTUAL; }
1374 YY_BREAK
1375 case 34:
1376 YY_RULE_SETUP
1377 { count(); BEGIN OPNAME; return T_OPERATOR; }
1378 YY_BREAK
1379 case 35:
1380 YY_RULE_SETUP
1381 { count(); return T_CONSTRUCTOR; }
1382 YY_BREAK
1383 case 36:
1384 YY_RULE_SETUP
1385 { count(); return T_DESTRUCTOR; }
1386 YY_BREAK
1387 case 37:
1388 YY_RULE_SETUP
1389 { count(); return T_MEMBER; }
1390 YY_BREAK
1391 case 38:
1392 YY_RULE_SETUP
1393 { count(); return T_ATTR; }
1394 YY_BREAK
1395 case 39:
1396 YY_RULE_SETUP
1397 { count(); return T_BASECLASS; }
1398 YY_BREAK
1399 case 40:
1400 YY_RULE_SETUP
1401 { count(); return T_DOTDOTDOT; }
1402 YY_BREAK
1403 case 41:
1404 YY_RULE_SETUP
1405 { count(); return T_COLONCOLON; }
1406 YY_BREAK
1407 case 42:
1408 /* rule 42 can match eol */
1409 YY_RULE_SETUP
1410 { count(false); }
1411 YY_BREAK
1412 case 43:
1413 YY_RULE_SETUP
1414 { count(); BEGIN NORMAL; yylval.yt_casestring = mkcasestring(yytext); return T_OPNAME ; }
1415 YY_BREAK
1416 case 44:
1417 YY_RULE_SETUP
1418 { count(); BEGIN NORMAL; yylval.yt_casestring = mkcasestring(yytext); return T_ID ; }
1419 YY_BREAK
1420 case 45:
1421 YY_RULE_SETUP
1422 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_ID ; }
1423 YY_BREAK
1424 case 46:
1425 YY_RULE_SETUP
1426 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_CEXPRESSION; }
1427 YY_BREAK
1428 case 47:
1429 YY_RULE_SETUP
1430 { count(); yylval.yt_integer = mkinteger(atoi(yytext+1)); return T_DOLLARVAR; }
1431 YY_BREAK
1432 case 48:
1433 YY_RULE_SETUP
1434 { count(); return T_UNPBLOCKSTART; }
1435 YY_BREAK
1436 case 49:
1437 YY_RULE_SETUP
1438 { count(); return T_UNPBLOCKEND; }
1439 YY_BREAK
1440 case 50:
1441 YY_RULE_SETUP
1442 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_CEXPRESSION; }
1443 YY_BREAK
1444 case 51:
1445 /* rule 51 can match eol */
1446 YY_RULE_SETUP
1447 { count(); return yytext[0]; }
1448 YY_BREAK
1449 case 52:
1450 YY_RULE_SETUP
1451 { count(); yylval.yt_casestring = mkcasestring("\\"); return T_CEXPRESSION; }
1452 YY_BREAK
1453 case 53:
1454 YY_RULE_SETUP
1455 { count(); yylval.yt_casestring = mkcasestring("\\\\"); return T_CEXPRESSION; }
1456 YY_BREAK
1457 case 54:
1458 YY_RULE_SETUP
1459 { count(); BEGIN CEXPRDQ; return yytext[0]; }
1460 YY_BREAK
1461 case 55:
1462 YY_RULE_SETUP
1463 { count(); BEGIN CEXPRSQ; return yytext[0]; }
1464 YY_BREAK
1465 case 56:
1466 YY_RULE_SETUP
1467 { count(); BEGIN NORMAL; reset_nestcount(); return yytext[0]; }
1468 YY_BREAK
1469 case 57:
1470 YY_RULE_SETUP
1471 { count(); return yytext[0]; }
1472 YY_BREAK
1473 case 58:
1474 YY_RULE_SETUP
1475 { count(); cinit_paren_nesting++; yylval.yt_casestring = mkcasestring("("); return yytext[0]; }
1476 YY_BREAK
1477 case 59:
1478 YY_RULE_SETUP
1479 { count(); if (cinit_paren_nesting == 0) {
1480 BEGIN NORMAL; reset_nestcount(); return yytext[0];
1481 } else {
1482 cinit_paren_nesting--; yylval.yt_casestring = mkcasestring(")"); return yytext[0]; }
1484 YY_BREAK
1485 case 60:
1486 YY_RULE_SETUP
1487 { count(); cinit_array_nesting++; yylval.yt_casestring = mkcasestring("["); return yytext[0]; }
1488 YY_BREAK
1489 case 61:
1490 YY_RULE_SETUP
1491 { count(); if (cinit_array_nesting == 0) {
1492 BEGIN NORMAL; reset_nestcount(); return yytext[0];
1493 } else {
1494 cinit_array_nesting--; yylval.yt_casestring = mkcasestring("]"); return yytext[0]; }
1496 YY_BREAK
1497 case 62:
1498 YY_RULE_SETUP
1499 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_CEXPRESSION; }
1500 YY_BREAK
1501 case 63:
1502 YY_RULE_SETUP
1503 { count(); BEGIN CEXPR; return yytext[0]; }
1504 YY_BREAK
1505 case 64:
1506 YY_RULE_SETUP
1507 { count(); yylval.yt_casestring = mkcasestring("\\\""); return T_CEXPRESSION; }
1508 YY_BREAK
1509 case 65:
1510 YY_RULE_SETUP
1511 { count(); BEGIN CEXPR; return yytext[0]; }
1512 YY_BREAK
1513 case 66:
1514 YY_RULE_SETUP
1515 { count(); yylval.yt_casestring = mkcasestring("\\'"); return T_CEXPRESSION; }
1516 YY_BREAK
1517 case 67:
1518 YY_RULE_SETUP
1519 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_CEXPRESSION; }
1520 YY_BREAK
1521 case 68:
1522 YY_RULE_SETUP
1523 { count(); yylval.yt_casestring = mkcasestring("$"); return T_CLINE; }
1524 YY_BREAK
1525 case 69:
1526 YY_RULE_SETUP
1527 { count(); yylval.yt_casestring = mkcasestring("\\\\"); return T_CLINE; }
1528 YY_BREAK
1529 case 70:
1530 YY_RULE_SETUP
1531 { count(); yylval.yt_casestring = mkcasestring("\\"); return T_CLINE ; }
1532 YY_BREAK
1533 case 71:
1534 YY_RULE_SETUP
1535 { count(); yylval.yt_casestring = mkcasestring("{"); /*WARNING-NO LONGER SUPPORTED*/ return T_CLINE ; }
1536 YY_BREAK
1537 case 72:
1538 YY_RULE_SETUP
1539 { count(); yylval.yt_casestring = mkcasestring("}"); /*WARNING-NO LONGER SUPPORTED*/ return T_CLINE ; }
1540 YY_BREAK
1541 case 73:
1542 YY_RULE_SETUP
1543 { count(); if (strcmp(yytext, "$") == 0) return yytext[0];
1544 yylval.yt_integer = mkinteger(atoi(yytext+1));
1545 return T_DOLLARVAR;
1547 YY_BREAK
1548 case 74:
1549 /* rule 74 can match eol */
1550 YY_RULE_SETUP
1551 { count(); return T_FOREACH_AFTER; }
1552 YY_BREAK
1553 case 75:
1554 YY_RULE_SETUP
1555 { count(); if (strcmp(yytext, "foreach") ==0) {
1556 return T_FOREACH;
1557 } else if (strcmp(yytext, "afterforeach") ==0) {
1558 return T_FOREACH_AFTER;
1559 } else if (strcmp(yytext, "with") ==0) {
1560 return T_WITH;
1561 } else {
1562 yylval.yt_casestring = mkcasestring(yytext);
1563 return T_CLINE ;
1566 YY_BREAK
1567 case 76:
1568 YY_RULE_SETUP
1569 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_CLINE; }
1570 YY_BREAK
1571 case 77:
1572 YY_RULE_SETUP
1573 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_CLINE; }
1574 YY_BREAK
1575 case 78:
1576 YY_RULE_SETUP
1577 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_CLINE; }
1578 YY_BREAK
1579 case 79:
1580 YY_RULE_SETUP
1581 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_CLINE; }
1582 YY_BREAK
1583 case 80:
1584 YY_RULE_SETUP
1585 { count(); yylval.yt_casestring = mkcasestring(yytext); return T_CLINE; }
1586 YY_BREAK
1587 case 81:
1588 YY_RULE_SETUP
1589 { count(); return yytext[0]; }
1590 YY_BREAK
1591 case 82:
1592 YY_RULE_SETUP
1593 { count(false); }
1594 YY_BREAK
1595 case 83:
1596 /* rule 83 can match eol */
1597 YY_RULE_SETUP
1598 { count(false); BEGIN NORMAL; }
1599 YY_BREAK
1600 case 84:
1601 YY_RULE_SETUP
1602 { count(); if (g_options.for_bison!="" && g_options.for_bison!="yystype.h") v_report(Warning(FileLine(pg_filename, pg_lineno), Problem2S("Name of yystype header is set to ", g_options.for_bison.c_str()))); else g_options.for_bison="yystype.h"; }
1603 YY_BREAK
1604 case 85:
1605 YY_RULE_SETUP
1606 { count(); g_options.no_csgio=true; }
1607 YY_BREAK
1608 case 86:
1609 YY_RULE_SETUP
1610 { count(); g_options.no_unparse=true; }
1611 YY_BREAK
1612 case 87:
1613 YY_RULE_SETUP
1614 { count(); g_options.no_rewrite=true; }
1615 YY_BREAK
1616 case 88:
1617 YY_RULE_SETUP
1618 { count(); g_options.no_printdot=true; }
1619 YY_BREAK
1620 case 89:
1621 YY_RULE_SETUP
1622 { count(); g_options.no_hashtables=true; }
1623 YY_BREAK
1624 case 90:
1625 YY_RULE_SETUP
1626 { count(); g_options.smart_pointer=true; }
1627 YY_BREAK
1628 case 91:
1629 YY_RULE_SETUP
1630 { count(); g_options.smart_pointer=true; g_options.weak_pointer=true; }
1631 YY_BREAK
1632 case 92:
1633 YY_RULE_SETUP
1634 { count(); return yytext[0]; }
1635 YY_BREAK
1636 case 93:
1637 YY_RULE_SETUP
1638 ECHO;
1639 YY_BREAK
1640 case YY_STATE_EOF(INITIAL):
1641 case YY_STATE_EOF(NORMAL):
1642 case YY_STATE_EOF(INCL):
1643 case YY_STATE_EOF(INCLSTART):
1644 case YY_STATE_EOF(CEXPR):
1645 case YY_STATE_EOF(CEXPRDQ):
1646 case YY_STATE_EOF(CEXPRSQ):
1647 case YY_STATE_EOF(C):
1648 case YY_STATE_EOF(OPNAME):
1649 case YY_STATE_EOF(OPTION):
1650 yyterminate();
1652 case YY_END_OF_BUFFER:
1654 /* Amount of text matched not including the EOB char. */
1655 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1657 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1658 *yy_cp = (yy_hold_char);
1659 YY_RESTORE_YY_MORE_OFFSET
1661 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1663 /* We're scanning a new file or input source. It's
1664 * possible that this happened because the user
1665 * just pointed yyin at a new source and called
1666 * yylex(). If so, then we have to assure
1667 * consistency between YY_CURRENT_BUFFER and our
1668 * globals. Here is the right place to do so, because
1669 * this is the first action (other than possibly a
1670 * back-up) that will match for the new input source.
1672 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1673 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1674 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1677 /* Note that here we test for yy_c_buf_p "<=" to the position
1678 * of the first EOB in the buffer, since yy_c_buf_p will
1679 * already have been incremented past the NUL character
1680 * (since all states make transitions on EOB to the
1681 * end-of-buffer state). Contrast this with the test
1682 * in input().
1684 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1685 { /* This was really a NUL. */
1686 yy_state_type yy_next_state;
1688 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1690 yy_current_state = yy_get_previous_state( );
1692 /* Okay, we're now positioned to make the NUL
1693 * transition. We couldn't have
1694 * yy_get_previous_state() go ahead and do it
1695 * for us because it doesn't know how to deal
1696 * with the possibility of jamming (and we don't
1697 * want to build jamming into it because then it
1698 * will run more slowly).
1701 yy_next_state = yy_try_NUL_trans( yy_current_state );
1703 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1705 if ( yy_next_state )
1707 /* Consume the NUL. */
1708 yy_cp = ++(yy_c_buf_p);
1709 yy_current_state = yy_next_state;
1710 goto yy_match;
1713 else
1715 yy_cp = (yy_c_buf_p);
1716 goto yy_find_action;
1720 else switch ( yy_get_next_buffer( ) )
1722 case EOB_ACT_END_OF_FILE:
1724 (yy_did_buffer_switch_on_eof) = 0;
1726 if ( yywrap( ) )
1728 /* Note: because we've taken care in
1729 * yy_get_next_buffer() to have set up
1730 * yytext, we can now set up
1731 * yy_c_buf_p so that if some total
1732 * hoser (like flex itself) wants to
1733 * call the scanner after we return the
1734 * YY_NULL, it'll still work - another
1735 * YY_NULL will get returned.
1737 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1739 yy_act = YY_STATE_EOF(YY_START);
1740 goto do_action;
1743 else
1745 if ( ! (yy_did_buffer_switch_on_eof) )
1746 YY_NEW_FILE;
1748 break;
1751 case EOB_ACT_CONTINUE_SCAN:
1752 (yy_c_buf_p) =
1753 (yytext_ptr) + yy_amount_of_matched_text;
1755 yy_current_state = yy_get_previous_state( );
1757 yy_cp = (yy_c_buf_p);
1758 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1759 goto yy_match;
1761 case EOB_ACT_LAST_MATCH:
1762 (yy_c_buf_p) =
1763 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1765 yy_current_state = yy_get_previous_state( );
1767 yy_cp = (yy_c_buf_p);
1768 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1769 goto yy_find_action;
1771 break;
1774 default:
1775 YY_FATAL_ERROR(
1776 "fatal flex scanner internal error--no action found" );
1777 } /* end of action switch */
1778 } /* end of scanning one token */
1779 } /* end of yylex */
1781 /* yy_get_next_buffer - try to read in a new buffer
1783 * Returns a code representing an action:
1784 * EOB_ACT_LAST_MATCH -
1785 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1786 * EOB_ACT_END_OF_FILE - end of file
1788 static int yy_get_next_buffer (void)
1790 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1791 register char *source = (yytext_ptr);
1792 register int number_to_move, i;
1793 int ret_val;
1795 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1796 YY_FATAL_ERROR(
1797 "fatal flex scanner internal error--end of buffer missed" );
1799 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1800 { /* Don't try to fill the buffer, so this is an EOF. */
1801 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1803 /* We matched a single character, the EOB, so
1804 * treat this as a final EOF.
1806 return EOB_ACT_END_OF_FILE;
1809 else
1811 /* We matched some text prior to the EOB, first
1812 * process it.
1814 return EOB_ACT_LAST_MATCH;
1818 /* Try to read more data. */
1820 /* First move last chars to start of buffer. */
1821 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1823 for ( i = 0; i < number_to_move; ++i )
1824 *(dest++) = *(source++);
1826 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1827 /* don't do the read, it's not guaranteed to return an EOF,
1828 * just force an EOF
1830 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1832 else
1834 size_t num_to_read =
1835 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1837 while ( num_to_read <= 0 )
1838 { /* Not enough room in the buffer - grow it. */
1840 YY_FATAL_ERROR(
1841 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1845 if ( num_to_read > YY_READ_BUF_SIZE )
1846 num_to_read = YY_READ_BUF_SIZE;
1848 /* Read in more data. */
1849 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1850 (yy_n_chars), num_to_read );
1852 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1855 if ( (yy_n_chars) == 0 )
1857 if ( number_to_move == YY_MORE_ADJ )
1859 ret_val = EOB_ACT_END_OF_FILE;
1860 yyrestart(yyin );
1863 else
1865 ret_val = EOB_ACT_LAST_MATCH;
1866 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1867 YY_BUFFER_EOF_PENDING;
1871 else
1872 ret_val = EOB_ACT_CONTINUE_SCAN;
1874 (yy_n_chars) += number_to_move;
1875 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1876 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1878 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1880 return ret_val;
1883 /* yy_get_previous_state - get the state just before the EOB char was reached */
1885 static yy_state_type yy_get_previous_state (void)
1887 register yy_state_type yy_current_state;
1888 register char *yy_cp;
1890 yy_current_state = (yy_start);
1891 yy_current_state += YY_AT_BOL();
1893 (yy_state_ptr) = (yy_state_buf);
1894 *(yy_state_ptr)++ = yy_current_state;
1896 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1898 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1899 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1901 yy_current_state = (int) yy_def[yy_current_state];
1902 if ( yy_current_state >= 438 )
1903 yy_c = yy_meta[(unsigned int) yy_c];
1905 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1906 *(yy_state_ptr)++ = yy_current_state;
1909 return yy_current_state;
1912 /* yy_try_NUL_trans - try to make a transition on the NUL character
1914 * synopsis
1915 * next_state = yy_try_NUL_trans( current_state );
1917 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1919 register int yy_is_jam;
1921 register YY_CHAR yy_c = 1;
1922 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1924 yy_current_state = (int) yy_def[yy_current_state];
1925 if ( yy_current_state >= 438 )
1926 yy_c = yy_meta[(unsigned int) yy_c];
1928 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1929 yy_is_jam = (yy_current_state == 437);
1930 if ( ! yy_is_jam )
1931 *(yy_state_ptr)++ = yy_current_state;
1933 return yy_is_jam ? 0 : yy_current_state;
1936 static void yyunput (int c, register char * yy_bp )
1938 register char *yy_cp;
1940 yy_cp = (yy_c_buf_p);
1942 /* undo effects of setting up yytext */
1943 *yy_cp = (yy_hold_char);
1945 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1946 { /* need to shift things up to make room */
1947 /* +2 for EOB chars. */
1948 register int number_to_move = (yy_n_chars) + 2;
1949 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1950 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1951 register char *source =
1952 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1954 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1955 *--dest = *--source;
1957 yy_cp += (int) (dest - source);
1958 yy_bp += (int) (dest - source);
1959 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1960 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1962 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1963 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1966 *--yy_cp = (char) c;
1968 if ( c == '\n' ){
1969 --yylineno;
1972 (yytext_ptr) = yy_bp;
1973 (yy_hold_char) = *yy_cp;
1974 (yy_c_buf_p) = yy_cp;
1977 #ifndef YY_NO_INPUT
1978 #ifdef __cplusplus
1979 static int yyinput (void)
1980 #else
1981 static int input (void)
1982 #endif
1985 int c;
1987 *(yy_c_buf_p) = (yy_hold_char);
1989 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1991 /* yy_c_buf_p now points to the character we want to return.
1992 * If this occurs *before* the EOB characters, then it's a
1993 * valid NUL; if not, then we've hit the end of the buffer.
1995 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1996 /* This was really a NUL. */
1997 *(yy_c_buf_p) = '\0';
1999 else
2000 { /* need more input */
2001 int offset = (yy_c_buf_p) - (yytext_ptr);
2002 ++(yy_c_buf_p);
2004 switch ( yy_get_next_buffer( ) )
2006 case EOB_ACT_LAST_MATCH:
2007 /* This happens because yy_g_n_b()
2008 * sees that we've accumulated a
2009 * token and flags that we need to
2010 * try matching the token before
2011 * proceeding. But for input(),
2012 * there's no matching to consider.
2013 * So convert the EOB_ACT_LAST_MATCH
2014 * to EOB_ACT_END_OF_FILE.
2017 /* Reset buffer status. */
2018 yyrestart(yyin );
2020 /*FALLTHROUGH*/
2022 case EOB_ACT_END_OF_FILE:
2024 if ( yywrap( ) )
2025 return EOF;
2027 if ( ! (yy_did_buffer_switch_on_eof) )
2028 YY_NEW_FILE;
2029 #ifdef __cplusplus
2030 return yyinput();
2031 #else
2032 return input();
2033 #endif
2036 case EOB_ACT_CONTINUE_SCAN:
2037 (yy_c_buf_p) = (yytext_ptr) + offset;
2038 break;
2043 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2044 *(yy_c_buf_p) = '\0'; /* preserve yytext */
2045 (yy_hold_char) = *++(yy_c_buf_p);
2047 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2048 if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
2050 yylineno++;
2053 return c;
2055 #endif /* ifndef YY_NO_INPUT */
2057 /** Immediately switch to a different input stream.
2058 * @param input_file A readable stream.
2060 * @note This function does not reset the start condition to @c INITIAL .
2062 void yyrestart (FILE * input_file )
2065 if ( ! YY_CURRENT_BUFFER ){
2066 yyensure_buffer_stack ();
2067 YY_CURRENT_BUFFER_LVALUE =
2068 yy_create_buffer(yyin,YY_BUF_SIZE );
2071 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
2072 yy_load_buffer_state( );
2075 /** Switch to a different input buffer.
2076 * @param new_buffer The new input buffer.
2079 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2082 /* TODO. We should be able to replace this entire function body
2083 * with
2084 * yypop_buffer_state();
2085 * yypush_buffer_state(new_buffer);
2087 yyensure_buffer_stack ();
2088 if ( YY_CURRENT_BUFFER == new_buffer )
2089 return;
2091 if ( YY_CURRENT_BUFFER )
2093 /* Flush out information for old buffer. */
2094 *(yy_c_buf_p) = (yy_hold_char);
2095 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2096 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2099 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2100 yy_load_buffer_state( );
2102 /* We don't actually know whether we did this switch during
2103 * EOF (yywrap()) processing, but the only time this flag
2104 * is looked at is after yywrap() is called, so it's safe
2105 * to go ahead and always set it.
2107 (yy_did_buffer_switch_on_eof) = 1;
2110 static void yy_load_buffer_state (void)
2112 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2113 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2114 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2115 (yy_hold_char) = *(yy_c_buf_p);
2118 /** Allocate and initialize an input buffer state.
2119 * @param file A readable stream.
2120 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2122 * @return the allocated buffer state.
2124 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2126 YY_BUFFER_STATE b;
2128 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2129 if ( ! b )
2130 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2132 b->yy_buf_size = size;
2134 /* yy_ch_buf has to be 2 characters longer than the size given because
2135 * we need to put in 2 end-of-buffer characters.
2137 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
2138 if ( ! b->yy_ch_buf )
2139 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2141 b->yy_is_our_buffer = 1;
2143 yy_init_buffer(b,file );
2145 return b;
2148 /** Destroy the buffer.
2149 * @param b a buffer created with yy_create_buffer()
2152 void yy_delete_buffer (YY_BUFFER_STATE b )
2155 if ( ! b )
2156 return;
2158 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2159 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2161 if ( b->yy_is_our_buffer )
2162 yyfree((void *) b->yy_ch_buf );
2164 yyfree((void *) b );
2167 /* Initializes or reinitializes a buffer.
2168 * This function is sometimes called more than once on the same buffer,
2169 * such as during a yyrestart() or at EOF.
2171 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2174 int oerrno = errno;
2176 yy_flush_buffer(b );
2178 b->yy_input_file = file;
2179 b->yy_fill_buffer = 1;
2181 /* If b is the current buffer, then yy_init_buffer was _probably_
2182 * called from yyrestart() or through yy_get_next_buffer.
2183 * In that case, we don't want to reset the lineno or column.
2185 if (b != YY_CURRENT_BUFFER){
2186 b->yy_bs_lineno = 1;
2187 b->yy_bs_column = 0;
2190 b->yy_is_interactive = 0;
2192 errno = oerrno;
2195 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2196 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2199 void yy_flush_buffer (YY_BUFFER_STATE b )
2201 if ( ! b )
2202 return;
2204 b->yy_n_chars = 0;
2206 /* We always need two end-of-buffer characters. The first causes
2207 * a transition to the end-of-buffer state. The second causes
2208 * a jam in that state.
2210 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2211 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2213 b->yy_buf_pos = &b->yy_ch_buf[0];
2215 b->yy_at_bol = 1;
2216 b->yy_buffer_status = YY_BUFFER_NEW;
2218 if ( b == YY_CURRENT_BUFFER )
2219 yy_load_buffer_state( );
2222 /** Pushes the new state onto the stack. The new state becomes
2223 * the current state. This function will allocate the stack
2224 * if necessary.
2225 * @param new_buffer The new state.
2228 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2230 if (new_buffer == NULL)
2231 return;
2233 yyensure_buffer_stack();
2235 /* This block is copied from yy_switch_to_buffer. */
2236 if ( YY_CURRENT_BUFFER )
2238 /* Flush out information for old buffer. */
2239 *(yy_c_buf_p) = (yy_hold_char);
2240 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2241 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2244 /* Only push if top exists. Otherwise, replace top. */
2245 if (YY_CURRENT_BUFFER)
2246 (yy_buffer_stack_top)++;
2247 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2249 /* copied from yy_switch_to_buffer. */
2250 yy_load_buffer_state( );
2251 (yy_did_buffer_switch_on_eof) = 1;
2254 /** Removes and deletes the top of the stack, if present.
2255 * The next element becomes the new top.
2258 void yypop_buffer_state (void)
2260 if (!YY_CURRENT_BUFFER)
2261 return;
2263 yy_delete_buffer(YY_CURRENT_BUFFER );
2264 YY_CURRENT_BUFFER_LVALUE = NULL;
2265 if ((yy_buffer_stack_top) > 0)
2266 --(yy_buffer_stack_top);
2268 if (YY_CURRENT_BUFFER) {
2269 yy_load_buffer_state( );
2270 (yy_did_buffer_switch_on_eof) = 1;
2274 /* Allocates the stack if it does not exist.
2275 * Guarantees space for at least one push.
2277 static void yyensure_buffer_stack (void)
2279 int num_to_alloc;
2281 if (!(yy_buffer_stack)) {
2283 /* First allocation is just for 2 elements, since we don't know if this
2284 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2285 * immediate realloc on the next call.
2287 num_to_alloc = 1;
2288 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2289 (num_to_alloc * sizeof(struct yy_buffer_state*)
2292 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2294 (yy_buffer_stack_max) = num_to_alloc;
2295 (yy_buffer_stack_top) = 0;
2296 return;
2299 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2301 /* Increase the buffer to prepare for a possible push. */
2302 int grow_size = 8 /* arbitrary grow size */;
2304 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2305 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2306 ((yy_buffer_stack),
2307 num_to_alloc * sizeof(struct yy_buffer_state*)
2310 /* zero only the new slots.*/
2311 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2312 (yy_buffer_stack_max) = num_to_alloc;
2316 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2317 * @param base the character buffer
2318 * @param size the size in bytes of the character buffer
2320 * @return the newly allocated buffer state object.
2322 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2324 YY_BUFFER_STATE b;
2326 if ( size < 2 ||
2327 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2328 base[size-1] != YY_END_OF_BUFFER_CHAR )
2329 /* They forgot to leave room for the EOB's. */
2330 return 0;
2332 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2333 if ( ! b )
2334 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2336 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2337 b->yy_buf_pos = b->yy_ch_buf = base;
2338 b->yy_is_our_buffer = 0;
2339 b->yy_input_file = 0;
2340 b->yy_n_chars = b->yy_buf_size;
2341 b->yy_is_interactive = 0;
2342 b->yy_at_bol = 1;
2343 b->yy_fill_buffer = 0;
2344 b->yy_buffer_status = YY_BUFFER_NEW;
2346 yy_switch_to_buffer(b );
2348 return b;
2351 /** Setup the input buffer state to scan a string. The next call to yylex() will
2352 * scan from a @e copy of @a str.
2353 * @param str a NUL-terminated string to scan
2355 * @return the newly allocated buffer state object.
2356 * @note If you want to scan bytes that may contain NUL values, then use
2357 * yy_scan_bytes() instead.
2359 YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )
2362 return yy_scan_bytes(yy_str,strlen(yy_str) );
2365 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2366 * scan from a @e copy of @a bytes.
2367 * @param bytes the byte buffer to scan
2368 * @param len the number of bytes in the buffer pointed to by @a bytes.
2370 * @return the newly allocated buffer state object.
2372 YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )
2374 YY_BUFFER_STATE b;
2375 char *buf;
2376 yy_size_t n;
2377 int i;
2379 /* Get memory for full buffer, including space for trailing EOB's. */
2380 n = len + 2;
2381 buf = (char *) yyalloc(n );
2382 if ( ! buf )
2383 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2385 for ( i = 0; i < len; ++i )
2386 buf[i] = bytes[i];
2388 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2390 b = yy_scan_buffer(buf,n );
2391 if ( ! b )
2392 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2394 /* It's okay to grow etc. this buffer, and we should throw it
2395 * away when we're done.
2397 b->yy_is_our_buffer = 1;
2399 return b;
2402 #ifndef YY_EXIT_FAILURE
2403 #define YY_EXIT_FAILURE 2
2404 #endif
2406 static void yy_fatal_error (yyconst char* msg )
2408 (void) fprintf( stderr, "%s\n", msg );
2409 exit( YY_EXIT_FAILURE );
2412 /* Redefine yyless() so it works in section 3 code. */
2414 #undef yyless
2415 #define yyless(n) \
2416 do \
2418 /* Undo effects of setting up yytext. */ \
2419 int yyless_macro_arg = (n); \
2420 YY_LESS_LINENO(yyless_macro_arg);\
2421 yytext[yyleng] = (yy_hold_char); \
2422 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2423 (yy_hold_char) = *(yy_c_buf_p); \
2424 *(yy_c_buf_p) = '\0'; \
2425 yyleng = yyless_macro_arg; \
2427 while ( 0 )
2429 /* Accessor methods (get/set functions) to struct members. */
2431 /** Get the current line number.
2434 int yyget_lineno (void)
2437 return yylineno;
2440 /** Get the input stream.
2443 FILE *yyget_in (void)
2445 return yyin;
2448 /** Get the output stream.
2451 FILE *yyget_out (void)
2453 return yyout;
2456 /** Get the length of the current token.
2459 int yyget_leng (void)
2461 return yyleng;
2464 /** Get the current token.
2468 char *yyget_text (void)
2470 return yytext;
2473 /** Set the current line number.
2474 * @param line_number
2477 void yyset_lineno (int line_number )
2480 yylineno = line_number;
2483 /** Set the input stream. This does not discard the current
2484 * input buffer.
2485 * @param in_str A readable stream.
2487 * @see yy_switch_to_buffer
2489 void yyset_in (FILE * in_str )
2491 yyin = in_str ;
2494 void yyset_out (FILE * out_str )
2496 yyout = out_str ;
2499 int yyget_debug (void)
2501 return yy_flex_debug;
2504 void yyset_debug (int bdebug )
2506 yy_flex_debug = bdebug ;
2509 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2510 int yylex_destroy (void)
2513 /* Pop the buffer stack, destroying each element. */
2514 while(YY_CURRENT_BUFFER){
2515 yy_delete_buffer(YY_CURRENT_BUFFER );
2516 YY_CURRENT_BUFFER_LVALUE = NULL;
2517 yypop_buffer_state();
2520 /* Destroy the stack itself. */
2521 yyfree((yy_buffer_stack) );
2522 (yy_buffer_stack) = NULL;
2524 yyfree ( (yy_state_buf) );
2526 return 0;
2530 * Internal utility routines.
2533 #ifndef yytext_ptr
2534 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2536 register int i;
2537 for ( i = 0; i < n; ++i )
2538 s1[i] = s2[i];
2540 #endif
2542 #ifdef YY_NEED_STRLEN
2543 static int yy_flex_strlen (yyconst char * s )
2545 register int n;
2546 for ( n = 0; s[n]; ++n )
2549 return n;
2551 #endif
2553 void *yyalloc (yy_size_t size )
2555 return (void *) malloc( size );
2558 void *yyrealloc (void * ptr, yy_size_t size )
2560 /* The cast to (char *) in the following accommodates both
2561 * implementations that use char* generic pointers, and those
2562 * that use void* generic pointers. It works with the latter
2563 * because both ANSI C and C++ allow castless assignment from
2564 * any pointer type to void*, and deal with argument conversions
2565 * as though doing an assignment.
2567 return (void *) realloc( (char *) ptr, size );
2570 void yyfree (void * ptr )
2572 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2575 #define YYTABLES_NAME "yytables"
2577 #undef YY_NEW_FILE
2578 #undef YY_FLUSH_BUFFER
2579 #undef yy_set_bol
2580 #undef yy_new_buffer
2581 #undef yy_set_interactive
2582 #undef yytext_ptr
2583 #undef YY_DO_BEFORE_ACTION
2585 #ifdef YY_DECL_IS_OURS
2586 #undef YY_DECL_IS_OURS
2587 #undef YY_DECL
2588 #endif
2592 void do_NORMAL() { BEGIN NORMAL; reset_nestcount(); }
2593 void do_CEXPR() { BEGIN CEXPR; }
2594 void do_CEXPRDQ() { BEGIN CEXPRDQ; }
2595 void do_CEXPRSQ() { BEGIN CEXPRSQ; }
2596 void do_C() { BEGIN C; }
2598 namespace {
2599 void
2600 reset_nestcount()
2602 /* WARNING if these are not == 0 */
2603 if (cinit_paren_nesting != 0) {
2604 v_report( NonFatal( PosNoFileLine(), Problem1S( "opening parenthesis '(' was not closed" )));
2606 if (cinit_array_nesting != 0) {
2607 v_report( NonFatal( PosNoFileLine(), Problem1S( "opening bracket '[' was not closed" )));
2609 cinit_paren_nesting = 0;
2610 cinit_array_nesting = 0;
2614 eat_comment(casestring start_filename)
2616 char c1, c2; /* comment string */
2617 int nest;
2618 int start_lineno = pg_lineno;
2620 for(nest=1, c2 = ' ';;){
2621 c1 = c2;
2622 c2 = yyinput();
2623 if (c2 == '\n') {
2624 pg_lineno++;
2625 pg_column = 0;
2626 pg_charpos ++;
2627 } else if (c2 == '\t') {
2628 pg_column += 8 - (pg_column % 8);
2629 pg_charpos += 8 - (pg_charpos % 8);
2630 } else if (c2 == 0) {
2631 v_report( Fatal( FileLine( start_filename, start_lineno ), Problem1S( "start of comment containing unexpected eof" )));
2632 } else {
2633 pg_column++;
2634 pg_charpos ++;
2636 if (c1 == '/' && c2 == '*')
2637 nest++;
2638 else if (c1 == '*' && c2 == '/')
2639 nest--;
2640 if (nest <= 0)
2641 break;
2643 return pg_lineno - start_lineno;
2646 void
2647 eat_line_comment()
2649 while (yyinput()!='\n')
2651 pg_lineno++;
2652 pg_column = 0;
2653 pg_charpos++;
2656 void
2657 count(bool notwhite)
2659 register char *s;
2661 #ifdef MYLEXDEBUG
2662 if (notwhite)
2663 printf ("symbol found: %s\n", yytext);
2664 #endif
2665 for (s = yytext; *s; s++)
2666 if (*s == '\n') {
2667 pg_column = 0;
2668 pg_lineno++;
2669 pg_charpos++;
2670 } else if (*s == '\t') {
2671 pg_column += 8 - (pg_column % 8);
2672 pg_charpos += 8 - (pg_charpos % 8);
2673 } else {
2674 pg_column++;
2675 pg_charpos++;
2679 } // namespace
2681 // vim:sts=4:ts=8:cino=g0,t0,\:0