Added quantiling UDAFs
[com/gs-lite.git] / src / tools / xmllexer.cc
1 #define yy_create_buffer xmlParser_create_buffer\r
2 #define yy_delete_buffer xmlParser_delete_buffer\r
3 #define yy_scan_buffer xmlParser_scan_buffer\r
4 #define yy_scan_string xmlParser_scan_string\r
5 #define yy_scan_bytes xmlParser_scan_bytes\r
6 #define yy_flex_debug xmlParser_flex_debug\r
7 #define yy_init_buffer xmlParser_init_buffer\r
8 #define yy_flush_buffer xmlParser_flush_buffer\r
9 #define yy_load_buffer_state xmlParser_load_buffer_state\r
10 #define yy_switch_to_buffer xmlParser_switch_to_buffer\r
11 #define yyin xmlParserin\r
12 #define yyleng xmlParserleng\r
13 #define yylex xmlParserlex\r
14 #define yyout xmlParserout\r
15 #define yyrestart xmlParserrestart\r
16 #define yytext xmlParsertext\r
17 \r
18 #line 19 "xmllexer.cc"\r
19 /* A lexical scanner generated by flex*/\r
20 \r
21 /* Scanner skeleton version:\r
22  * $Header: /cvsroot/gscpv4/src/tools/xmllexer.cc,v 1.1.1.1 2013/12/02 17:44:57 spatsch Exp $\r
23  */\r
24 \r
25 #define FLEX_SCANNER\r
26 #define YY_FLEX_MAJOR_VERSION 2\r
27 #define YY_FLEX_MINOR_VERSION 5\r
28 \r
29 #include <stdio.h>\r
30 #include <unistd.h>\r
31 \r
32 \r
33 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */\r
34 #ifdef c_plusplus\r
35 #ifndef __cplusplus\r
36 #define __cplusplus\r
37 #endif\r
38 #endif\r
39 \r
40 \r
41 #ifdef __cplusplus\r
42 \r
43 #include <stdlib.h>\r
44 \r
45 /* Use prototypes in function declarations. */\r
46 #define YY_USE_PROTOS\r
47 \r
48 /* The "const" storage-class-modifier is valid. */\r
49 #define YY_USE_CONST\r
50 \r
51 #else   /* ! __cplusplus */\r
52 \r
53 #if __STDC__\r
54 \r
55 #define YY_USE_PROTOS\r
56 #define YY_USE_CONST\r
57 \r
58 #endif  /* __STDC__ */\r
59 #endif  /* ! __cplusplus */\r
60 \r
61 #ifdef __TURBOC__\r
62  #pragma warn -rch\r
63  #pragma warn -use\r
64 #include <io.h>\r
65 #include <stdlib.h>\r
66 #define YY_USE_CONST\r
67 #define YY_USE_PROTOS\r
68 #endif\r
69 \r
70 #ifdef YY_USE_CONST\r
71 #define yyconst const\r
72 #else\r
73 #define yyconst\r
74 #endif\r
75 \r
76 \r
77 #ifdef YY_USE_PROTOS\r
78 #define YY_PROTO(proto) proto\r
79 #else\r
80 #define YY_PROTO(proto) ()\r
81 #endif\r
82 \r
83 /* Returned upon end-of-file. */\r
84 #define YY_NULL 0\r
85 \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
89  * double cast.\r
90  */\r
91 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)\r
92 \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
96  */\r
97 #define BEGIN yy_start = 1 + 2 *\r
98 \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
101  * compatibility.\r
102  */\r
103 #define YY_START ((yy_start - 1) / 2)\r
104 #define YYSTATE YY_START\r
105 \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
108 \r
109 /* Special action meaning "start processing a new file". */\r
110 #define YY_NEW_FILE yyrestart( yyin )\r
111 \r
112 #define YY_END_OF_BUFFER_CHAR 0\r
113 \r
114 /* Size of default input buffer. */\r
115 #define YY_BUF_SIZE 16384\r
116 \r
117 typedef struct yy_buffer_state *YY_BUFFER_STATE;\r
118 \r
119 extern int yyleng;\r
120 extern FILE *yyin, *yyout;\r
121 \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
125 \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
129  *\r
130  *      if ( condition_holds )\r
131  *              yyless( 5 );\r
132  *      else\r
133  *              do_something_else();\r
134  *\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
138  */\r
139 \r
140 /* Return all but the first 'n' matched characters back to the input stream. */\r
141 \r
142 #define yyless(n) \\r
143         do \\r
144                 { \\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
150                 } \\r
151         while ( 0 )\r
152 \r
153 #define unput(c) yyunput( c, yytext_ptr )\r
154 \r
155 /* Some routines like yy_flex_realloc() are emitted as static but are\r
156    not called by all lexers. This generates warnings in some compilers,\r
157    notably GCC. Arrange to suppress these. */\r
158 #ifdef __GNUC__\r
159 #define YY_MAY_BE_UNUSED __attribute__((unused))\r
160 #else\r
161 #define YY_MAY_BE_UNUSED\r
162 #endif\r
163 \r
164 /* The following is because we cannot portably get our hands on size_t\r
165  * (without autoconf's help, which isn't available because we want\r
166  * flex-generated scanners to compile on their own).\r
167  */\r
168 typedef unsigned int yy_size_t;\r
169 \r
170 \r
171 struct yy_buffer_state\r
172         {\r
173         FILE *yy_input_file;\r
174 \r
175         char *yy_ch_buf;                /* input buffer */\r
176         char *yy_buf_pos;               /* current position in input buffer */\r
177 \r
178         /* Size of input buffer in bytes, not including room for EOB\r
179          * characters.\r
180          */\r
181         yy_size_t yy_buf_size;\r
182 \r
183         /* Number of characters read into yy_ch_buf, not including EOB\r
184          * characters.\r
185          */\r
186         int yy_n_chars;\r
187 \r
188         /* Whether we "own" the buffer - i.e., we know we created it,\r
189          * and can realloc() it to grow it, and should free() it to\r
190          * delete it.\r
191          */\r
192         int yy_is_our_buffer;\r
193 \r
194         /* Whether this is an "interactive" input source; if so, and\r
195          * if we're using stdio for input, then we want to use getc()\r
196          * instead of fread(), to make sure we stop fetching input after\r
197          * each newline.\r
198          */\r
199         int yy_is_interactive;\r
200 \r
201         /* Whether we're considered to be at the beginning of a line.\r
202          * If so, '^' rules will be active on the next match, otherwise\r
203          * not.\r
204          */\r
205         int yy_at_bol;\r
206 \r
207         /* Whether to try to fill the input buffer when we reach the\r
208          * end of it.\r
209          */\r
210         int yy_fill_buffer;\r
211 \r
212         int yy_buffer_status;\r
213 #define YY_BUFFER_NEW 0\r
214 #define YY_BUFFER_NORMAL 1\r
215         /* When an EOF's been seen but there's still some text to process\r
216          * then we mark the buffer as YY_EOF_PENDING, to indicate that we\r
217          * shouldn't try reading from the input source any more.  We might\r
218          * still have a bunch of tokens to match, though, because of\r
219          * possible backing-up.\r
220          *\r
221          * When we actually see the EOF, we change the status to "new"\r
222          * (via yyrestart()), so that the user can continue scanning by\r
223          * just pointing yyin at a new input file.\r
224          */\r
225 #define YY_BUFFER_EOF_PENDING 2\r
226         };\r
227 \r
228 static YY_BUFFER_STATE yy_current_buffer = 0;\r
229 \r
230 /* We provide macros for accessing buffer states in case in the\r
231  * future we want to put the buffer states in a more general\r
232  * "scanner state".\r
233  */\r
234 #define YY_CURRENT_BUFFER yy_current_buffer\r
235 \r
236 \r
237 /* yy_hold_char holds the character lost when yytext is formed. */\r
238 static char yy_hold_char;\r
239 \r
240 static int yy_n_chars;          /* number of characters read into yy_ch_buf */\r
241 \r
242 \r
243 int yyleng;\r
244 \r
245 /* Points to current character in buffer. */\r
246 static char *yy_c_buf_p = (char *) 0;\r
247 static int yy_init = 1;         /* whether we need to initialize */\r
248 static int yy_start = 0;        /* start state number */\r
249 \r
250 /* Flag which is used to allow yywrap()'s to do buffer switches\r
251  * instead of setting up a fresh yyin.  A bit of a hack ...\r
252  */\r
253 static int yy_did_buffer_switch_on_eof;\r
254 \r
255 void yyrestart YY_PROTO(( FILE *input_file ));\r
256 \r
257 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));\r
258 void yy_load_buffer_state YY_PROTO(( void ));\r
259 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));\r
260 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));\r
261 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));\r
262 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));\r
263 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )\r
264 \r
265 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));\r
266 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));\r
267 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));\r
268 \r
269 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));\r
270 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;\r
271 static void yy_flex_free YY_PROTO(( void * ));\r
272 \r
273 #define yy_new_buffer yy_create_buffer\r
274 \r
275 #define yy_set_interactive(is_interactive) \\r
276         { \\r
277         if ( ! yy_current_buffer ) \\r
278                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \\r
279         yy_current_buffer->yy_is_interactive = is_interactive; \\r
280         }\r
281 \r
282 #define yy_set_bol(at_bol) \\r
283         { \\r
284         if ( ! yy_current_buffer ) \\r
285                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \\r
286         yy_current_buffer->yy_at_bol = at_bol; \\r
287         }\r
288 \r
289 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)\r
290 \r
291 \r
292 #define yywrap() 1\r
293 #define YY_SKIP_YYWRAP\r
294 typedef unsigned char YY_CHAR;\r
295 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;\r
296 typedef int yy_state_type;\r
297 extern char *yytext;\r
298 #define yytext_ptr yytext\r
299 \r
300 static yy_state_type yy_get_previous_state YY_PROTO(( void ));\r
301 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));\r
302 static int yy_get_next_buffer YY_PROTO(( void ));\r
303 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));\r
304 \r
305 /* Done after the current pattern has been matched and before the\r
306  * corresponding action - sets up yytext.\r
307  */\r
308 #define YY_DO_BEFORE_ACTION \\r
309         yytext_ptr = yy_bp; \\r
310         yytext_ptr -= yy_more_len; \\r
311         yyleng = (int) (yy_cp - yytext_ptr); \\r
312         yy_hold_char = *yy_cp; \\r
313         *yy_cp = '\0'; \\r
314         yy_c_buf_p = yy_cp;\r
315 \r
316 #define YY_NUM_RULES 11\r
317 #define YY_END_OF_BUFFER 12\r
318 static yyconst short int yy_accept[32] =\r
319     {   0,\r
320         0,    0,   12,   10,    6,    5,   10,   10,    1,    1,\r
321         1,    2,    6,    5,    0,    4,    3,    0,    0,    0,\r
322         2,    0,    7,    0,    8,    0,    0,    0,    0,    9,\r
323         0\r
324     } ;\r
325 \r
326 static yyconst int yy_ec[256] =\r
327     {   0,\r
328         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,\r
329         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,\r
330         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
331         1,    2,    1,    1,    1,    1,    1,    1,    4,    1,\r
332         1,    1,    1,    1,    5,    1,    6,    7,    7,    7,\r
333         7,    7,    7,    7,    7,    7,    7,    7,    1,    8,\r
334         9,    9,   10,    1,   11,   11,   11,   11,   11,   11,\r
335        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,\r
336        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,\r
337         1,    1,    1,    1,   11,    1,   11,   11,   11,   11,\r
338 \r
339        11,   11,   11,   11,   11,   11,   11,   12,   13,   11,\r
340        11,   11,   11,   11,   11,   11,   11,   11,   11,   14,\r
341        11,   11,    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
346         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
347         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
348         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
349 \r
350         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
351         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
352         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
353         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
354         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
355         1,    1,    1,    1,    1\r
356     } ;\r
357 \r
358 static yyconst int yy_meta[15] =\r
359     {   0,\r
360         1,    1,    2,    1,    3,    1,    3,    1,    1,    1,\r
361         3,    3,    3,    3\r
362     } ;\r
363 \r
364 static yyconst short int yy_base[38] =\r
365     {   0,\r
366         0,    0,   48,   49,   45,    0,   12,   41,   39,   34,\r
367        49,    0,   41,    0,   14,   49,   49,   39,   38,   26,\r
368         0,   36,   49,   35,   49,   24,   24,   32,   31,   49,\r
369        49,   18,   21,   17,   24,   27,   30\r
370     } ;\r
371 \r
372 static yyconst short int yy_def[38] =\r
373     {   0,\r
374        31,    1,   31,   31,   31,   32,   33,   31,   31,   31,\r
375        31,   34,   31,   32,   33,   31,   31,   35,   36,   31,\r
376        34,   35,   31,   36,   31,   31,   31,   37,   37,   31,\r
377         0,   31,   31,   31,   31,   31,   31\r
378     } ;\r
379 \r
380 static yyconst short int yy_nxt[64] =\r
381     {   0,\r
382         4,    5,    6,    7,    8,    9,    4,   10,   11,    4,\r
383        12,   12,   12,   12,   16,   17,   16,   17,   14,   21,\r
384        14,   15,   15,   15,   22,   22,   22,   24,   24,   24,\r
385        29,   29,   29,   30,   30,   28,   27,   25,   23,   26,\r
386        25,   23,   13,   20,   19,   18,   13,   31,    3,   31,\r
387        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,\r
388        31,   31,   31\r
389     } ;\r
390 \r
391 static yyconst short int yy_chk[64] =\r
392     {   0,\r
393         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
394         1,    1,    1,    1,    7,    7,   15,   15,   32,   34,\r
395        32,   33,   33,   33,   35,   35,   35,   36,   36,   36,\r
396        37,   37,   37,   29,   28,   27,   26,   24,   22,   20,\r
397        19,   18,   13,   10,    9,    8,    5,    3,   31,   31,\r
398        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,\r
399        31,   31,   31\r
400     } ;\r
401 \r
402 static yy_state_type yy_last_accepting_state;\r
403 static char *yy_last_accepting_cpos;\r
404 \r
405 /* The intent behind this definition is that it'll catch\r
406  * any uses of REJECT which flex missed.\r
407  */\r
408 #define REJECT reject_used_but_not_detected\r
409 static int yy_more_flag = 0;\r
410 static int yy_more_len = 0;\r
411 #define yymore() (yy_more_flag = 1)\r
412 #define YY_MORE_ADJ yy_more_len\r
413 #define YY_RESTORE_YY_MORE_OFFSET\r
414 char *yytext;\r
415 #line 1 "xml.l"\r
416 #define INITIAL 0\r
417 /*\r
418         MUST COMPILE WITH\r
419                 flex -PxmlParser -oxmllexer.cc xml.l\r
420         (or equivalent).\r
421 */      \r
422 #line 9 "xml.l"\r
423 /*\r
424  * AT&T lex can't handle this lexer due to lex bugs.  It works with flex\r
425  * 2.3.7, pclex 2.0.5, and MKS lex 3.1a.\r
426  */\r
427 \r
428  // #include "parse_fta.h"\r
429  #include <string.h>\r
430 \r
431 \r
432 \r
433 #include "xml.tab.hh"\r
434 \r
435 /*\r
436         Some includes that flex doesn't include as standard,\r
437         but which are needed.\r
438 */\r
439 \r
440 #include <stdlib.h>\r
441 #include <string.h>\r
442 \r
443 \r
444 //              Prevent flex from defining yywrap as extern "C" \r
445 \r
446 #define YY_SKIP_YYWRAP\r
447 \r
448 /*              No lex lib, supply the yywrap fcn. that normally resides there\r
449 */\r
450 \r
451 int xmlParserwrap(){return(1);}\r
452 \r
453 extern int xmlParserdebug;\r
454 \r
455 \r
456 /*\r
457                 These variables are used for error reporting:\r
458                 flex_xml_lineno : the line currently being parsed when the error occurs.\r
459                 flex_xml_ch : the character on the line where the error occurs\r
460                 flex_xml_linebuf : store the line for reporting.\r
461 \r
462                 NOTE : 1) the fixed size flex_xml_linebuf buffer is dangerous.\r
463                            2) You might get pointed to a place shortly after\r
464                                   where the syntax error occurs.  It is close enough\r
465                                   for now.\r
466 */\r
467 \r
468 int flex_xml_lineno = 1;\r
469 int flex_xml_ch = 0;\r
470 char flex_xml_linebuf[20000];\r
471 \r
472 char *flex_xml_stringinput = NULL;\r
473 int flex_xml_stringinput_ptr = 0;\r
474 FILE *flex_xml_fileinput = NULL;\r
475 int my_xmlParser_yyinput(char *buf, int max_size);\r
476 \r
477 \r
478 \r
479 void xmlParsererror(char *s){\r
480         int i;\r
481         fprintf(stderr,"On line %d, char %d: %s (token %s):\n%s\n",\r
482                                 flex_xml_lineno, flex_xml_ch, s, xmlParsertext, flex_xml_linebuf );\r
483     for(i=0;i<flex_xml_ch;i++){\r
484                 if(flex_xml_linebuf[i] == '\t'){\r
485                         fprintf(stderr,"\t");\r
486                 }else{\r
487                         fprintf(stderr," ");\r
488                 }\r
489         }\r
490         fprintf(stderr,"^\n");\r
491         //      fprintf(stderr,"%*s\n",1+flex_xml_ch,"^");\r
492 }\r
493 \r
494 #undef YY_INPUT\r
495 #define YY_INPUT(b, r, ms) (r = my_xmlParser_yyinput(b,ms))\r
496 \r
497 /* MKS needs the next line to increase the NFA table */\r
498 #line 499 "xmllexer.cc"\r
499 \r
500 /* Macros after this point can all be overridden by user definitions in\r
501  * section 1.\r
502  */\r
503 \r
504 #ifndef YY_SKIP_YYWRAP\r
505 #ifdef __cplusplus\r
506 extern "C" int yywrap YY_PROTO(( void ));\r
507 #else\r
508 extern int yywrap YY_PROTO(( void ));\r
509 #endif\r
510 #endif\r
511 \r
512 #ifndef YY_NO_UNPUT\r
513 static void yyunput YY_PROTO(( int c, char *buf_ptr ));\r
514 #endif\r
515 \r
516 #ifndef yytext_ptr\r
517 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));\r
518 #endif\r
519 \r
520 #ifdef YY_NEED_STRLEN\r
521 static int yy_flex_strlen YY_PROTO(( yyconst char * ));\r
522 #endif\r
523 \r
524 #ifndef YY_NO_INPUT\r
525 #ifdef __cplusplus\r
526 static int yyinput YY_PROTO(( void ));\r
527 #else\r
528 static int input YY_PROTO(( void ));\r
529 #endif\r
530 #endif\r
531 \r
532 #if YY_STACK_USED\r
533 static int yy_start_stack_ptr = 0;\r
534 static int yy_start_stack_depth = 0;\r
535 static int *yy_start_stack = 0;\r
536 #ifndef YY_NO_PUSH_STATE\r
537 static void yy_push_state YY_PROTO(( int new_state ));\r
538 #endif\r
539 #ifndef YY_NO_POP_STATE\r
540 static void yy_pop_state YY_PROTO(( void ));\r
541 #endif\r
542 #ifndef YY_NO_TOP_STATE\r
543 static int yy_top_state YY_PROTO(( void ));\r
544 #endif\r
545 \r
546 #else\r
547 #define YY_NO_PUSH_STATE 1\r
548 #define YY_NO_POP_STATE 1\r
549 #define YY_NO_TOP_STATE 1\r
550 #endif\r
551 \r
552 #ifdef YY_MALLOC_DECL\r
553 YY_MALLOC_DECL\r
554 #else\r
555 #if __STDC__\r
556 #ifndef __cplusplus\r
557 #include <stdlib.h>\r
558 #endif\r
559 #else\r
560 /* Just try to get by without declaring the routines.  This will fail\r
561  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)\r
562  * or sizeof(void*) != sizeof(int).\r
563  */\r
564 #endif\r
565 #endif\r
566 \r
567 /* Amount of stuff to slurp up with each read. */\r
568 #ifndef YY_READ_BUF_SIZE\r
569 #define YY_READ_BUF_SIZE 8192\r
570 #endif\r
571 \r
572 /* Copy whatever the last rule matched to the standard output. */\r
573 \r
574 #ifndef ECHO\r
575 /* This used to be an fputs(), but since the string might contain NUL's,\r
576  * we now use fwrite().\r
577  */\r
578 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )\r
579 #endif\r
580 \r
581 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,\r
582  * is returned in "result".\r
583  */\r
584 #ifndef YY_INPUT\r
585 #define YY_INPUT(buf,result,max_size) \\r
586         if ( yy_current_buffer->yy_is_interactive ) \\r
587                 { \\r
588                 int c = '*', n; \\r
589                 for ( n = 0; n < max_size && \\r
590                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \\r
591                         buf[n] = (char) c; \\r
592                 if ( c == '\n' ) \\r
593                         buf[n++] = (char) c; \\r
594                 if ( c == EOF && ferror( yyin ) ) \\r
595                         YY_FATAL_ERROR( "input in flex scanner failed" ); \\r
596                 result = n; \\r
597                 } \\r
598         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \\r
599                   && ferror( yyin ) ) \\r
600                 YY_FATAL_ERROR( "input in flex scanner failed" );\r
601 #endif\r
602 \r
603 /* No semi-colon after return; correct usage is to write "yyterminate();" -\r
604  * we don't want an extra ';' after the "return" because that will cause\r
605  * some compilers to complain about unreachable statements.\r
606  */\r
607 #ifndef yyterminate\r
608 #define yyterminate() return YY_NULL\r
609 #endif\r
610 \r
611 /* Number of entries by which start-condition stack grows. */\r
612 #ifndef YY_START_STACK_INCR\r
613 #define YY_START_STACK_INCR 25\r
614 #endif\r
615 \r
616 /* Report a fatal error. */\r
617 #ifndef YY_FATAL_ERROR\r
618 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )\r
619 #endif\r
620 \r
621 /* Default declaration of generated scanner - a define so the user can\r
622  * easily add parameters.\r
623  */\r
624 #ifndef YY_DECL\r
625 #define YY_DECL int yylex YY_PROTO(( void ))\r
626 #endif\r
627 \r
628 /* Code executed at the beginning of each rule, after yytext and yyleng\r
629  * have been set up.\r
630  */\r
631 #ifndef YY_USER_ACTION\r
632 #define YY_USER_ACTION\r
633 #endif\r
634 \r
635 /* Code executed at the end of each rule. */\r
636 #ifndef YY_BREAK\r
637 #define YY_BREAK break;\r
638 #endif\r
639 \r
640 #define YY_RULE_SETUP \\r
641         YY_USER_ACTION\r
642 \r
643 YY_DECL\r
644         {\r
645         register yy_state_type yy_current_state;\r
646         register char *yy_cp = NULL, *yy_bp = NULL;\r
647         register int yy_act;\r
648 \r
649 #line 88 "xml.l"\r
650 \r
651 \r
652         /* literal keyword tokens */\r
653 \r
654  /*\r
655                         The actions associated with each text token are to\r
656                         keep track of the current location (for syntax error reporting)\r
657                         and to report any necessary info to the emf.y parse tree builder\r
658 \r
659                         Its likely that there are a number of omissions, inconsistencies\r
660                         (some keywords do not need to be in caps), and relics\r
661                         (keywords such as BETWEEN, INDICATOR, etc., are not used\r
662                          in emf.y)\r
663                         This parser is somewhat of a work in progress.\r
664  */\r
665 \r
666  /*             Query keywords          */\r
667 \r
668 \r
669 \r
670 \r
671 #line 672 "xmllexer.cc"\r
672 \r
673         if ( yy_init )\r
674                 {\r
675                 yy_init = 0;\r
676 \r
677 #ifdef YY_USER_INIT\r
678                 YY_USER_INIT;\r
679 #endif\r
680 \r
681                 if ( ! yy_start )\r
682                         yy_start = 1;   /* first start state */\r
683 \r
684                 if ( ! yyin )\r
685                         yyin = stdin;\r
686 \r
687                 if ( ! yyout )\r
688                         yyout = stdout;\r
689 \r
690                 if ( ! yy_current_buffer )\r
691                         yy_current_buffer =\r
692                                 yy_create_buffer( yyin, YY_BUF_SIZE );\r
693 \r
694                 yy_load_buffer_state();\r
695                 }\r
696 \r
697         while ( 1 )             /* loops until end-of-file is reached */\r
698                 {\r
699                 yy_more_len = 0;\r
700                 if ( yy_more_flag )\r
701                         {\r
702                         yy_more_len = yy_c_buf_p - yytext_ptr;\r
703                         yy_more_flag = 0;\r
704                         }\r
705                 yy_cp = yy_c_buf_p;\r
706 \r
707                 /* Support of yytext. */\r
708                 *yy_cp = yy_hold_char;\r
709 \r
710                 /* yy_bp points to the position in yy_ch_buf of the start of\r
711                  * the current run.\r
712                  */\r
713                 yy_bp = yy_cp;\r
714 \r
715                 yy_current_state = yy_start;\r
716 yy_match:\r
717                 do\r
718                         {\r
719                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];\r
720                         if ( yy_accept[yy_current_state] )\r
721                                 {\r
722                                 yy_last_accepting_state = yy_current_state;\r
723                                 yy_last_accepting_cpos = yy_cp;\r
724                                 }\r
725                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )\r
726                                 {\r
727                                 yy_current_state = (int) yy_def[yy_current_state];\r
728                                 if ( yy_current_state >= 32 )\r
729                                         yy_c = yy_meta[(unsigned int) yy_c];\r
730                                 }\r
731                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];\r
732                         ++yy_cp;\r
733                         }\r
734                 while ( yy_base[yy_current_state] != 49 );\r
735 \r
736 yy_find_action:\r
737                 yy_act = yy_accept[yy_current_state];\r
738                 if ( yy_act == 0 )\r
739                         { /* have to back up */\r
740                         yy_cp = yy_last_accepting_cpos;\r
741                         yy_current_state = yy_last_accepting_state;\r
742                         yy_act = yy_accept[yy_current_state];\r
743                         }\r
744 \r
745                 YY_DO_BEFORE_ACTION;\r
746 \r
747 \r
748 do_action:      /* This label is used only to access EOF actions. */\r
749 \r
750 \r
751                 switch ( yy_act )\r
752         { /* beginning of action switch */\r
753                         case 0: /* must back up */\r
754                         /* undo the effects of YY_DO_BEFORE_ACTION */\r
755                         *yy_cp = yy_hold_char;\r
756                         yy_cp = yy_last_accepting_cpos;\r
757                         yy_current_state = yy_last_accepting_state;\r
758                         goto yy_find_action;\r
759 \r
760 case 1:\r
761 YY_RULE_SETUP\r
762 #line 109 "xml.l"\r
763 { flex_xml_ch+=xmlParserleng; return yytext[0]; }\r
764         YY_BREAK\r
765 /* names */\r
766 case 2:\r
767 YY_RULE_SETUP\r
768 #line 113 "xml.l"\r
769 { flex_xml_ch+=xmlParserleng; xmlParserlval.strval = strdup(yytext); return NAME; }\r
770         YY_BREAK\r
771 /* strings */\r
772 case 3:\r
773 YY_RULE_SETUP\r
774 #line 118 "xml.l"\r
775 {\r
776                 \r
777                 int c;\r
778                 \r
779                 xmlParserlval.strval = strdup(xmlParsertext+1); \r
780 \r
781                 c = yyinput();\r
782 \r
783                 unput(c);       /* just peeking */\r
784                 if(c != '\'') {\r
785                         flex_xml_ch+=xmlParserleng; \r
786                         xmlParserlval.strval[xmlParserleng-2] = '\0';\r
787                         return STRING_TOKEN;\r
788                 } else\r
789                         yymore();\r
790         }\r
791         YY_BREAK\r
792 case 4:\r
793 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */\r
794 yy_c_buf_p = yy_cp -= 1;\r
795 YY_DO_BEFORE_ACTION; /* set up yytext again */\r
796 YY_RULE_SETUP\r
797 #line 135 "xml.l"\r
798 { flex_xml_ch+=xmlParserleng; xmlParsererror("Unterminated string"); }\r
799         YY_BREAK\r
800 /*                                                                                                                      */\r
801 /*              Newline : advance the error reporting line number       */\r
802 /*              and grab the next line into flex_xml_linebuf                    */\r
803 /*                                                                                                                      */\r
804 case 5:\r
805 YY_RULE_SETUP\r
806 #line 142 "xml.l"\r
807 {flex_xml_ch=0; flex_xml_lineno++;\r
808                            strcpy(flex_xml_linebuf,xmlParsertext+1);\r
809                            yyless(1);\r
810                            }\r
811         YY_BREAK\r
812 case 6:\r
813 YY_RULE_SETUP\r
814 #line 147 "xml.l"\r
815 {flex_xml_ch+=xmlParserleng; }  /* white space */\r
816         YY_BREAK\r
817 case 7:\r
818 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */\r
819 yy_c_buf_p = yy_cp -= 1;\r
820 YY_DO_BEFORE_ACTION; /* set up yytext again */\r
821 YY_RULE_SETUP\r
822 #line 149 "xml.l"\r
823 {flex_xml_ch+=xmlParserleng; }; /* comment */\r
824         YY_BREAK\r
825 case 8:\r
826 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */\r
827 yy_c_buf_p = yy_cp -= 1;\r
828 YY_DO_BEFORE_ACTION; /* set up yytext again */\r
829 YY_RULE_SETUP\r
830 #line 150 "xml.l"\r
831 {flex_xml_ch+=xmlParserleng; }; /* comment */\r
832         YY_BREAK\r
833 case 9:\r
834 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */\r
835 yy_c_buf_p = yy_cp -= 1;\r
836 YY_DO_BEFORE_ACTION; /* set up yytext again */\r
837 YY_RULE_SETUP\r
838 #line 151 "xml.l"\r
839 {flex_xml_ch+=xmlParserleng; }; /* comment */\r
840         YY_BREAK\r
841 case 10:\r
842 YY_RULE_SETUP\r
843 #line 153 "xml.l"\r
844 {flex_xml_ch+=xmlParserleng; fprintf(stderr,"Warning: unknown token (ignored)\n");  xmlParsererror(yytext);}\r
845         YY_BREAK\r
846 case 11:\r
847 YY_RULE_SETUP\r
848 #line 155 "xml.l"\r
849 ECHO;\r
850         YY_BREAK\r
851 #line 852 "xmllexer.cc"\r
852 case YY_STATE_EOF(INITIAL):\r
853         yyterminate();\r
854 \r
855         case YY_END_OF_BUFFER:\r
856                 {\r
857                 /* Amount of text matched not including the EOB char. */\r
858                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;\r
859 \r
860                 /* Undo the effects of YY_DO_BEFORE_ACTION. */\r
861                 *yy_cp = yy_hold_char;\r
862                 YY_RESTORE_YY_MORE_OFFSET\r
863 \r
864                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )\r
865                         {\r
866                         /* We're scanning a new file or input source.  It's\r
867                          * possible that this happened because the user\r
868                          * just pointed yyin at a new source and called\r
869                          * yylex().  If so, then we have to assure\r
870                          * consistency between yy_current_buffer and our\r
871                          * globals.  Here is the right place to do so, because\r
872                          * this is the first action (other than possibly a\r
873                          * back-up) that will match for the new input source.\r
874                          */\r
875                         yy_n_chars = yy_current_buffer->yy_n_chars;\r
876                         yy_current_buffer->yy_input_file = yyin;\r
877                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;\r
878                         }\r
879 \r
880                 /* Note that here we test for yy_c_buf_p "<=" to the position\r
881                  * of the first EOB in the buffer, since yy_c_buf_p will\r
882                  * already have been incremented past the NUL character\r
883                  * (since all states make transitions on EOB to the\r
884                  * end-of-buffer state).  Contrast this with the test\r
885                  * in input().\r
886                  */\r
887                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )\r
888                         { /* This was really a NUL. */\r
889                         yy_state_type yy_next_state;\r
890 \r
891                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;\r
892 \r
893                         yy_current_state = yy_get_previous_state();\r
894 \r
895                         /* Okay, we're now positioned to make the NUL\r
896                          * transition.  We couldn't have\r
897                          * yy_get_previous_state() go ahead and do it\r
898                          * for us because it doesn't know how to deal\r
899                          * with the possibility of jamming (and we don't\r
900                          * want to build jamming into it because then it\r
901                          * will run more slowly).\r
902                          */\r
903 \r
904                         yy_next_state = yy_try_NUL_trans( yy_current_state );\r
905 \r
906                         yy_bp = yytext_ptr + YY_MORE_ADJ;\r
907 \r
908                         if ( yy_next_state )\r
909                                 {\r
910                                 /* Consume the NUL. */\r
911                                 yy_cp = ++yy_c_buf_p;\r
912                                 yy_current_state = yy_next_state;\r
913                                 goto yy_match;\r
914                                 }\r
915 \r
916                         else\r
917                                 {\r
918                                 yy_cp = yy_c_buf_p;\r
919                                 goto yy_find_action;\r
920                                 }\r
921                         }\r
922 \r
923                 else switch ( yy_get_next_buffer() )\r
924                         {\r
925                         case EOB_ACT_END_OF_FILE:\r
926                                 {\r
927                                 yy_did_buffer_switch_on_eof = 0;\r
928 \r
929                                 if ( yywrap() )\r
930                                         {\r
931                                         /* Note: because we've taken care in\r
932                                          * yy_get_next_buffer() to have set up\r
933                                          * yytext, we can now set up\r
934                                          * yy_c_buf_p so that if some total\r
935                                          * hoser (like flex itself) wants to\r
936                                          * call the scanner after we return the\r
937                                          * YY_NULL, it'll still work - another\r
938                                          * YY_NULL will get returned.\r
939                                          */\r
940                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;\r
941 \r
942                                         yy_act = YY_STATE_EOF(YY_START);\r
943                                         goto do_action;\r
944                                         }\r
945 \r
946                                 else\r
947                                         {\r
948                                         if ( ! yy_did_buffer_switch_on_eof )\r
949                                                 YY_NEW_FILE;\r
950                                         }\r
951                                 break;\r
952                                 }\r
953 \r
954                         case EOB_ACT_CONTINUE_SCAN:\r
955                                 yy_c_buf_p =\r
956                                         yytext_ptr + yy_amount_of_matched_text;\r
957 \r
958                                 yy_current_state = yy_get_previous_state();\r
959 \r
960                                 yy_cp = yy_c_buf_p;\r
961                                 yy_bp = yytext_ptr + YY_MORE_ADJ;\r
962                                 goto yy_match;\r
963 \r
964                         case EOB_ACT_LAST_MATCH:\r
965                                 yy_c_buf_p =\r
966                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];\r
967 \r
968                                 yy_current_state = yy_get_previous_state();\r
969 \r
970                                 yy_cp = yy_c_buf_p;\r
971                                 yy_bp = yytext_ptr + YY_MORE_ADJ;\r
972                                 goto yy_find_action;\r
973                         }\r
974                 break;\r
975                 }\r
976 \r
977         default:\r
978                 YY_FATAL_ERROR(\r
979                         "fatal flex scanner internal error--no action found" );\r
980         } /* end of action switch */\r
981                 } /* end of scanning one token */\r
982         } /* end of yylex */\r
983 \r
984 \r
985 /* yy_get_next_buffer - try to read in a new buffer\r
986  *\r
987  * Returns a code representing an action:\r
988  *      EOB_ACT_LAST_MATCH -\r
989  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position\r
990  *      EOB_ACT_END_OF_FILE - end of file\r
991  */\r
992 \r
993 static int yy_get_next_buffer()\r
994         {\r
995         register char *dest = yy_current_buffer->yy_ch_buf;\r
996         register char *source = yytext_ptr;\r
997         register int number_to_move, i;\r
998         int ret_val;\r
999 \r
1000         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )\r
1001                 YY_FATAL_ERROR(\r
1002                 "fatal flex scanner internal error--end of buffer missed" );\r
1003 \r
1004         if ( yy_current_buffer->yy_fill_buffer == 0 )\r
1005                 { /* Don't try to fill the buffer, so this is an EOF. */\r
1006                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )\r
1007                         {\r
1008                         /* We matched a single character, the EOB, so\r
1009                          * treat this as a final EOF.\r
1010                          */\r
1011                         return EOB_ACT_END_OF_FILE;\r
1012                         }\r
1013 \r
1014                 else\r
1015                         {\r
1016                         /* We matched some text prior to the EOB, first\r
1017                          * process it.\r
1018                          */\r
1019                         return EOB_ACT_LAST_MATCH;\r
1020                         }\r
1021                 }\r
1022 \r
1023         /* Try to read more data. */\r
1024 \r
1025         /* First move last chars to start of buffer. */\r
1026         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;\r
1027 \r
1028         for ( i = 0; i < number_to_move; ++i )\r
1029                 *(dest++) = *(source++);\r
1030 \r
1031         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )\r
1032                 /* don't do the read, it's not guaranteed to return an EOF,\r
1033                  * just force an EOF\r
1034                  */\r
1035                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;\r
1036 \r
1037         else\r
1038                 {\r
1039                 int num_to_read =\r
1040                         yy_current_buffer->yy_buf_size - number_to_move - 1;\r
1041 \r
1042                 while ( num_to_read <= 0 )\r
1043                         { /* Not enough room in the buffer - grow it. */\r
1044 #ifdef YY_USES_REJECT\r
1045                         YY_FATAL_ERROR(\r
1046 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );\r
1047 #else\r
1048 \r
1049                         /* just a shorter name for the current buffer */\r
1050                         YY_BUFFER_STATE b = yy_current_buffer;\r
1051 \r
1052                         int yy_c_buf_p_offset =\r
1053                                 (int) (yy_c_buf_p - b->yy_ch_buf);\r
1054 \r
1055                         if ( b->yy_is_our_buffer )\r
1056                                 {\r
1057                                 int new_size = b->yy_buf_size * 2;\r
1058 \r
1059                                 if ( new_size <= 0 )\r
1060                                         b->yy_buf_size += b->yy_buf_size / 8;\r
1061                                 else\r
1062                                         b->yy_buf_size *= 2;\r
1063 \r
1064                                 b->yy_ch_buf = (char *)\r
1065                                         /* Include room in for 2 EOB chars. */\r
1066                                         yy_flex_realloc( (void *) b->yy_ch_buf,\r
1067                                                          b->yy_buf_size + 2 );\r
1068                                 }\r
1069                         else\r
1070                                 /* Can't grow it, we don't own it. */\r
1071                                 b->yy_ch_buf = 0;\r
1072 \r
1073                         if ( ! b->yy_ch_buf )\r
1074                                 YY_FATAL_ERROR(\r
1075                                 "fatal error - scanner input buffer overflow" );\r
1076 \r
1077                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];\r
1078 \r
1079                         num_to_read = yy_current_buffer->yy_buf_size -\r
1080                                                 number_to_move - 1;\r
1081 #endif\r
1082                         }\r
1083 \r
1084                 if ( num_to_read > YY_READ_BUF_SIZE )\r
1085                         num_to_read = YY_READ_BUF_SIZE;\r
1086 \r
1087                 /* Read in more data. */\r
1088                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),\r
1089                         yy_n_chars, num_to_read );\r
1090 \r
1091                 yy_current_buffer->yy_n_chars = yy_n_chars;\r
1092                 }\r
1093 \r
1094         if ( yy_n_chars == 0 )\r
1095                 {\r
1096                 if ( number_to_move == YY_MORE_ADJ )\r
1097                         {\r
1098                         ret_val = EOB_ACT_END_OF_FILE;\r
1099                         yyrestart( yyin );\r
1100                         }\r
1101 \r
1102                 else\r
1103                         {\r
1104                         ret_val = EOB_ACT_LAST_MATCH;\r
1105                         yy_current_buffer->yy_buffer_status =\r
1106                                 YY_BUFFER_EOF_PENDING;\r
1107                         }\r
1108                 }\r
1109 \r
1110         else\r
1111                 ret_val = EOB_ACT_CONTINUE_SCAN;\r
1112 \r
1113         yy_n_chars += number_to_move;\r
1114         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;\r
1115         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;\r
1116 \r
1117         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];\r
1118 \r
1119         return ret_val;\r
1120         }\r
1121 \r
1122 \r
1123 /* yy_get_previous_state - get the state just before the EOB char was reached */\r
1124 \r
1125 static yy_state_type yy_get_previous_state()\r
1126         {\r
1127         register yy_state_type yy_current_state;\r
1128         register char *yy_cp;\r
1129 \r
1130         yy_current_state = yy_start;\r
1131 \r
1132         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )\r
1133                 {\r
1134                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);\r
1135                 if ( yy_accept[yy_current_state] )\r
1136                         {\r
1137                         yy_last_accepting_state = yy_current_state;\r
1138                         yy_last_accepting_cpos = yy_cp;\r
1139                         }\r
1140                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )\r
1141                         {\r
1142                         yy_current_state = (int) yy_def[yy_current_state];\r
1143                         if ( yy_current_state >= 32 )\r
1144                                 yy_c = yy_meta[(unsigned int) yy_c];\r
1145                         }\r
1146                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];\r
1147                 }\r
1148 \r
1149         return yy_current_state;\r
1150         }\r
1151 \r
1152 \r
1153 /* yy_try_NUL_trans - try to make a transition on the NUL character\r
1154  *\r
1155  * synopsis\r
1156  *      next_state = yy_try_NUL_trans( current_state );\r
1157  */\r
1158 \r
1159 #ifdef YY_USE_PROTOS\r
1160 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )\r
1161 #else\r
1162 static yy_state_type yy_try_NUL_trans( yy_current_state )\r
1163 yy_state_type yy_current_state;\r
1164 #endif\r
1165         {\r
1166         register int yy_is_jam;\r
1167         register char *yy_cp = yy_c_buf_p;\r
1168 \r
1169         register YY_CHAR yy_c = 1;\r
1170         if ( yy_accept[yy_current_state] )\r
1171                 {\r
1172                 yy_last_accepting_state = yy_current_state;\r
1173                 yy_last_accepting_cpos = yy_cp;\r
1174                 }\r
1175         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )\r
1176                 {\r
1177                 yy_current_state = (int) yy_def[yy_current_state];\r
1178                 if ( yy_current_state >= 32 )\r
1179                         yy_c = yy_meta[(unsigned int) yy_c];\r
1180                 }\r
1181         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];\r
1182         yy_is_jam = (yy_current_state == 31);\r
1183 \r
1184         return yy_is_jam ? 0 : yy_current_state;\r
1185         }\r
1186 \r
1187 \r
1188 #ifndef YY_NO_UNPUT\r
1189 #ifdef YY_USE_PROTOS\r
1190 static void yyunput( int c, register char *yy_bp )\r
1191 #else\r
1192 static void yyunput( c, yy_bp )\r
1193 int c;\r
1194 register char *yy_bp;\r
1195 #endif\r
1196         {\r
1197         register char *yy_cp = yy_c_buf_p;\r
1198 \r
1199         /* undo effects of setting up yytext */\r
1200         *yy_cp = yy_hold_char;\r
1201 \r
1202         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )\r
1203                 { /* need to shift things up to make room */\r
1204                 /* +2 for EOB chars. */\r
1205                 register int number_to_move = yy_n_chars + 2;\r
1206                 register char *dest = &yy_current_buffer->yy_ch_buf[\r
1207                                         yy_current_buffer->yy_buf_size + 2];\r
1208                 register char *source =\r
1209                                 &yy_current_buffer->yy_ch_buf[number_to_move];\r
1210 \r
1211                 while ( source > yy_current_buffer->yy_ch_buf )\r
1212                         *--dest = *--source;\r
1213 \r
1214                 yy_cp += (int) (dest - source);\r
1215                 yy_bp += (int) (dest - source);\r
1216                 yy_current_buffer->yy_n_chars =\r
1217                         yy_n_chars = yy_current_buffer->yy_buf_size;\r
1218 \r
1219                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )\r
1220                         YY_FATAL_ERROR( "flex scanner push-back overflow" );\r
1221                 }\r
1222 \r
1223         *--yy_cp = (char) c;\r
1224 \r
1225 \r
1226         yytext_ptr = yy_bp;\r
1227         yy_hold_char = *yy_cp;\r
1228         yy_c_buf_p = yy_cp;\r
1229         }\r
1230 #endif  /* ifndef YY_NO_UNPUT */\r
1231 \r
1232 \r
1233 #ifndef YY_NO_INPUT\r
1234 #ifdef __cplusplus\r
1235 static int yyinput()\r
1236 #else\r
1237 static int input()\r
1238 #endif\r
1239         {\r
1240         int c;\r
1241 \r
1242         *yy_c_buf_p = yy_hold_char;\r
1243 \r
1244         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )\r
1245                 {\r
1246                 /* yy_c_buf_p now points to the character we want to return.\r
1247                  * If this occurs *before* the EOB characters, then it's a\r
1248                  * valid NUL; if not, then we've hit the end of the buffer.\r
1249                  */\r
1250                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )\r
1251                         /* This was really a NUL. */\r
1252                         *yy_c_buf_p = '\0';\r
1253 \r
1254                 else\r
1255                         { /* need more input */\r
1256                         int offset = yy_c_buf_p - yytext_ptr;\r
1257                         ++yy_c_buf_p;\r
1258 \r
1259                         switch ( yy_get_next_buffer() )\r
1260                                 {\r
1261                                 case EOB_ACT_LAST_MATCH:\r
1262                                         /* This happens because yy_g_n_b()\r
1263                                          * sees that we've accumulated a\r
1264                                          * token and flags that we need to\r
1265                                          * try matching the token before\r
1266                                          * proceeding.  But for input(),\r
1267                                          * there's no matching to consider.\r
1268                                          * So convert the EOB_ACT_LAST_MATCH\r
1269                                          * to EOB_ACT_END_OF_FILE.\r
1270                                          */\r
1271 \r
1272                                         /* Reset buffer status. */\r
1273                                         yyrestart( yyin );\r
1274 \r
1275                                         /* fall through */\r
1276 \r
1277                                 case EOB_ACT_END_OF_FILE:\r
1278                                         {\r
1279                                         if ( yywrap() )\r
1280                                                 return EOF;\r
1281 \r
1282                                         if ( ! yy_did_buffer_switch_on_eof )\r
1283                                                 YY_NEW_FILE;\r
1284 #ifdef __cplusplus\r
1285                                         return yyinput();\r
1286 #else\r
1287                                         return input();\r
1288 #endif\r
1289                                         }\r
1290 \r
1291                                 case EOB_ACT_CONTINUE_SCAN:\r
1292                                         yy_c_buf_p = yytext_ptr + offset;\r
1293                                         break;\r
1294                                 }\r
1295                         }\r
1296                 }\r
1297 \r
1298         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */\r
1299         *yy_c_buf_p = '\0';     /* preserve yytext */\r
1300         yy_hold_char = *++yy_c_buf_p;\r
1301 \r
1302 \r
1303         return c;\r
1304         }\r
1305 #endif /* YY_NO_INPUT */\r
1306 \r
1307 #ifdef YY_USE_PROTOS\r
1308 void yyrestart( FILE *input_file )\r
1309 #else\r
1310 void yyrestart( input_file )\r
1311 FILE *input_file;\r
1312 #endif\r
1313         {\r
1314         if ( ! yy_current_buffer )\r
1315                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );\r
1316 \r
1317         yy_init_buffer( yy_current_buffer, input_file );\r
1318         yy_load_buffer_state();\r
1319         }\r
1320 \r
1321 \r
1322 #ifdef YY_USE_PROTOS\r
1323 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )\r
1324 #else\r
1325 void yy_switch_to_buffer( new_buffer )\r
1326 YY_BUFFER_STATE new_buffer;\r
1327 #endif\r
1328         {\r
1329         if ( yy_current_buffer == new_buffer )\r
1330                 return;\r
1331 \r
1332         if ( yy_current_buffer )\r
1333                 {\r
1334                 /* Flush out information for old buffer. */\r
1335                 *yy_c_buf_p = yy_hold_char;\r
1336                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;\r
1337                 yy_current_buffer->yy_n_chars = yy_n_chars;\r
1338                 }\r
1339 \r
1340         yy_current_buffer = new_buffer;\r
1341         yy_load_buffer_state();\r
1342 \r
1343         /* We don't actually know whether we did this switch during\r
1344          * EOF (yywrap()) processing, but the only time this flag\r
1345          * is looked at is after yywrap() is called, so it's safe\r
1346          * to go ahead and always set it.\r
1347          */\r
1348         yy_did_buffer_switch_on_eof = 1;\r
1349         }\r
1350 \r
1351 \r
1352 #ifdef YY_USE_PROTOS\r
1353 void yy_load_buffer_state( void )\r
1354 #else\r
1355 void yy_load_buffer_state()\r
1356 #endif\r
1357         {\r
1358         yy_n_chars = yy_current_buffer->yy_n_chars;\r
1359         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;\r
1360         yyin = yy_current_buffer->yy_input_file;\r
1361         yy_hold_char = *yy_c_buf_p;\r
1362         }\r
1363 \r
1364 \r
1365 #ifdef YY_USE_PROTOS\r
1366 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )\r
1367 #else\r
1368 YY_BUFFER_STATE yy_create_buffer( file, size )\r
1369 FILE *file;\r
1370 int size;\r
1371 #endif\r
1372         {\r
1373         YY_BUFFER_STATE b;\r
1374 \r
1375         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );\r
1376         if ( ! b )\r
1377                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );\r
1378 \r
1379         b->yy_buf_size = size;\r
1380 \r
1381         /* yy_ch_buf has to be 2 characters longer than the size given because\r
1382          * we need to put in 2 end-of-buffer characters.\r
1383          */\r
1384         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );\r
1385         if ( ! b->yy_ch_buf )\r
1386                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );\r
1387 \r
1388         b->yy_is_our_buffer = 1;\r
1389 \r
1390         yy_init_buffer( b, file );\r
1391 \r
1392         return b;\r
1393         }\r
1394 \r
1395 \r
1396 #ifdef YY_USE_PROTOS\r
1397 void yy_delete_buffer( YY_BUFFER_STATE b )\r
1398 #else\r
1399 void yy_delete_buffer( b )\r
1400 YY_BUFFER_STATE b;\r
1401 #endif\r
1402         {\r
1403         if ( ! b )\r
1404                 return;\r
1405 \r
1406         if ( b == yy_current_buffer )\r
1407                 yy_current_buffer = (YY_BUFFER_STATE) 0;\r
1408 \r
1409         if ( b->yy_is_our_buffer )\r
1410                 yy_flex_free( (void *) b->yy_ch_buf );\r
1411 \r
1412         yy_flex_free( (void *) b );\r
1413         }\r
1414 \r
1415 \r
1416 \r
1417 #ifdef YY_USE_PROTOS\r
1418 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )\r
1419 #else\r
1420 void yy_init_buffer( b, file )\r
1421 YY_BUFFER_STATE b;\r
1422 FILE *file;\r
1423 #endif\r
1424 \r
1425 \r
1426         {\r
1427         yy_flush_buffer( b );\r
1428 \r
1429         b->yy_input_file = file;\r
1430         b->yy_fill_buffer = 1;\r
1431 \r
1432 #if YY_ALWAYS_INTERACTIVE\r
1433         b->yy_is_interactive = 1;\r
1434 #else\r
1435 #if YY_NEVER_INTERACTIVE\r
1436         b->yy_is_interactive = 0;\r
1437 #else\r
1438         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;\r
1439 #endif\r
1440 #endif\r
1441         }\r
1442 \r
1443 \r
1444 #ifdef YY_USE_PROTOS\r
1445 void yy_flush_buffer( YY_BUFFER_STATE b )\r
1446 #else\r
1447 void yy_flush_buffer( b )\r
1448 YY_BUFFER_STATE b;\r
1449 #endif\r
1450 \r
1451         {\r
1452         if ( ! b )\r
1453                 return;\r
1454 \r
1455         b->yy_n_chars = 0;\r
1456 \r
1457         /* We always need two end-of-buffer characters.  The first causes\r
1458          * a transition to the end-of-buffer state.  The second causes\r
1459          * a jam in that state.\r
1460          */\r
1461         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;\r
1462         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;\r
1463 \r
1464         b->yy_buf_pos = &b->yy_ch_buf[0];\r
1465 \r
1466         b->yy_at_bol = 1;\r
1467         b->yy_buffer_status = YY_BUFFER_NEW;\r
1468 \r
1469         if ( b == yy_current_buffer )\r
1470                 yy_load_buffer_state();\r
1471         }\r
1472 \r
1473 \r
1474 #ifndef YY_NO_SCAN_BUFFER\r
1475 #ifdef YY_USE_PROTOS\r
1476 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )\r
1477 #else\r
1478 YY_BUFFER_STATE yy_scan_buffer( base, size )\r
1479 char *base;\r
1480 yy_size_t size;\r
1481 #endif\r
1482         {\r
1483         YY_BUFFER_STATE b;\r
1484 \r
1485         if ( size < 2 ||\r
1486              base[size-2] != YY_END_OF_BUFFER_CHAR ||\r
1487              base[size-1] != YY_END_OF_BUFFER_CHAR )\r
1488                 /* They forgot to leave room for the EOB's. */\r
1489                 return 0;\r
1490 \r
1491         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );\r
1492         if ( ! b )\r
1493                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );\r
1494 \r
1495         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */\r
1496         b->yy_buf_pos = b->yy_ch_buf = base;\r
1497         b->yy_is_our_buffer = 0;\r
1498         b->yy_input_file = 0;\r
1499         b->yy_n_chars = b->yy_buf_size;\r
1500         b->yy_is_interactive = 0;\r
1501         b->yy_at_bol = 1;\r
1502         b->yy_fill_buffer = 0;\r
1503         b->yy_buffer_status = YY_BUFFER_NEW;\r
1504 \r
1505         yy_switch_to_buffer( b );\r
1506 \r
1507         return b;\r
1508         }\r
1509 #endif\r
1510 \r
1511 \r
1512 #ifndef YY_NO_SCAN_STRING\r
1513 #ifdef YY_USE_PROTOS\r
1514 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )\r
1515 #else\r
1516 YY_BUFFER_STATE yy_scan_string( yy_str )\r
1517 yyconst char *yy_str;\r
1518 #endif\r
1519         {\r
1520         int len;\r
1521         for ( len = 0; yy_str[len]; ++len )\r
1522                 ;\r
1523 \r
1524         return yy_scan_bytes( yy_str, len );\r
1525         }\r
1526 #endif\r
1527 \r
1528 \r
1529 #ifndef YY_NO_SCAN_BYTES\r
1530 #ifdef YY_USE_PROTOS\r
1531 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )\r
1532 #else\r
1533 YY_BUFFER_STATE yy_scan_bytes( bytes, len )\r
1534 yyconst char *bytes;\r
1535 int len;\r
1536 #endif\r
1537         {\r
1538         YY_BUFFER_STATE b;\r
1539         char *buf;\r
1540         yy_size_t n;\r
1541         int i;\r
1542 \r
1543         /* Get memory for full buffer, including space for trailing EOB's. */\r
1544         n = len + 2;\r
1545         buf = (char *) yy_flex_alloc( n );\r
1546         if ( ! buf )\r
1547                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );\r
1548 \r
1549         for ( i = 0; i < len; ++i )\r
1550                 buf[i] = bytes[i];\r
1551 \r
1552         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;\r
1553 \r
1554         b = yy_scan_buffer( buf, n );\r
1555         if ( ! b )\r
1556                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );\r
1557 \r
1558         /* It's okay to grow etc. this buffer, and we should throw it\r
1559          * away when we're done.\r
1560          */\r
1561         b->yy_is_our_buffer = 1;\r
1562 \r
1563         return b;\r
1564         }\r
1565 #endif\r
1566 \r
1567 \r
1568 #ifndef YY_NO_PUSH_STATE\r
1569 #ifdef YY_USE_PROTOS\r
1570 static void yy_push_state( int new_state )\r
1571 #else\r
1572 static void yy_push_state( new_state )\r
1573 int new_state;\r
1574 #endif\r
1575         {\r
1576         if ( yy_start_stack_ptr >= yy_start_stack_depth )\r
1577                 {\r
1578                 yy_size_t new_size;\r
1579 \r
1580                 yy_start_stack_depth += YY_START_STACK_INCR;\r
1581                 new_size = yy_start_stack_depth * sizeof( int );\r
1582 \r
1583                 if ( ! yy_start_stack )\r
1584                         yy_start_stack = (int *) yy_flex_alloc( new_size );\r
1585 \r
1586                 else\r
1587                         yy_start_stack = (int *) yy_flex_realloc(\r
1588                                         (void *) yy_start_stack, new_size );\r
1589 \r
1590                 if ( ! yy_start_stack )\r
1591                         YY_FATAL_ERROR(\r
1592                         "out of memory expanding start-condition stack" );\r
1593                 }\r
1594 \r
1595         yy_start_stack[yy_start_stack_ptr++] = YY_START;\r
1596 \r
1597         BEGIN(new_state);\r
1598         }\r
1599 #endif\r
1600 \r
1601 \r
1602 #ifndef YY_NO_POP_STATE\r
1603 static void yy_pop_state()\r
1604         {\r
1605         if ( --yy_start_stack_ptr < 0 )\r
1606                 YY_FATAL_ERROR( "start-condition stack underflow" );\r
1607 \r
1608         BEGIN(yy_start_stack[yy_start_stack_ptr]);\r
1609         }\r
1610 #endif\r
1611 \r
1612 \r
1613 #ifndef YY_NO_TOP_STATE\r
1614 static int yy_top_state()\r
1615         {\r
1616         return yy_start_stack[yy_start_stack_ptr - 1];\r
1617         }\r
1618 #endif\r
1619 \r
1620 #ifndef YY_EXIT_FAILURE\r
1621 #define YY_EXIT_FAILURE 2\r
1622 #endif\r
1623 \r
1624 #ifdef YY_USE_PROTOS\r
1625 static void yy_fatal_error( yyconst char msg[] )\r
1626 #else\r
1627 static void yy_fatal_error( msg )\r
1628 char msg[];\r
1629 #endif\r
1630         {\r
1631         (void) fprintf( stderr, "%s\n", msg );\r
1632         exit( YY_EXIT_FAILURE );\r
1633         }\r
1634 \r
1635 \r
1636 \r
1637 /* Redefine yyless() so it works in section 3 code. */\r
1638 \r
1639 #undef yyless\r
1640 #define yyless(n) \\r
1641         do \\r
1642                 { \\r
1643                 /* Undo effects of setting up yytext. */ \\r
1644                 yytext[yyleng] = yy_hold_char; \\r
1645                 yy_c_buf_p = yytext + n; \\r
1646                 yy_hold_char = *yy_c_buf_p; \\r
1647                 *yy_c_buf_p = '\0'; \\r
1648                 yyleng = n; \\r
1649                 } \\r
1650         while ( 0 )\r
1651 \r
1652 \r
1653 /* Internal utility routines. */\r
1654 \r
1655 #ifndef yytext_ptr\r
1656 #ifdef YY_USE_PROTOS\r
1657 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )\r
1658 #else\r
1659 static void yy_flex_strncpy( s1, s2, n )\r
1660 char *s1;\r
1661 yyconst char *s2;\r
1662 int n;\r
1663 #endif\r
1664         {\r
1665         register int i;\r
1666         for ( i = 0; i < n; ++i )\r
1667                 s1[i] = s2[i];\r
1668         }\r
1669 #endif\r
1670 \r
1671 #ifdef YY_NEED_STRLEN\r
1672 #ifdef YY_USE_PROTOS\r
1673 static int yy_flex_strlen( yyconst char *s )\r
1674 #else\r
1675 static int yy_flex_strlen( s )\r
1676 yyconst char *s;\r
1677 #endif\r
1678         {\r
1679         register int n;\r
1680         for ( n = 0; s[n]; ++n )\r
1681                 ;\r
1682 \r
1683         return n;\r
1684         }\r
1685 #endif\r
1686 \r
1687 \r
1688 #ifdef YY_USE_PROTOS\r
1689 static void *yy_flex_alloc( yy_size_t size )\r
1690 #else\r
1691 static void *yy_flex_alloc( size )\r
1692 yy_size_t size;\r
1693 #endif\r
1694         {\r
1695         return (void *) malloc( size );\r
1696         }\r
1697 \r
1698 #ifdef YY_USE_PROTOS\r
1699 static void *yy_flex_realloc( void *ptr, yy_size_t size )\r
1700 #else\r
1701 static void *yy_flex_realloc( ptr, size )\r
1702 void *ptr;\r
1703 yy_size_t size;\r
1704 #endif\r
1705         {\r
1706         /* The cast to (char *) in the following accommodates both\r
1707          * implementations that use char* generic pointers, and those\r
1708          * that use void* generic pointers.  It works with the latter\r
1709          * because both ANSI C and C++ allow castless assignment from\r
1710          * any pointer type to void*, and deal with argument conversions\r
1711          * as though doing an assignment.\r
1712          */\r
1713         return (void *) realloc( (char *) ptr, size );\r
1714         }\r
1715 \r
1716 #ifdef YY_USE_PROTOS\r
1717 static void yy_flex_free( void *ptr )\r
1718 #else\r
1719 static void yy_flex_free( ptr )\r
1720 void *ptr;\r
1721 #endif\r
1722         {\r
1723         free( ptr );\r
1724         }\r
1725 \r
1726 #if YY_MAIN\r
1727 int main()\r
1728         {\r
1729         yylex();\r
1730         return 0;\r
1731         }\r
1732 #endif\r
1733 #line 155 "xml.l"\r
1734 \r
1735 \r
1736 int my_xmlParser_yyinput(char *buf, int max_size){\r
1737         int c = 0;\r
1738         int inchar = 0;\r
1739         \r
1740         if(flex_xml_stringinput != NULL){\r
1741                 while(c<max_size){\r
1742                         if(flex_xml_stringinput[flex_xml_stringinput_ptr] != '\0'){\r
1743                                 buf[c++] = flex_xml_stringinput[flex_xml_stringinput_ptr++];\r
1744                         }else{\r
1745                                 break;\r
1746                         }\r
1747                 }\r
1748                 return(c);\r
1749         }\r
1750         \r
1751         if(flex_xml_fileinput != NULL){\r
1752                 while(c < max_size){\r
1753                         inchar = getc(flex_xml_fileinput);\r
1754                         if(inchar != EOF){\r
1755                                 buf[c++] = inchar;\r
1756                         }else{\r
1757                                 break;\r
1758                         }\r
1759                 }\r
1760                 return(c);\r
1761         }\r
1762         \r
1763         return(0);\r
1764 }\r
1765 \r
1766 void xmlParser_setfileinput(FILE *f){\r
1767         xmlParserrestart(NULL);\r
1768 \r
1769         flex_xml_fileinput = f;\r
1770         flex_xml_stringinput = NULL;\r
1771         flex_xml_lineno = 1;\r
1772         flex_xml_ch = 0;\r
1773 }\r
1774 \r
1775 void xmlParser_setstringinput(char *s){\r
1776         xmlParserrestart(NULL);\r
1777 \r
1778         flex_xml_fileinput = NULL;\r
1779         flex_xml_stringinput = s;\r
1780         flex_xml_stringinput_ptr = 0;\r
1781         flex_xml_lineno = 1;\r
1782         flex_xml_ch = 0;\r
1783 }\r
1784         \r
1785                 \r
1786 \r
1787 \r
1788 \r