1 #define yy_create_buffer xmlParser_create_buffer
2 #define yy_delete_buffer xmlParser_delete_buffer
3 #define yy_scan_buffer xmlParser_scan_buffer
4 #define yy_scan_string xmlParser_scan_string
5 #define yy_scan_bytes xmlParser_scan_bytes
6 #define yy_flex_debug xmlParser_flex_debug
7 #define yy_init_buffer xmlParser_init_buffer
8 #define yy_flush_buffer xmlParser_flush_buffer
9 #define yy_load_buffer_state xmlParser_load_buffer_state
10 #define yy_switch_to_buffer xmlParser_switch_to_buffer
11 #define yyin xmlParserin
12 #define yyleng xmlParserleng
13 #define yylex xmlParserlex
14 #define yyout xmlParserout
15 #define yyrestart xmlParserrestart
16 #define yytext xmlParsertext
18 #line 19 "xmllexer.cc"
19 /* A lexical scanner generated by flex*/
21 /* Scanner skeleton version:
22 * $Header: /cvsroot/gscpv4/src/tools/xmllexer.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 /* Some routines like yy_flex_realloc() are emitted as static but are
156 not called by all lexers. This generates warnings in some compilers,
157 notably GCC. Arrange to suppress these. */
159 #define YY_MAY_BE_UNUSED __attribute__((unused))
161 #define YY_MAY_BE_UNUSED
164 /* The following is because we cannot portably get our hands on size_t
165 * (without autoconf's help, which isn't available because we want
166 * flex-generated scanners to compile on their own).
168 typedef unsigned int yy_size_t;
171 struct yy_buffer_state
175 char *yy_ch_buf; /* input buffer */
176 char *yy_buf_pos; /* current position in input buffer */
178 /* Size of input buffer in bytes, not including room for EOB
181 yy_size_t yy_buf_size;
183 /* Number of characters read into yy_ch_buf, not including EOB
188 /* Whether we "own" the buffer - i.e., we know we created it,
189 * and can realloc() it to grow it, and should free() it to
192 int yy_is_our_buffer;
194 /* Whether this is an "interactive" input source; if so, and
195 * if we're using stdio for input, then we want to use getc()
196 * instead of fread(), to make sure we stop fetching input after
199 int yy_is_interactive;
201 /* Whether we're considered to be at the beginning of a line.
202 * If so, '^' rules will be active on the next match, otherwise
207 /* Whether to try to fill the input buffer when we reach the
212 int yy_buffer_status;
213 #define YY_BUFFER_NEW 0
214 #define YY_BUFFER_NORMAL 1
215 /* When an EOF's been seen but there's still some text to process
216 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
217 * shouldn't try reading from the input source any more. We might
218 * still have a bunch of tokens to match, though, because of
219 * possible backing-up.
221 * When we actually see the EOF, we change the status to "new"
222 * (via yyrestart()), so that the user can continue scanning by
223 * just pointing yyin at a new input file.
225 #define YY_BUFFER_EOF_PENDING 2
228 static YY_BUFFER_STATE yy_current_buffer = 0;
230 /* We provide macros for accessing buffer states in case in the
231 * future we want to put the buffer states in a more general
234 #define YY_CURRENT_BUFFER yy_current_buffer
237 /* yy_hold_char holds the character lost when yytext is formed. */
238 static char yy_hold_char;
240 static int yy_n_chars; /* number of characters read into yy_ch_buf */
245 /* Points to current character in buffer. */
246 static char *yy_c_buf_p = (char *) 0;
247 static int yy_init = 1; /* whether we need to initialize */
248 static int yy_start = 0; /* start state number */
250 /* Flag which is used to allow yywrap()'s to do buffer switches
251 * instead of setting up a fresh yyin. A bit of a hack ...
253 static int yy_did_buffer_switch_on_eof;
255 void yyrestart YY_PROTO(( FILE *input_file ));
257 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
258 void yy_load_buffer_state YY_PROTO(( void ));
259 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
260 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
261 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
262 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
263 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
265 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
266 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
267 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
269 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
270 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;
271 static void yy_flex_free YY_PROTO(( void * ));
273 #define yy_new_buffer yy_create_buffer
275 #define yy_set_interactive(is_interactive) \
277 if ( ! yy_current_buffer ) \
278 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
279 yy_current_buffer->yy_is_interactive = is_interactive; \
282 #define yy_set_bol(at_bol) \
284 if ( ! yy_current_buffer ) \
285 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
286 yy_current_buffer->yy_at_bol = at_bol; \
289 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
293 #define YY_SKIP_YYWRAP
294 typedef unsigned char YY_CHAR;
295 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
296 typedef int yy_state_type;
298 #define yytext_ptr yytext
300 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
301 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
302 static int yy_get_next_buffer YY_PROTO(( void ));
303 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
305 /* Done after the current pattern has been matched and before the
306 * corresponding action - sets up yytext.
308 #define YY_DO_BEFORE_ACTION \
309 yytext_ptr = yy_bp; \
310 yytext_ptr -= yy_more_len; \
311 yyleng = (int) (yy_cp - yytext_ptr); \
312 yy_hold_char = *yy_cp; \
316 #define YY_NUM_RULES 11
317 #define YY_END_OF_BUFFER 12
318 static yyconst short int yy_accept[32] =
320 0, 0, 12, 10, 6, 5, 10, 10, 1, 1,
321 1, 2, 6, 5, 0, 4, 3, 0, 0, 0,
322 2, 0, 7, 0, 8, 0, 0, 0, 0, 9,
326 static yyconst int yy_ec[256] =
328 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
329 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 2, 1, 1, 1, 1, 1, 1, 4, 1,
332 1, 1, 1, 1, 5, 1, 6, 7, 7, 7,
333 7, 7, 7, 7, 7, 7, 7, 7, 1, 8,
334 9, 9, 10, 1, 11, 11, 11, 11, 11, 11,
335 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
336 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
337 1, 1, 1, 1, 11, 1, 11, 11, 11, 11,
339 11, 11, 11, 11, 11, 11, 11, 12, 13, 11,
340 11, 11, 11, 11, 11, 11, 11, 11, 11, 14,
341 11, 11, 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,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
358 static yyconst int yy_meta[15] =
360 1, 1, 2, 1, 3, 1, 3, 1, 1, 1,
364 static yyconst short int yy_base[38] =
366 0, 0, 48, 49, 45, 0, 12, 41, 39, 34,
367 49, 0, 41, 0, 14, 49, 49, 39, 38, 26,
368 0, 36, 49, 35, 49, 24, 24, 32, 31, 49,
369 49, 18, 21, 17, 24, 27, 30
372 static yyconst short int yy_def[38] =
374 31, 1, 31, 31, 31, 32, 33, 31, 31, 31,
375 31, 34, 31, 32, 33, 31, 31, 35, 36, 31,
376 34, 35, 31, 36, 31, 31, 31, 37, 37, 31,
377 0, 31, 31, 31, 31, 31, 31
380 static yyconst short int yy_nxt[64] =
382 4, 5, 6, 7, 8, 9, 4, 10, 11, 4,
383 12, 12, 12, 12, 16, 17, 16, 17, 14, 21,
384 14, 15, 15, 15, 22, 22, 22, 24, 24, 24,
385 29, 29, 29, 30, 30, 28, 27, 25, 23, 26,
386 25, 23, 13, 20, 19, 18, 13, 31, 3, 31,
387 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
391 static yyconst short int yy_chk[64] =
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 7, 7, 15, 15, 32, 34,
395 32, 33, 33, 33, 35, 35, 35, 36, 36, 36,
396 37, 37, 37, 29, 28, 27, 26, 24, 22, 20,
397 19, 18, 13, 10, 9, 8, 5, 3, 31, 31,
398 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
402 static yy_state_type yy_last_accepting_state;
403 static char *yy_last_accepting_cpos;
405 /* The intent behind this definition is that it'll catch
406 * any uses of REJECT which flex missed.
408 #define REJECT reject_used_but_not_detected
409 static int yy_more_flag = 0;
410 static int yy_more_len = 0;
411 #define yymore() (yy_more_flag = 1)
412 #define YY_MORE_ADJ yy_more_len
413 #define YY_RESTORE_YY_MORE_OFFSET
419 flex -PxmlParser -oxmllexer.cc xml.l
424 * AT&T lex can't handle this lexer due to lex bugs. It works with flex
425 * 2.3.7, pclex 2.0.5, and MKS lex 3.1a.
428 // #include "parse_fta.h"
433 #include "xml.tab.hh"
436 Some includes that flex doesn't include as standard,
437 but which are needed.
444 // Prevent flex from defining yywrap as extern "C"
446 #define YY_SKIP_YYWRAP
448 /* No lex lib, supply the yywrap fcn. that normally resides there
451 int xmlParserwrap(){return(1);}
453 extern int xmlParserdebug;
457 These variables are used for error reporting:
458 flex_xml_lineno : the line currently being parsed when the error occurs.
459 flex_xml_ch : the character on the line where the error occurs
460 flex_xml_linebuf : store the line for reporting.
462 NOTE : 1) the fixed size flex_xml_linebuf buffer is dangerous.
463 2) You might get pointed to a place shortly after
464 where the syntax error occurs. It is close enough
468 int flex_xml_lineno = 1;
470 char flex_xml_linebuf[20000];
472 char *flex_xml_stringinput = NULL;
473 int flex_xml_stringinput_ptr = 0;
474 FILE *flex_xml_fileinput = NULL;
475 int my_xmlParser_yyinput(char *buf, int max_size);
479 void xmlParsererror(char *s){
481 fprintf(stderr,"On line %d, char %d: %s (token %s):\n%s\n",
482 flex_xml_lineno, flex_xml_ch, s, xmlParsertext, flex_xml_linebuf );
483 for(i=0;i<flex_xml_ch;i++){
484 if(flex_xml_linebuf[i] == '\t'){
485 fprintf(stderr,"\t");
490 fprintf(stderr,"^\n");
491 // fprintf(stderr,"%*s\n",1+flex_xml_ch,"^");
495 #define YY_INPUT(b, r, ms) (r = my_xmlParser_yyinput(b,ms))
497 /* MKS needs the next line to increase the NFA table */
498 #line 499 "xmllexer.cc"
500 /* Macros after this point can all be overridden by user definitions in
504 #ifndef YY_SKIP_YYWRAP
506 extern "C" int yywrap YY_PROTO(( void ));
508 extern int yywrap YY_PROTO(( void ));
513 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
517 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
520 #ifdef YY_NEED_STRLEN
521 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
526 static int yyinput YY_PROTO(( void ));
528 static int input YY_PROTO(( void ));
533 static int yy_start_stack_ptr = 0;
534 static int yy_start_stack_depth = 0;
535 static int *yy_start_stack = 0;
536 #ifndef YY_NO_PUSH_STATE
537 static void yy_push_state YY_PROTO(( int new_state ));
539 #ifndef YY_NO_POP_STATE
540 static void yy_pop_state YY_PROTO(( void ));
542 #ifndef YY_NO_TOP_STATE
543 static int yy_top_state YY_PROTO(( void ));
547 #define YY_NO_PUSH_STATE 1
548 #define YY_NO_POP_STATE 1
549 #define YY_NO_TOP_STATE 1
552 #ifdef YY_MALLOC_DECL
560 /* Just try to get by without declaring the routines. This will fail
561 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
562 * or sizeof(void*) != sizeof(int).
567 /* Amount of stuff to slurp up with each read. */
568 #ifndef YY_READ_BUF_SIZE
569 #define YY_READ_BUF_SIZE 8192
572 /* Copy whatever the last rule matched to the standard output. */
575 /* This used to be an fputs(), but since the string might contain NUL's,
576 * we now use fwrite().
578 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
581 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
582 * is returned in "result".
585 #define YY_INPUT(buf,result,max_size) \
586 if ( yy_current_buffer->yy_is_interactive ) \
589 for ( n = 0; n < max_size && \
590 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
593 buf[n++] = (char) c; \
594 if ( c == EOF && ferror( yyin ) ) \
595 YY_FATAL_ERROR( "input in flex scanner failed" ); \
598 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
599 && ferror( yyin ) ) \
600 YY_FATAL_ERROR( "input in flex scanner failed" );
603 /* No semi-colon after return; correct usage is to write "yyterminate();" -
604 * we don't want an extra ';' after the "return" because that will cause
605 * some compilers to complain about unreachable statements.
608 #define yyterminate() return YY_NULL
611 /* Number of entries by which start-condition stack grows. */
612 #ifndef YY_START_STACK_INCR
613 #define YY_START_STACK_INCR 25
616 /* Report a fatal error. */
617 #ifndef YY_FATAL_ERROR
618 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
621 /* Default declaration of generated scanner - a define so the user can
622 * easily add parameters.
625 #define YY_DECL int yylex YY_PROTO(( void ))
628 /* Code executed at the beginning of each rule, after yytext and yyleng
631 #ifndef YY_USER_ACTION
632 #define YY_USER_ACTION
635 /* Code executed at the end of each rule. */
637 #define YY_BREAK break;
640 #define YY_RULE_SETUP \
645 register yy_state_type yy_current_state;
646 register char *yy_cp = NULL, *yy_bp = NULL;
652 /* literal keyword tokens */
655 The actions associated with each text token are to
656 keep track of the current location (for syntax error reporting)
657 and to report any necessary info to the emf.y parse tree builder
659 Its likely that there are a number of omissions, inconsistencies
660 (some keywords do not need to be in caps), and relics
661 (keywords such as BETWEEN, INDICATOR, etc., are not used
663 This parser is somewhat of a work in progress.
671 #line 672 "xmllexer.cc"
682 yy_start = 1; /* first start state */
690 if ( ! yy_current_buffer )
692 yy_create_buffer( yyin, YY_BUF_SIZE );
694 yy_load_buffer_state();
697 while ( 1 ) /* loops until end-of-file is reached */
702 yy_more_len = yy_c_buf_p - yytext_ptr;
707 /* Support of yytext. */
708 *yy_cp = yy_hold_char;
710 /* yy_bp points to the position in yy_ch_buf of the start of
715 yy_current_state = yy_start;
719 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
720 if ( yy_accept[yy_current_state] )
722 yy_last_accepting_state = yy_current_state;
723 yy_last_accepting_cpos = yy_cp;
725 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
727 yy_current_state = (int) yy_def[yy_current_state];
728 if ( yy_current_state >= 32 )
729 yy_c = yy_meta[(unsigned int) yy_c];
731 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
734 while ( yy_base[yy_current_state] != 49 );
737 yy_act = yy_accept[yy_current_state];
739 { /* have to back up */
740 yy_cp = yy_last_accepting_cpos;
741 yy_current_state = yy_last_accepting_state;
742 yy_act = yy_accept[yy_current_state];
748 do_action: /* This label is used only to access EOF actions. */
752 { /* beginning of action switch */
753 case 0: /* must back up */
754 /* undo the effects of YY_DO_BEFORE_ACTION */
755 *yy_cp = yy_hold_char;
756 yy_cp = yy_last_accepting_cpos;
757 yy_current_state = yy_last_accepting_state;
763 { flex_xml_ch+=xmlParserleng; return yytext[0]; }
769 { flex_xml_ch+=xmlParserleng; xmlParserlval.strval = strdup(yytext); return NAME; }
779 xmlParserlval.strval = strdup(xmlParsertext+1);
783 unput(c); /* just peeking */
785 flex_xml_ch+=xmlParserleng;
786 xmlParserlval.strval[xmlParserleng-2] = '\0';
793 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
794 yy_c_buf_p = yy_cp -= 1;
795 YY_DO_BEFORE_ACTION; /* set up yytext again */
798 { flex_xml_ch+=xmlParserleng; xmlParsererror("Unterminated string"); }
801 /* Newline : advance the error reporting line number */
802 /* and grab the next line into flex_xml_linebuf */
807 {flex_xml_ch=0; flex_xml_lineno++;
808 strcpy(flex_xml_linebuf,xmlParsertext+1);
815 {flex_xml_ch+=xmlParserleng; } /* white space */
818 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
819 yy_c_buf_p = yy_cp -= 1;
820 YY_DO_BEFORE_ACTION; /* set up yytext again */
823 {flex_xml_ch+=xmlParserleng; }; /* comment */
826 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
827 yy_c_buf_p = yy_cp -= 1;
828 YY_DO_BEFORE_ACTION; /* set up yytext again */
831 {flex_xml_ch+=xmlParserleng; }; /* comment */
834 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
835 yy_c_buf_p = yy_cp -= 1;
836 YY_DO_BEFORE_ACTION; /* set up yytext again */
839 {flex_xml_ch+=xmlParserleng; }; /* comment */
844 {flex_xml_ch+=xmlParserleng; fprintf(stderr,"Warning: unknown token (ignored)\n"); xmlParsererror(yytext);}
851 #line 852 "xmllexer.cc"
852 case YY_STATE_EOF(INITIAL):
855 case YY_END_OF_BUFFER:
857 /* Amount of text matched not including the EOB char. */
858 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
860 /* Undo the effects of YY_DO_BEFORE_ACTION. */
861 *yy_cp = yy_hold_char;
862 YY_RESTORE_YY_MORE_OFFSET
864 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
866 /* We're scanning a new file or input source. It's
867 * possible that this happened because the user
868 * just pointed yyin at a new source and called
869 * yylex(). If so, then we have to assure
870 * consistency between yy_current_buffer and our
871 * globals. Here is the right place to do so, because
872 * this is the first action (other than possibly a
873 * back-up) that will match for the new input source.
875 yy_n_chars = yy_current_buffer->yy_n_chars;
876 yy_current_buffer->yy_input_file = yyin;
877 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
880 /* Note that here we test for yy_c_buf_p "<=" to the position
881 * of the first EOB in the buffer, since yy_c_buf_p will
882 * already have been incremented past the NUL character
883 * (since all states make transitions on EOB to the
884 * end-of-buffer state). Contrast this with the test
887 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
888 { /* This was really a NUL. */
889 yy_state_type yy_next_state;
891 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
893 yy_current_state = yy_get_previous_state();
895 /* Okay, we're now positioned to make the NUL
896 * transition. We couldn't have
897 * yy_get_previous_state() go ahead and do it
898 * for us because it doesn't know how to deal
899 * with the possibility of jamming (and we don't
900 * want to build jamming into it because then it
901 * will run more slowly).
904 yy_next_state = yy_try_NUL_trans( yy_current_state );
906 yy_bp = yytext_ptr + YY_MORE_ADJ;
910 /* Consume the NUL. */
911 yy_cp = ++yy_c_buf_p;
912 yy_current_state = yy_next_state;
923 else switch ( yy_get_next_buffer() )
925 case EOB_ACT_END_OF_FILE:
927 yy_did_buffer_switch_on_eof = 0;
931 /* Note: because we've taken care in
932 * yy_get_next_buffer() to have set up
933 * yytext, we can now set up
934 * yy_c_buf_p so that if some total
935 * hoser (like flex itself) wants to
936 * call the scanner after we return the
937 * YY_NULL, it'll still work - another
938 * YY_NULL will get returned.
940 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
942 yy_act = YY_STATE_EOF(YY_START);
948 if ( ! yy_did_buffer_switch_on_eof )
954 case EOB_ACT_CONTINUE_SCAN:
956 yytext_ptr + yy_amount_of_matched_text;
958 yy_current_state = yy_get_previous_state();
961 yy_bp = yytext_ptr + YY_MORE_ADJ;
964 case EOB_ACT_LAST_MATCH:
966 &yy_current_buffer->yy_ch_buf[yy_n_chars];
968 yy_current_state = yy_get_previous_state();
971 yy_bp = yytext_ptr + YY_MORE_ADJ;
979 "fatal flex scanner internal error--no action found" );
980 } /* end of action switch */
981 } /* end of scanning one token */
985 /* yy_get_next_buffer - try to read in a new buffer
987 * Returns a code representing an action:
988 * EOB_ACT_LAST_MATCH -
989 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
990 * EOB_ACT_END_OF_FILE - end of file
993 static int yy_get_next_buffer()
995 register char *dest = yy_current_buffer->yy_ch_buf;
996 register char *source = yytext_ptr;
997 register int number_to_move, i;
1000 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1002 "fatal flex scanner internal error--end of buffer missed" );
1004 if ( yy_current_buffer->yy_fill_buffer == 0 )
1005 { /* Don't try to fill the buffer, so this is an EOF. */
1006 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1008 /* We matched a single character, the EOB, so
1009 * treat this as a final EOF.
1011 return EOB_ACT_END_OF_FILE;
1016 /* We matched some text prior to the EOB, first
1019 return EOB_ACT_LAST_MATCH;
1023 /* Try to read more data. */
1025 /* First move last chars to start of buffer. */
1026 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1028 for ( i = 0; i < number_to_move; ++i )
1029 *(dest++) = *(source++);
1031 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1032 /* don't do the read, it's not guaranteed to return an EOF,
1035 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1040 yy_current_buffer->yy_buf_size - number_to_move - 1;
1042 while ( num_to_read <= 0 )
1043 { /* Not enough room in the buffer - grow it. */
1044 #ifdef YY_USES_REJECT
1046 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1049 /* just a shorter name for the current buffer */
1050 YY_BUFFER_STATE b = yy_current_buffer;
1052 int yy_c_buf_p_offset =
1053 (int) (yy_c_buf_p - b->yy_ch_buf);
1055 if ( b->yy_is_our_buffer )
1057 int new_size = b->yy_buf_size * 2;
1059 if ( new_size <= 0 )
1060 b->yy_buf_size += b->yy_buf_size / 8;
1062 b->yy_buf_size *= 2;
1064 b->yy_ch_buf = (char *)
1065 /* Include room in for 2 EOB chars. */
1066 yy_flex_realloc( (void *) b->yy_ch_buf,
1067 b->yy_buf_size + 2 );
1070 /* Can't grow it, we don't own it. */
1073 if ( ! b->yy_ch_buf )
1075 "fatal error - scanner input buffer overflow" );
1077 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1079 num_to_read = yy_current_buffer->yy_buf_size -
1084 if ( num_to_read > YY_READ_BUF_SIZE )
1085 num_to_read = YY_READ_BUF_SIZE;
1087 /* Read in more data. */
1088 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1089 yy_n_chars, num_to_read );
1091 yy_current_buffer->yy_n_chars = yy_n_chars;
1094 if ( yy_n_chars == 0 )
1096 if ( number_to_move == YY_MORE_ADJ )
1098 ret_val = EOB_ACT_END_OF_FILE;
1104 ret_val = EOB_ACT_LAST_MATCH;
1105 yy_current_buffer->yy_buffer_status =
1106 YY_BUFFER_EOF_PENDING;
1111 ret_val = EOB_ACT_CONTINUE_SCAN;
1113 yy_n_chars += number_to_move;
1114 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1115 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1117 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1123 /* yy_get_previous_state - get the state just before the EOB char was reached */
1125 static yy_state_type yy_get_previous_state()
1127 register yy_state_type yy_current_state;
1128 register char *yy_cp;
1130 yy_current_state = yy_start;
1132 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1134 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1135 if ( yy_accept[yy_current_state] )
1137 yy_last_accepting_state = yy_current_state;
1138 yy_last_accepting_cpos = yy_cp;
1140 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1142 yy_current_state = (int) yy_def[yy_current_state];
1143 if ( yy_current_state >= 32 )
1144 yy_c = yy_meta[(unsigned int) yy_c];
1146 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1149 return yy_current_state;
1153 /* yy_try_NUL_trans - try to make a transition on the NUL character
1156 * next_state = yy_try_NUL_trans( current_state );
1159 #ifdef YY_USE_PROTOS
1160 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1162 static yy_state_type yy_try_NUL_trans( yy_current_state )
1163 yy_state_type yy_current_state;
1166 register int yy_is_jam;
1167 register char *yy_cp = yy_c_buf_p;
1169 register YY_CHAR yy_c = 1;
1170 if ( yy_accept[yy_current_state] )
1172 yy_last_accepting_state = yy_current_state;
1173 yy_last_accepting_cpos = yy_cp;
1175 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1177 yy_current_state = (int) yy_def[yy_current_state];
1178 if ( yy_current_state >= 32 )
1179 yy_c = yy_meta[(unsigned int) yy_c];
1181 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1182 yy_is_jam = (yy_current_state == 31);
1184 return yy_is_jam ? 0 : yy_current_state;
1189 #ifdef YY_USE_PROTOS
1190 static void yyunput( int c, register char *yy_bp )
1192 static void yyunput( c, yy_bp )
1194 register char *yy_bp;
1197 register char *yy_cp = yy_c_buf_p;
1199 /* undo effects of setting up yytext */
1200 *yy_cp = yy_hold_char;
1202 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1203 { /* need to shift things up to make room */
1204 /* +2 for EOB chars. */
1205 register int number_to_move = yy_n_chars + 2;
1206 register char *dest = &yy_current_buffer->yy_ch_buf[
1207 yy_current_buffer->yy_buf_size + 2];
1208 register char *source =
1209 &yy_current_buffer->yy_ch_buf[number_to_move];
1211 while ( source > yy_current_buffer->yy_ch_buf )
1212 *--dest = *--source;
1214 yy_cp += (int) (dest - source);
1215 yy_bp += (int) (dest - source);
1216 yy_current_buffer->yy_n_chars =
1217 yy_n_chars = yy_current_buffer->yy_buf_size;
1219 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1220 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1223 *--yy_cp = (char) c;
1227 yy_hold_char = *yy_cp;
1230 #endif /* ifndef YY_NO_UNPUT */
1235 static int yyinput()
1242 *yy_c_buf_p = yy_hold_char;
1244 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1246 /* yy_c_buf_p now points to the character we want to return.
1247 * If this occurs *before* the EOB characters, then it's a
1248 * valid NUL; if not, then we've hit the end of the buffer.
1250 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1251 /* This was really a NUL. */
1255 { /* need more input */
1256 int offset = yy_c_buf_p - yytext_ptr;
1259 switch ( yy_get_next_buffer() )
1261 case EOB_ACT_LAST_MATCH:
1262 /* This happens because yy_g_n_b()
1263 * sees that we've accumulated a
1264 * token and flags that we need to
1265 * try matching the token before
1266 * proceeding. But for input(),
1267 * there's no matching to consider.
1268 * So convert the EOB_ACT_LAST_MATCH
1269 * to EOB_ACT_END_OF_FILE.
1272 /* Reset buffer status. */
1277 case EOB_ACT_END_OF_FILE:
1282 if ( ! yy_did_buffer_switch_on_eof )
1291 case EOB_ACT_CONTINUE_SCAN:
1292 yy_c_buf_p = yytext_ptr + offset;
1298 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1299 *yy_c_buf_p = '\0'; /* preserve yytext */
1300 yy_hold_char = *++yy_c_buf_p;
1305 #endif /* YY_NO_INPUT */
1307 #ifdef YY_USE_PROTOS
1308 void yyrestart( FILE *input_file )
1310 void yyrestart( input_file )
1314 if ( ! yy_current_buffer )
1315 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1317 yy_init_buffer( yy_current_buffer, input_file );
1318 yy_load_buffer_state();
1322 #ifdef YY_USE_PROTOS
1323 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1325 void yy_switch_to_buffer( new_buffer )
1326 YY_BUFFER_STATE new_buffer;
1329 if ( yy_current_buffer == new_buffer )
1332 if ( yy_current_buffer )
1334 /* Flush out information for old buffer. */
1335 *yy_c_buf_p = yy_hold_char;
1336 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1337 yy_current_buffer->yy_n_chars = yy_n_chars;
1340 yy_current_buffer = new_buffer;
1341 yy_load_buffer_state();
1343 /* We don't actually know whether we did this switch during
1344 * EOF (yywrap()) processing, but the only time this flag
1345 * is looked at is after yywrap() is called, so it's safe
1346 * to go ahead and always set it.
1348 yy_did_buffer_switch_on_eof = 1;
1352 #ifdef YY_USE_PROTOS
1353 void yy_load_buffer_state( void )
1355 void yy_load_buffer_state()
1358 yy_n_chars = yy_current_buffer->yy_n_chars;
1359 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1360 yyin = yy_current_buffer->yy_input_file;
1361 yy_hold_char = *yy_c_buf_p;
1365 #ifdef YY_USE_PROTOS
1366 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1368 YY_BUFFER_STATE yy_create_buffer( file, size )
1375 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1377 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1379 b->yy_buf_size = size;
1381 /* yy_ch_buf has to be 2 characters longer than the size given because
1382 * we need to put in 2 end-of-buffer characters.
1384 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1385 if ( ! b->yy_ch_buf )
1386 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1388 b->yy_is_our_buffer = 1;
1390 yy_init_buffer( b, file );
1396 #ifdef YY_USE_PROTOS
1397 void yy_delete_buffer( YY_BUFFER_STATE b )
1399 void yy_delete_buffer( b )
1406 if ( b == yy_current_buffer )
1407 yy_current_buffer = (YY_BUFFER_STATE) 0;
1409 if ( b->yy_is_our_buffer )
1410 yy_flex_free( (void *) b->yy_ch_buf );
1412 yy_flex_free( (void *) b );
1417 #ifdef YY_USE_PROTOS
1418 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1420 void yy_init_buffer( b, file )
1427 yy_flush_buffer( b );
1429 b->yy_input_file = file;
1430 b->yy_fill_buffer = 1;
1432 #if YY_ALWAYS_INTERACTIVE
1433 b->yy_is_interactive = 1;
1435 #if YY_NEVER_INTERACTIVE
1436 b->yy_is_interactive = 0;
1438 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1444 #ifdef YY_USE_PROTOS
1445 void yy_flush_buffer( YY_BUFFER_STATE b )
1447 void yy_flush_buffer( b )
1457 /* We always need two end-of-buffer characters. The first causes
1458 * a transition to the end-of-buffer state. The second causes
1459 * a jam in that state.
1461 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1462 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1464 b->yy_buf_pos = &b->yy_ch_buf[0];
1467 b->yy_buffer_status = YY_BUFFER_NEW;
1469 if ( b == yy_current_buffer )
1470 yy_load_buffer_state();
1474 #ifndef YY_NO_SCAN_BUFFER
1475 #ifdef YY_USE_PROTOS
1476 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1478 YY_BUFFER_STATE yy_scan_buffer( base, size )
1486 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1487 base[size-1] != YY_END_OF_BUFFER_CHAR )
1488 /* They forgot to leave room for the EOB's. */
1491 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1493 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1495 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1496 b->yy_buf_pos = b->yy_ch_buf = base;
1497 b->yy_is_our_buffer = 0;
1498 b->yy_input_file = 0;
1499 b->yy_n_chars = b->yy_buf_size;
1500 b->yy_is_interactive = 0;
1502 b->yy_fill_buffer = 0;
1503 b->yy_buffer_status = YY_BUFFER_NEW;
1505 yy_switch_to_buffer( b );
1512 #ifndef YY_NO_SCAN_STRING
1513 #ifdef YY_USE_PROTOS
1514 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1516 YY_BUFFER_STATE yy_scan_string( yy_str )
1517 yyconst char *yy_str;
1521 for ( len = 0; yy_str[len]; ++len )
1524 return yy_scan_bytes( yy_str, len );
1529 #ifndef YY_NO_SCAN_BYTES
1530 #ifdef YY_USE_PROTOS
1531 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1533 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1534 yyconst char *bytes;
1543 /* Get memory for full buffer, including space for trailing EOB's. */
1545 buf = (char *) yy_flex_alloc( n );
1547 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1549 for ( i = 0; i < len; ++i )
1552 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1554 b = yy_scan_buffer( buf, n );
1556 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1558 /* It's okay to grow etc. this buffer, and we should throw it
1559 * away when we're done.
1561 b->yy_is_our_buffer = 1;
1568 #ifndef YY_NO_PUSH_STATE
1569 #ifdef YY_USE_PROTOS
1570 static void yy_push_state( int new_state )
1572 static void yy_push_state( new_state )
1576 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1580 yy_start_stack_depth += YY_START_STACK_INCR;
1581 new_size = yy_start_stack_depth * sizeof( int );
1583 if ( ! yy_start_stack )
1584 yy_start_stack = (int *) yy_flex_alloc( new_size );
1587 yy_start_stack = (int *) yy_flex_realloc(
1588 (void *) yy_start_stack, new_size );
1590 if ( ! yy_start_stack )
1592 "out of memory expanding start-condition stack" );
1595 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1602 #ifndef YY_NO_POP_STATE
1603 static void yy_pop_state()
1605 if ( --yy_start_stack_ptr < 0 )
1606 YY_FATAL_ERROR( "start-condition stack underflow" );
1608 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1613 #ifndef YY_NO_TOP_STATE
1614 static int yy_top_state()
1616 return yy_start_stack[yy_start_stack_ptr - 1];
1620 #ifndef YY_EXIT_FAILURE
1621 #define YY_EXIT_FAILURE 2
1624 #ifdef YY_USE_PROTOS
1625 static void yy_fatal_error( yyconst char msg[] )
1627 static void yy_fatal_error( msg )
1631 (void) fprintf( stderr, "%s\n", msg );
1632 exit( YY_EXIT_FAILURE );
1637 /* Redefine yyless() so it works in section 3 code. */
1643 /* Undo effects of setting up yytext. */ \
1644 yytext[yyleng] = yy_hold_char; \
1645 yy_c_buf_p = yytext + n; \
1646 yy_hold_char = *yy_c_buf_p; \
1647 *yy_c_buf_p = '\0'; \
1653 /* Internal utility routines. */
1656 #ifdef YY_USE_PROTOS
1657 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1659 static void yy_flex_strncpy( s1, s2, n )
1666 for ( i = 0; i < n; ++i )
1671 #ifdef YY_NEED_STRLEN
1672 #ifdef YY_USE_PROTOS
1673 static int yy_flex_strlen( yyconst char *s )
1675 static int yy_flex_strlen( s )
1680 for ( n = 0; s[n]; ++n )
1688 #ifdef YY_USE_PROTOS
1689 static void *yy_flex_alloc( yy_size_t size )
1691 static void *yy_flex_alloc( size )
1695 return (void *) malloc( size );
1698 #ifdef YY_USE_PROTOS
1699 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1701 static void *yy_flex_realloc( ptr, size )
1706 /* The cast to (char *) in the following accommodates both
1707 * implementations that use char* generic pointers, and those
1708 * that use void* generic pointers. It works with the latter
1709 * because both ANSI C and C++ allow castless assignment from
1710 * any pointer type to void*, and deal with argument conversions
1711 * as though doing an assignment.
1713 return (void *) realloc( (char *) ptr, size );
1716 #ifdef YY_USE_PROTOS
1717 static void yy_flex_free( void *ptr )
1719 static void yy_flex_free( ptr )
1736 int my_xmlParser_yyinput(char *buf, int max_size){
1740 if(flex_xml_stringinput != NULL){
1742 if(flex_xml_stringinput[flex_xml_stringinput_ptr] != '\0'){
1743 buf[c++] = flex_xml_stringinput[flex_xml_stringinput_ptr++];
1751 if(flex_xml_fileinput != NULL){
1752 while(c < max_size){
1753 inchar = getc(flex_xml_fileinput);
1766 void xmlParser_setfileinput(FILE *f){
1767 xmlParserrestart(NULL);
1769 flex_xml_fileinput = f;
1770 flex_xml_stringinput = NULL;
1771 flex_xml_lineno = 1;
1775 void xmlParser_setstringinput(char *s){
1776 xmlParserrestart(NULL);
1778 flex_xml_fileinput = NULL;
1779 flex_xml_stringinput = s;
1780 flex_xml_stringinput_ptr = 0;
1781 flex_xml_lineno = 1;