1 #define yy_create_buffer PartnParser_create_buffer
2 #define yy_delete_buffer PartnParser_delete_buffer
3 #define yy_scan_buffer PartnParser_scan_buffer
4 #define yy_scan_string PartnParser_scan_string
5 #define yy_scan_bytes PartnParser_scan_bytes
6 #define yy_flex_debug PartnParser_flex_debug
7 #define yy_init_buffer PartnParser_init_buffer
8 #define yy_flush_buffer PartnParser_flush_buffer
9 #define yy_load_buffer_state PartnParser_load_buffer_state
10 #define yy_switch_to_buffer PartnParser_switch_to_buffer
11 #define yyin PartnParserin
12 #define yyleng PartnParserleng
13 #define yylex PartnParserlex
14 #define yyout PartnParserout
15 #define yyrestart PartnParserrestart
16 #define yytext PartnParsertext
18 #line 19 "partnlexer.cc"
19 /* A lexical scanner generated by flex */
21 /* Scanner skeleton version:
22 * $Header: /cvsroot/gscpv4/src/ftacmp/partnlexer.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 yyleng = (int) (yy_cp - yy_bp); \
302 yy_hold_char = *yy_cp; \
306 #define YY_NUM_RULES 16
307 #define YY_END_OF_BUFFER 17
308 static yyconst short int yy_accept[40] =
310 0, 0, 17, 15, 12, 11, 4, 5, 4, 8,
311 7, 7, 7, 7, 6, 12, 11, 0, 0, 8,
312 0, 7, 7, 7, 7, 0, 13, 0, 14, 9,
313 1, 7, 7, 10, 7, 2, 7, 3, 0
316 static yyconst int yy_ec[256] =
318 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
319 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
320 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
321 1, 2, 4, 1, 4, 4, 4, 4, 1, 4,
322 4, 4, 4, 4, 5, 4, 6, 7, 7, 7,
323 7, 7, 7, 7, 7, 7, 7, 4, 4, 1,
324 1, 1, 1, 4, 8, 9, 9, 9, 10, 9,
325 9, 11, 12, 9, 9, 13, 9, 9, 9, 14,
326 9, 9, 9, 9, 15, 16, 9, 17, 9, 9,
327 4, 1, 4, 1, 18, 1, 9, 9, 9, 9,
329 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
330 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
331 9, 9, 1, 4, 1, 19, 1, 1, 1, 1,
332 1, 1, 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,
340 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,
348 static yyconst int yy_meta[20] =
350 1, 1, 2, 1, 1, 1, 3, 3, 3, 3,
351 3, 3, 3, 3, 3, 3, 3, 3, 1
354 static yyconst short int yy_base[44] =
356 0, 0, 53, 54, 50, 0, 54, 46, 44, 13,
357 0, 39, 34, 36, 54, 44, 0, 42, 41, 14,
358 30, 0, 25, 23, 30, 36, 54, 28, 54, 14,
359 0, 10, 8, 54, 16, 0, 10, 0, 54, 29,
363 static yyconst short int yy_def[44] =
365 39, 1, 39, 39, 39, 40, 39, 39, 39, 39,
366 41, 41, 41, 41, 39, 39, 40, 42, 43, 39,
367 39, 41, 41, 41, 41, 42, 39, 43, 39, 39,
368 41, 41, 41, 39, 41, 41, 41, 41, 0, 39,
372 static yyconst short int yy_nxt[74] =
374 4, 5, 6, 7, 8, 9, 10, 11, 11, 11,
375 12, 13, 14, 11, 11, 11, 11, 11, 15, 20,
376 20, 22, 38, 37, 36, 35, 34, 21, 21, 17,
377 29, 17, 26, 26, 26, 28, 28, 28, 27, 33,
378 32, 31, 30, 29, 27, 16, 25, 24, 23, 19,
379 18, 16, 39, 3, 39, 39, 39, 39, 39, 39,
380 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
384 static yyconst short int yy_chk[74] =
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 10,
388 20, 41, 37, 35, 33, 32, 30, 10, 20, 40,
389 28, 40, 42, 42, 42, 43, 43, 43, 26, 25,
390 24, 23, 21, 19, 18, 16, 14, 13, 12, 9,
391 8, 5, 3, 39, 39, 39, 39, 39, 39, 39,
392 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
396 static yy_state_type yy_last_accepting_state;
397 static char *yy_last_accepting_cpos;
399 /* The intent behind this definition is that it'll catch
400 * any uses of REJECT which flex missed.
402 #define REJECT reject_used_but_not_detected
403 #define yymore() yymore_used_but_not_detected
404 #define YY_MORE_ADJ 0
405 #define YY_RESTORE_YY_MORE_OFFSET
411 flex -PPartnParser -opartnlexer.cc partn.l
416 * AT&T lex can't handle this lexer due to lex bugs. It works with flex
417 * 2.3.7, pclex 2.0.5, and MKS lex 3.1a.
420 #include "parse_partn.h"
425 #include "partn.tab.cc.h"
428 Some includes that flex doesn't include as standard,
429 but which are needed.
436 // Prevent flex from defining yywrap as extern "C"
438 #define YY_SKIP_YYWRAP
440 /* No lex lib, supply the yywrap fcn. that normally resides there
443 int PartnParserwrap(){return(1);}
445 extern int PartnParserdebug;
449 These variables are used for error reporting:
450 flex_partn_lineno : the line currently being parsed when the error occurs.
451 flex_partn_ch : the character on the line where the error occurs
452 flex_partn_linebuf : store the line for reporting.
454 NOTE : 1) the fixed size flex_partn_linebuf buffer is dangerous.
455 2) You might get pointed to a place shortly after
456 where the syntax error occurs. It is close enough
460 int flex_partn_lineno = 1;
461 int flex_partn_ch = 0;
462 char flex_partn_linebuf[20000];
464 char *flex_partn_stringinput = NULL;
465 int flex_partn_stringinput_ptr = 0;
466 FILE *flex_partn_fileinput = NULL;
467 int my_PartnParser_yyinput(char *buf, int max_size);
471 void PartnParsererror(char *s){
473 fprintf(stderr,"On line %d, char %d: %s (token %s):\n%s\n",
474 flex_partn_lineno, flex_partn_ch, s, PartnParsertext, flex_partn_linebuf );
475 for(i=0;i<flex_partn_ch;i++){
476 if(flex_partn_linebuf[i] == '\t'){
477 fprintf(stderr,"\t");
482 fprintf(stderr,"^\n");
483 // fprintf(stderr,"%*s\n",1+flex_partn_ch,"^");
487 #define YY_INPUT(b, r, ms) (r = my_PartnParser_yyinput(b,ms))
489 /* MKS needs the next line to increase the NFA table */
490 #line 491 "partnlexer.cc"
492 /* Macros after this point can all be overridden by user definitions in
496 #ifndef YY_SKIP_YYWRAP
498 extern "C" int yywrap YY_PROTO(( void ));
500 extern int yywrap YY_PROTO(( void ));
505 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
509 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
512 #ifdef YY_NEED_STRLEN
513 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
518 static int yyinput YY_PROTO(( void ));
520 static int input YY_PROTO(( void ));
525 static int yy_start_stack_ptr = 0;
526 static int yy_start_stack_depth = 0;
527 static int *yy_start_stack = 0;
528 #ifndef YY_NO_PUSH_STATE
529 static void yy_push_state YY_PROTO(( int new_state ));
531 #ifndef YY_NO_POP_STATE
532 static void yy_pop_state YY_PROTO(( void ));
534 #ifndef YY_NO_TOP_STATE
535 static int yy_top_state YY_PROTO(( void ));
539 #define YY_NO_PUSH_STATE 1
540 #define YY_NO_POP_STATE 1
541 #define YY_NO_TOP_STATE 1
544 #ifdef YY_MALLOC_DECL
552 /* Just try to get by without declaring the routines. This will fail
553 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
554 * or sizeof(void*) != sizeof(int).
559 /* Amount of stuff to slurp up with each read. */
560 #ifndef YY_READ_BUF_SIZE
561 #define YY_READ_BUF_SIZE 8192
564 /* Copy whatever the last rule matched to the standard output. */
567 /* This used to be an fputs(), but since the string might contain NUL's,
568 * we now use fwrite().
570 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
573 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
574 * is returned in "result".
577 #define YY_INPUT(buf,result,max_size) \
578 if ( yy_current_buffer->yy_is_interactive ) \
581 for ( n = 0; n < max_size && \
582 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
585 buf[n++] = (char) c; \
586 if ( c == EOF && ferror( yyin ) ) \
587 YY_FATAL_ERROR( "input in flex scanner failed" ); \
590 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
591 && ferror( yyin ) ) \
592 YY_FATAL_ERROR( "input in flex scanner failed" );
595 /* No semi-colon after return; correct usage is to write "yyterminate();" -
596 * we don't want an extra ';' after the "return" because that will cause
597 * some compilers to complain about unreachable statements.
600 #define yyterminate() return YY_NULL
603 /* Number of entries by which start-condition stack grows. */
604 #ifndef YY_START_STACK_INCR
605 #define YY_START_STACK_INCR 25
608 /* Report a fatal error. */
609 #ifndef YY_FATAL_ERROR
610 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
613 /* Default declaration of generated scanner - a define so the user can
614 * easily add parameters.
617 #define YY_DECL int yylex YY_PROTO(( void ))
620 /* Code executed at the beginning of each rule, after yytext and yyleng
623 #ifndef YY_USER_ACTION
624 #define YY_USER_ACTION
627 /* Code executed at the end of each rule. */
629 #define YY_BREAK break;
632 #define YY_RULE_SETUP \
637 register yy_state_type yy_current_state;
638 register char *yy_cp = NULL, *yy_bp = NULL;
644 /* literal keyword tokens */
647 The actions associated with each text token are to
648 keep track of the current location (for syntax error reporting)
649 and to report any necessary info to the emf.y parse tree builder
651 Its likely that there are a number of omissions, inconsistencies
652 (some keywords do not need to be in caps), and relics
653 (keywords such as BETWEEN, INDICATOR, etc., are not used
655 This parser is somewhat of a work in progress.
660 #line 661 "partnlexer.cc"
671 yy_start = 1; /* first start state */
679 if ( ! yy_current_buffer )
681 yy_create_buffer( yyin, YY_BUF_SIZE );
683 yy_load_buffer_state();
686 while ( 1 ) /* loops until end-of-file is reached */
690 /* Support of yytext. */
691 *yy_cp = yy_hold_char;
693 /* yy_bp points to the position in yy_ch_buf of the start of
698 yy_current_state = yy_start;
702 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
703 if ( yy_accept[yy_current_state] )
705 yy_last_accepting_state = yy_current_state;
706 yy_last_accepting_cpos = yy_cp;
708 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
710 yy_current_state = (int) yy_def[yy_current_state];
711 if ( yy_current_state >= 40 )
712 yy_c = yy_meta[(unsigned int) yy_c];
714 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
717 while ( yy_base[yy_current_state] != 54 );
720 yy_act = yy_accept[yy_current_state];
722 { /* have to back up */
723 yy_cp = yy_last_accepting_cpos;
724 yy_current_state = yy_last_accepting_state;
725 yy_act = yy_accept[yy_current_state];
731 do_action: /* This label is used only to access EOF actions. */
735 { /* beginning of action switch */
736 case 0: /* must back up */
737 /* undo the effects of YY_DO_BEFORE_ACTION */
738 *yy_cp = yy_hold_char;
739 yy_cp = yy_last_accepting_cpos;
740 yy_current_state = yy_last_accepting_state;
746 { flex_partn_ch+=PartnParserleng; return HEX_L;}
751 { flex_partn_ch+=PartnParserleng; return LHEX_L;}
756 { flex_partn_ch+=PartnParserleng; return IP_L;}
762 { flex_partn_ch+=PartnParserleng; return yytext[0]; }
767 { flex_partn_ch+=PartnParserleng; return yytext[0]; }
772 { flex_partn_ch+=PartnParserleng; return yytext[0]; }
778 { flex_partn_ch+=PartnParserleng; PartnParserlval.strval = strdup(yytext); return NAME; }
786 { flex_partn_ch+=PartnParserleng; PartnParserlval.strval = strdup(yytext); return INTNUM; }
791 { flex_partn_ch+=PartnParserleng; PartnParserlval.strval = strdup(yytext); return LONGINTNUM; }
795 /* Newline : advance the error reporting line number */
796 /* and grab the next line into flex_partn_linebuf */
801 {flex_partn_ch=0; flex_partn_lineno++;
802 strcpy(flex_partn_linebuf,PartnParsertext+1);
809 {flex_partn_ch+=PartnParserleng; } /* white space */
812 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
813 yy_c_buf_p = yy_cp -= 1;
814 YY_DO_BEFORE_ACTION; /* set up yytext again */
817 {flex_partn_ch+=PartnParserleng; }; /* comment */
820 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
821 yy_c_buf_p = yy_cp -= 1;
822 YY_DO_BEFORE_ACTION; /* set up yytext again */
825 {flex_partn_ch+=PartnParserleng; }; /* comment */
830 {flex_partn_ch+=PartnParserleng; fprintf(stderr,"Warning: unknown token (ignored)\n"); PartnParsererror(yytext);}
837 #line 838 "partnlexer.cc"
838 case YY_STATE_EOF(INITIAL):
841 case YY_END_OF_BUFFER:
843 /* Amount of text matched not including the EOB char. */
844 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
846 /* Undo the effects of YY_DO_BEFORE_ACTION. */
847 *yy_cp = yy_hold_char;
848 YY_RESTORE_YY_MORE_OFFSET
850 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
852 /* We're scanning a new file or input source. It's
853 * possible that this happened because the user
854 * just pointed yyin at a new source and called
855 * yylex(). If so, then we have to assure
856 * consistency between yy_current_buffer and our
857 * globals. Here is the right place to do so, because
858 * this is the first action (other than possibly a
859 * back-up) that will match for the new input source.
861 yy_n_chars = yy_current_buffer->yy_n_chars;
862 yy_current_buffer->yy_input_file = yyin;
863 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
866 /* Note that here we test for yy_c_buf_p "<=" to the position
867 * of the first EOB in the buffer, since yy_c_buf_p will
868 * already have been incremented past the NUL character
869 * (since all states make transitions on EOB to the
870 * end-of-buffer state). Contrast this with the test
873 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
874 { /* This was really a NUL. */
875 yy_state_type yy_next_state;
877 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
879 yy_current_state = yy_get_previous_state();
881 /* Okay, we're now positioned to make the NUL
882 * transition. We couldn't have
883 * yy_get_previous_state() go ahead and do it
884 * for us because it doesn't know how to deal
885 * with the possibility of jamming (and we don't
886 * want to build jamming into it because then it
887 * will run more slowly).
890 yy_next_state = yy_try_NUL_trans( yy_current_state );
892 yy_bp = yytext_ptr + YY_MORE_ADJ;
896 /* Consume the NUL. */
897 yy_cp = ++yy_c_buf_p;
898 yy_current_state = yy_next_state;
909 else switch ( yy_get_next_buffer() )
911 case EOB_ACT_END_OF_FILE:
913 yy_did_buffer_switch_on_eof = 0;
917 /* Note: because we've taken care in
918 * yy_get_next_buffer() to have set up
919 * yytext, we can now set up
920 * yy_c_buf_p so that if some total
921 * hoser (like flex itself) wants to
922 * call the scanner after we return the
923 * YY_NULL, it'll still work - another
924 * YY_NULL will get returned.
926 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
928 yy_act = YY_STATE_EOF(YY_START);
934 if ( ! yy_did_buffer_switch_on_eof )
940 case EOB_ACT_CONTINUE_SCAN:
942 yytext_ptr + yy_amount_of_matched_text;
944 yy_current_state = yy_get_previous_state();
947 yy_bp = yytext_ptr + YY_MORE_ADJ;
950 case EOB_ACT_LAST_MATCH:
952 &yy_current_buffer->yy_ch_buf[yy_n_chars];
954 yy_current_state = yy_get_previous_state();
957 yy_bp = yytext_ptr + YY_MORE_ADJ;
965 "fatal flex scanner internal error--no action found" );
966 } /* end of action switch */
967 } /* end of scanning one token */
971 /* yy_get_next_buffer - try to read in a new buffer
973 * Returns a code representing an action:
974 * EOB_ACT_LAST_MATCH -
975 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
976 * EOB_ACT_END_OF_FILE - end of file
979 static int yy_get_next_buffer()
981 register char *dest = yy_current_buffer->yy_ch_buf;
982 register char *source = yytext_ptr;
983 register int number_to_move, i;
986 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
988 "fatal flex scanner internal error--end of buffer missed" );
990 if ( yy_current_buffer->yy_fill_buffer == 0 )
991 { /* Don't try to fill the buffer, so this is an EOF. */
992 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
994 /* We matched a single character, the EOB, so
995 * treat this as a final EOF.
997 return EOB_ACT_END_OF_FILE;
1002 /* We matched some text prior to the EOB, first
1005 return EOB_ACT_LAST_MATCH;
1009 /* Try to read more data. */
1011 /* First move last chars to start of buffer. */
1012 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1014 for ( i = 0; i < number_to_move; ++i )
1015 *(dest++) = *(source++);
1017 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1018 /* don't do the read, it's not guaranteed to return an EOF,
1021 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1026 yy_current_buffer->yy_buf_size - number_to_move - 1;
1028 while ( num_to_read <= 0 )
1029 { /* Not enough room in the buffer - grow it. */
1030 #ifdef YY_USES_REJECT
1032 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1035 /* just a shorter name for the current buffer */
1036 YY_BUFFER_STATE b = yy_current_buffer;
1038 int yy_c_buf_p_offset =
1039 (int) (yy_c_buf_p - b->yy_ch_buf);
1041 if ( b->yy_is_our_buffer )
1043 int new_size = b->yy_buf_size * 2;
1045 if ( new_size <= 0 )
1046 b->yy_buf_size += b->yy_buf_size / 8;
1048 b->yy_buf_size *= 2;
1050 b->yy_ch_buf = (char *)
1051 /* Include room in for 2 EOB chars. */
1052 yy_flex_realloc( (void *) b->yy_ch_buf,
1053 b->yy_buf_size + 2 );
1056 /* Can't grow it, we don't own it. */
1059 if ( ! b->yy_ch_buf )
1061 "fatal error - scanner input buffer overflow" );
1063 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1065 num_to_read = yy_current_buffer->yy_buf_size -
1070 if ( num_to_read > YY_READ_BUF_SIZE )
1071 num_to_read = YY_READ_BUF_SIZE;
1073 /* Read in more data. */
1074 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1075 yy_n_chars, num_to_read );
1077 yy_current_buffer->yy_n_chars = yy_n_chars;
1080 if ( yy_n_chars == 0 )
1082 if ( number_to_move == YY_MORE_ADJ )
1084 ret_val = EOB_ACT_END_OF_FILE;
1090 ret_val = EOB_ACT_LAST_MATCH;
1091 yy_current_buffer->yy_buffer_status =
1092 YY_BUFFER_EOF_PENDING;
1097 ret_val = EOB_ACT_CONTINUE_SCAN;
1099 yy_n_chars += number_to_move;
1100 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1101 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1103 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1109 /* yy_get_previous_state - get the state just before the EOB char was reached */
1111 static yy_state_type yy_get_previous_state()
1113 register yy_state_type yy_current_state;
1114 register char *yy_cp;
1116 yy_current_state = yy_start;
1118 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1120 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1121 if ( yy_accept[yy_current_state] )
1123 yy_last_accepting_state = yy_current_state;
1124 yy_last_accepting_cpos = yy_cp;
1126 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1128 yy_current_state = (int) yy_def[yy_current_state];
1129 if ( yy_current_state >= 40 )
1130 yy_c = yy_meta[(unsigned int) yy_c];
1132 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1135 return yy_current_state;
1139 /* yy_try_NUL_trans - try to make a transition on the NUL character
1142 * next_state = yy_try_NUL_trans( current_state );
1145 #ifdef YY_USE_PROTOS
1146 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1148 static yy_state_type yy_try_NUL_trans( yy_current_state )
1149 yy_state_type yy_current_state;
1152 register int yy_is_jam;
1153 register char *yy_cp = yy_c_buf_p;
1155 register YY_CHAR yy_c = 1;
1156 if ( yy_accept[yy_current_state] )
1158 yy_last_accepting_state = yy_current_state;
1159 yy_last_accepting_cpos = yy_cp;
1161 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1163 yy_current_state = (int) yy_def[yy_current_state];
1164 if ( yy_current_state >= 40 )
1165 yy_c = yy_meta[(unsigned int) yy_c];
1167 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1168 yy_is_jam = (yy_current_state == 39);
1170 return yy_is_jam ? 0 : yy_current_state;
1175 #ifdef YY_USE_PROTOS
1176 static void yyunput( int c, register char *yy_bp )
1178 static void yyunput( c, yy_bp )
1180 register char *yy_bp;
1183 register char *yy_cp = yy_c_buf_p;
1185 /* undo effects of setting up yytext */
1186 *yy_cp = yy_hold_char;
1188 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1189 { /* need to shift things up to make room */
1190 /* +2 for EOB chars. */
1191 register int number_to_move = yy_n_chars + 2;
1192 register char *dest = &yy_current_buffer->yy_ch_buf[
1193 yy_current_buffer->yy_buf_size + 2];
1194 register char *source =
1195 &yy_current_buffer->yy_ch_buf[number_to_move];
1197 while ( source > yy_current_buffer->yy_ch_buf )
1198 *--dest = *--source;
1200 yy_cp += (int) (dest - source);
1201 yy_bp += (int) (dest - source);
1202 yy_current_buffer->yy_n_chars =
1203 yy_n_chars = yy_current_buffer->yy_buf_size;
1205 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1206 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1209 *--yy_cp = (char) c;
1213 yy_hold_char = *yy_cp;
1216 #endif /* ifndef YY_NO_UNPUT */
1221 static int yyinput()
1228 *yy_c_buf_p = yy_hold_char;
1230 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1232 /* yy_c_buf_p now points to the character we want to return.
1233 * If this occurs *before* the EOB characters, then it's a
1234 * valid NUL; if not, then we've hit the end of the buffer.
1236 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1237 /* This was really a NUL. */
1241 { /* need more input */
1242 int offset = yy_c_buf_p - yytext_ptr;
1245 switch ( yy_get_next_buffer() )
1247 case EOB_ACT_LAST_MATCH:
1248 /* This happens because yy_g_n_b()
1249 * sees that we've accumulated a
1250 * token and flags that we need to
1251 * try matching the token before
1252 * proceeding. But for input(),
1253 * there's no matching to consider.
1254 * So convert the EOB_ACT_LAST_MATCH
1255 * to EOB_ACT_END_OF_FILE.
1258 /* Reset buffer status. */
1263 case EOB_ACT_END_OF_FILE:
1268 if ( ! yy_did_buffer_switch_on_eof )
1277 case EOB_ACT_CONTINUE_SCAN:
1278 yy_c_buf_p = yytext_ptr + offset;
1284 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1285 *yy_c_buf_p = '\0'; /* preserve yytext */
1286 yy_hold_char = *++yy_c_buf_p;
1291 #endif /* YY_NO_INPUT */
1293 #ifdef YY_USE_PROTOS
1294 void yyrestart( FILE *input_file )
1296 void yyrestart( input_file )
1300 if ( ! yy_current_buffer )
1301 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1303 yy_init_buffer( yy_current_buffer, input_file );
1304 yy_load_buffer_state();
1308 #ifdef YY_USE_PROTOS
1309 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1311 void yy_switch_to_buffer( new_buffer )
1312 YY_BUFFER_STATE new_buffer;
1315 if ( yy_current_buffer == new_buffer )
1318 if ( yy_current_buffer )
1320 /* Flush out information for old buffer. */
1321 *yy_c_buf_p = yy_hold_char;
1322 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1323 yy_current_buffer->yy_n_chars = yy_n_chars;
1326 yy_current_buffer = new_buffer;
1327 yy_load_buffer_state();
1329 /* We don't actually know whether we did this switch during
1330 * EOF (yywrap()) processing, but the only time this flag
1331 * is looked at is after yywrap() is called, so it's safe
1332 * to go ahead and always set it.
1334 yy_did_buffer_switch_on_eof = 1;
1338 #ifdef YY_USE_PROTOS
1339 void yy_load_buffer_state( void )
1341 void yy_load_buffer_state()
1344 yy_n_chars = yy_current_buffer->yy_n_chars;
1345 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1346 yyin = yy_current_buffer->yy_input_file;
1347 yy_hold_char = *yy_c_buf_p;
1351 #ifdef YY_USE_PROTOS
1352 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1354 YY_BUFFER_STATE yy_create_buffer( file, size )
1361 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1363 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1365 b->yy_buf_size = size;
1367 /* yy_ch_buf has to be 2 characters longer than the size given because
1368 * we need to put in 2 end-of-buffer characters.
1370 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1371 if ( ! b->yy_ch_buf )
1372 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1374 b->yy_is_our_buffer = 1;
1376 yy_init_buffer( b, file );
1382 #ifdef YY_USE_PROTOS
1383 void yy_delete_buffer( YY_BUFFER_STATE b )
1385 void yy_delete_buffer( b )
1392 if ( b == yy_current_buffer )
1393 yy_current_buffer = (YY_BUFFER_STATE) 0;
1395 if ( b->yy_is_our_buffer )
1396 yy_flex_free( (void *) b->yy_ch_buf );
1398 yy_flex_free( (void *) b );
1403 #ifdef YY_USE_PROTOS
1404 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1406 void yy_init_buffer( b, file )
1413 yy_flush_buffer( b );
1415 b->yy_input_file = file;
1416 b->yy_fill_buffer = 1;
1418 #if YY_ALWAYS_INTERACTIVE
1419 b->yy_is_interactive = 1;
1421 #if YY_NEVER_INTERACTIVE
1422 b->yy_is_interactive = 0;
1424 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1430 #ifdef YY_USE_PROTOS
1431 void yy_flush_buffer( YY_BUFFER_STATE b )
1433 void yy_flush_buffer( b )
1443 /* We always need two end-of-buffer characters. The first causes
1444 * a transition to the end-of-buffer state. The second causes
1445 * a jam in that state.
1447 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1448 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1450 b->yy_buf_pos = &b->yy_ch_buf[0];
1453 b->yy_buffer_status = YY_BUFFER_NEW;
1455 if ( b == yy_current_buffer )
1456 yy_load_buffer_state();
1460 #ifndef YY_NO_SCAN_BUFFER
1461 #ifdef YY_USE_PROTOS
1462 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1464 YY_BUFFER_STATE yy_scan_buffer( base, size )
1472 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1473 base[size-1] != YY_END_OF_BUFFER_CHAR )
1474 /* They forgot to leave room for the EOB's. */
1477 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1479 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1481 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1482 b->yy_buf_pos = b->yy_ch_buf = base;
1483 b->yy_is_our_buffer = 0;
1484 b->yy_input_file = 0;
1485 b->yy_n_chars = b->yy_buf_size;
1486 b->yy_is_interactive = 0;
1488 b->yy_fill_buffer = 0;
1489 b->yy_buffer_status = YY_BUFFER_NEW;
1491 yy_switch_to_buffer( b );
1498 #ifndef YY_NO_SCAN_STRING
1499 #ifdef YY_USE_PROTOS
1500 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1502 YY_BUFFER_STATE yy_scan_string( yy_str )
1503 yyconst char *yy_str;
1507 for ( len = 0; yy_str[len]; ++len )
1510 return yy_scan_bytes( yy_str, len );
1515 #ifndef YY_NO_SCAN_BYTES
1516 #ifdef YY_USE_PROTOS
1517 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1519 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1520 yyconst char *bytes;
1529 /* Get memory for full buffer, including space for trailing EOB's. */
1531 buf = (char *) yy_flex_alloc( n );
1533 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1535 for ( i = 0; i < len; ++i )
1538 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1540 b = yy_scan_buffer( buf, n );
1542 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1544 /* It's okay to grow etc. this buffer, and we should throw it
1545 * away when we're done.
1547 b->yy_is_our_buffer = 1;
1554 #ifndef YY_NO_PUSH_STATE
1555 #ifdef YY_USE_PROTOS
1556 static void yy_push_state( int new_state )
1558 static void yy_push_state( new_state )
1562 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1566 yy_start_stack_depth += YY_START_STACK_INCR;
1567 new_size = yy_start_stack_depth * sizeof( int );
1569 if ( ! yy_start_stack )
1570 yy_start_stack = (int *) yy_flex_alloc( new_size );
1573 yy_start_stack = (int *) yy_flex_realloc(
1574 (void *) yy_start_stack, new_size );
1576 if ( ! yy_start_stack )
1578 "out of memory expanding start-condition stack" );
1581 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1588 #ifndef YY_NO_POP_STATE
1589 static void yy_pop_state()
1591 if ( --yy_start_stack_ptr < 0 )
1592 YY_FATAL_ERROR( "start-condition stack underflow" );
1594 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1599 #ifndef YY_NO_TOP_STATE
1600 static int yy_top_state()
1602 return yy_start_stack[yy_start_stack_ptr - 1];
1606 #ifndef YY_EXIT_FAILURE
1607 #define YY_EXIT_FAILURE 2
1610 #ifdef YY_USE_PROTOS
1611 static void yy_fatal_error( yyconst char msg[] )
1613 static void yy_fatal_error( msg )
1617 (void) fprintf( stderr, "%s\n", msg );
1618 exit( YY_EXIT_FAILURE );
1623 /* Redefine yyless() so it works in section 3 code. */
1629 /* Undo effects of setting up yytext. */ \
1630 yytext[yyleng] = yy_hold_char; \
1631 yy_c_buf_p = yytext + n; \
1632 yy_hold_char = *yy_c_buf_p; \
1633 *yy_c_buf_p = '\0'; \
1639 /* Internal utility routines. */
1642 #ifdef YY_USE_PROTOS
1643 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1645 static void yy_flex_strncpy( s1, s2, n )
1652 for ( i = 0; i < n; ++i )
1657 #ifdef YY_NEED_STRLEN
1658 #ifdef YY_USE_PROTOS
1659 static int yy_flex_strlen( yyconst char *s )
1661 static int yy_flex_strlen( s )
1666 for ( n = 0; s[n]; ++n )
1674 #ifdef YY_USE_PROTOS
1675 static void *yy_flex_alloc( yy_size_t size )
1677 static void *yy_flex_alloc( size )
1681 return (void *) malloc( size );
1684 #ifdef YY_USE_PROTOS
1685 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1687 static void *yy_flex_realloc( ptr, size )
1692 /* The cast to (char *) in the following accommodates both
1693 * implementations that use char* generic pointers, and those
1694 * that use void* generic pointers. It works with the latter
1695 * because both ANSI C and C++ allow castless assignment from
1696 * any pointer type to void*, and deal with argument conversions
1697 * as though doing an assignment.
1699 return (void *) realloc( (char *) ptr, size );
1702 #ifdef YY_USE_PROTOS
1703 static void yy_flex_free( void *ptr )
1705 static void yy_flex_free( ptr )
1722 int my_PartnParser_yyinput(char *buf, int max_size){
1726 if(flex_partn_stringinput != NULL){
1728 if(flex_partn_stringinput[flex_partn_stringinput_ptr] != '\0'){
1729 buf[c++] = flex_partn_stringinput[flex_partn_stringinput_ptr++];
1737 if(flex_partn_fileinput != NULL){
1738 while(c < max_size){
1739 inchar = getc(flex_partn_fileinput);
1752 void PartnParser_setfileinput(FILE *f){
1753 PartnParserrestart(NULL);
1755 flex_partn_fileinput = f;
1756 flex_partn_stringinput = NULL;
1757 flex_partn_lineno = 1;
1761 void PartnParser_setstringinput(char *s){
1762 PartnParserrestart(NULL);
1764 flex_partn_fileinput = NULL;
1765 flex_partn_stringinput = s;
1766 flex_partn_stringinput_ptr = 0;
1767 flex_partn_lineno = 1;