5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 33
13 #if YY_FLEX_SUBMINOR_VERSION > 0
28 /* First, we deal with platform-specific or compiler-specific issues. */
30 /* begin standard C headers. */
38 /* %if-tables-serialization */
40 /* end standard C headers. */
43 /* flex integer type definitions */
48 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
50 #if __STDC_VERSION__ >= 199901L
52 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
53 * if you want the limit (max/min) macros for int types.
55 #ifndef __STDC_LIMIT_MACROS
56 #define __STDC_LIMIT_MACROS 1
60 typedef int8_t flex_int8_t
;
61 typedef uint8_t flex_uint8_t
;
62 typedef int16_t flex_int16_t
;
63 typedef uint16_t flex_uint16_t
;
64 typedef int32_t flex_int32_t
;
65 typedef uint32_t flex_uint32_t
;
67 typedef signed char flex_int8_t
;
68 typedef short int flex_int16_t
;
69 typedef int flex_int32_t
;
70 typedef unsigned char flex_uint8_t
;
71 typedef unsigned short int flex_uint16_t
;
72 typedef unsigned int flex_uint32_t
;
75 /* Limits of integral types. */
77 #define INT8_MIN (-128)
80 #define INT16_MIN (-32767-1)
83 #define INT32_MIN (-2147483647-1)
86 #define INT8_MAX (127)
89 #define INT16_MAX (32767)
92 #define INT32_MAX (2147483647)
95 #define UINT8_MAX (255U)
98 #define UINT16_MAX (65535U)
101 #define UINT32_MAX (4294967295U)
104 #endif /* ! FLEXINT_H */
113 /* The "const" storage-class-modifier is valid. */
116 #else /* ! __cplusplus */
122 #endif /* __STDC__ */
123 #endif /* ! __cplusplus */
126 #define yyconst const
131 /* %not-for-header */
133 /* Returned upon end-of-file. */
137 /* %not-for-header */
139 /* Promotes a possibly negative, possibly signed char to an unsigned
140 * integer for use as an array index. If the signed char is negative,
141 * we want to instead treat it as an 8-bit unsigned char, hence the
144 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
149 /* An opaque pointer. */
150 #ifndef YY_TYPEDEF_YY_SCANNER_T
151 #define YY_TYPEDEF_YY_SCANNER_T
152 typedef void* yyscan_t
;
155 /* For convenience, these vars (plus the bison vars far below)
156 are macros in the reentrant scanner. */
157 #define yyin yyg->yyin_r
158 #define yyout yyg->yyout_r
159 #define yyextra yyg->yyextra_r
160 #define yyleng yyg->yyleng_r
161 #define yytext yyg->yytext_r
162 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
163 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
164 #define yy_flex_debug yyg->yy_flex_debug_r
166 int yylex_init (yyscan_t
* scanner
);
169 /* %if-not-reentrant */
172 /* Enter a start condition. This macro really ought to take a parameter,
173 * but we do it the disgusting crufty way forced on us by the ()-less
174 * definition of BEGIN.
176 #define BEGIN yyg->yy_start = 1 + 2 *
178 /* Translate the current start state into a value that can be later handed
179 * to BEGIN to return to the state. The YYSTATE alias is for lex
182 #define YY_START ((yyg->yy_start - 1) / 2)
183 #define YYSTATE YY_START
185 /* Action number for EOF rule of a given start state. */
186 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
188 /* Special action meaning "start processing a new file". */
189 #define YY_NEW_FILE yyrestart(yyin ,yyscanner )
191 #define YY_END_OF_BUFFER_CHAR 0
193 /* Size of default input buffer. */
195 #define YY_BUF_SIZE 16384
198 /* The state buf must be large enough to hold one state per character in the main buffer.
200 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
202 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
203 #define YY_TYPEDEF_YY_BUFFER_STATE
204 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
207 /* %if-not-reentrant */
211 /* %if-not-reentrant */
215 #define EOB_ACT_CONTINUE_SCAN 0
216 #define EOB_ACT_END_OF_FILE 1
217 #define EOB_ACT_LAST_MATCH 2
219 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
220 * access to the local variable yy_act. Since yyless() is a macro, it would break
221 * existing scanners that call yyless() from OUTSIDE yylex.
222 * One obvious solution it to make yy_act a global. I tried that, and saw
223 * a 5% performance hit in a non-yylineno scanner, because yy_act is
224 * normally declared as a register variable-- so it is not worth it.
226 #define YY_LESS_LINENO(n) \
229 for ( yyl = n; yyl < yyleng; ++yyl )\
230 if ( yytext[yyl] == '\n' )\
234 /* Return all but the first "n" matched characters back to the input stream. */
238 /* Undo effects of setting up yytext. */ \
239 int yyless_macro_arg = (n); \
240 YY_LESS_LINENO(yyless_macro_arg);\
241 *yy_cp = yyg->yy_hold_char; \
242 YY_RESTORE_YY_MORE_OFFSET \
243 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
244 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
248 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
250 /* The following is because we cannot portably get our hands on size_t
251 * (without autoconf's help, which isn't available because we want
252 * flex-generated scanners to compile on their own).
255 #ifndef YY_TYPEDEF_YY_SIZE_T
256 #define YY_TYPEDEF_YY_SIZE_T
257 typedef unsigned int yy_size_t
;
260 #ifndef YY_STRUCT_YY_BUFFER_STATE
261 #define YY_STRUCT_YY_BUFFER_STATE
262 struct yy_buffer_state
271 char *yy_ch_buf
; /* input buffer */
272 char *yy_buf_pos
; /* current position in input buffer */
274 /* Size of input buffer in bytes, not including room for EOB
277 yy_size_t yy_buf_size
;
279 /* Number of characters read into yy_ch_buf, not including EOB
284 /* Whether we "own" the buffer - i.e., we know we created it,
285 * and can realloc() it to grow it, and should free() it to
288 int yy_is_our_buffer
;
290 /* Whether this is an "interactive" input source; if so, and
291 * if we're using stdio for input, then we want to use getc()
292 * instead of fread(), to make sure we stop fetching input after
295 int yy_is_interactive
;
297 /* Whether we're considered to be at the beginning of a line.
298 * If so, '^' rules will be active on the next match, otherwise
303 int yy_bs_lineno
; /**< The line count. */
304 int yy_bs_column
; /**< The column count. */
306 /* Whether to try to fill the input buffer when we reach the
311 int yy_buffer_status
;
313 #define YY_BUFFER_NEW 0
314 #define YY_BUFFER_NORMAL 1
315 /* When an EOF's been seen but there's still some text to process
316 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
317 * shouldn't try reading from the input source any more. We might
318 * still have a bunch of tokens to match, though, because of
319 * possible backing-up.
321 * When we actually see the EOF, we change the status to "new"
322 * (via yyrestart()), so that the user can continue scanning by
323 * just pointing yyin at a new input file.
325 #define YY_BUFFER_EOF_PENDING 2
328 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
330 /* %if-c-only Standard (non-C++) definition */
331 /* %not-for-header */
333 /* %if-not-reentrant */
339 /* We provide macros for accessing buffer states in case in the
340 * future we want to put the buffer states in a more general
343 * Returns the top of the stack, or NULL.
345 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
346 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
349 /* Same as previous macro, but useful when we know that the buffer stack is not
350 * NULL or when we need an lvalue. For internal use only.
352 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
354 /* %if-c-only Standard (non-C++) definition */
356 /* %if-not-reentrant */
357 /* %not-for-header */
363 void yyrestart (FILE *input_file
,yyscan_t yyscanner
);
364 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
365 YY_BUFFER_STATE
yy_create_buffer (FILE *file
,int size
,yyscan_t yyscanner
);
366 void yy_delete_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
367 void yy_flush_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
368 void yypush_buffer_state (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
369 void yypop_buffer_state (yyscan_t yyscanner
);
371 static void yyensure_buffer_stack (yyscan_t yyscanner
);
372 static void yy_load_buffer_state (yyscan_t yyscanner
);
373 static void yy_init_buffer (YY_BUFFER_STATE b
,FILE *file
,yyscan_t yyscanner
);
375 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
377 YY_BUFFER_STATE
yy_scan_buffer (char *base
,yy_size_t size
,yyscan_t yyscanner
);
378 YY_BUFFER_STATE
yy_scan_string (yyconst
char *yy_str
,yyscan_t yyscanner
);
379 YY_BUFFER_STATE
yy_scan_bytes (yyconst
char *bytes
,int len
,yyscan_t yyscanner
);
383 void *yyalloc (yy_size_t
,yyscan_t yyscanner
);
384 void *yyrealloc (void *,yy_size_t
,yyscan_t yyscanner
);
385 void yyfree (void * ,yyscan_t yyscanner
);
387 #define yy_new_buffer yy_create_buffer
389 #define yy_set_interactive(is_interactive) \
391 if ( ! YY_CURRENT_BUFFER ){ \
392 yyensure_buffer_stack (yyscanner); \
393 YY_CURRENT_BUFFER_LVALUE = \
394 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
396 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
399 #define yy_set_bol(at_bol) \
401 if ( ! YY_CURRENT_BUFFER ){\
402 yyensure_buffer_stack (yyscanner); \
403 YY_CURRENT_BUFFER_LVALUE = \
404 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
406 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
409 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
411 /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
412 /* Begin user sect3 */
415 #define YY_SKIP_YYWRAP
419 typedef unsigned char YY_CHAR
;
421 typedef int yy_state_type
;
423 #define yytext_ptr yytext_r
425 /* %if-c-only Standard (non-C++) definition */
427 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
);
428 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
,yyscan_t yyscanner
);
429 static int yy_get_next_buffer (yyscan_t yyscanner
);
430 static void yy_fatal_error (yyconst
char msg
[] ,yyscan_t yyscanner
);
434 /* Done after the current pattern has been matched and before the
435 * corresponding action - sets up yytext.
437 #define YY_DO_BEFORE_ACTION \
438 yyg->yytext_ptr = yy_bp; \
439 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
440 yyleng = (size_t) (yy_cp - yy_bp); \
441 yyg->yy_hold_char = *yy_cp; \
443 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
444 yyg->yy_c_buf_p = yy_cp;
446 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
447 #define YY_NUM_RULES 119
448 #define YY_END_OF_BUFFER 120
449 /* This struct is not used in this scanner,
450 but its presence is necessary. */
453 flex_int32_t yy_verify
;
456 static yyconst flex_int16_t yy_accept
[400] =
458 0, 0, 120, 118, 1, 3, 1, 24, 118, 118,
459 118, 21, 118, 118, 27, 28, 22, 20, 29, 26,
460 35, 23, 114, 114, 118, 37, 14, 36, 15, 112,
461 30, 31, 112, 112, 112, 112, 112, 112, 118, 25,
462 33, 3, 3, 11, 0, 106, 0, 0, 2, 0,
463 0, 0, 0, 42, 17, 45, 0, 0, 41, 0,
464 114, 38, 39, 34, 113, 48, 0, 0, 0, 0,
465 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
466 16, 40, 113, 0, 0, 0, 0, 0, 0, 0,
467 0, 0, 0, 0, 0, 0, 0, 0, 8, 12,
469 10, 9, 13, 7, 112, 111, 112, 49, 112, 112,
470 112, 112, 112, 44, 18, 47, 19, 32, 110, 109,
471 107, 108, 43, 0, 0, 0, 0, 0, 0, 0,
472 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
473 0, 0, 0, 46, 113, 116, 0, 113, 117, 115,
474 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
475 0, 0, 0, 0, 0, 0, 6, 5, 112, 53,
476 112, 54, 55, 112, 112, 0, 113, 62, 0, 0,
477 0, 59, 0, 0, 0, 65, 0, 0, 0, 0,
478 0, 0, 0, 0, 81, 0, 0, 0, 0, 0,
480 0, 0, 0, 93, 0, 0, 0, 0, 0, 0,
481 0, 0, 0, 0, 0, 4, 50, 52, 112, 112,
482 0, 0, 75, 0, 0, 0, 0, 0, 0, 0,
483 0, 0, 0, 0, 0, 0, 0, 0, 86, 104,
484 0, 87, 0, 0, 0, 88, 91, 0, 0, 0,
485 0, 0, 0, 0, 0, 0, 0, 112, 112, 0,
486 0, 58, 0, 0, 0, 0, 0, 0, 0, 67,
487 0, 0, 0, 71, 0, 0, 0, 0, 0, 82,
488 0, 0, 0, 97, 0, 96, 103, 0, 0, 94,
489 0, 0, 0, 0, 56, 51, 0, 0, 0, 0,
491 0, 0, 0, 0, 0, 0, 0, 0, 80, 0,
492 0, 0, 0, 0, 0, 0, 92, 0, 0, 0,
493 102, 0, 95, 63, 0, 0, 0, 0, 0, 0,
494 0, 0, 0, 66, 0, 0, 0, 57, 0, 0,
495 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
496 0, 76, 0, 0, 0, 0, 64, 0, 0, 70,
497 0, 0, 85, 0, 0, 105, 101, 100, 89, 0,
498 0, 0, 0, 0, 78, 0, 0, 68, 69, 0,
499 84, 90, 0, 0, 72, 0, 0, 77, 79, 0,
500 83, 98, 99, 0, 74, 60, 61, 73, 0
504 static yyconst flex_int32_t yy_ec
[256] =
506 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
507 1, 4, 5, 1, 1, 1, 1, 1, 1, 1,
508 1, 1, 1, 1, 1, 4, 1, 1, 1, 1,
509 1, 2, 6, 7, 8, 9, 10, 11, 12, 13,
510 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
511 23, 23, 23, 23, 23, 24, 24, 25, 26, 27,
512 28, 29, 1, 30, 31, 32, 31, 31, 33, 31,
513 30, 34, 35, 30, 30, 36, 30, 37, 38, 39,
514 30, 30, 40, 30, 30, 30, 30, 41, 30, 30,
515 42, 43, 44, 1, 45, 1, 46, 47, 48, 49,
517 50, 51, 52, 53, 54, 30, 30, 55, 56, 57,
518 58, 59, 60, 61, 62, 63, 64, 65, 30, 66,
519 67, 30, 1, 68, 1, 69, 1, 1, 1, 1,
520 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
521 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
522 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
523 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
524 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
525 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
526 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
528 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
529 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
530 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
531 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
532 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
536 static yyconst flex_int32_t yy_meta
[70] =
538 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
539 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
540 3, 3, 3, 3, 4, 1, 1, 1, 1, 4,
541 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,
542 4, 1, 1, 1, 4, 3, 3, 3, 3, 3,
543 3, 4, 4, 4, 4, 4, 4, 4, 4, 4,
544 4, 4, 4, 4, 4, 4, 4, 1, 1
547 static yyconst flex_int16_t yy_base
[405] =
549 0, 0, 596, 597, 576, 68, 69, 566, 67, 590,
550 40, 564, 65, 579, 597, 597, 63, 62, 597, 73,
551 109, 78, 158, 96, 179, 597, 72, 74, 76, 565,
552 597, 597, 64, 83, 57, 82, 62, 84, 84, 98,
553 140, 145, 181, 597, 117, 597, 0, 586, 597, 171,
554 179, 188, 196, 597, 597, 597, 576, 559, 597, 205,
555 226, 597, 597, 597, 230, 597, 550, 535, 70, 527,
556 99, 526, 77, 532, 105, 535, 530, 105, 533, 524,
557 549, 597, 234, 152, 248, 166, 0, 519, 520, 141,
558 156, 196, 528, 209, 515, 517, 514, 507, 597, 597,
560 597, 597, 597, 193, 544, 597, 150, 543, 160, 206,
561 114, 179, 240, 597, 597, 597, 597, 597, 264, 268,
562 275, 279, 597, 288, 531, 514, 510, 507, 514, 499,
563 503, 495, 493, 229, 495, 501, 502, 494, 491, 490,
564 505, 497, 500, 597, 292, 257, 296, 300, 260, 0,
565 491, 502, 491, 272, 480, 499, 490, 480, 487, 485,
566 477, 476, 476, 473, 482, 489, 597, 506, 249, 508,
567 280, 507, 506, 153, 283, 306, 317, 485, 475, 473,
568 465, 481, 480, 477, 465, 597, 473, 475, 467, 469,
569 473, 471, 452, 470, 597, 459, 458, 455, 448, 460,
571 446, 445, 449, 452, 456, 447, 450, 439, 451, 291,
572 450, 436, 437, 437, 449, 597, 470, 469, 306, 307,
573 437, 435, 597, 428, 295, 429, 443, 440, 432, 431,
574 440, 422, 435, 426, 420, 298, 432, 430, 597, 597,
575 429, 597, 431, 428, 426, 597, 597, 416, 419, 423,
576 420, 412, 408, 420, 408, 402, 410, 321, 322, 418,
577 418, 597, 416, 411, 406, 409, 403, 411, 402, 597,
578 407, 395, 407, 597, 395, 390, 400, 395, 402, 597,
579 393, 389, 399, 597, 395, 597, 597, 388, 385, 597,
580 383, 373, 389, 388, 412, 411, 376, 300, 379, 370,
582 382, 369, 382, 372, 381, 381, 380, 370, 597, 372,
583 360, 372, 366, 374, 371, 361, 597, 371, 370, 359,
584 597, 369, 597, 597, 367, 362, 357, 355, 345, 353,
585 343, 348, 342, 597, 349, 355, 347, 597, 337, 345,
586 344, 331, 336, 320, 330, 326, 321, 318, 323, 314,
587 326, 597, 314, 325, 317, 314, 597, 315, 318, 597,
588 305, 315, 597, 310, 300, 597, 597, 597, 597, 307,
589 300, 290, 298, 295, 597, 288, 288, 597, 597, 292,
590 597, 597, 243, 241, 597, 178, 183, 597, 153, 95,
591 597, 597, 597, 79, 597, 597, 597, 597, 597, 384,
596 static yyconst flex_int16_t yy_def
[405] =
598 399, 1, 399, 399, 399, 399, 399, 399, 400, 401,
599 399, 399, 399, 402, 399, 399, 399, 399, 399, 399,
600 399, 399, 399, 399, 399, 399, 399, 399, 399, 403,
601 399, 399, 403, 403, 403, 403, 403, 403, 399, 399,
602 399, 399, 399, 399, 400, 399, 400, 401, 399, 399,
603 399, 399, 399, 399, 399, 399, 402, 399, 399, 399,
604 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
605 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
606 399, 399, 399, 399, 399, 399, 404, 399, 399, 399,
607 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
609 399, 399, 399, 399, 403, 399, 403, 403, 403, 403,
610 403, 403, 403, 399, 399, 399, 399, 399, 399, 399,
611 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
612 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
613 399, 399, 399, 399, 399, 399, 399, 399, 399, 404,
614 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
615 399, 399, 399, 399, 399, 399, 399, 399, 403, 403,
616 403, 403, 403, 403, 403, 399, 399, 399, 399, 399,
617 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
618 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
620 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
621 399, 399, 399, 399, 399, 399, 403, 403, 403, 403,
622 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
623 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
624 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
625 399, 399, 399, 399, 399, 399, 399, 403, 403, 399,
626 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
627 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
628 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
629 399, 399, 399, 399, 403, 403, 399, 399, 399, 399,
631 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
632 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
633 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
634 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
635 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
636 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
637 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
638 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
639 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
640 399, 399, 399, 399, 399, 399, 399, 399, 0, 399,
645 static yyconst flex_int16_t yy_nxt
[667] =
647 4, 5, 6, 5, 7, 8, 9, 10, 11, 12,
648 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
649 23, 24, 24, 24, 25, 26, 27, 28, 29, 30,
650 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
651 30, 31, 4, 32, 30, 30, 30, 30, 30, 30,
652 30, 33, 30, 34, 30, 30, 35, 30, 36, 30,
653 30, 37, 30, 38, 30, 30, 30, 39, 40, 42,
654 42, 43, 42, 46, 50, 55, 51, 58, 52, 53,
655 60, 106, 61, 61, 61, 61, 106, 41, 106, 62,
656 59, 60, 56, 61, 61, 61, 61, 81, 99, 100,
658 63, 101, 102, 103, 104, 82, 106, 106, 106, 47,
659 64, 114, 64, 64, 83, 127, 61, 61, 61, 61,
660 110, 107, 150, 46, 112, 116, 133, 128, 85, 65,
661 65, 65, 65, 108, 134, 398, 66, 111, 106, 109,
662 113, 118, 67, 118, 118, 85, 42, 42, 130, 42,
663 136, 115, 137, 131, 140, 68, 69, 397, 70, 47,
664 71, 173, 72, 73, 74, 75, 117, 76, 141, 77,
665 78, 79, 146, 146, 106, 80, 83, 106, 61, 61,
666 61, 61, 42, 42, 106, 42, 149, 149, 149, 84,
667 85, 119, 119, 119, 119, 86, 153, 154, 87, 120,
669 120, 120, 120, 106, 84, 155, 219, 85, 121, 121,
670 121, 121, 169, 156, 396, 86, 122, 122, 122, 122,
671 167, 168, 170, 87, 88, 65, 65, 65, 65, 89,
672 106, 395, 90, 91, 92, 93, 94, 95, 394, 174,
673 96, 157, 97, 98, 83, 158, 61, 61, 61, 61,
674 65, 65, 65, 65, 145, 145, 145, 145, 85, 159,
675 171, 172, 124, 147, 106, 147, 124, 161, 148, 148,
676 148, 148, 162, 106, 187, 85, 188, 146, 146, 124,
677 149, 149, 149, 124, 119, 119, 119, 119, 120, 120,
678 120, 120, 393, 392, 175, 121, 121, 121, 121, 122,
680 122, 122, 122, 176, 106, 176, 217, 106, 177, 177,
681 177, 177, 145, 145, 145, 145, 148, 148, 148, 148,
682 148, 148, 148, 148, 124, 201, 177, 177, 177, 177,
683 106, 106, 220, 202, 218, 251, 203, 177, 177, 177,
684 177, 124, 263, 276, 252, 106, 106, 325, 391, 390,
685 389, 388, 387, 386, 385, 264, 384, 383, 277, 382,
686 326, 265, 258, 381, 278, 380, 327, 379, 259, 378,
687 377, 376, 295, 375, 374, 373, 372, 371, 370, 369,
688 368, 367, 366, 296, 45, 365, 45, 45, 48, 48,
689 48, 48, 57, 364, 57, 57, 105, 105, 363, 362,
691 361, 360, 359, 358, 357, 356, 355, 354, 353, 352,
692 351, 350, 349, 348, 347, 346, 345, 344, 343, 342,
693 341, 340, 339, 338, 337, 336, 335, 334, 333, 332,
694 331, 330, 329, 328, 324, 106, 106, 323, 322, 321,
695 320, 319, 318, 317, 316, 315, 314, 313, 312, 311,
696 310, 309, 308, 307, 306, 305, 304, 303, 302, 301,
697 300, 299, 298, 297, 294, 293, 292, 291, 290, 289,
698 288, 287, 286, 285, 284, 283, 282, 281, 280, 279,
699 275, 274, 273, 272, 271, 270, 269, 268, 267, 266,
700 262, 261, 260, 106, 106, 257, 256, 255, 254, 253,
702 250, 249, 248, 247, 246, 245, 244, 243, 242, 241,
703 240, 239, 238, 237, 236, 235, 234, 233, 232, 231,
704 230, 229, 228, 227, 226, 225, 224, 223, 222, 221,
705 106, 106, 106, 216, 215, 214, 213, 212, 211, 210,
706 209, 208, 207, 206, 205, 204, 200, 199, 198, 197,
707 196, 195, 194, 193, 192, 191, 190, 189, 186, 185,
708 184, 183, 182, 181, 180, 179, 178, 106, 106, 166,
709 165, 164, 163, 160, 152, 151, 144, 143, 142, 139,
710 138, 135, 132, 129, 126, 125, 123, 46, 49, 106,
711 46, 54, 49, 44, 41, 399, 3, 399, 399, 399,
713 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
714 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
715 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
716 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
717 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
718 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
719 399, 399, 399, 399, 399, 399
722 static yyconst flex_int16_t yy_chk
[667] =
724 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
725 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
726 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
727 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
728 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
729 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
730 1, 1, 1, 1, 1, 1, 1, 1, 1, 6,
731 6, 7, 6, 9, 11, 13, 11, 17, 11, 11,
732 18, 35, 18, 18, 18, 18, 37, 7, 33, 18,
733 17, 20, 13, 20, 20, 20, 20, 22, 27, 27,
735 20, 28, 28, 29, 29, 22, 36, 34, 38, 9,
736 21, 39, 21, 21, 24, 69, 24, 24, 24, 24,
737 35, 33, 404, 45, 37, 40, 73, 69, 24, 21,
738 21, 21, 21, 34, 73, 394, 21, 36, 111, 34,
739 38, 41, 21, 41, 41, 24, 42, 42, 71, 42,
740 75, 39, 75, 71, 78, 21, 21, 390, 21, 45,
741 21, 111, 21, 21, 21, 21, 40, 21, 78, 21,
742 21, 21, 84, 84, 107, 21, 23, 174, 23, 23,
743 23, 23, 43, 43, 109, 43, 86, 86, 86, 23,
744 23, 50, 50, 50, 50, 23, 90, 90, 23, 51,
746 51, 51, 51, 112, 23, 91, 174, 23, 52, 52,
747 52, 52, 107, 91, 389, 23, 53, 53, 53, 53,
748 104, 104, 109, 23, 25, 60, 60, 60, 60, 25,
749 110, 387, 25, 25, 25, 25, 25, 25, 386, 112,
750 25, 92, 25, 25, 61, 92, 61, 61, 61, 61,
751 65, 65, 65, 65, 83, 83, 83, 83, 61, 92,
752 110, 110, 65, 85, 113, 85, 83, 94, 85, 85,
753 85, 85, 94, 169, 134, 61, 134, 146, 146, 65,
754 149, 149, 149, 83, 119, 119, 119, 119, 120, 120,
755 120, 120, 384, 383, 113, 121, 121, 121, 121, 122,
757 122, 122, 122, 124, 171, 124, 169, 175, 124, 124,
758 124, 124, 145, 145, 145, 145, 147, 147, 147, 147,
759 148, 148, 148, 148, 145, 154, 176, 176, 176, 176,
760 219, 220, 175, 154, 171, 210, 154, 177, 177, 177,
761 177, 145, 225, 236, 210, 258, 259, 298, 380, 377,
762 376, 374, 373, 372, 371, 225, 370, 365, 236, 364,
763 298, 225, 219, 362, 236, 361, 298, 359, 220, 358,
764 356, 355, 258, 354, 353, 351, 350, 349, 348, 347,
765 346, 345, 344, 259, 400, 343, 400, 400, 401, 401,
766 401, 401, 402, 342, 402, 402, 403, 403, 341, 340,
768 339, 337, 336, 335, 333, 332, 331, 330, 329, 328,
769 327, 326, 325, 322, 320, 319, 318, 316, 315, 314,
770 313, 312, 311, 310, 308, 307, 306, 305, 304, 303,
771 302, 301, 300, 299, 297, 296, 295, 294, 293, 292,
772 291, 289, 288, 285, 283, 282, 281, 279, 278, 277,
773 276, 275, 273, 272, 271, 269, 268, 267, 266, 265,
774 264, 263, 261, 260, 257, 256, 255, 254, 253, 252,
775 251, 250, 249, 248, 245, 244, 243, 241, 238, 237,
776 235, 234, 233, 232, 231, 230, 229, 228, 227, 226,
777 224, 222, 221, 218, 217, 215, 214, 213, 212, 211,
779 209, 208, 207, 206, 205, 204, 203, 202, 201, 200,
780 199, 198, 197, 196, 194, 193, 192, 191, 190, 189,
781 188, 187, 185, 184, 183, 182, 181, 180, 179, 178,
782 173, 172, 170, 168, 166, 165, 164, 163, 162, 161,
783 160, 159, 158, 157, 156, 155, 153, 152, 151, 143,
784 142, 141, 140, 139, 138, 137, 136, 135, 133, 132,
785 131, 130, 129, 128, 127, 126, 125, 108, 105, 98,
786 97, 96, 95, 93, 89, 88, 81, 80, 79, 77,
787 76, 74, 72, 70, 68, 67, 58, 57, 48, 30,
788 14, 12, 10, 8, 5, 3, 399, 399, 399, 399,
790 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
791 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
792 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
793 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
794 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
795 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
796 399, 399, 399, 399, 399, 399
799 /* Table of booleans, true if rule could match eol. */
800 static yyconst flex_int32_t yy_rule_can_match_eol
[120] =
802 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
803 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
804 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
805 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
806 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
807 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
810 static yyconst flex_int16_t yy_rule_linenum
[119] =
812 140, 142, 144, 148, 149, 150, 151, 152, 153, 154,
813 155, 156, 157, 158, 159, 161, 162, 163, 164, 166,
814 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
815 177, 179, 183, 189, 195, 202, 203, 205, 206, 207,
816 208, 209, 210, 211, 212, 213, 214, 215, 217, 218,
817 219, 220, 222, 223, 224, 225, 227, 228, 229, 231,
818 232, 233, 234, 235, 236, 237, 238, 240, 241, 242,
819 243, 244, 245, 246, 247, 248, 249, 250, 251, 252,
820 253, 254, 255, 256, 257, 259, 260, 261, 262, 263,
821 264, 265, 266, 267, 268, 269, 270, 271, 273, 274,
823 275, 276, 277, 278, 279, 282, 287, 288, 289, 290,
824 292, 297, 302, 303, 304, 305, 306, 309
827 /* The intent behind this definition is that it'll catch
828 * any uses of REJECT which flex missed.
830 #define REJECT reject_used_but_not_detected
831 #define yymore() yymore_used_but_not_detected
832 #define YY_MORE_ADJ 0
833 #define YY_RESTORE_YY_MORE_OFFSET
839 * Copyright (C) 2007-2008, The Perl Foundation.
846 pir.l - implementation of the lexical analyzer of the PIR assembly language.
850 This file implements the lexical analyzer of the PIR assembly language.
852 The current approach is to create a three-pass compiler, but if any optimizations
853 in this schedule can be made, then this is preferred. This needs more experimentation.
855 The first pass is the heredoc pre-processor, which converts all heredoc strings into
856 normal strings (they are "flattened). Furthermore, this phase strips all comments, both
857 POD and line comments.
859 The second pass is the macro pre-processor, which handles the C<.macro>, C<.macro_const>
860 and C<.include> directives. The resulting output is the file that can be fed into the
863 The third pass is then the PIR parsing phase. It takes the output of the macro pre-processor,
864 which contains no heredoc strings and macros. For that reason, the PIR lexer is very
865 simple and straightforward.
867 Each of the phases can be easily implemented. When they must be combined, the complexity
868 grows quickly. Therefore, this approach, which is probably not the most efficient, is
869 easier to maintain, and preferable.
880 #include "pirparser.h"
881 #include "pircompiler.h"
886 /* define the type of the extra field in the yyscan_t object that is passed around;
887 * this is the lexer_state structure, defined in "pircompiler.h"
889 #define YY_EXTRA_TYPE struct lexer_state *
891 /* accessor methods for setting and getting the lexer_state */
892 extern YY_EXTRA_TYPE
yyget_extra(yyscan_t scanner
);
893 extern void yyset_extra(YY_EXTRA_TYPE lexer
,yyscan_t scanner
);
898 /* Windows doesn't have <unistd.h> */
899 #ifndef YY_NO_UNISTD_H
900 # define YY_NO_UNISTD_H
903 /* keep MSVC happy */
908 /* keep MSVC happy */
909 #ifndef YY_ALWAYS_INTERACTIVE
910 # define YY_ALWAYS_INTERACTIVE 0
914 /* make sure yytext is a pointer */
915 /* slightly more efficient when this option is set; our parser is not interactive anyway. */
916 /* define output file */
917 /* use flex' built-in capability for line counting */
918 /* make the scanner re-entrant */
919 /* needed for bison interaction. */
920 /* make yywrap() always return true. */
921 /* always show warnings if something's wrong with our spec. */
922 /* create a scanner in debug mode; XXX remove this in production build. */
923 #line 924 "pirlexer.c"
927 #ifndef YY_NO_UNISTD_H
928 /* Special case for "unistd.h", since it is non-ANSI. We include it way
929 * down here because we want the user's section 1 to have been scanned first.
930 * The user has a chance to override it with an option.
939 #ifndef YY_EXTRA_TYPE
940 #define YY_EXTRA_TYPE void *
943 /* %if-c-only Reentrant structure and macros (non-C++). */
946 /* Holds the entire state of the reentrant scanner. */
950 /* User-defined. Not touched by flex. */
951 YY_EXTRA_TYPE yyextra_r
;
953 /* The rest are the same as the globals declared in the non-reentrant scanner. */
954 FILE *yyin_r
, *yyout_r
;
955 size_t yy_buffer_stack_top
; /**< index of top of stack. */
956 size_t yy_buffer_stack_max
; /**< capacity of stack. */
957 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
964 int yy_did_buffer_switch_on_eof
;
965 int yy_start_stack_ptr
;
966 int yy_start_stack_depth
;
968 yy_state_type yy_last_accepting_state
;
969 char* yy_last_accepting_cpos
;
980 }; /* end struct yyguts_t */
984 static int yy_init_globals (yyscan_t yyscanner
);
990 /* This must go here because YYSTYPE and YYLTYPE are included
991 * from bison output in section 1.*/
992 # define yylval yyg->yylval_r
996 /* Accessor methods to globals.
997 These are made visible to non-reentrant scanners for convenience. */
999 int yylex_destroy (yyscan_t yyscanner
);
1001 int yyget_debug (yyscan_t yyscanner
);
1003 void yyset_debug (int debug_flag
,yyscan_t yyscanner
);
1005 YY_EXTRA_TYPE
yyget_extra (yyscan_t yyscanner
);
1007 void yyset_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
1009 FILE *yyget_in (yyscan_t yyscanner
);
1011 void yyset_in (FILE * in_str
,yyscan_t yyscanner
);
1013 FILE *yyget_out (yyscan_t yyscanner
);
1015 void yyset_out (FILE * out_str
,yyscan_t yyscanner
);
1017 int yyget_leng (yyscan_t yyscanner
);
1019 char *yyget_text (yyscan_t yyscanner
);
1021 int yyget_lineno (yyscan_t yyscanner
);
1023 void yyset_lineno (int line_number
,yyscan_t yyscanner
);
1025 /* %if-bison-bridge */
1027 YYSTYPE
* yyget_lval (yyscan_t yyscanner
);
1029 void yyset_lval (YYSTYPE
* yylval_param
,yyscan_t yyscanner
);
1032 /* %endif End reentrant structures and macros. */
1034 /* Macros after this point can all be overridden by user definitions in
1038 #ifndef YY_SKIP_YYWRAP
1040 extern "C" int yywrap (yyscan_t yyscanner
);
1042 extern int yywrap (yyscan_t yyscanner
);
1046 /* %not-for-header */
1048 /* %ok-for-header */
1053 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
1056 #ifdef YY_NEED_STRLEN
1057 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
1061 /* %if-c-only Standard (non-C++) definition */
1062 /* %not-for-header */
1065 static int yyinput (yyscan_t yyscanner
);
1067 static int input (yyscan_t yyscanner
);
1069 /* %ok-for-header */
1078 /* Amount of stuff to slurp up with each read. */
1079 #ifndef YY_READ_BUF_SIZE
1080 #define YY_READ_BUF_SIZE 8192
1083 /* Copy whatever the last rule matched to the standard output. */
1085 /* %if-c-only Standard (non-C++) definition */
1086 /* This used to be an fputs(), but since the string might contain NUL's,
1087 * we now use fwrite().
1089 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1091 /* %if-c++-only C++ definition */
1095 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1096 * is returned in "result".
1099 #define YY_INPUT(buf,result,max_size) \
1100 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1101 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1105 for ( n = 0; n < max_size && \
1106 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1107 buf[n] = (char) c; \
1109 buf[n++] = (char) c; \
1110 if ( c == EOF && ferror( yyin ) ) \
1111 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1117 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1119 if( errno != EINTR) \
1121 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1129 /* %if-c++-only C++ definition \ */\
1134 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1135 * we don't want an extra ';' after the "return" because that will cause
1136 * some compilers to complain about unreachable statements.
1139 #define yyterminate() return YY_NULL
1142 /* Number of entries by which start-condition stack grows. */
1143 #ifndef YY_START_STACK_INCR
1144 #define YY_START_STACK_INCR 25
1147 /* Report a fatal error. */
1148 #ifndef YY_FATAL_ERROR
1150 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1156 /* %if-tables-serialization structures and prototypes */
1157 /* %not-for-header */
1159 /* %ok-for-header */
1161 /* %not-for-header */
1163 /* %tables-yydmap generated elements */
1165 /* end tables serialization structures and prototypes */
1167 /* %ok-for-header */
1169 /* Default declaration of generated scanner - a define so the user can
1170 * easily add parameters.
1173 #define YY_DECL_IS_OURS 1
1174 /* %if-c-only Standard (non-C++) definition */
1176 extern int yylex (YYSTYPE
* yylval_param
,yyscan_t yyscanner
);
1178 #define YY_DECL int yylex (YYSTYPE * yylval_param , yyscan_t yyscanner)
1180 /* %if-c++-only C++ definition */
1182 #endif /* !YY_DECL */
1184 /* Code executed at the beginning of each rule, after yytext and yyleng
1187 #ifndef YY_USER_ACTION
1188 #define YY_USER_ACTION
1191 /* Code executed at the end of each rule. */
1193 #define YY_BREAK break;
1196 /* %% [6.0] YY_RULE_SETUP definition goes here */
1197 #define YY_RULE_SETUP \
1200 /* %not-for-header */
1202 /** The main scanner function which does all the work.
1206 register yy_state_type yy_current_state
;
1207 register char *yy_cp
, *yy_bp
;
1208 register int yy_act
;
1209 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1211 /* %% [7.0] user's declarations go here */
1216 #line 1217 "pirlexer.c"
1218 yylval
= yylval_param
;
1220 if ( !yyg
->yy_init
)
1228 if ( ! yyg
->yy_start
)
1229 yyg
->yy_start
= 1; /* first start state */
1245 if ( ! YY_CURRENT_BUFFER
) {
1246 yyensure_buffer_stack (yyscanner
);
1247 YY_CURRENT_BUFFER_LVALUE
=
1248 yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1251 yy_load_buffer_state(yyscanner
);
1254 while ( 1 ) /* loops until end-of-file is reached */
1256 /* %% [8.0] yymore()-related code goes here */
1257 yy_cp
= yyg
->yy_c_buf_p
;
1259 /* Support of yytext. */
1260 *yy_cp
= yyg
->yy_hold_char
;
1262 /* yy_bp points to the position in yy_ch_buf of the start of
1267 /* %% [9.0] code to set up and find next match goes here */
1268 yy_current_state
= yyg
->yy_start
;
1272 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1273 if ( yy_accept
[yy_current_state
] )
1275 yyg
->yy_last_accepting_state
= yy_current_state
;
1276 yyg
->yy_last_accepting_cpos
= yy_cp
;
1278 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1280 yy_current_state
= (int) yy_def
[yy_current_state
];
1281 if ( yy_current_state
>= 400 )
1282 yy_c
= yy_meta
[(unsigned int) yy_c
];
1284 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1287 while ( yy_current_state
!= 399 );
1288 yy_cp
= yyg
->yy_last_accepting_cpos
;
1289 yy_current_state
= yyg
->yy_last_accepting_state
;
1292 /* %% [10.0] code to find the action number goes here */
1293 yy_act
= yy_accept
[yy_current_state
];
1295 YY_DO_BEFORE_ACTION
;
1297 /* %% [11.0] code for yylineno update goes here */
1299 if ( yy_act
!= YY_END_OF_BUFFER
&& yy_rule_can_match_eol
[yy_act
] )
1302 for ( yyl
= 0; yyl
< yyleng
; ++yyl
)
1303 if ( yytext
[yyl
] == '\n' )
1311 do_action
: /* This label is used only to access EOF actions. */
1313 /* %% [12.0] debug code goes here */
1314 if ( yy_flex_debug
)
1317 fprintf( stderr
, "--scanner backing up\n" );
1318 else if ( yy_act
< 119 )
1319 fprintf( stderr
, "--accepting rule at line %ld (\"%s\")\n",
1320 (long)yy_rule_linenum
[yy_act
], yytext
);
1321 else if ( yy_act
== 119 )
1322 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1324 else if ( yy_act
== 120 )
1325 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1327 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1331 { /* beginning of action switch */
1332 /* %% [13.0] actions go here */
1333 case 0: /* must back up */
1334 /* undo the effects of YY_DO_BEFORE_ACTION */
1335 *yy_cp
= yyg
->yy_hold_char
;
1336 yy_cp
= yyg
->yy_last_accepting_cpos
;
1337 yy_current_state
= yyg
->yy_last_accepting_state
;
1338 goto yy_find_action
;
1343 { /* ignore whitespace */ }
1346 /* rule 2 can match eol */
1349 { /* ignore line comments */ }
1352 /* rule 3 can match eol */
1355 { /* a set of continuous newlines yields a single newline token. */
1362 { return TK_ASSIGN_USHIFT
; }
1367 { return TK_USHIFT
; }
1372 { return TK_ASSIGN_RSHIFT
; }
1377 { return TK_RSHIFT
; }
1382 { return TK_LSHIFT
; }
1387 { return TK_ARROW
; }
1502 { /* if the dot is surrounded by whitespace, it's a concatenation operator */
1509 { /* $P0 .$P1 means error; either space on both side or none at all. */
1510 yyerror(yyscanner
, yyget_extra(yyscanner
),
1511 "ambiguous '.'; must be enclosed in space on both sides or none at all.");
1518 { /* $P0. $P1 means error; see {WS}"." */
1519 yyerror(yyscanner
, yyget_extra(yyscanner
),
1520 "ambiguous '.'; must be enclosed in space on both sides or none at all.");
1527 { /* at this point all dot-whitespace combinations have been covered;
1528 * so we can be sure that the dot does not have any surrounding
1529 * whitespace: that's the method-call dot, as in $P0.$P1().
1547 { return TK_ASSIGN_INC
; }
1552 { return TK_ASSIGN_DEC
; }
1557 { return TK_ASSIGN_DIV
; }
1562 { return TK_ASSIGN_MUL
; }
1567 { return TK_ASSIGN_MOD
; }
1572 { return TK_ASSIGN_POW
; }
1577 { return TK_ASSIGN_BOR
; }
1582 { return TK_ASSIGN_BAND
; }
1587 { return TK_ASSIGN_FDIV
; }
1592 { return TK_ASSIGN_BNOT
; }
1597 { return TK_ASSIGN_CONC
; }
1612 { return TK_UNLESS
; }
1637 { return TK_STRING
; }
1642 { return TK_SET_ARG
; }
1647 { return TK_CONST
; }
1657 { return TK_GET_RESULTS
; }
1662 { return TK_GLOBALCONST
; }
1672 { return TK_HLL_MAP
; }
1677 { return TK_INVOCANT
; }
1687 { return TK_LOADLIB
; }
1692 { return TK_LOCAL
; }
1697 { return TK_METH_CALL
; }
1702 { return TK_NAMESPACE
; }
1707 { return TK_NCI_CALL
; }
1712 { return TK_PARAM
; }
1717 { return TK_BEGIN_CALL
; }
1722 { return TK_BEGIN_RETURN
; }
1727 { return TK_BEGIN_YIELD
; }
1737 { return TK_END_CALL
; }
1742 { return TK_END_RETURN
; }
1747 { return TK_END_YIELD
; }
1752 { return TK_GET_RESULT
; }
1757 { return TK_RETURN
; }
1767 { return TK_YIELD
; }
1772 { return TK_SET_RETURN
; }
1777 { return TK_SET_YIELD
; }
1782 { return TK_TAILCALL
; }
1787 { return TK_FLAG_ANON
; }
1792 { return TK_FLAG_INIT
; }
1797 { return TK_FLAG_LOAD
; }
1802 { return TK_FLAG_POSTCOMP
; }
1807 { return TK_FLAG_IMMEDIATE
; }
1812 { return TK_FLAG_MAIN
; }
1817 { return TK_FLAG_METHOD
; }
1822 { return TK_FLAG_LEX
; }
1827 { return TK_FLAG_OUTER
; }
1832 { return TK_FLAG_VTABLE
; }
1837 { return TK_FLAG_MULTI
; }
1842 { return TK_FLAG_LEXID
; }
1847 { return TK_INSTANCEOF
; }
1852 { return TK_FLAG_UNIQUE_REG
; }
1857 { return TK_FLAG_OPTIONAL
; }
1862 { return TK_FLAG_OPT_FLAG
; }
1867 { return TK_FLAG_SLURPY
; }
1872 { return TK_FLAG_NAMED
; }
1877 { return TK_FLAG_FLAT
; }
1882 { return TK_FLAG_INVOCANT
; }
1887 { /* copy the string, remove the quotes. */
1888 yylval
->sval
= dupstrn(yyget_extra(yyscanner
), yytext
+ 1, yyleng
- 2);
1895 { yylval
->ival
= atoi(yytext
+ 2); return TK_PREG
; }
1900 { yylval
->ival
= atoi(yytext
+ 2); return TK_SREG
; }
1905 { yylval
->ival
= atoi(yytext
+ 2); return TK_NREG
; }
1910 { yylval
->ival
= atoi(yytext
+ 2); return TK_IREG
; }
1915 { /* make the label Id available in the parser. remove the ":" first. */
1916 yylval
->sval
= dupstrn(yyget_extra(yyscanner
), yytext
, yyleng
- 1);
1923 { /* identifier; can be a global (sub or const), local or parrot op */
1924 yylval
->sval
= dupstr(yyget_extra(yyscanner
), yytext
);
1931 { yylval
->dval
= atof(yytext
); return TK_NUMC
; }
1936 { yylval
->ival
= atoi(yytext
); return TK_INTC
; }
1941 { yylval
->ival
= atoi(yytext
); return TK_INTC
; }
1946 { yylval
->ival
= atoi(yytext
); return TK_INTC
; }
1951 { yylval
->ival
= atoi(yytext
); return TK_INTC
; }
1956 { /* any character not covered in the rules above is an error. */
1957 yyerror(yyscanner
, yyget_extra(yyscanner
), "unexpected character: '%c'", yytext
[0]);
1960 case YY_STATE_EOF(INITIAL
):
1962 { /* end of file, stop scanning. */
1971 #line 1972 "pirlexer.c"
1973 case YY_END_OF_BUFFER
:
1975 /* Amount of text matched not including the EOB char. */
1976 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
1978 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1979 *yy_cp
= yyg
->yy_hold_char
;
1980 YY_RESTORE_YY_MORE_OFFSET
1982 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1984 /* We're scanning a new file or input source. It's
1985 * possible that this happened because the user
1986 * just pointed yyin at a new source and called
1987 * yylex(). If so, then we have to assure
1988 * consistency between YY_CURRENT_BUFFER and our
1989 * globals. Here is the right place to do so, because
1990 * this is the first action (other than possibly a
1991 * back-up) that will match for the new input source.
1993 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1994 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
1995 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1998 /* Note that here we test for yy_c_buf_p "<=" to the position
1999 * of the first EOB in the buffer, since yy_c_buf_p will
2000 * already have been incremented past the NUL character
2001 * (since all states make transitions on EOB to the
2002 * end-of-buffer state). Contrast this with the test
2005 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
2006 { /* This was really a NUL. */
2007 yy_state_type yy_next_state
;
2009 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
2011 yy_current_state
= yy_get_previous_state( yyscanner
);
2013 /* Okay, we're now positioned to make the NUL
2014 * transition. We couldn't have
2015 * yy_get_previous_state() go ahead and do it
2016 * for us because it doesn't know how to deal
2017 * with the possibility of jamming (and we don't
2018 * want to build jamming into it because then it
2019 * will run more slowly).
2022 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
2024 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2026 if ( yy_next_state
)
2028 /* Consume the NUL. */
2029 yy_cp
= ++yyg
->yy_c_buf_p
;
2030 yy_current_state
= yy_next_state
;
2036 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
2037 yy_cp
= yyg
->yy_last_accepting_cpos
;
2038 yy_current_state
= yyg
->yy_last_accepting_state
;
2039 goto yy_find_action
;
2043 else switch ( yy_get_next_buffer( yyscanner
) )
2045 case EOB_ACT_END_OF_FILE
:
2047 yyg
->yy_did_buffer_switch_on_eof
= 0;
2049 if ( yywrap(yyscanner
) )
2051 /* Note: because we've taken care in
2052 * yy_get_next_buffer() to have set up
2053 * yytext, we can now set up
2054 * yy_c_buf_p so that if some total
2055 * hoser (like flex itself) wants to
2056 * call the scanner after we return the
2057 * YY_NULL, it'll still work - another
2058 * YY_NULL will get returned.
2060 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2062 yy_act
= YY_STATE_EOF(YY_START
);
2068 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
2074 case EOB_ACT_CONTINUE_SCAN
:
2076 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
2078 yy_current_state
= yy_get_previous_state( yyscanner
);
2080 yy_cp
= yyg
->yy_c_buf_p
;
2081 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2084 case EOB_ACT_LAST_MATCH
:
2086 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
2088 yy_current_state
= yy_get_previous_state( yyscanner
);
2090 yy_cp
= yyg
->yy_c_buf_p
;
2091 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
2092 goto yy_find_action
;
2099 "fatal flex scanner internal error--no action found" );
2100 } /* end of action switch */
2101 } /* end of scanning one token */
2102 } /* end of yylex */
2103 /* %ok-for-header */
2106 /* %not-for-header */
2108 /* %ok-for-header */
2112 /* yy_get_next_buffer - try to read in a new buffer
2114 * Returns a code representing an action:
2115 * EOB_ACT_LAST_MATCH -
2116 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2117 * EOB_ACT_END_OF_FILE - end of file
2120 static int yy_get_next_buffer (yyscan_t yyscanner
)
2125 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2126 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
2127 register char *source
= yyg
->yytext_ptr
;
2128 register int number_to_move
, i
;
2131 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
2133 "fatal flex scanner internal error--end of buffer missed" );
2135 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
2136 { /* Don't try to fill the buffer, so this is an EOF. */
2137 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
2139 /* We matched a single character, the EOB, so
2140 * treat this as a final EOF.
2142 return EOB_ACT_END_OF_FILE
;
2147 /* We matched some text prior to the EOB, first
2150 return EOB_ACT_LAST_MATCH
;
2154 /* Try to read more data. */
2156 /* First move last chars to start of buffer. */
2157 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
2159 for ( i
= 0; i
< number_to_move
; ++i
)
2160 *(dest
++) = *(source
++);
2162 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2163 /* don't do the read, it's not guaranteed to return an EOF,
2166 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
2171 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
2173 while ( num_to_read
<= 0 )
2174 { /* Not enough room in the buffer - grow it. */
2176 /* just a shorter name for the current buffer */
2177 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
2179 int yy_c_buf_p_offset
=
2180 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
2182 if ( b
->yy_is_our_buffer
)
2184 int new_size
= b
->yy_buf_size
* 2;
2186 if ( new_size
<= 0 )
2187 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2189 b
->yy_buf_size
*= 2;
2191 b
->yy_ch_buf
= (char *)
2192 /* Include room in for 2 EOB chars. */
2193 yyrealloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
2196 /* Can't grow it, we don't own it. */
2199 if ( ! b
->yy_ch_buf
)
2201 "fatal error - scanner input buffer overflow" );
2203 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2205 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
2210 if ( num_to_read
> YY_READ_BUF_SIZE
)
2211 num_to_read
= YY_READ_BUF_SIZE
;
2213 /* Read in more data. */
2214 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
2215 yyg
->yy_n_chars
, num_to_read
);
2217 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2220 if ( yyg
->yy_n_chars
== 0 )
2222 if ( number_to_move
== YY_MORE_ADJ
)
2224 ret_val
= EOB_ACT_END_OF_FILE
;
2225 yyrestart(yyin
,yyscanner
);
2230 ret_val
= EOB_ACT_LAST_MATCH
;
2231 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
2232 YY_BUFFER_EOF_PENDING
;
2237 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2239 yyg
->yy_n_chars
+= number_to_move
;
2240 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2241 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2243 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
2248 /* yy_get_previous_state - get the state just before the EOB char was reached */
2251 /* %not-for-header */
2253 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
2258 register yy_state_type yy_current_state
;
2259 register char *yy_cp
;
2260 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2262 /* %% [15.0] code to get the start state into yy_current_state goes here */
2263 yy_current_state
= yyg
->yy_start
;
2265 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
2267 /* %% [16.0] code to find the next state goes here */
2268 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2269 if ( yy_accept
[yy_current_state
] )
2271 yyg
->yy_last_accepting_state
= yy_current_state
;
2272 yyg
->yy_last_accepting_cpos
= yy_cp
;
2274 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2276 yy_current_state
= (int) yy_def
[yy_current_state
];
2277 if ( yy_current_state
>= 400 )
2278 yy_c
= yy_meta
[(unsigned int) yy_c
];
2280 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2283 return yy_current_state
;
2286 /* yy_try_NUL_trans - try to make a transition on the NUL character
2289 * next_state = yy_try_NUL_trans( current_state );
2292 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
2297 register int yy_is_jam
;
2298 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
2299 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
2300 register char *yy_cp
= yyg
->yy_c_buf_p
;
2302 register YY_CHAR yy_c
= 1;
2303 if ( yy_accept
[yy_current_state
] )
2305 yyg
->yy_last_accepting_state
= yy_current_state
;
2306 yyg
->yy_last_accepting_cpos
= yy_cp
;
2308 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2310 yy_current_state
= (int) yy_def
[yy_current_state
];
2311 if ( yy_current_state
>= 400 )
2312 yy_c
= yy_meta
[(unsigned int) yy_c
];
2314 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2315 yy_is_jam
= (yy_current_state
== 399);
2317 return yy_is_jam
? 0 : yy_current_state
;
2327 static int yyinput (yyscan_t yyscanner
)
2329 static int input (yyscan_t yyscanner
)
2337 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2339 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2341 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2343 /* yy_c_buf_p now points to the character we want to return.
2344 * If this occurs *before* the EOB characters, then it's a
2345 * valid NUL; if not, then we've hit the end of the buffer.
2347 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
2348 /* This was really a NUL. */
2349 *yyg
->yy_c_buf_p
= '\0';
2352 { /* need more input */
2353 int offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
2356 switch ( yy_get_next_buffer( yyscanner
) )
2358 case EOB_ACT_LAST_MATCH
:
2359 /* This happens because yy_g_n_b()
2360 * sees that we've accumulated a
2361 * token and flags that we need to
2362 * try matching the token before
2363 * proceeding. But for input(),
2364 * there's no matching to consider.
2365 * So convert the EOB_ACT_LAST_MATCH
2366 * to EOB_ACT_END_OF_FILE.
2369 /* Reset buffer status. */
2370 yyrestart(yyin
,yyscanner
);
2374 case EOB_ACT_END_OF_FILE
:
2376 if ( yywrap(yyscanner
) )
2379 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
2382 return yyinput(yyscanner
);
2384 return input(yyscanner
);
2388 case EOB_ACT_CONTINUE_SCAN
:
2389 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
2395 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
2396 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
2397 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
2399 /* %% [19.0] update BOL and yylineno */
2410 #endif /* ifndef YY_NO_INPUT */
2413 /** Immediately switch to a different input stream.
2414 * @param input_file A readable stream.
2415 * @param yyscanner The scanner object.
2416 * @note This function does not reset the start condition to @c INITIAL .
2419 void yyrestart (FILE * input_file
, yyscan_t yyscanner
)
2424 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2426 if ( ! YY_CURRENT_BUFFER
){
2427 yyensure_buffer_stack (yyscanner
);
2428 YY_CURRENT_BUFFER_LVALUE
=
2429 yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
2432 yy_init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
2433 yy_load_buffer_state(yyscanner
);
2436 /** Switch to a different input buffer.
2437 * @param new_buffer The new input buffer.
2438 * @param yyscanner The scanner object.
2441 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
2446 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2448 /* TODO. We should be able to replace this entire function body
2450 * yypop_buffer_state();
2451 * yypush_buffer_state(new_buffer);
2453 yyensure_buffer_stack (yyscanner
);
2454 if ( YY_CURRENT_BUFFER
== new_buffer
)
2457 if ( YY_CURRENT_BUFFER
)
2459 /* Flush out information for old buffer. */
2460 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2461 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
2462 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2465 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
2466 yy_load_buffer_state(yyscanner
);
2468 /* We don't actually know whether we did this switch during
2469 * EOF (yywrap()) processing, but the only time this flag
2470 * is looked at is after yywrap() is called, so it's safe
2471 * to go ahead and always set it.
2473 yyg
->yy_did_buffer_switch_on_eof
= 1;
2477 static void yy_load_buffer_state (yyscan_t yyscanner
)
2482 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2483 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
2484 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
2485 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
2486 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
2489 /** Allocate and initialize an input buffer state.
2490 * @param file A readable stream.
2491 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2492 * @param yyscanner The scanner object.
2493 * @return the allocated buffer state.
2496 YY_BUFFER_STATE
yy_create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
2503 b
= (YY_BUFFER_STATE
) yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
2505 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2507 b
->yy_buf_size
= size
;
2509 /* yy_ch_buf has to be 2 characters longer than the size given because
2510 * we need to put in 2 end-of-buffer characters.
2512 b
->yy_ch_buf
= (char *) yyalloc(b
->yy_buf_size
+ 2 ,yyscanner
);
2513 if ( ! b
->yy_ch_buf
)
2514 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2516 b
->yy_is_our_buffer
= 1;
2518 yy_init_buffer(b
,file
,yyscanner
);
2523 /** Destroy the buffer.
2524 * @param b a buffer created with yy_create_buffer()
2525 * @param yyscanner The scanner object.
2528 void yy_delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
2533 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2538 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
2539 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
2541 if ( b
->yy_is_our_buffer
)
2542 yyfree((void *) b
->yy_ch_buf
,yyscanner
);
2544 yyfree((void *) b
,yyscanner
);
2554 /* Initializes or reinitializes a buffer.
2555 * This function is sometimes called more than once on the same buffer,
2556 * such as during a yyrestart() or at EOF.
2559 static void yy_init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
2566 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2568 yy_flush_buffer(b
,yyscanner
);
2570 b
->yy_input_file
= file
;
2571 b
->yy_fill_buffer
= 1;
2573 /* If b is the current buffer, then yy_init_buffer was _probably_
2574 * called from yyrestart() or through yy_get_next_buffer.
2575 * In that case, we don't want to reset the lineno or column.
2577 if (b
!= YY_CURRENT_BUFFER
){
2578 b
->yy_bs_lineno
= 1;
2579 b
->yy_bs_column
= 0;
2584 b
->yy_is_interactive
= 0;
2592 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2593 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2594 * @param yyscanner The scanner object.
2597 void yy_flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
2602 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2608 /* We always need two end-of-buffer characters. The first causes
2609 * a transition to the end-of-buffer state. The second causes
2610 * a jam in that state.
2612 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2613 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2615 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2618 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2620 if ( b
== YY_CURRENT_BUFFER
)
2621 yy_load_buffer_state(yyscanner
);
2625 /** Pushes the new state onto the stack. The new state becomes
2626 * the current state. This function will allocate the stack
2628 * @param new_buffer The new state.
2629 * @param yyscanner The scanner object.
2632 void yypush_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
2637 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2638 if (new_buffer
== NULL
)
2641 yyensure_buffer_stack(yyscanner
);
2643 /* This block is copied from yy_switch_to_buffer. */
2644 if ( YY_CURRENT_BUFFER
)
2646 /* Flush out information for old buffer. */
2647 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
2648 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
2649 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
2652 /* Only push if top exists. Otherwise, replace top. */
2653 if (YY_CURRENT_BUFFER
)
2654 yyg
->yy_buffer_stack_top
++;
2655 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
2657 /* copied from yy_switch_to_buffer. */
2658 yy_load_buffer_state(yyscanner
);
2659 yyg
->yy_did_buffer_switch_on_eof
= 1;
2664 /** Removes and deletes the top of the stack, if present.
2665 * The next element becomes the new top.
2666 * @param yyscanner The scanner object.
2669 void yypop_buffer_state (yyscan_t yyscanner
)
2674 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2675 if (!YY_CURRENT_BUFFER
)
2678 yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
2679 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2680 if (yyg
->yy_buffer_stack_top
> 0)
2681 --yyg
->yy_buffer_stack_top
;
2683 if (YY_CURRENT_BUFFER
) {
2684 yy_load_buffer_state(yyscanner
);
2685 yyg
->yy_did_buffer_switch_on_eof
= 1;
2691 /* Allocates the stack if it does not exist.
2692 * Guarantees space for at least one push.
2695 static void yyensure_buffer_stack (yyscan_t yyscanner
)
2701 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2703 if (!yyg
->yy_buffer_stack
) {
2705 /* First allocation is just for 2 elements, since we don't know if this
2706 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2707 * immediate realloc on the next call.
2710 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)yyalloc
2711 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
2714 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
2716 yyg
->yy_buffer_stack_max
= num_to_alloc
;
2717 yyg
->yy_buffer_stack_top
= 0;
2721 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
2723 /* Increase the buffer to prepare for a possible push. */
2724 int grow_size
= 8 /* arbitrary grow size */;
2726 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
2727 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)yyrealloc
2728 (yyg
->yy_buffer_stack
,
2729 num_to_alloc
* sizeof(struct yy_buffer_state
*)
2732 /* zero only the new slots.*/
2733 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
2734 yyg
->yy_buffer_stack_max
= num_to_alloc
;
2740 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2741 * @param base the character buffer
2742 * @param size the size in bytes of the character buffer
2743 * @param yyscanner The scanner object.
2744 * @return the newly allocated buffer state object.
2746 YY_BUFFER_STATE
yy_scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
2751 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2752 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2753 /* They forgot to leave room for the EOB's. */
2756 b
= (YY_BUFFER_STATE
) yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
2758 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2760 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2761 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2762 b
->yy_is_our_buffer
= 0;
2763 b
->yy_input_file
= 0;
2764 b
->yy_n_chars
= b
->yy_buf_size
;
2765 b
->yy_is_interactive
= 0;
2767 b
->yy_fill_buffer
= 0;
2768 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2770 yy_switch_to_buffer(b
,yyscanner
);
2777 /** Setup the input buffer state to scan a string. The next call to yylex() will
2778 * scan from a @e copy of @a str.
2779 * @param str a NUL-terminated string to scan
2780 * @param yyscanner The scanner object.
2781 * @return the newly allocated buffer state object.
2782 * @note If you want to scan bytes that may contain NUL values, then use
2783 * yy_scan_bytes() instead.
2785 YY_BUFFER_STATE
yy_scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
2788 return yy_scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
2793 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2794 * scan from a @e copy of @a bytes.
2795 * @param bytes the byte buffer to scan
2796 * @param len the number of bytes in the buffer pointed to by @a bytes.
2797 * @param yyscanner The scanner object.
2798 * @return the newly allocated buffer state object.
2800 YY_BUFFER_STATE
yy_scan_bytes (yyconst
char * yybytes
, int _yybytes_len
, yyscan_t yyscanner
)
2807 /* Get memory for full buffer, including space for trailing EOB's. */
2808 n
= _yybytes_len
+ 2;
2809 buf
= (char *) yyalloc(n
,yyscanner
);
2811 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2813 for ( i
= 0; i
< _yybytes_len
; ++i
)
2814 buf
[i
] = yybytes
[i
];
2816 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
2818 b
= yy_scan_buffer(buf
,n
,yyscanner
);
2820 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2822 /* It's okay to grow etc. this buffer, and we should throw it
2823 * away when we're done.
2825 b
->yy_is_our_buffer
= 1;
2831 #ifndef YY_EXIT_FAILURE
2832 #define YY_EXIT_FAILURE 2
2836 static void yy_fatal_error (yyconst
char* msg
, yyscan_t yyscanner
)
2838 (void) fprintf( stderr
, "%s\n", msg
);
2839 exit( YY_EXIT_FAILURE
);
2845 /* Redefine yyless() so it works in section 3 code. */
2851 /* Undo effects of setting up yytext. */ \
2852 int yyless_macro_arg = (n); \
2853 YY_LESS_LINENO(yyless_macro_arg);\
2854 yytext[yyleng] = yyg->yy_hold_char; \
2855 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2856 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2857 *yyg->yy_c_buf_p = '\0'; \
2858 yyleng = yyless_macro_arg; \
2862 /* Accessor methods (get/set functions) to struct members. */
2867 /** Get the user-defined data for this scanner.
2868 * @param yyscanner The scanner object.
2870 YY_EXTRA_TYPE
yyget_extra (yyscan_t yyscanner
)
2872 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2878 /** Get the current line number.
2879 * @param yyscanner The scanner object.
2881 int yyget_lineno (yyscan_t yyscanner
)
2883 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2885 if (! YY_CURRENT_BUFFER
)
2891 /** Get the current column number.
2892 * @param yyscanner The scanner object.
2894 int yyget_column (yyscan_t yyscanner
)
2896 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2898 if (! YY_CURRENT_BUFFER
)
2904 /** Get the input stream.
2905 * @param yyscanner The scanner object.
2907 FILE *yyget_in (yyscan_t yyscanner
)
2909 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2913 /** Get the output stream.
2914 * @param yyscanner The scanner object.
2916 FILE *yyget_out (yyscan_t yyscanner
)
2918 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2922 /** Get the length of the current token.
2923 * @param yyscanner The scanner object.
2925 int yyget_leng (yyscan_t yyscanner
)
2927 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2931 /** Get the current token.
2932 * @param yyscanner The scanner object.
2935 char *yyget_text (yyscan_t yyscanner
)
2937 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2943 /** Set the user-defined data. This data is never touched by the scanner.
2944 * @param user_defined The data to be associated with this scanner.
2945 * @param yyscanner The scanner object.
2947 void yyset_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
2949 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2950 yyextra
= user_defined
;
2955 /** Set the current line number.
2956 * @param line_number
2957 * @param yyscanner The scanner object.
2959 void yyset_lineno (int line_number
, yyscan_t yyscanner
)
2961 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2963 /* lineno is only valid if an input buffer exists. */
2964 if (! YY_CURRENT_BUFFER
)
2965 yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner
);
2967 yylineno
= line_number
;
2970 /** Set the current column.
2971 * @param line_number
2972 * @param yyscanner The scanner object.
2974 void yyset_column (int column_no
, yyscan_t yyscanner
)
2976 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2978 /* column is only valid if an input buffer exists. */
2979 if (! YY_CURRENT_BUFFER
)
2980 yy_fatal_error( "yyset_column called with no buffer" , yyscanner
);
2982 yycolumn
= column_no
;
2985 /** Set the input stream. This does not discard the current
2987 * @param in_str A readable stream.
2988 * @param yyscanner The scanner object.
2989 * @see yy_switch_to_buffer
2991 void yyset_in (FILE * in_str
, yyscan_t yyscanner
)
2993 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2997 void yyset_out (FILE * out_str
, yyscan_t yyscanner
)
2999 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3003 int yyget_debug (yyscan_t yyscanner
)
3005 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3006 return yy_flex_debug
;
3009 void yyset_debug (int bdebug
, yyscan_t yyscanner
)
3011 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3012 yy_flex_debug
= bdebug
;
3018 /* Accessor methods for yylval and yylloc */
3020 /* %if-bison-bridge */
3022 YYSTYPE
* yyget_lval (yyscan_t yyscanner
)
3024 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3028 void yyset_lval (YYSTYPE
* yylval_param
, yyscan_t yyscanner
)
3030 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3031 yylval
= yylval_param
;
3036 /* User-visible API */
3038 /* yylex_init is special because it creates the scanner itself, so it is
3039 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3040 * That's why we explicitly handle the declaration, instead of using our macros.
3043 int yylex_init(yyscan_t
* ptr_yy_globals
)
3046 if (ptr_yy_globals
== NULL
){
3051 *ptr_yy_globals
= (yyscan_t
) yyalloc ( sizeof( struct yyguts_t
), NULL
);
3053 if (*ptr_yy_globals
== NULL
){
3058 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3059 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
3061 return yy_init_globals ( *ptr_yy_globals
);
3067 static int yy_init_globals (yyscan_t yyscanner
)
3069 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3070 /* Initialization is the same as for the non-reentrant scanner.
3071 * This function is called from yylex_destroy(), so don't allocate here.
3074 yyg
->yy_buffer_stack
= 0;
3075 yyg
->yy_buffer_stack_top
= 0;
3076 yyg
->yy_buffer_stack_max
= 0;
3077 yyg
->yy_c_buf_p
= (char *) 0;
3081 yyg
->yy_start_stack_ptr
= 0;
3082 yyg
->yy_start_stack_depth
= 0;
3083 yyg
->yy_start_stack
= NULL
;
3085 /* Defined in main.c */
3094 /* For future reference: Set errno on error, since we are called by
3101 /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
3102 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
3103 int yylex_destroy (yyscan_t yyscanner
)
3105 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
3107 /* Pop the buffer stack, destroying each element. */
3108 while(YY_CURRENT_BUFFER
){
3109 yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
3110 YY_CURRENT_BUFFER_LVALUE
= NULL
;
3111 yypop_buffer_state(yyscanner
);
3114 /* Destroy the stack itself. */
3115 yyfree(yyg
->yy_buffer_stack
,yyscanner
);
3116 yyg
->yy_buffer_stack
= NULL
;
3118 /* Destroy the start condition stack. */
3119 yyfree(yyg
->yy_start_stack
,yyscanner
);
3120 yyg
->yy_start_stack
= NULL
;
3122 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3123 * yylex() is called, initialization will occur. */
3124 yy_init_globals( yyscanner
);
3127 /* Destroy the main struct (reentrant only). */
3128 yyfree ( yyscanner
, yyscanner
);
3136 * Internal utility routines.
3140 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
3143 for ( i
= 0; i
< n
; ++i
)
3148 #ifdef YY_NEED_STRLEN
3149 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
3152 for ( n
= 0; s
[n
]; ++n
)
3159 void *yyalloc (yy_size_t size
, yyscan_t yyscanner
)
3161 return (void *) malloc( size
);
3164 void *yyrealloc (void * ptr
, yy_size_t size
, yyscan_t yyscanner
)
3166 /* The cast to (char *) in the following accommodates both
3167 * implementations that use char* generic pointers, and those
3168 * that use void* generic pointers. It works with the latter
3169 * because both ANSI C and C++ allow castless assignment from
3170 * any pointer type to void*, and deal with argument conversions
3171 * as though doing an assignment.
3173 return (void *) realloc( (char *) ptr
, size
);
3176 void yyfree (void * ptr
, yyscan_t yyscanner
)
3178 free( (char *) ptr
); /* see yyrealloc() for (char *) cast */
3181 /* %if-tables-serialization definitions */
3182 /* %define-yytables The name for this specific scanner's tables. */
3183 #define YYTABLES_NAME "yytables"
3186 /* %ok-for-header */
3199 * c-file-style: "parrot"
3201 * vim: expandtab shiftwidth=4: