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