1 #define yy_create_buffer ResParser_create_buffer
2 #define yy_delete_buffer ResParser_delete_buffer
3 #define yy_scan_buffer ResParser_scan_buffer
4 #define yy_scan_string ResParser_scan_string
5 #define yy_scan_bytes ResParser_scan_bytes
6 #define yy_flex_debug ResParser_flex_debug
7 #define yy_init_buffer ResParser_init_buffer
8 #define yy_flush_buffer ResParser_flush_buffer
9 #define yy_load_buffer_state ResParser_load_buffer_state
10 #define yy_switch_to_buffer ResParser_switch_to_buffer
11 #define yyin ResParserin
12 #define yyleng ResParserleng
13 #define yylex ResParserlex
14 #define yyout ResParserout
15 #define yyrestart ResParserrestart
16 #define yytext ResParsertext
18 #line 19 "reslexer.cc"
19 /* A lexical scanner generated by flex */
21 /* Scanner skeleton version:
22 * $Header: /cvsroot/gscpv4/src/ftacmp/reslexer.cc,v 1.1.1.1 2013/12/02 17:44:57 spatsch Exp $
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
33 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
45 /* Use prototypes in function declarations. */
48 /* The "const" storage-class-modifier is valid. */
51 #else /* ! __cplusplus */
59 #endif /* ! __cplusplus */
78 #define YY_PROTO(proto) proto
80 #define YY_PROTO(proto) ()
83 /* Returned upon end-of-file. */
86 /* Promotes a possibly negative, possibly signed char to an unsigned
87 * integer for use as an array index. If the signed char is negative,
88 * we want to instead treat it as an 8-bit unsigned char, hence the
91 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
93 /* Enter a start condition. This macro really ought to take a parameter,
94 * but we do it the disgusting crufty way forced on us by the ()-less
95 * definition of BEGIN.
97 #define BEGIN yy_start = 1 + 2 *
99 /* Translate the current start state into a value that can be later handed
100 * to BEGIN to return to the state. The YYSTATE alias is for lex
103 #define YY_START ((yy_start - 1) / 2)
104 #define YYSTATE YY_START
106 /* Action number for EOF rule of a given start state. */
107 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
109 /* Special action meaning "start processing a new file". */
110 #define YY_NEW_FILE yyrestart( yyin )
112 #define YY_END_OF_BUFFER_CHAR 0
114 /* Size of default input buffer. */
115 #define YY_BUF_SIZE 16384
117 typedef struct yy_buffer_state *YY_BUFFER_STATE;
120 extern FILE *yyin, *yyout;
122 #define EOB_ACT_CONTINUE_SCAN 0
123 #define EOB_ACT_END_OF_FILE 1
124 #define EOB_ACT_LAST_MATCH 2
126 /* The funky do-while in the following #define is used to turn the definition
127 * int a single C statement (which needs a semi-colon terminator). This
128 * avoids problems with code like:
130 * if ( condition_holds )
133 * do_something_else();
135 * Prior to using the do-while the compiler would get upset at the
136 * "else" because it interpreted the "if" statement as being all
137 * done when it reached the ';' after the yyless() call.
140 /* Return all but the first 'n' matched characters back to the input stream. */
145 /* Undo effects of setting up yytext. */ \
146 *yy_cp = yy_hold_char; \
147 YY_RESTORE_YY_MORE_OFFSET \
148 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
149 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
153 #define unput(c) yyunput( c, yytext_ptr )
155 /* The following is because we cannot portably get our hands on size_t
156 * (without autoconf's help, which isn't available because we want
157 * flex-generated scanners to compile on their own).
159 typedef unsigned int yy_size_t;
162 struct yy_buffer_state
166 char *yy_ch_buf; /* input buffer */
167 char *yy_buf_pos; /* current position in input buffer */
169 /* Size of input buffer in bytes, not including room for EOB
172 yy_size_t yy_buf_size;
174 /* Number of characters read into yy_ch_buf, not including EOB
179 /* Whether we "own" the buffer - i.e., we know we created it,
180 * and can realloc() it to grow it, and should free() it to
183 int yy_is_our_buffer;
185 /* Whether this is an "interactive" input source; if so, and
186 * if we're using stdio for input, then we want to use getc()
187 * instead of fread(), to make sure we stop fetching input after
190 int yy_is_interactive;
192 /* Whether we're considered to be at the beginning of a line.
193 * If so, '^' rules will be active on the next match, otherwise
198 /* Whether to try to fill the input buffer when we reach the
203 int yy_buffer_status;
204 #define YY_BUFFER_NEW 0
205 #define YY_BUFFER_NORMAL 1
206 /* When an EOF's been seen but there's still some text to process
207 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
208 * shouldn't try reading from the input source any more. We might
209 * still have a bunch of tokens to match, though, because of
210 * possible backing-up.
212 * When we actually see the EOF, we change the status to "new"
213 * (via yyrestart()), so that the user can continue scanning by
214 * just pointing yyin at a new input file.
216 #define YY_BUFFER_EOF_PENDING 2
219 static YY_BUFFER_STATE yy_current_buffer = 0;
221 /* We provide macros for accessing buffer states in case in the
222 * future we want to put the buffer states in a more general
225 #define YY_CURRENT_BUFFER yy_current_buffer
228 /* yy_hold_char holds the character lost when yytext is formed. */
229 static char yy_hold_char;
231 static int yy_n_chars; /* number of characters read into yy_ch_buf */
236 /* Points to current character in buffer. */
237 static char *yy_c_buf_p = (char *) 0;
238 static int yy_init = 1; /* whether we need to initialize */
239 static int yy_start = 0; /* start state number */
241 /* Flag which is used to allow yywrap()'s to do buffer switches
242 * instead of setting up a fresh yyin. A bit of a hack ...
244 static int yy_did_buffer_switch_on_eof;
246 void yyrestart YY_PROTO(( FILE *input_file ));
248 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
249 void yy_load_buffer_state YY_PROTO(( void ));
250 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
251 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
252 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
253 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
254 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
256 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
257 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
258 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
260 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
261 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
262 static void yy_flex_free YY_PROTO(( void * ));
264 #define yy_new_buffer yy_create_buffer
266 #define yy_set_interactive(is_interactive) \
268 if ( ! yy_current_buffer ) \
269 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
270 yy_current_buffer->yy_is_interactive = is_interactive; \
273 #define yy_set_bol(at_bol) \
275 if ( ! yy_current_buffer ) \
276 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
277 yy_current_buffer->yy_at_bol = at_bol; \
280 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
284 #define YY_SKIP_YYWRAP
285 typedef unsigned char YY_CHAR;
286 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
287 typedef int yy_state_type;
289 #define yytext_ptr yytext
291 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
292 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
293 static int yy_get_next_buffer YY_PROTO(( void ));
294 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
296 /* Done after the current pattern has been matched and before the
297 * corresponding action - sets up yytext.
299 #define YY_DO_BEFORE_ACTION \
300 yytext_ptr = yy_bp; \
301 yytext_ptr -= yy_more_len; \
302 yyleng = (int) (yy_cp - yytext_ptr); \
303 yy_hold_char = *yy_cp; \
307 #define YY_NUM_RULES 11
308 #define YY_END_OF_BUFFER 12
309 static yyconst short int yy_accept[32] =
311 0, 0, 12, 10, 6, 5, 10, 10, 1, 1,
312 1, 2, 6, 5, 0, 4, 3, 0, 0, 0,
313 2, 0, 7, 0, 8, 0, 0, 0, 0, 9,
317 static yyconst int yy_ec[256] =
319 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
320 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
321 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
322 1, 2, 1, 1, 1, 1, 1, 1, 4, 1,
323 1, 1, 1, 1, 5, 1, 6, 7, 7, 7,
324 7, 7, 7, 7, 7, 7, 7, 1, 1, 8,
325 9, 9, 10, 1, 11, 11, 11, 11, 11, 11,
326 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
327 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
328 1, 1, 1, 1, 11, 1, 11, 11, 11, 11,
330 11, 11, 11, 11, 11, 11, 11, 12, 13, 11,
331 11, 11, 11, 11, 11, 11, 11, 11, 11, 14,
332 11, 11, 1, 1, 1, 1, 1, 1, 1, 1,
333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 static yyconst int yy_meta[15] =
351 1, 1, 2, 1, 1, 1, 3, 1, 1, 1,
355 static yyconst short int yy_base[38] =
357 0, 0, 48, 49, 45, 0, 12, 41, 39, 34,
358 49, 0, 41, 0, 14, 49, 49, 39, 38, 26,
359 0, 36, 49, 35, 49, 24, 24, 32, 31, 49,
360 49, 18, 21, 17, 24, 27, 30
363 static yyconst short int yy_def[38] =
365 31, 1, 31, 31, 31, 32, 33, 31, 31, 31,
366 31, 34, 31, 32, 33, 31, 31, 35, 36, 31,
367 34, 35, 31, 36, 31, 31, 31, 37, 37, 31,
368 0, 31, 31, 31, 31, 31, 31
371 static yyconst short int yy_nxt[64] =
373 4, 5, 6, 7, 8, 9, 4, 10, 11, 4,
374 12, 12, 12, 12, 16, 17, 16, 17, 14, 21,
375 14, 15, 15, 15, 22, 22, 22, 24, 24, 24,
376 29, 29, 29, 30, 30, 28, 27, 25, 23, 26,
377 25, 23, 13, 20, 19, 18, 13, 31, 3, 31,
378 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
382 static yyconst short int yy_chk[64] =
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 7, 7, 15, 15, 32, 34,
386 32, 33, 33, 33, 35, 35, 35, 36, 36, 36,
387 37, 37, 37, 29, 28, 27, 26, 24, 22, 20,
388 19, 18, 13, 10, 9, 8, 5, 3, 31, 31,
389 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
393 static yy_state_type yy_last_accepting_state;
394 static char *yy_last_accepting_cpos;
396 /* The intent behind this definition is that it'll catch
397 * any uses of REJECT which flex missed.
399 #define REJECT reject_used_but_not_detected
400 static int yy_more_flag = 0;
401 static int yy_more_len = 0;
402 #define yymore() (yy_more_flag = 1)
403 #define YY_MORE_ADJ yy_more_len
404 #define YY_RESTORE_YY_MORE_OFFSET
410 flex -PResParser -oreslexer.cc res.l
415 * AT&T lex can't handle this lexer due to lex bugs. It works with flex
416 * 2.3.7, pclex 2.0.5, and MKS lex 3.1a.
419 #include "parse_fta.h"
424 #include "res.tab.cc.h"
427 Some includes that flex doesn't include as standard,
428 but which are needed.
435 // Prevent flex from defining yywrap as extern "C"
437 #define YY_SKIP_YYWRAP
439 /* No lex lib, supply the yywrap fcn. that normally resides there
442 int ResParserwrap(){return(1);}
444 extern int ResParserdebug;
448 These variables are used for error reporting:
449 flex_res_lineno : the line currently being parsed when the error occurs.
450 flex_res_ch : the character on the line where the error occurs
451 flex_res_linebuf : store the line for reporting.
453 NOTE : 1) the fixed size flex_res_linebuf buffer is dangerous.
454 2) You might get pointed to a place shortly after
455 where the syntax error occurs. It is close enough
459 int flex_res_lineno = 1;
461 char flex_res_linebuf[20000];
463 char *flex_res_stringinput = NULL;
464 int flex_res_stringinput_ptr = 0;
465 FILE *flex_res_fileinput = NULL;
466 int my_ResParser_yyinput(char *buf, int max_size);
470 void ResParsererror(char *s){
472 fprintf(stderr,"On line %d, char %d: %s (token %s):\n%s\n",
473 flex_res_lineno, flex_res_ch, s, ResParsertext, flex_res_linebuf );
474 for(i=0;i<flex_res_ch;i++){
475 if(flex_res_linebuf[i] == '\t'){
476 fprintf(stderr,"\t");
481 fprintf(stderr,"^\n");
482 // fprintf(stderr,"%*s\n",1+flex_res_ch,"^");
486 #define YY_INPUT(b, r, ms) (r = my_ResParser_yyinput(b,ms))
488 /* MKS needs the next line to increase the NFA table */
489 #line 490 "reslexer.cc"
491 /* Macros after this point can all be overridden by user definitions in
495 #ifndef YY_SKIP_YYWRAP
497 extern "C" int yywrap YY_PROTO(( void ));
499 extern int yywrap YY_PROTO(( void ));
504 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
508 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
511 #ifdef YY_NEED_STRLEN
512 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
517 static int yyinput YY_PROTO(( void ));
519 static int input YY_PROTO(( void ));
524 static int yy_start_stack_ptr = 0;
525 static int yy_start_stack_depth = 0;
526 static int *yy_start_stack = 0;
527 #ifndef YY_NO_PUSH_STATE
528 static void yy_push_state YY_PROTO(( int new_state ));
530 #ifndef YY_NO_POP_STATE
531 static void yy_pop_state YY_PROTO(( void ));
533 #ifndef YY_NO_TOP_STATE
534 static int yy_top_state YY_PROTO(( void ));
538 #define YY_NO_PUSH_STATE 1
539 #define YY_NO_POP_STATE 1
540 #define YY_NO_TOP_STATE 1
543 #ifdef YY_MALLOC_DECL
551 /* Just try to get by without declaring the routines. This will fail
552 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
553 * or sizeof(void*) != sizeof(int).
558 /* Amount of stuff to slurp up with each read. */
559 #ifndef YY_READ_BUF_SIZE
560 #define YY_READ_BUF_SIZE 8192
563 /* Copy whatever the last rule matched to the standard output. */
566 /* This used to be an fputs(), but since the string might contain NUL's,
567 * we now use fwrite().
569 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
572 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
573 * is returned in "result".
576 #define YY_INPUT(buf,result,max_size) \
577 if ( yy_current_buffer->yy_is_interactive ) \
580 for ( n = 0; n < max_size && \
581 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
584 buf[n++] = (char) c; \
585 if ( c == EOF && ferror( yyin ) ) \
586 YY_FATAL_ERROR( "input in flex scanner failed" ); \
589 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
590 && ferror( yyin ) ) \
591 YY_FATAL_ERROR( "input in flex scanner failed" );
594 /* No semi-colon after return; correct usage is to write "yyterminate();" -
595 * we don't want an extra ';' after the "return" because that will cause
596 * some compilers to complain about unreachable statements.
599 #define yyterminate() return YY_NULL
602 /* Number of entries by which start-condition stack grows. */
603 #ifndef YY_START_STACK_INCR
604 #define YY_START_STACK_INCR 25
607 /* Report a fatal error. */
608 #ifndef YY_FATAL_ERROR
609 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
612 /* Default declaration of generated scanner - a define so the user can
613 * easily add parameters.
616 #define YY_DECL int yylex YY_PROTO(( void ))
619 /* Code executed at the beginning of each rule, after yytext and yyleng
622 #ifndef YY_USER_ACTION
623 #define YY_USER_ACTION
626 /* Code executed at the end of each rule. */
628 #define YY_BREAK break;
631 #define YY_RULE_SETUP \
636 register yy_state_type yy_current_state;
637 register char *yy_cp = NULL, *yy_bp = NULL;
643 /* literal keyword tokens */
646 The actions associated with each text token are to
647 keep track of the current location (for syntax error reporting)
648 and to report any necessary info to the emf.y parse tree builder
650 Its likely that there are a number of omissions, inconsistencies
651 (some keywords do not need to be in caps), and relics
652 (keywords such as BETWEEN, INDICATOR, etc., are not used
654 This parser is somewhat of a work in progress.
662 #line 663 "reslexer.cc"
673 yy_start = 1; /* first start state */
681 if ( ! yy_current_buffer )
683 yy_create_buffer( yyin, YY_BUF_SIZE );
685 yy_load_buffer_state();
688 while ( 1 ) /* loops until end-of-file is reached */
693 yy_more_len = yy_c_buf_p - yytext_ptr;
698 /* Support of yytext. */
699 *yy_cp = yy_hold_char;
701 /* yy_bp points to the position in yy_ch_buf of the start of
706 yy_current_state = yy_start;
710 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
711 if ( yy_accept[yy_current_state] )
713 yy_last_accepting_state = yy_current_state;
714 yy_last_accepting_cpos = yy_cp;
716 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
718 yy_current_state = (int) yy_def[yy_current_state];
719 if ( yy_current_state >= 32 )
720 yy_c = yy_meta[(unsigned int) yy_c];
722 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
725 while ( yy_base[yy_current_state] != 49 );
728 yy_act = yy_accept[yy_current_state];
730 { /* have to back up */
731 yy_cp = yy_last_accepting_cpos;
732 yy_current_state = yy_last_accepting_state;
733 yy_act = yy_accept[yy_current_state];
739 do_action: /* This label is used only to access EOF actions. */
743 { /* beginning of action switch */
744 case 0: /* must back up */
745 /* undo the effects of YY_DO_BEFORE_ACTION */
746 *yy_cp = yy_hold_char;
747 yy_cp = yy_last_accepting_cpos;
748 yy_current_state = yy_last_accepting_state;
754 { flex_res_ch+=ResParserleng; return yytext[0]; }
760 { flex_res_ch+=ResParserleng; ResParserlval.strval = strdup(yytext); return NAME; }
770 ResParserlval.strval = strdup(ResParsertext+1);
774 unput(c); /* just peeking */
776 flex_res_ch+=ResParserleng;
777 ResParserlval.strval[ResParserleng-2] = '\0';
784 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
785 yy_c_buf_p = yy_cp -= 1;
786 YY_DO_BEFORE_ACTION; /* set up yytext again */
789 { flex_res_ch+=ResParserleng; ResParsererror("Unterminated string"); }
792 /* Newline : advance the error reporting line number */
793 /* and grab the next line into flex_res_linebuf */
798 {flex_res_ch=0; flex_res_lineno++;
799 strcpy(flex_res_linebuf,ResParsertext+1);
806 {flex_res_ch+=ResParserleng; } /* white space */
809 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
810 yy_c_buf_p = yy_cp -= 1;
811 YY_DO_BEFORE_ACTION; /* set up yytext again */
814 {flex_res_ch+=ResParserleng; }; /* comment */
817 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
818 yy_c_buf_p = yy_cp -= 1;
819 YY_DO_BEFORE_ACTION; /* set up yytext again */
822 {flex_res_ch+=ResParserleng; }; /* comment */
825 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
826 yy_c_buf_p = yy_cp -= 1;
827 YY_DO_BEFORE_ACTION; /* set up yytext again */
830 {flex_res_ch+=ResParserleng; }; /* comment */
835 {flex_res_ch+=ResParserleng; fprintf(stderr,"Warning: unknown token (ignored)\n"); ResParsererror(yytext);}
842 #line 843 "reslexer.cc"
843 case YY_STATE_EOF(INITIAL):
846 case YY_END_OF_BUFFER:
848 /* Amount of text matched not including the EOB char. */
849 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
851 /* Undo the effects of YY_DO_BEFORE_ACTION. */
852 *yy_cp = yy_hold_char;
853 YY_RESTORE_YY_MORE_OFFSET
855 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
857 /* We're scanning a new file or input source. It's
858 * possible that this happened because the user
859 * just pointed yyin at a new source and called
860 * yylex(). If so, then we have to assure
861 * consistency between yy_current_buffer and our
862 * globals. Here is the right place to do so, because
863 * this is the first action (other than possibly a
864 * back-up) that will match for the new input source.
866 yy_n_chars = yy_current_buffer->yy_n_chars;
867 yy_current_buffer->yy_input_file = yyin;
868 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
871 /* Note that here we test for yy_c_buf_p "<=" to the position
872 * of the first EOB in the buffer, since yy_c_buf_p will
873 * already have been incremented past the NUL character
874 * (since all states make transitions on EOB to the
875 * end-of-buffer state). Contrast this with the test
878 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
879 { /* This was really a NUL. */
880 yy_state_type yy_next_state;
882 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
884 yy_current_state = yy_get_previous_state();
886 /* Okay, we're now positioned to make the NUL
887 * transition. We couldn't have
888 * yy_get_previous_state() go ahead and do it
889 * for us because it doesn't know how to deal
890 * with the possibility of jamming (and we don't
891 * want to build jamming into it because then it
892 * will run more slowly).
895 yy_next_state = yy_try_NUL_trans( yy_current_state );
897 yy_bp = yytext_ptr + YY_MORE_ADJ;
901 /* Consume the NUL. */
902 yy_cp = ++yy_c_buf_p;
903 yy_current_state = yy_next_state;
914 else switch ( yy_get_next_buffer() )
916 case EOB_ACT_END_OF_FILE:
918 yy_did_buffer_switch_on_eof = 0;
922 /* Note: because we've taken care in
923 * yy_get_next_buffer() to have set up
924 * yytext, we can now set up
925 * yy_c_buf_p so that if some total
926 * hoser (like flex itself) wants to
927 * call the scanner after we return the
928 * YY_NULL, it'll still work - another
929 * YY_NULL will get returned.
931 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
933 yy_act = YY_STATE_EOF(YY_START);
939 if ( ! yy_did_buffer_switch_on_eof )
945 case EOB_ACT_CONTINUE_SCAN:
947 yytext_ptr + yy_amount_of_matched_text;
949 yy_current_state = yy_get_previous_state();
952 yy_bp = yytext_ptr + YY_MORE_ADJ;
955 case EOB_ACT_LAST_MATCH:
957 &yy_current_buffer->yy_ch_buf[yy_n_chars];
959 yy_current_state = yy_get_previous_state();
962 yy_bp = yytext_ptr + YY_MORE_ADJ;
970 "fatal flex scanner internal error--no action found" );
971 } /* end of action switch */
972 } /* end of scanning one token */
976 /* yy_get_next_buffer - try to read in a new buffer
978 * Returns a code representing an action:
979 * EOB_ACT_LAST_MATCH -
980 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
981 * EOB_ACT_END_OF_FILE - end of file
984 static int yy_get_next_buffer()
986 register char *dest = yy_current_buffer->yy_ch_buf;
987 register char *source = yytext_ptr;
988 register int number_to_move, i;
991 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
993 "fatal flex scanner internal error--end of buffer missed" );
995 if ( yy_current_buffer->yy_fill_buffer == 0 )
996 { /* Don't try to fill the buffer, so this is an EOF. */
997 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
999 /* We matched a single character, the EOB, so
1000 * treat this as a final EOF.
1002 return EOB_ACT_END_OF_FILE;
1007 /* We matched some text prior to the EOB, first
1010 return EOB_ACT_LAST_MATCH;
1014 /* Try to read more data. */
1016 /* First move last chars to start of buffer. */
1017 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1019 for ( i = 0; i < number_to_move; ++i )
1020 *(dest++) = *(source++);
1022 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1023 /* don't do the read, it's not guaranteed to return an EOF,
1026 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1031 yy_current_buffer->yy_buf_size - number_to_move - 1;
1033 while ( num_to_read <= 0 )
1034 { /* Not enough room in the buffer - grow it. */
1035 #ifdef YY_USES_REJECT
1037 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1040 /* just a shorter name for the current buffer */
1041 YY_BUFFER_STATE b = yy_current_buffer;
1043 int yy_c_buf_p_offset =
1044 (int) (yy_c_buf_p - b->yy_ch_buf);
1046 if ( b->yy_is_our_buffer )
1048 int new_size = b->yy_buf_size * 2;
1050 if ( new_size <= 0 )
1051 b->yy_buf_size += b->yy_buf_size / 8;
1053 b->yy_buf_size *= 2;
1055 b->yy_ch_buf = (char *)
1056 /* Include room in for 2 EOB chars. */
1057 yy_flex_realloc( (void *) b->yy_ch_buf,
1058 b->yy_buf_size + 2 );
1061 /* Can't grow it, we don't own it. */
1064 if ( ! b->yy_ch_buf )
1066 "fatal error - scanner input buffer overflow" );
1068 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1070 num_to_read = yy_current_buffer->yy_buf_size -
1075 if ( num_to_read > YY_READ_BUF_SIZE )
1076 num_to_read = YY_READ_BUF_SIZE;
1078 /* Read in more data. */
1079 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1080 yy_n_chars, num_to_read );
1082 yy_current_buffer->yy_n_chars = yy_n_chars;
1085 if ( yy_n_chars == 0 )
1087 if ( number_to_move == YY_MORE_ADJ )
1089 ret_val = EOB_ACT_END_OF_FILE;
1095 ret_val = EOB_ACT_LAST_MATCH;
1096 yy_current_buffer->yy_buffer_status =
1097 YY_BUFFER_EOF_PENDING;
1102 ret_val = EOB_ACT_CONTINUE_SCAN;
1104 yy_n_chars += number_to_move;
1105 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1106 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1108 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1114 /* yy_get_previous_state - get the state just before the EOB char was reached */
1116 static yy_state_type yy_get_previous_state()
1118 register yy_state_type yy_current_state;
1119 register char *yy_cp;
1121 yy_current_state = yy_start;
1123 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1125 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1126 if ( yy_accept[yy_current_state] )
1128 yy_last_accepting_state = yy_current_state;
1129 yy_last_accepting_cpos = yy_cp;
1131 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1133 yy_current_state = (int) yy_def[yy_current_state];
1134 if ( yy_current_state >= 32 )
1135 yy_c = yy_meta[(unsigned int) yy_c];
1137 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1140 return yy_current_state;
1144 /* yy_try_NUL_trans - try to make a transition on the NUL character
1147 * next_state = yy_try_NUL_trans( current_state );
1150 #ifdef YY_USE_PROTOS
1151 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1153 static yy_state_type yy_try_NUL_trans( yy_current_state )
1154 yy_state_type yy_current_state;
1157 register int yy_is_jam;
1158 register char *yy_cp = yy_c_buf_p;
1160 register YY_CHAR yy_c = 1;
1161 if ( yy_accept[yy_current_state] )
1163 yy_last_accepting_state = yy_current_state;
1164 yy_last_accepting_cpos = yy_cp;
1166 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1168 yy_current_state = (int) yy_def[yy_current_state];
1169 if ( yy_current_state >= 32 )
1170 yy_c = yy_meta[(unsigned int) yy_c];
1172 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1173 yy_is_jam = (yy_current_state == 31);
1175 return yy_is_jam ? 0 : yy_current_state;
1180 #ifdef YY_USE_PROTOS
1181 static void yyunput( int c, register char *yy_bp )
1183 static void yyunput( c, yy_bp )
1185 register char *yy_bp;
1188 register char *yy_cp = yy_c_buf_p;
1190 /* undo effects of setting up yytext */
1191 *yy_cp = yy_hold_char;
1193 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1194 { /* need to shift things up to make room */
1195 /* +2 for EOB chars. */
1196 register int number_to_move = yy_n_chars + 2;
1197 register char *dest = &yy_current_buffer->yy_ch_buf[
1198 yy_current_buffer->yy_buf_size + 2];
1199 register char *source =
1200 &yy_current_buffer->yy_ch_buf[number_to_move];
1202 while ( source > yy_current_buffer->yy_ch_buf )
1203 *--dest = *--source;
1205 yy_cp += (int) (dest - source);
1206 yy_bp += (int) (dest - source);
1207 yy_current_buffer->yy_n_chars =
1208 yy_n_chars = yy_current_buffer->yy_buf_size;
1210 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1211 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1214 *--yy_cp = (char) c;
1218 yy_hold_char = *yy_cp;
1221 #endif /* ifndef YY_NO_UNPUT */
1226 static int yyinput()
1233 *yy_c_buf_p = yy_hold_char;
1235 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1237 /* yy_c_buf_p now points to the character we want to return.
1238 * If this occurs *before* the EOB characters, then it's a
1239 * valid NUL; if not, then we've hit the end of the buffer.
1241 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1242 /* This was really a NUL. */
1246 { /* need more input */
1247 int offset = yy_c_buf_p - yytext_ptr;
1250 switch ( yy_get_next_buffer() )
1252 case EOB_ACT_LAST_MATCH:
1253 /* This happens because yy_g_n_b()
1254 * sees that we've accumulated a
1255 * token and flags that we need to
1256 * try matching the token before
1257 * proceeding. But for input(),
1258 * there's no matching to consider.
1259 * So convert the EOB_ACT_LAST_MATCH
1260 * to EOB_ACT_END_OF_FILE.
1263 /* Reset buffer status. */
1268 case EOB_ACT_END_OF_FILE:
1273 if ( ! yy_did_buffer_switch_on_eof )
1282 case EOB_ACT_CONTINUE_SCAN:
1283 yy_c_buf_p = yytext_ptr + offset;
1289 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1290 *yy_c_buf_p = '\0'; /* preserve yytext */
1291 yy_hold_char = *++yy_c_buf_p;
1296 #endif /* YY_NO_INPUT */
1298 #ifdef YY_USE_PROTOS
1299 void yyrestart( FILE *input_file )
1301 void yyrestart( input_file )
1305 if ( ! yy_current_buffer )
1306 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1308 yy_init_buffer( yy_current_buffer, input_file );
1309 yy_load_buffer_state();
1313 #ifdef YY_USE_PROTOS
1314 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1316 void yy_switch_to_buffer( new_buffer )
1317 YY_BUFFER_STATE new_buffer;
1320 if ( yy_current_buffer == new_buffer )
1323 if ( yy_current_buffer )
1325 /* Flush out information for old buffer. */
1326 *yy_c_buf_p = yy_hold_char;
1327 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1328 yy_current_buffer->yy_n_chars = yy_n_chars;
1331 yy_current_buffer = new_buffer;
1332 yy_load_buffer_state();
1334 /* We don't actually know whether we did this switch during
1335 * EOF (yywrap()) processing, but the only time this flag
1336 * is looked at is after yywrap() is called, so it's safe
1337 * to go ahead and always set it.
1339 yy_did_buffer_switch_on_eof = 1;
1343 #ifdef YY_USE_PROTOS
1344 void yy_load_buffer_state( void )
1346 void yy_load_buffer_state()
1349 yy_n_chars = yy_current_buffer->yy_n_chars;
1350 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1351 yyin = yy_current_buffer->yy_input_file;
1352 yy_hold_char = *yy_c_buf_p;
1356 #ifdef YY_USE_PROTOS
1357 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1359 YY_BUFFER_STATE yy_create_buffer( file, size )
1366 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1368 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1370 b->yy_buf_size = size;
1372 /* yy_ch_buf has to be 2 characters longer than the size given because
1373 * we need to put in 2 end-of-buffer characters.
1375 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1376 if ( ! b->yy_ch_buf )
1377 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1379 b->yy_is_our_buffer = 1;
1381 yy_init_buffer( b, file );
1387 #ifdef YY_USE_PROTOS
1388 void yy_delete_buffer( YY_BUFFER_STATE b )
1390 void yy_delete_buffer( b )
1397 if ( b == yy_current_buffer )
1398 yy_current_buffer = (YY_BUFFER_STATE) 0;
1400 if ( b->yy_is_our_buffer )
1401 yy_flex_free( (void *) b->yy_ch_buf );
1403 yy_flex_free( (void *) b );
1408 #ifdef YY_USE_PROTOS
1409 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1411 void yy_init_buffer( b, file )
1418 yy_flush_buffer( b );
1420 b->yy_input_file = file;
1421 b->yy_fill_buffer = 1;
1423 #if YY_ALWAYS_INTERACTIVE
1424 b->yy_is_interactive = 1;
1426 #if YY_NEVER_INTERACTIVE
1427 b->yy_is_interactive = 0;
1429 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1435 #ifdef YY_USE_PROTOS
1436 void yy_flush_buffer( YY_BUFFER_STATE b )
1438 void yy_flush_buffer( b )
1448 /* We always need two end-of-buffer characters. The first causes
1449 * a transition to the end-of-buffer state. The second causes
1450 * a jam in that state.
1452 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1453 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1455 b->yy_buf_pos = &b->yy_ch_buf[0];
1458 b->yy_buffer_status = YY_BUFFER_NEW;
1460 if ( b == yy_current_buffer )
1461 yy_load_buffer_state();
1465 #ifndef YY_NO_SCAN_BUFFER
1466 #ifdef YY_USE_PROTOS
1467 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1469 YY_BUFFER_STATE yy_scan_buffer( base, size )
1477 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1478 base[size-1] != YY_END_OF_BUFFER_CHAR )
1479 /* They forgot to leave room for the EOB's. */
1482 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1484 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1486 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1487 b->yy_buf_pos = b->yy_ch_buf = base;
1488 b->yy_is_our_buffer = 0;
1489 b->yy_input_file = 0;
1490 b->yy_n_chars = b->yy_buf_size;
1491 b->yy_is_interactive = 0;
1493 b->yy_fill_buffer = 0;
1494 b->yy_buffer_status = YY_BUFFER_NEW;
1496 yy_switch_to_buffer( b );
1503 #ifndef YY_NO_SCAN_STRING
1504 #ifdef YY_USE_PROTOS
1505 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1507 YY_BUFFER_STATE yy_scan_string( yy_str )
1508 yyconst char *yy_str;
1512 for ( len = 0; yy_str[len]; ++len )
1515 return yy_scan_bytes( yy_str, len );
1520 #ifndef YY_NO_SCAN_BYTES
1521 #ifdef YY_USE_PROTOS
1522 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1524 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1525 yyconst char *bytes;
1534 /* Get memory for full buffer, including space for trailing EOB's. */
1536 buf = (char *) yy_flex_alloc( n );
1538 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1540 for ( i = 0; i < len; ++i )
1543 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1545 b = yy_scan_buffer( buf, n );
1547 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1549 /* It's okay to grow etc. this buffer, and we should throw it
1550 * away when we're done.
1552 b->yy_is_our_buffer = 1;
1559 #ifndef YY_NO_PUSH_STATE
1560 #ifdef YY_USE_PROTOS
1561 static void yy_push_state( int new_state )
1563 static void yy_push_state( new_state )
1567 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1571 yy_start_stack_depth += YY_START_STACK_INCR;
1572 new_size = yy_start_stack_depth * sizeof( int );
1574 if ( ! yy_start_stack )
1575 yy_start_stack = (int *) yy_flex_alloc( new_size );
1578 yy_start_stack = (int *) yy_flex_realloc(
1579 (void *) yy_start_stack, new_size );
1581 if ( ! yy_start_stack )
1583 "out of memory expanding start-condition stack" );
1586 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1593 #ifndef YY_NO_POP_STATE
1594 static void yy_pop_state()
1596 if ( --yy_start_stack_ptr < 0 )
1597 YY_FATAL_ERROR( "start-condition stack underflow" );
1599 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1604 #ifndef YY_NO_TOP_STATE
1605 static int yy_top_state()
1607 return yy_start_stack[yy_start_stack_ptr - 1];
1611 #ifndef YY_EXIT_FAILURE
1612 #define YY_EXIT_FAILURE 2
1615 #ifdef YY_USE_PROTOS
1616 static void yy_fatal_error( yyconst char msg[] )
1618 static void yy_fatal_error( msg )
1622 (void) fprintf( stderr, "%s\n", msg );
1623 exit( YY_EXIT_FAILURE );
1628 /* Redefine yyless() so it works in section 3 code. */
1634 /* Undo effects of setting up yytext. */ \
1635 yytext[yyleng] = yy_hold_char; \
1636 yy_c_buf_p = yytext + n; \
1637 yy_hold_char = *yy_c_buf_p; \
1638 *yy_c_buf_p = '\0'; \
1644 /* Internal utility routines. */
1647 #ifdef YY_USE_PROTOS
1648 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1650 static void yy_flex_strncpy( s1, s2, n )
1657 for ( i = 0; i < n; ++i )
1662 #ifdef YY_NEED_STRLEN
1663 #ifdef YY_USE_PROTOS
1664 static int yy_flex_strlen( yyconst char *s )
1666 static int yy_flex_strlen( s )
1671 for ( n = 0; s[n]; ++n )
1679 #ifdef YY_USE_PROTOS
1680 static void *yy_flex_alloc( yy_size_t size )
1682 static void *yy_flex_alloc( size )
1686 return (void *) malloc( size );
1689 #ifdef YY_USE_PROTOS
1690 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1692 static void *yy_flex_realloc( ptr, size )
1697 /* The cast to (char *) in the following accommodates both
1698 * implementations that use char* generic pointers, and those
1699 * that use void* generic pointers. It works with the latter
1700 * because both ANSI C and C++ allow castless assignment from
1701 * any pointer type to void*, and deal with argument conversions
1702 * as though doing an assignment.
1704 return (void *) realloc( (char *) ptr, size );
1707 #ifdef YY_USE_PROTOS
1708 static void yy_flex_free( void *ptr )
1710 static void yy_flex_free( ptr )
1727 int my_ResParser_yyinput(char *buf, int max_size){
1731 if(flex_res_stringinput != NULL){
1733 if(flex_res_stringinput[flex_res_stringinput_ptr] != '\0'){
1734 buf[c++] = flex_res_stringinput[flex_res_stringinput_ptr++];
1742 if(flex_res_fileinput != NULL){
1743 while(c < max_size){
1744 inchar = getc(flex_res_fileinput);
1757 void ResParser_setfileinput(FILE *f){
1758 ResParserrestart(NULL);
1760 flex_res_fileinput = f;
1761 flex_res_stringinput = NULL;
1762 flex_res_lineno = 1;
1766 void ResParser_setstringinput(char *s){
1767 ResParserrestart(NULL);
1769 flex_res_fileinput = NULL;
1770 flex_res_stringinput = s;
1771 flex_res_stringinput_ptr = 0;
1772 flex_res_lineno = 1;