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