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