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