1 #line 2 "jsgf_scanner.c"
3 #line 4 "jsgf_scanner.c"
5 #define YY_INT_ALIGNED short int
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
98 #if defined (__STDC__)
106 #define yyconst const
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
122 #ifndef YY_TYPEDEF_YY_SCANNER_T
123 #define YY_TYPEDEF_YY_SCANNER_T
124 typedef void* yyscan_t;
129 #define yyin yyg->yyin_r
130 #define yyout yyg->yyout_r
131 #define yyextra yyg->yyextra_r
132 #define yyleng yyg->yyleng_r
133 #define yytext yyg->yytext_r
134 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
135 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
136 #define yy_flex_debug yyg->yy_flex_debug_r
142 #define BEGIN yyg->yy_start = 1 + 2 *
148 #define YY_START ((yyg->yy_start - 1) / 2)
149 #define YYSTATE YY_START
152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 #define YY_NEW_FILE yyrestart(yyin ,yyscanner )
157 #define YY_END_OF_BUFFER_CHAR 0
161 #define YY_BUF_SIZE 16384
166 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
169 #define YY_TYPEDEF_YY_BUFFER_STATE
173 #define EOB_ACT_CONTINUE_SCAN 0
174 #define EOB_ACT_END_OF_FILE 1
175 #define EOB_ACT_LAST_MATCH 2
177 #define YY_LESS_LINENO(n)
184 int yyless_macro_arg = (n); \
185 YY_LESS_LINENO(yyless_macro_arg);\
186 *yy_cp = yyg->yy_hold_char; \
187 YY_RESTORE_YY_MORE_OFFSET \
188 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
189 YY_DO_BEFORE_ACTION; \
193 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
195 #ifndef YY_TYPEDEF_YY_SIZE_T
196 #define YY_TYPEDEF_YY_SIZE_T
197 typedef size_t yy_size_t;
200 #ifndef YY_STRUCT_YY_BUFFER_STATE
201 #define YY_STRUCT_YY_BUFFER_STATE
212 yy_size_t yy_buf_size;
223 int yy_is_our_buffer;
230 int yy_is_interactive;
246 int yy_buffer_status;
248 #define YY_BUFFER_NEW 0
249 #define YY_BUFFER_NORMAL 1
260 #define YY_BUFFER_EOF_PENDING 2
271 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
272 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
278 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
280 void yyrestart (FILE *input_file ,yyscan_t yyscanner );
281 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
282 YY_BUFFER_STATE yy_create_buffer (FILE *file,
int size ,yyscan_t yyscanner );
283 void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
284 void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
285 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
286 void yypop_buffer_state (yyscan_t yyscanner );
288 static void yyensure_buffer_stack (yyscan_t yyscanner );
289 static void yy_load_buffer_state (yyscan_t yyscanner );
290 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
292 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
294 YY_BUFFER_STATE yy_scan_buffer (
char *base,yy_size_t size ,yyscan_t yyscanner );
295 YY_BUFFER_STATE yy_scan_string (yyconst
char *yy_str ,yyscan_t yyscanner );
296 YY_BUFFER_STATE yy_scan_bytes (yyconst
char *bytes,
int len ,yyscan_t yyscanner );
298 void *
yyalloc (yy_size_t ,yyscan_t yyscanner );
299 void *yyrealloc (
void *,yy_size_t ,yyscan_t yyscanner );
300 void yyfree (
void * ,yyscan_t yyscanner );
302 #define yy_new_buffer yy_create_buffer
304 #define yy_set_interactive(is_interactive) \
306 if ( ! YY_CURRENT_BUFFER ){ \
307 yyensure_buffer_stack (yyscanner); \
308 YY_CURRENT_BUFFER_LVALUE = \
309 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
311 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
314 #define yy_set_bol(at_bol) \
316 if ( ! YY_CURRENT_BUFFER ){\
317 yyensure_buffer_stack (yyscanner); \
318 YY_CURRENT_BUFFER_LVALUE = \
319 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
321 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
324 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
329 #define YY_SKIP_YYWRAP
331 typedef unsigned char YY_CHAR;
333 typedef int yy_state_type;
335 #define yytext_ptr yytext_r
337 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
338 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
339 static int yy_get_next_buffer (yyscan_t yyscanner );
340 static void yy_fatal_error (yyconst
char msg[] ,yyscan_t yyscanner );
345 #define YY_DO_BEFORE_ACTION \
346 yyg->yytext_ptr = yy_bp; \
347 yyleng = (size_t) (yy_cp - yy_bp); \
348 yyg->yy_hold_char = *yy_cp; \
350 yyg->yy_c_buf_p = yy_cp;
352 #define YY_NUM_RULES 16
353 #define YY_END_OF_BUFFER 17
358 flex_int32_t yy_verify;
361 static yyconst flex_int16_t yy_accept[77] =
363 0, 0, 0, 0, 17, 12, 1, 1, 1, 12,
364 12, 15, 15, 15, 12, 12, 12, 15, 12, 5,
365 1, 5, 12, 12, 0, 12, 12, 12, 3, 0,
366 14, 0, 0, 12, 12, 12, 0, 0, 11, 12,
367 4, 13, 0, 12, 0, 12, 12, 12, 0, 0,
368 2, 14, 10, 12, 12, 12, 0, 0, 11, 12,
369 13, 0, 12, 12, 12, 12, 12, 6, 12, 12,
373 static yyconst flex_int32_t yy_ec[256] =
375 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
376 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 2, 1, 5, 6, 1, 1, 1, 1, 7,
379 7, 8, 7, 1, 1, 9, 10, 11, 11, 11,
380 11, 11, 11, 11, 11, 11, 11, 1, 7, 12,
381 7, 13, 1, 1, 1, 1, 1, 1, 1, 14,
382 15, 1, 1, 16, 1, 1, 1, 1, 1, 1,
383 1, 1, 17, 1, 1, 1, 1, 1, 1, 1,
384 7, 18, 7, 1, 1, 1, 19, 20, 21, 1,
386 1, 1, 22, 1, 23, 1, 1, 24, 25, 1,
387 26, 27, 1, 28, 1, 29, 30, 1, 1, 1,
388 1, 1, 31, 7, 32, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 33, 1, 1, 1,
395 34, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 35, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 static yyconst flex_int32_t yy_meta[36] =
407 1, 2, 2, 1, 1, 1, 2, 2, 1, 2,
408 1, 3, 3, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 static yyconst flex_int16_t yy_base[87] =
415 0, 0, 34, 37, 148, 0, 196, 196, 0, 44,
416 130, 196, 50, 0, 115, 116, 106, 32, 102, 196,
417 196, 124, 0, 75, 48, 0, 106, 116, 196, 121,
418 128, 58, 117, 110, 101, 107, 47, 52, 196, 91,
419 196, 196, 68, 0, 76, 0, 137, 108, 33, 119,
420 196, 196, 196, 96, 94, 93, 71, 94, 72, 104,
421 87, 97, 87, 74, 70, 73, 79, 0, 72, 45,
422 51, 35, 0, 0, 0, 196, 169, 47, 172, 175,
423 177, 180, 183, 186, 189, 192
426 static yyconst flex_int16_t yy_def[87] =
428 76, 1, 77, 77, 76, 78, 76, 76, 78, 79,
429 78, 76, 76, 80, 78, 78, 78, 81, 78, 76,
430 76, 76, 78, 79, 82, 78, 83, 78, 76, 76,
431 84, 76, 80, 78, 78, 78, 81, 85, 76, 78,
432 76, 76, 86, 24, 82, 24, 83, 78, 76, 84,
433 76, 76, 76, 78, 78, 78, 81, 85, 81, 78,
434 82, 86, 78, 78, 78, 78, 78, 78, 78, 78,
435 78, 78, 78, 78, 78, 0, 76, 76, 76, 76,
436 76, 76, 76, 76, 76, 76
439 static yyconst flex_int16_t yy_nxt[232] =
441 6, 7, 8, 9, 10, 11, 12, 12, 6, 13,
442 6, 14, 12, 6, 6, 6, 6, 6, 6, 6,
443 6, 15, 16, 6, 6, 6, 17, 6, 6, 6,
444 18, 12, 6, 6, 19, 21, 8, 21, 21, 8,
445 21, 22, 52, 49, 22, 25, 25, 23, 26, 38,
446 25, 25, 42, 25, 37, 25, 25, 29, 30, 31,
447 32, 27, 75, 39, 38, 43, 30, 52, 32, 58,
448 25, 74, 61, 73, 25, 25, 25, 25, 39, 26,
449 42, 25, 25, 59, 25, 62, 25, 25, 38, 38,
450 72, 42, 27, 43, 28, 71, 37, 70, 69, 25,
452 68, 61, 39, 39, 43, 25, 25, 45, 25, 67,
453 46, 58, 45, 45, 62, 45, 66, 45, 45, 65,
454 64, 51, 63, 47, 60, 59, 56, 55, 54, 53,
455 51, 49, 48, 41, 40, 36, 45, 45, 45, 25,
456 35, 46, 34, 45, 45, 28, 45, 76, 45, 45,
457 76, 76, 76, 76, 47, 76, 76, 76, 76, 76,
458 76, 76, 76, 76, 76, 76, 76, 45, 45, 20,
459 20, 20, 24, 24, 24, 33, 33, 37, 37, 37,
460 25, 25, 25, 44, 44, 44, 50, 50, 50, 57,
461 57, 57, 45, 45, 45, 5, 76, 76, 76, 76,
463 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
464 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
465 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
469 static yyconst flex_int16_t yy_chk[232] =
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
473 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474 1, 1, 1, 1, 1, 3, 3, 3, 4, 4,
475 4, 3, 49, 49, 4, 10, 10, 78, 10, 18,
476 10, 10, 25, 10, 38, 10, 10, 13, 13, 13,
477 13, 10, 72, 18, 37, 25, 32, 32, 32, 38,
478 43, 71, 43, 70, 10, 10, 24, 24, 37, 24,
479 45, 24, 24, 38, 24, 43, 24, 24, 57, 59,
480 69, 61, 24, 45, 67, 66, 58, 65, 64, 62,
482 63, 62, 57, 59, 61, 24, 24, 27, 27, 60,
483 27, 58, 27, 27, 62, 27, 56, 27, 27, 55,
484 54, 50, 48, 27, 40, 58, 36, 35, 34, 33,
485 31, 30, 28, 22, 19, 17, 27, 27, 47, 47,
486 16, 47, 15, 47, 47, 11, 47, 5, 47, 47,
487 0, 0, 0, 0, 47, 0, 0, 0, 0, 0,
488 0, 0, 0, 0, 0, 0, 0, 47, 47, 77,
489 77, 77, 79, 79, 79, 80, 80, 81, 81, 81,
490 82, 82, 82, 83, 83, 83, 84, 84, 84, 85,
491 85, 85, 86, 86, 86, 76, 76, 76, 76, 76,
493 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
494 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
495 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
502 #define REJECT reject_used_but_not_detected
503 #define yymore() yymore_used_but_not_detected
504 #define YY_MORE_ADJ 0
505 #define YY_RESTORE_YY_MORE_OFFSET
506 #line 1 "_jsgf_scanner.l"
544 #line 39 "_jsgf_scanner.l"
547 #include "jsgf_parser.h"
550 #line 551 "jsgf_scanner.c"
555 #ifndef YY_NO_UNISTD_H
563 #ifndef YY_EXTRA_TYPE
564 #define YY_EXTRA_TYPE void *
572 YY_EXTRA_TYPE yyextra_r;
575 FILE *yyin_r, *yyout_r;
585 int yy_did_buffer_switch_on_eof;
586 int yy_start_stack_ptr;
587 int yy_start_stack_depth;
589 yy_state_type yy_last_accepting_state;
590 char* yy_last_accepting_cpos;
603 static int yy_init_globals (yyscan_t yyscanner );
607 # define yylval yyg->yylval_r
609 int yylex_init (yyscan_t* scanner);
611 int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
616 int yylex_destroy (yyscan_t yyscanner );
618 int yyget_debug (yyscan_t yyscanner );
620 void yyset_debug (
int debug_flag ,yyscan_t yyscanner );
622 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
624 void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
626 FILE *yyget_in (yyscan_t yyscanner );
628 void yyset_in (FILE * in_str ,yyscan_t yyscanner );
630 FILE *yyget_out (yyscan_t yyscanner );
632 void yyset_out (FILE * out_str ,yyscan_t yyscanner );
634 int yyget_leng (yyscan_t yyscanner );
636 char *yyget_text (yyscan_t yyscanner );
638 int yyget_lineno (yyscan_t yyscanner );
640 void yyset_lineno (
int line_number ,yyscan_t yyscanner );
642 YYSTYPE * yyget_lval (yyscan_t yyscanner );
644 void yyset_lval (
YYSTYPE * yylval_param ,yyscan_t yyscanner );
650 #ifndef YY_SKIP_YYWRAP
652 extern "C" int yywrap (yyscan_t yyscanner );
654 extern int yywrap (yyscan_t yyscanner );
658 static void yyunput (
int c,
char *buf_ptr ,yyscan_t yyscanner);
661 static void yy_flex_strncpy (
char *,yyconst
char *,
int ,yyscan_t yyscanner);
664 #ifdef YY_NEED_STRLEN
665 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner);
671 static int yyinput (yyscan_t yyscanner );
673 static int input (yyscan_t yyscanner );
679 #ifndef YY_READ_BUF_SIZE
680 #define YY_READ_BUF_SIZE 8192
688 #define ECHO fwrite( yytext, yyleng, 1, yyout )
695 #define YY_INPUT(buf,result,max_size) \
696 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
700 for ( n = 0; n < max_size && \
701 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
704 buf[n++] = (char) c; \
705 if ( c == EOF && ferror( yyin ) ) \
706 YY_FATAL_ERROR( "input in flex scanner failed" ); \
712 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
714 if( errno != EINTR) \
716 YY_FATAL_ERROR( "input in flex scanner failed" ); \
732 #define yyterminate() return YY_NULL
736 #ifndef YY_START_STACK_INCR
737 #define YY_START_STACK_INCR 25
741 #ifndef YY_FATAL_ERROR
742 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
751 #define YY_DECL_IS_OURS 1
754 (
YYSTYPE * yylval_param ,yyscan_t yyscanner);
756 #define YY_DECL int yylex \
757 (YYSTYPE * yylval_param , yyscan_t yyscanner)
763 #ifndef YY_USER_ACTION
764 #define YY_USER_ACTION
769 #define YY_BREAK break;
772 #define YY_RULE_SETUP \
779 register yy_state_type yy_current_state;
780 register char *yy_cp, *yy_bp;
784 #line 57 "_jsgf_scanner.l"
787 #line 788 "jsgf_scanner.c"
789 yylval = yylval_param;
799 if ( ! yyg->yy_start )
808 if ( ! YY_CURRENT_BUFFER ) {
809 yyensure_buffer_stack (yyscanner);
810 YY_CURRENT_BUFFER_LVALUE =
811 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
814 yy_load_buffer_state(yyscanner );
819 yy_cp = yyg->yy_c_buf_p;
822 *yy_cp = yyg->yy_hold_char;
829 yy_current_state = yyg->yy_start;
833 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
834 if ( yy_accept[yy_current_state] )
836 yyg->yy_last_accepting_state = yy_current_state;
837 yyg->yy_last_accepting_cpos = yy_cp;
839 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
841 yy_current_state = (int) yy_def[yy_current_state];
842 if ( yy_current_state >= 77 )
843 yy_c = yy_meta[(
unsigned int) yy_c];
845 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
848 while ( yy_base[yy_current_state] != 196 );
851 yy_act = yy_accept[yy_current_state];
854 yy_cp = yyg->yy_last_accepting_cpos;
855 yy_current_state = yyg->yy_last_accepting_state;
856 yy_act = yy_accept[yy_current_state];
867 *yy_cp = yyg->yy_hold_char;
868 yy_cp = yyg->yy_last_accepting_cpos;
869 yy_current_state = yyg->yy_last_accepting_state;
875 #line 59 "_jsgf_scanner.l"
881 #line 60 "_jsgf_scanner.l"
886 #line 61 "_jsgf_scanner.l"
891 #line 62 "_jsgf_scanner.l"
896 #line 63 "_jsgf_scanner.l"
901 #line 65 "_jsgf_scanner.l"
906 #line 66 "_jsgf_scanner.l"
911 #line 67 "_jsgf_scanner.l"
916 #line 68 "_jsgf_scanner.l"
922 #line 70 "_jsgf_scanner.l"
923 { yylval->name = strdup(yytext);
return RULENAME; }
928 #line 71 "_jsgf_scanner.l"
929 { yylval->name = strdup(yytext);
return TAG; }
933 #line 72 "_jsgf_scanner.l"
934 { yylval->name = strdup(yytext);
return TOKEN; }
939 #line 73 "_jsgf_scanner.l"
940 { yylval->name = strdup(yytext);
return TOKEN; }
944 #line 74 "_jsgf_scanner.l"
945 { yylval->weight =
atof_c(yytext+1);
return WEIGHT; }
949 #line 76 "_jsgf_scanner.l"
954 #line 78 "_jsgf_scanner.l"
957 #line 958 "jsgf_scanner.c"
958 case YY_STATE_EOF(INITIAL):
959 case YY_STATE_EOF(COMMENT):
962 case YY_END_OF_BUFFER:
965 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
968 *yy_cp = yyg->yy_hold_char;
969 YY_RESTORE_YY_MORE_OFFSET
971 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
982 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
983 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
984 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
994 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
996 yy_state_type yy_next_state;
998 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1000 yy_current_state = yy_get_previous_state( yyscanner );
1011 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1013 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1015 if ( yy_next_state )
1018 yy_cp = ++yyg->yy_c_buf_p;
1019 yy_current_state = yy_next_state;
1025 yy_cp = yyg->yy_c_buf_p;
1026 goto yy_find_action;
1030 else switch ( yy_get_next_buffer( yyscanner ) )
1032 case EOB_ACT_END_OF_FILE:
1034 yyg->yy_did_buffer_switch_on_eof = 0;
1036 if ( yywrap(yyscanner ) )
1047 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1049 yy_act = YY_STATE_EOF(YY_START);
1055 if ( ! yyg->yy_did_buffer_switch_on_eof )
1061 case EOB_ACT_CONTINUE_SCAN:
1063 yyg->yytext_ptr + yy_amount_of_matched_text;
1065 yy_current_state = yy_get_previous_state( yyscanner );
1067 yy_cp = yyg->yy_c_buf_p;
1068 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1071 case EOB_ACT_LAST_MATCH:
1073 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1075 yy_current_state = yy_get_previous_state( yyscanner );
1077 yy_cp = yyg->yy_c_buf_p;
1078 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1079 goto yy_find_action;
1086 "fatal flex scanner internal error--no action found" );
1098 static int yy_get_next_buffer (yyscan_t yyscanner)
1101 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1102 register char *source = yyg->yytext_ptr;
1103 register int number_to_move, i;
1106 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1108 "fatal flex scanner internal error--end of buffer missed" );
1110 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1112 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1117 return EOB_ACT_END_OF_FILE;
1125 return EOB_ACT_LAST_MATCH;
1132 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1134 for ( i = 0; i < number_to_move; ++i )
1135 *(dest++) = *(source++);
1137 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1141 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1146 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1148 while ( num_to_read <= 0 )
1152 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1154 int yy_c_buf_p_offset =
1155 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1157 if ( b->yy_is_our_buffer )
1159 int new_size = b->yy_buf_size * 2;
1161 if ( new_size <= 0 )
1162 b->yy_buf_size += b->yy_buf_size / 8;
1164 b->yy_buf_size *= 2;
1166 b->yy_ch_buf = (
char *)
1168 yyrealloc((
void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1174 if ( ! b->yy_ch_buf )
1176 "fatal error - scanner input buffer overflow" );
1178 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1180 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1185 if ( num_to_read > YY_READ_BUF_SIZE )
1186 num_to_read = YY_READ_BUF_SIZE;
1189 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1190 yyg->yy_n_chars, (
size_t) num_to_read );
1192 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1195 if ( yyg->yy_n_chars == 0 )
1197 if ( number_to_move == YY_MORE_ADJ )
1199 ret_val = EOB_ACT_END_OF_FILE;
1200 yyrestart(yyin ,yyscanner);
1205 ret_val = EOB_ACT_LAST_MATCH;
1206 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1207 YY_BUFFER_EOF_PENDING;
1212 ret_val = EOB_ACT_CONTINUE_SCAN;
1214 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1216 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1217 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) yyrealloc((
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1218 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1219 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1222 yyg->yy_n_chars += number_to_move;
1223 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1224 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1226 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1233 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1235 register yy_state_type yy_current_state;
1236 register char *yy_cp;
1239 yy_current_state = yyg->yy_start;
1241 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1243 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1244 if ( yy_accept[yy_current_state] )
1246 yyg->yy_last_accepting_state = yy_current_state;
1247 yyg->yy_last_accepting_cpos = yy_cp;
1249 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1251 yy_current_state = (int) yy_def[yy_current_state];
1252 if ( yy_current_state >= 77 )
1253 yy_c = yy_meta[(
unsigned int) yy_c];
1255 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1258 return yy_current_state;
1266 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1268 register int yy_is_jam;
1270 register char *yy_cp = yyg->yy_c_buf_p;
1272 register YY_CHAR yy_c = 1;
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 >= 77 )
1282 yy_c = yy_meta[(
unsigned int) yy_c];
1284 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1285 yy_is_jam = (yy_current_state == 76);
1287 return yy_is_jam ? 0 : yy_current_state;
1290 static void yyunput (
int c,
register char * yy_bp , yyscan_t yyscanner)
1292 register char *yy_cp;
1295 yy_cp = yyg->yy_c_buf_p;
1298 *yy_cp = yyg->yy_hold_char;
1300 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1303 register int number_to_move = yyg->yy_n_chars + 2;
1304 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1305 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1306 register char *source =
1307 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1309 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1310 *--dest = *--source;
1312 yy_cp += (int) (dest - source);
1313 yy_bp += (int) (dest - source);
1314 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1315 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1317 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1318 YY_FATAL_ERROR(
"flex scanner push-back overflow" );
1321 *--yy_cp = (char) c;
1323 yyg->yytext_ptr = yy_bp;
1324 yyg->yy_hold_char = *yy_cp;
1325 yyg->yy_c_buf_p = yy_cp;
1330 static int yyinput (yyscan_t yyscanner)
1332 static int input (yyscan_t yyscanner)
1339 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1341 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1347 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1349 *yyg->yy_c_buf_p =
'\0';
1353 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1356 switch ( yy_get_next_buffer( yyscanner ) )
1358 case EOB_ACT_LAST_MATCH:
1370 yyrestart(yyin ,yyscanner);
1374 case EOB_ACT_END_OF_FILE:
1376 if ( yywrap(yyscanner ) )
1379 if ( ! yyg->yy_did_buffer_switch_on_eof )
1382 return yyinput(yyscanner);
1384 return input(yyscanner);
1388 case EOB_ACT_CONTINUE_SCAN:
1389 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1395 c = *(
unsigned char *) yyg->yy_c_buf_p;
1396 *yyg->yy_c_buf_p =
'\0';
1397 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1408 void yyrestart (FILE * input_file , yyscan_t yyscanner)
1412 if ( ! YY_CURRENT_BUFFER ){
1413 yyensure_buffer_stack (yyscanner);
1414 YY_CURRENT_BUFFER_LVALUE =
1415 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1418 yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1419 yy_load_buffer_state(yyscanner );
1426 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1435 yyensure_buffer_stack (yyscanner);
1436 if ( YY_CURRENT_BUFFER == new_buffer )
1439 if ( YY_CURRENT_BUFFER )
1442 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1443 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1444 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1447 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1448 yy_load_buffer_state(yyscanner );
1455 yyg->yy_did_buffer_switch_on_eof = 1;
1458 static void yy_load_buffer_state (yyscan_t yyscanner)
1461 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1462 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1463 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1464 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1473 YY_BUFFER_STATE yy_create_buffer (FILE * file,
int size , yyscan_t yyscanner)
1479 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1481 b->yy_buf_size = size;
1486 b->yy_ch_buf = (
char *)
yyalloc(b->yy_buf_size + 2 ,yyscanner );
1487 if ( ! b->yy_ch_buf )
1488 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1490 b->yy_is_our_buffer = 1;
1492 yy_init_buffer(b,file ,yyscanner);
1501 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1508 if ( b == YY_CURRENT_BUFFER )
1509 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1511 if ( b->yy_is_our_buffer )
1512 yyfree((
void *) b->yy_ch_buf ,yyscanner );
1514 yyfree((
void *) b ,yyscanner );
1518 extern int isatty (
int );
1525 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1531 yy_flush_buffer(b ,yyscanner);
1533 b->yy_input_file = file;
1534 b->yy_fill_buffer = 1;
1540 if (b != YY_CURRENT_BUFFER){
1545 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1554 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1566 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1567 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1569 b->yy_buf_pos = &b->yy_ch_buf[0];
1572 b->yy_buffer_status = YY_BUFFER_NEW;
1574 if ( b == YY_CURRENT_BUFFER )
1575 yy_load_buffer_state(yyscanner );
1584 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1587 if (new_buffer == NULL)
1590 yyensure_buffer_stack(yyscanner);
1593 if ( YY_CURRENT_BUFFER )
1596 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1597 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1598 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1602 if (YY_CURRENT_BUFFER)
1604 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1607 yy_load_buffer_state(yyscanner );
1608 yyg->yy_did_buffer_switch_on_eof = 1;
1615 void yypop_buffer_state (yyscan_t yyscanner)
1618 if (!YY_CURRENT_BUFFER)
1621 yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1622 YY_CURRENT_BUFFER_LVALUE = NULL;
1626 if (YY_CURRENT_BUFFER) {
1627 yy_load_buffer_state(yyscanner );
1628 yyg->yy_did_buffer_switch_on_eof = 1;
1635 static void yyensure_buffer_stack (yyscan_t yyscanner)
1651 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1671 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1685 YY_BUFFER_STATE yy_scan_buffer (
char * base, yy_size_t size , yyscan_t yyscanner)
1690 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1691 base[size-1] != YY_END_OF_BUFFER_CHAR )
1697 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1699 b->yy_buf_size = size - 2;
1700 b->yy_buf_pos = b->yy_ch_buf = base;
1701 b->yy_is_our_buffer = 0;
1702 b->yy_input_file = 0;
1703 b->yy_n_chars = b->yy_buf_size;
1704 b->yy_is_interactive = 0;
1706 b->yy_fill_buffer = 0;
1707 b->yy_buffer_status = YY_BUFFER_NEW;
1709 yy_switch_to_buffer(b ,yyscanner );
1722 YY_BUFFER_STATE yy_scan_string (yyconst
char * yystr , yyscan_t yyscanner)
1725 return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1735 YY_BUFFER_STATE yy_scan_bytes (yyconst
char * yybytes,
int _yybytes_len , yyscan_t yyscanner)
1743 n = _yybytes_len + 2;
1744 buf = (
char *)
yyalloc(n ,yyscanner );
1746 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1748 for ( i = 0; i < _yybytes_len; ++i )
1749 buf[i] = yybytes[i];
1751 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1753 b = yy_scan_buffer(buf,n ,yyscanner);
1755 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1760 b->yy_is_our_buffer = 1;
1765 #ifndef YY_EXIT_FAILURE
1766 #define YY_EXIT_FAILURE 2
1769 static void yy_fatal_error (yyconst
char* msg , yyscan_t yyscanner)
1771 (void) fprintf( stderr,
"%s\n", msg );
1772 exit( YY_EXIT_FAILURE );
1782 int yyless_macro_arg = (n); \
1783 YY_LESS_LINENO(yyless_macro_arg);\
1784 yytext[yyleng] = yyg->yy_hold_char; \
1785 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1786 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1787 *yyg->yy_c_buf_p = '\0'; \
1788 yyleng = yyless_macro_arg; \
1797 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
1806 int yyget_lineno (yyscan_t yyscanner)
1810 if (! YY_CURRENT_BUFFER)
1819 int yyget_column (yyscan_t yyscanner)
1823 if (! YY_CURRENT_BUFFER)
1832 FILE *yyget_in (yyscan_t yyscanner)
1841 FILE *yyget_out (yyscan_t yyscanner)
1850 int yyget_leng (yyscan_t yyscanner)
1860 char *yyget_text (yyscan_t yyscanner)
1870 void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1873 yyextra = user_defined ;
1880 void yyset_lineno (
int line_number , yyscan_t yyscanner)
1885 if (! YY_CURRENT_BUFFER )
1886 yy_fatal_error(
"yyset_lineno called with no buffer" , yyscanner);
1888 yylineno = line_number;
1895 void yyset_column (
int column_no , yyscan_t yyscanner)
1900 if (! YY_CURRENT_BUFFER )
1901 yy_fatal_error(
"yyset_column called with no buffer" , yyscanner);
1903 yycolumn = column_no;
1912 void yyset_in (FILE * in_str , yyscan_t yyscanner)
1918 void yyset_out (FILE * out_str , yyscan_t yyscanner)
1924 int yyget_debug (yyscan_t yyscanner)
1927 return yy_flex_debug;
1930 void yyset_debug (
int bdebug , yyscan_t yyscanner)
1933 yy_flex_debug = bdebug ;
1938 YYSTYPE * yyget_lval (yyscan_t yyscanner)
1944 void yyset_lval (
YYSTYPE * yylval_param , yyscan_t yyscanner)
1947 yylval = yylval_param;
1957 int yylex_init(yyscan_t* ptr_yy_globals)
1960 if (ptr_yy_globals == NULL){
1965 *ptr_yy_globals = (yyscan_t)
yyalloc (
sizeof(
struct yyguts_t ), NULL );
1967 if (*ptr_yy_globals == NULL){
1973 memset(*ptr_yy_globals,0x00,
sizeof(
struct yyguts_t));
1975 return yy_init_globals ( *ptr_yy_globals );
1986 int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
1991 yyset_extra (yy_user_defined, &dummy_yyguts);
1993 if (ptr_yy_globals == NULL){
1998 *ptr_yy_globals = (yyscan_t)
yyalloc (
sizeof(
struct yyguts_t ), &dummy_yyguts );
2000 if (*ptr_yy_globals == NULL){
2007 memset(*ptr_yy_globals,0x00,
sizeof(
struct yyguts_t));
2009 yyset_extra (yy_user_defined, *ptr_yy_globals);
2011 return yy_init_globals ( *ptr_yy_globals );
2014 static int yy_init_globals (yyscan_t yyscanner)
2024 yyg->yy_c_buf_p = (
char *) 0;
2028 yyg->yy_start_stack_ptr = 0;
2029 yyg->yy_start_stack_depth = 0;
2030 yyg->yy_start_stack = NULL;
2048 int yylex_destroy (yyscan_t yyscanner)
2053 while(YY_CURRENT_BUFFER){
2054 yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2055 YY_CURRENT_BUFFER_LVALUE = NULL;
2056 yypop_buffer_state(yyscanner);
2064 yyfree(yyg->yy_start_stack ,yyscanner );
2065 yyg->yy_start_stack = NULL;
2069 yy_init_globals( yyscanner);
2072 yyfree ( yyscanner , yyscanner );
2082 static void yy_flex_strncpy (
char* s1, yyconst
char * s2,
int n , yyscan_t yyscanner)
2085 for ( i = 0; i < n; ++i )
2090 #ifdef YY_NEED_STRLEN
2091 static int yy_flex_strlen (yyconst
char * s , yyscan_t yyscanner)
2094 for ( n = 0; s[n]; ++n )
2101 void *
yyalloc (yy_size_t size , yyscan_t yyscanner)
2103 return (
void *) malloc( size );
2106 void *yyrealloc (
void * ptr, yy_size_t size , yyscan_t yyscanner)
2115 return (
void *) realloc( (
char *) ptr, size );
2118 void yyfree (
void * ptr , yyscan_t yyscanner)
2120 free( (
char *) ptr );
2123 #define YYTABLES_NAME "yytables"
2125 #line 78 "_jsgf_scanner.l"