]> Creatis software - clitk.git/blob - utilities/gengetopt/scanner.cc
Debug RTStruct conversion with empty struc
[clitk.git] / utilities / gengetopt / scanner.cc
1 #line 2 "../../src/scanner.cc"
2
3 #line 4 "../../src/scanner.cc"
4
5 #define  YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define FLEX_SCANNER
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
16
17 /* First, we deal with  platform-specific or compiler-specific issues. */
18
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
24
25 /* end standard C headers. */
26
27 /* flex integer type definitions */
28
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
31
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37  * if you want the limit (max/min) macros for int types. 
38  */
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
41 #endif
42
43 #include <inttypes.h>
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
50 #else
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t; 
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
57
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN               (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN              (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN              (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX               (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX              (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX              (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX              (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX             (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX             (4294967295U)
85 #endif
86
87 #endif /* ! C99 */
88
89 #endif /* ! FLEXINT_H */
90
91 #ifdef __cplusplus
92
93 /* The "const" storage-class-modifier is valid. */
94 #define YY_USE_CONST
95
96 #else   /* ! __cplusplus */
97
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
100
101 #define YY_USE_CONST
102
103 #endif  /* defined (__STDC__) */
104 #endif  /* ! __cplusplus */
105
106 #ifdef YY_USE_CONST
107 #define yyconst const
108 #else
109 #define yyconst
110 #endif
111
112 /* Returned upon end-of-file. */
113 #define YY_NULL 0
114
115 /* Promotes a possibly negative, possibly signed char to an unsigned
116  * integer for use as an array index.  If the signed char is negative,
117  * we want to instead treat it as an 8-bit unsigned char, hence the
118  * double cast.
119  */
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121
122 /* Enter a start condition.  This macro really ought to take a parameter,
123  * but we do it the disgusting crufty way forced on us by the ()-less
124  * definition of BEGIN.
125  */
126 #define BEGIN (yy_start) = 1 + 2 *
127
128 /* Translate the current start state into a value that can be later handed
129  * to BEGIN to return to the state.  The YYSTATE alias is for lex
130  * compatibility.
131  */
132 #define YY_START (((yy_start) - 1) / 2)
133 #define YYSTATE YY_START
134
135 /* Action number for EOF rule of a given start state. */
136 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137
138 /* Special action meaning "start processing a new file". */
139 #define YY_NEW_FILE yyrestart(yyin  )
140
141 #define YY_END_OF_BUFFER_CHAR 0
142
143 /* Size of default input buffer. */
144 #ifndef YY_BUF_SIZE
145 #ifdef __ia64__
146 /* On IA-64, the buffer size is 16k, not 8k.
147  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
148  * Ditto for the __ia64__ case accordingly.
149  */
150 #define YY_BUF_SIZE 32768
151 #else
152 #define YY_BUF_SIZE 16384
153 #endif /* __ia64__ */
154 #endif
155
156 /* The state buf must be large enough to hold one state per character in the main buffer.
157  */
158 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
159
160 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
161 #define YY_TYPEDEF_YY_BUFFER_STATE
162 typedef struct yy_buffer_state *YY_BUFFER_STATE;
163 #endif
164
165 extern int yyleng;
166
167 extern FILE *yyin, *yyout;
168
169 #define EOB_ACT_CONTINUE_SCAN 0
170 #define EOB_ACT_END_OF_FILE 1
171 #define EOB_ACT_LAST_MATCH 2
172
173     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
174      *       access to the local variable yy_act. Since yyless() is a macro, it would break
175      *       existing scanners that call yyless() from OUTSIDE yylex. 
176      *       One obvious solution it to make yy_act a global. I tried that, and saw
177      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
178      *       normally declared as a register variable-- so it is not worth it.
179      */
180     #define  YY_LESS_LINENO(n) \
181             do { \
182                 int yyl;\
183                 for ( yyl = n; yyl < yyleng; ++yyl )\
184                     if ( yytext[yyl] == '\n' )\
185                         --yylineno;\
186             }while(0)
187     
188 /* Return all but the first "n" matched characters back to the input stream. */
189 #define yyless(n) \
190         do \
191                 { \
192                 /* Undo effects of setting up yytext. */ \
193         int yyless_macro_arg = (n); \
194         YY_LESS_LINENO(yyless_macro_arg);\
195                 *yy_cp = (yy_hold_char); \
196                 YY_RESTORE_YY_MORE_OFFSET \
197                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
199                 } \
200         while ( 0 )
201
202 #define unput(c) yyunput( c, (yytext_ptr)  )
203
204 #ifndef YY_TYPEDEF_YY_SIZE_T
205 #define YY_TYPEDEF_YY_SIZE_T
206 typedef size_t yy_size_t;
207 #endif
208
209 #ifndef YY_STRUCT_YY_BUFFER_STATE
210 #define YY_STRUCT_YY_BUFFER_STATE
211 struct yy_buffer_state
212         {
213         FILE *yy_input_file;
214
215         char *yy_ch_buf;                /* input buffer */
216         char *yy_buf_pos;               /* current position in input buffer */
217
218         /* Size of input buffer in bytes, not including room for EOB
219          * characters.
220          */
221         yy_size_t yy_buf_size;
222
223         /* Number of characters read into yy_ch_buf, not including EOB
224          * characters.
225          */
226         int yy_n_chars;
227
228         /* Whether we "own" the buffer - i.e., we know we created it,
229          * and can realloc() it to grow it, and should free() it to
230          * delete it.
231          */
232         int yy_is_our_buffer;
233
234         /* Whether this is an "interactive" input source; if so, and
235          * if we're using stdio for input, then we want to use getc()
236          * instead of fread(), to make sure we stop fetching input after
237          * each newline.
238          */
239         int yy_is_interactive;
240
241         /* Whether we're considered to be at the beginning of a line.
242          * If so, '^' rules will be active on the next match, otherwise
243          * not.
244          */
245         int yy_at_bol;
246
247     int yy_bs_lineno; /**< The line count. */
248     int yy_bs_column; /**< The column count. */
249     
250         /* Whether to try to fill the input buffer when we reach the
251          * end of it.
252          */
253         int yy_fill_buffer;
254
255         int yy_buffer_status;
256
257 #define YY_BUFFER_NEW 0
258 #define YY_BUFFER_NORMAL 1
259         /* When an EOF's been seen but there's still some text to process
260          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261          * shouldn't try reading from the input source any more.  We might
262          * still have a bunch of tokens to match, though, because of
263          * possible backing-up.
264          *
265          * When we actually see the EOF, we change the status to "new"
266          * (via yyrestart()), so that the user can continue scanning by
267          * just pointing yyin at a new input file.
268          */
269 #define YY_BUFFER_EOF_PENDING 2
270
271         };
272 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
273
274 /* Stack of input buffers. */
275 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
276 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
277 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
278
279 /* We provide macros for accessing buffer states in case in the
280  * future we want to put the buffer states in a more general
281  * "scanner state".
282  *
283  * Returns the top of the stack, or NULL.
284  */
285 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
286                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
287                           : NULL)
288
289 /* Same as previous macro, but useful when we know that the buffer stack is not
290  * NULL or when we need an lvalue. For internal use only.
291  */
292 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
293
294 /* yy_hold_char holds the character lost when yytext is formed. */
295 static char yy_hold_char;
296 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
297 int yyleng;
298
299 /* Points to current character in buffer. */
300 static char *yy_c_buf_p = (char *) 0;
301 static int yy_init = 0;         /* whether we need to initialize */
302 static int yy_start = 0;        /* start state number */
303
304 /* Flag which is used to allow yywrap()'s to do buffer switches
305  * instead of setting up a fresh yyin.  A bit of a hack ...
306  */
307 static int yy_did_buffer_switch_on_eof;
308
309 void yyrestart (FILE *input_file  );
310 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
311 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
312 void yy_delete_buffer (YY_BUFFER_STATE b  );
313 void yy_flush_buffer (YY_BUFFER_STATE b  );
314 void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
315 void yypop_buffer_state (void );
316
317 static void yyensure_buffer_stack (void );
318 static void yy_load_buffer_state (void );
319 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
320
321 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
322
323 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
324 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
325 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
326
327 void *yyalloc (yy_size_t  );
328 void *yyrealloc (void *,yy_size_t  );
329 void yyfree (void *  );
330
331 #define yy_new_buffer yy_create_buffer
332
333 #define yy_set_interactive(is_interactive) \
334         { \
335         if ( ! YY_CURRENT_BUFFER ){ \
336         yyensure_buffer_stack (); \
337                 YY_CURRENT_BUFFER_LVALUE =    \
338             yy_create_buffer(yyin,YY_BUF_SIZE ); \
339         } \
340         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
341         }
342
343 #define yy_set_bol(at_bol) \
344         { \
345         if ( ! YY_CURRENT_BUFFER ){\
346         yyensure_buffer_stack (); \
347                 YY_CURRENT_BUFFER_LVALUE =    \
348             yy_create_buffer(yyin,YY_BUF_SIZE ); \
349         } \
350         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
351         }
352
353 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
354
355 /* Begin user sect3 */
356
357 #define yywrap(n) 1
358 #define YY_SKIP_YYWRAP
359
360 typedef unsigned char YY_CHAR;
361
362 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
363
364 typedef int yy_state_type;
365
366 extern int yylineno;
367
368 int yylineno = 1;
369
370 extern char *yytext;
371 #define yytext_ptr yytext
372
373 static yy_state_type yy_get_previous_state (void );
374 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
375 static int yy_get_next_buffer (void );
376 static void yy_fatal_error (yyconst char msg[]  );
377
378 /* Done after the current pattern has been matched and before the
379  * corresponding action - sets up yytext.
380  */
381 #define YY_DO_BEFORE_ACTION \
382         (yytext_ptr) = yy_bp; \
383         yyleng = (size_t) (yy_cp - yy_bp); \
384         (yy_hold_char) = *yy_cp; \
385         *yy_cp = '\0'; \
386         (yy_c_buf_p) = yy_cp;
387
388 #define YY_NUM_RULES 62
389 #define YY_END_OF_BUFFER 63
390 /* This struct is not used in this scanner,
391    but its presence is necessary. */
392 struct yy_trans_info
393         {
394         flex_int32_t yy_verify;
395         flex_int32_t yy_nxt;
396         };
397 static yyconst flex_int16_t yy_accept[246] =
398     {   0,
399         0,    0,    0,    0,    0,    0,   63,   61,   57,   59,
400        60,   56,   48,   58,   43,   42,   47,   41,   47,   47,
401        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
402        47,   47,   47,   47,   47,   47,   62,   46,   44,   45,
403        55,   51,   55,   54,   55,   57,   59,   56,   58,    0,
404         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
405        15,    0,   18,    0,    0,    0,    0,    0,    0,    0,
406         0,    0,    0,    0,    0,    0,   45,   51,   52,    0,
407        53,    0,   50,    0,    0,    0,    0,    0,    0,    0,
408         0,    0,    0,    0,    2,    0,    0,    0,   19,    0,
409
410         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
411         0,   14,   49,    0,   40,    0,    0,    0,    0,    0,
412         0,    0,    9,   17,    0,    0,    0,    4,   28,    0,
413         0,    0,    0,    0,    0,    0,    0,   39,    0,    0,
414         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
415         5,   25,    0,    0,    0,    0,    0,    0,    0,    0,
416         0,    0,    0,    3,    0,    0,   22,    0,    0,    0,
417         0,    0,    0,    0,    0,    0,    6,    0,    0,   36,
418         0,    0,    0,    0,    0,   16,    0,    0,    0,    0,
419         1,    0,   35,    0,    0,   23,    0,   30,    0,    0,
420
421        38,    0,    0,    0,    0,    0,    0,    0,    0,   10,
422        20,    0,   34,   24,   11,    0,   27,   37,    0,    0,
423         0,    0,    8,   29,    0,   31,    0,    0,    0,   26,
424         0,    0,    0,    0,    0,    0,    0,    7,   13,    0,
425        32,   21,   12,   33,    0
426     } ;
427
428 static yyconst flex_int32_t yy_ec[256] =
429     {   0,
430         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
431         1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
432         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
433         1,    5,    1,    6,    7,    1,    1,    1,    1,    8,
434         9,    1,    1,   10,   11,    1,    1,   12,   12,   12,
435        12,   12,   12,   12,   12,   12,   12,    1,    1,    1,
436        13,    1,   14,    1,   15,   15,   15,   15,   15,   15,
437        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
438        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
439         1,   16,    1,    1,    1,    1,   17,   18,   19,   20,
440
441        21,   22,   23,   24,   25,   15,   26,   27,   28,   29,
442        30,   31,   32,   33,   34,   35,   36,   37,   15,   38,
443        39,   15,    1,    1,    1,    1,    1,    1,    1,    1,
444         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
445         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
446         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
447         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
448         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
449         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
450         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
451
452         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
453         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
454         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
455         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
456         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
457         1,    1,    1,    1,    1
458     } ;
459
460 static yyconst flex_int32_t yy_meta[40] =
461     {   0,
462         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
463         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
464         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
465         1,    1,    1,    1,    1,    1,    1,    1,    1
466     } ;
467
468 static yyconst flex_int16_t yy_base[250] =
469     {   0,
470         0,    0,   37,   47,   39,   57,  271,  272,  268,    0,
471       272,  264,  272,    0,  272,  272,  272,  272,  235,   32,
472       238,  239,  232,  239,  234,  232,   34,  231,   43,   30,
473       239,   47,   36,  225,   59,  237,  272,  272,  272,  245,
474       272,  253,  272,  272,   78,  253,    0,  249,    0,  230,
475        55,  216,  215,   61,  220,  229,  213,  218,  226,  218,
476       272,  222,  272,  208,  223,  208,  208,  220,  208,  204,
477       198,  204,  217,  206,  199,  197,  218,  226,  272,   64,
478       272,  199,  272,   58,   70,  206,  207,  208,  206,  195,
479       199,  204,  184,  199,  272,  195,  196,  181,  272,  190,
480
481       188,  182,  176,  176,  177,  184,  173,  186,  183,  169,
482       170,  272,  272,  172,  272,  166,  168,  170,  170,  165,
483       172,  169,  272,  272,  160,  163,  172,   75,   76,  167,
484       161,  173,  159,  163,  162,  151,  156,  272,  150,  162,
485       161,  156,  145,  152,  148,  157,  156,  150,  147,  152,
486       272,   79,  143,  141,  140,  148,  137,  136,  137,  142,
487       130,  130,  132,  272,  138,  125,  272,  125,  128,  132,
488       121,  119,  133,  123,  121,  117,  272,  129,  118,  272,
489       112,  118,  112,  110,  117,  126,  121,  120,  119,  110,
490       272,  105,  272,  108,  106,  272,  104,  272,  105,   98,
491
492       272,   98,   96,  112,  106,  109,  102,  105,   98,  272,
493       272,  104,  103,  272,  272,   93,  272,  272,   96,  101,
494        94,   91,  272,  272,   87,  272,   95,   98,   84,  272,
495        78,   84,   75,   69,   74,   71,   68,  272,  272,   66,
496       272,  272,  272,  272,  272,  109,  111,   78,   51
497     } ;
498
499 static yyconst flex_int16_t yy_def[250] =
500     {   0,
501       245,    1,  246,  246,  247,  247,  245,  245,  245,  248,
502       245,  245,  245,  249,  245,  245,  245,  245,  245,  245,
503       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
504       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
505       245,  245,  245,  245,  245,  245,  248,  245,  249,  245,
506       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
507       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
508       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
509       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
510       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
511
512       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
513       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
514       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
515       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
516       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
517       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
518       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
519       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
520       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
521       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
522
523       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
524       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
525       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
526       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
527       245,  245,  245,  245,    0,  245,  245,  245,  245
528     } ;
529
530 static yyconst flex_int16_t yy_nxt[312] =
531     {   0,
532         8,    9,   10,   11,   12,   13,   14,   15,    8,   16,
533        17,   17,   18,   17,   17,    8,   19,   17,   17,   20,
534        21,   22,   23,   24,   25,   17,   26,   27,   28,   29,
535        30,   17,   31,   32,   33,   34,   35,   17,   36,   37,
536        11,   42,   43,   14,   44,   38,   65,   39,   40,   37,
537        11,   49,   51,   14,   45,   38,   71,   39,   40,   42,
538        43,   52,   44,   59,   62,   66,   79,   68,   80,   60,
539        69,   63,   45,   64,   72,   74,   85,   91,   47,   75,
540        79,   70,   80,   81,  244,   86,  116,  114,   87,   88,
541        92,  115,  117,   82,  154,  156,  243,  118,  178,  242,
542
543       241,  155,  240,  239,  238,  157,   83,  237,  179,    8,
544         8,   41,   41,  236,  235,  234,  233,  232,  231,  230,
545       229,  228,  227,  112,   61,  226,  225,  224,  223,  222,
546       221,  220,  219,  218,  217,  216,  215,  214,  213,  212,
547       211,  210,  209,  208,  207,  206,  205,  204,  203,  202,
548       201,  200,  199,  198,  197,  196,  195,  194,  193,  192,
549       191,  190,  189,  188,  187,  186,  185,  184,  183,  182,
550       181,  180,  177,  176,  175,  174,  173,  172,  171,  170,
551       169,  168,  167,  166,  165,  164,  163,  162,  161,  160,
552       159,  158,  153,  152,  151,  150,  149,  148,  147,  146,
553
554       145,  144,  143,  142,  141,  140,  139,  138,  137,  136,
555       135,  134,  133,  132,  131,  130,  129,  128,  127,  126,
556       125,  124,  123,  122,  121,  120,  119,  113,   78,   77,
557       112,  111,  110,  109,  108,  107,  106,  105,  104,  103,
558       102,  101,  100,   99,   98,   97,   96,   95,   94,   93,
559        90,   89,   84,   48,   46,   78,   77,   76,   73,   67,
560        61,   58,   57,   56,   55,   54,   53,   50,   48,   46,
561       245,    7,  245,  245,  245,  245,  245,  245,  245,  245,
562       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
563       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
564
565       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
566       245
567     } ;
568
569 static yyconst flex_int16_t yy_chk[312] =
570     {   0,
571         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
572         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
573         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
574         1,    1,    1,    1,    1,    1,    1,    1,    1,    3,
575         3,    5,    5,    3,    5,    3,   30,    3,    3,    4,
576         4,  249,   20,    4,    5,    4,   33,    4,    4,    6,
577         6,   20,    6,   27,   29,   30,   80,   32,   80,   27,
578        32,   29,    6,   29,   33,   35,   51,   54,  248,   35,
579        45,   32,   45,   45,  240,   51,   85,   84,   51,   51,
580        54,   84,   85,   45,  128,  129,  237,   85,  152,  236,
581
582       235,  128,  234,  233,  232,  129,   45,  231,  152,  246,
583       246,  247,  247,  229,  228,  227,  225,  222,  221,  220,
584       219,  216,  213,  212,  209,  208,  207,  206,  205,  204,
585       203,  202,  200,  199,  197,  195,  194,  192,  190,  189,
586       188,  187,  186,  185,  184,  183,  182,  181,  179,  178,
587       176,  175,  174,  173,  172,  171,  170,  169,  168,  166,
588       165,  163,  162,  161,  160,  159,  158,  157,  156,  155,
589       154,  153,  150,  149,  148,  147,  146,  145,  144,  143,
590       142,  141,  140,  139,  137,  136,  135,  134,  133,  132,
591       131,  130,  127,  126,  125,  122,  121,  120,  119,  118,
592
593       117,  116,  114,  111,  110,  109,  108,  107,  106,  105,
594       104,  103,  102,  101,  100,   98,   97,   96,   94,   93,
595        92,   91,   90,   89,   88,   87,   86,   82,   78,   77,
596        76,   75,   74,   73,   72,   71,   70,   69,   68,   67,
597        66,   65,   64,   62,   60,   59,   58,   57,   56,   55,
598        53,   52,   50,   48,   46,   42,   40,   36,   34,   31,
599        28,   26,   25,   24,   23,   22,   21,   19,   12,    9,
600         7,  245,  245,  245,  245,  245,  245,  245,  245,  245,
601       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
602       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
603
604       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
605       245
606     } ;
607
608 /* Table of booleans, true if rule could match eol. */
609 static yyconst flex_int32_t yy_rule_can_match_eol[63] =
610     {   0,
611 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
612     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
613     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 
614     0, 0, 0,     };
615
616 static yy_state_type yy_last_accepting_state;
617 static char *yy_last_accepting_cpos;
618
619 extern int yy_flex_debug;
620 int yy_flex_debug = 0;
621
622 /* The intent behind this definition is that it'll catch
623  * any uses of REJECT which flex missed.
624  */
625 #define REJECT reject_used_but_not_detected
626 #define yymore() yymore_used_but_not_detected
627 #define YY_MORE_ADJ 0
628 #define YY_RESTORE_YY_MORE_OFFSET
629 char *yytext;
630 #line 1 "../../src/scanner.ll"
631 /**
632  * Copyright (C) 1999-2007  Free Software Foundation, Inc.
633  *
634  * This file is part of GNU gengetopt
635  *
636  * GNU gengetopt is free software; you can redistribute it and/or modify
637  * it under the terms of the GNU General Public License as published by
638  * the Free Software Foundation; either version 3, or (at your option)
639  * any later version.
640  *
641  * GNU gengetopt is distributed in the hope that it will be useful, but
642  * WITHOUT ANY WARRANTY; without even the implied warranty of
643  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
644  * Public License for more details.
645  *
646  * You should have received a copy of the GNU General Public License along
647  * with gengetopt; see the file COPYING. If not, write to the Free Software
648  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
649  */
650 #line 23 "../../src/scanner.ll"
651 #ifdef HAVE_CONFIG_H
652 #include "config.h"
653 #endif
654
655 #include <string.h>
656
657 #include "argsdef.h"
658 #include "parser.h"
659 extern int gengetopt_count_line;
660
661 #include "my_sstream.h"
662
663 static void update_count_line (char *str);
664 static void updateTokenInfo (int pos);
665
666 // the buffer for strings (possibly spanning more lines)
667 static std::ostringstream buff;
668
669 static void buffer(const char *s);
670 static char *flush_buffer();
671
672 #define LINEBUF_LEN 1024
673
674 #define PUSH(s) yy_push_state(s);
675 #define POP() yy_pop_state();
676
677 int tokenpos = 0;
678 char linebuf[LINEBUF_LEN] ; /* current line */
679
680 //#define DEBUG_SCANNER
681 #ifdef DEBUG_SCANNER
682 #include <iostream> // for debug
683 #define DEB(s) std::cerr << s << std::endl;
684 #define DEB2(s,s2) std::cerr << s << ": " << s2 << std::endl;
685 #else
686 #define DEB(s)
687 #define DEB2(s,s2)
688 #endif
689
690
691 #line 692 "../../src/scanner.cc"
692
693 #define INITIAL 0
694 #define SIZE_STATE 1
695 #define STRING_STATE 2
696
697 #ifndef YY_NO_UNISTD_H
698 /* Special case for "unistd.h", since it is non-ANSI. We include it way
699  * down here because we want the user's section 1 to have been scanned first.
700  * The user has a chance to override it with an option.
701  */
702 #include <unistd.h>
703 #endif
704
705 #ifndef YY_EXTRA_TYPE
706 #define YY_EXTRA_TYPE void *
707 #endif
708
709 static int yy_init_globals (void );
710
711 /* Accessor methods to globals.
712    These are made visible to non-reentrant scanners for convenience. */
713
714 int yylex_destroy (void );
715
716 int yyget_debug (void );
717
718 void yyset_debug (int debug_flag  );
719
720 YY_EXTRA_TYPE yyget_extra (void );
721
722 void yyset_extra (YY_EXTRA_TYPE user_defined  );
723
724 FILE *yyget_in (void );
725
726 void yyset_in  (FILE * in_str  );
727
728 FILE *yyget_out (void );
729
730 void yyset_out  (FILE * out_str  );
731
732 int yyget_leng (void );
733
734 char *yyget_text (void );
735
736 int yyget_lineno (void );
737
738 void yyset_lineno (int line_number  );
739
740 /* Macros after this point can all be overridden by user definitions in
741  * section 1.
742  */
743
744 #ifndef YY_SKIP_YYWRAP
745 #ifdef __cplusplus
746 extern "C" int yywrap (void );
747 #else
748 extern int yywrap (void );
749 #endif
750 #endif
751
752 #ifndef yytext_ptr
753 static void yy_flex_strncpy (char *,yyconst char *,int );
754 #endif
755
756 #ifdef YY_NEED_STRLEN
757 static int yy_flex_strlen (yyconst char * );
758 #endif
759
760 #ifndef YY_NO_INPUT
761
762 #ifdef __cplusplus
763 static int yyinput (void );
764 #else
765 static int input (void );
766 #endif
767
768 #endif
769
770         static int yy_start_stack_ptr = 0;
771         static int yy_start_stack_depth = 0;
772         static int *yy_start_stack = NULL;
773     
774     static void yy_push_state (int new_state );
775     
776     static void yy_pop_state (void );
777     
778     static int yy_top_state (void );
779     
780 /* Amount of stuff to slurp up with each read. */
781 #ifndef YY_READ_BUF_SIZE
782 #ifdef __ia64__
783 /* On IA-64, the buffer size is 16k, not 8k */
784 #define YY_READ_BUF_SIZE 16384
785 #else
786 #define YY_READ_BUF_SIZE 8192
787 #endif /* __ia64__ */
788 #endif
789
790 /* Copy whatever the last rule matched to the standard output. */
791 #ifndef ECHO
792 /* This used to be an fputs(), but since the string might contain NUL's,
793  * we now use fwrite().
794  */
795 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
796 #endif
797
798 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
799  * is returned in "result".
800  */
801 #ifndef YY_INPUT
802 #define YY_INPUT(buf,result,max_size) \
803         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
804                 { \
805                 int c = '*'; \
806                 size_t n; \
807                 for ( n = 0; n < max_size && \
808                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
809                         buf[n] = (char) c; \
810                 if ( c == '\n' ) \
811                         buf[n++] = (char) c; \
812                 if ( c == EOF && ferror( yyin ) ) \
813                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
814                 result = n; \
815                 } \
816         else \
817                 { \
818                 errno=0; \
819                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
820                         { \
821                         if( errno != EINTR) \
822                                 { \
823                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
824                                 break; \
825                                 } \
826                         errno=0; \
827                         clearerr(yyin); \
828                         } \
829                 }\
830 \
831
832 #endif
833
834 /* No semi-colon after return; correct usage is to write "yyterminate();" -
835  * we don't want an extra ';' after the "return" because that will cause
836  * some compilers to complain about unreachable statements.
837  */
838 #ifndef yyterminate
839 #define yyterminate() return YY_NULL
840 #endif
841
842 /* Number of entries by which start-condition stack grows. */
843 #ifndef YY_START_STACK_INCR
844 #define YY_START_STACK_INCR 25
845 #endif
846
847 /* Report a fatal error. */
848 #ifndef YY_FATAL_ERROR
849 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
850 #endif
851
852 /* end tables serialization structures and prototypes */
853
854 /* Default declaration of generated scanner - a define so the user can
855  * easily add parameters.
856  */
857 #ifndef YY_DECL
858 #define YY_DECL_IS_OURS 1
859
860 extern int yylex (void);
861
862 #define YY_DECL int yylex (void)
863 #endif /* !YY_DECL */
864
865 /* Code executed at the beginning of each rule, after yytext and yyleng
866  * have been set up.
867  */
868 #ifndef YY_USER_ACTION
869 #define YY_USER_ACTION
870 #endif
871
872 /* Code executed at the end of each rule. */
873 #ifndef YY_BREAK
874 #define YY_BREAK break;
875 #endif
876
877 #define YY_RULE_SETUP \
878         YY_USER_ACTION
879
880 /** The main scanner function which does all the work.
881  */
882 YY_DECL
883 {
884         register yy_state_type yy_current_state;
885         register char *yy_cp, *yy_bp;
886         register int yy_act;
887     
888 #line 71 "../../src/scanner.ll"
889
890
891
892 #line 893 "../../src/scanner.cc"
893
894         if ( !(yy_init) )
895                 {
896                 (yy_init) = 1;
897
898 #ifdef YY_USER_INIT
899                 YY_USER_INIT;
900 #endif
901
902                 if ( ! (yy_start) )
903                         (yy_start) = 1; /* first start state */
904
905                 if ( ! yyin )
906                         yyin = stdin;
907
908                 if ( ! yyout )
909                         yyout = stdout;
910
911                 if ( ! YY_CURRENT_BUFFER ) {
912                         yyensure_buffer_stack ();
913                         YY_CURRENT_BUFFER_LVALUE =
914                                 yy_create_buffer(yyin,YY_BUF_SIZE );
915                 }
916
917                 yy_load_buffer_state( );
918                 }
919
920         while ( 1 )             /* loops until end-of-file is reached */
921                 {
922                 yy_cp = (yy_c_buf_p);
923
924                 /* Support of yytext. */
925                 *yy_cp = (yy_hold_char);
926
927                 /* yy_bp points to the position in yy_ch_buf of the start of
928                  * the current run.
929                  */
930                 yy_bp = yy_cp;
931
932                 yy_current_state = (yy_start);
933 yy_match:
934                 do
935                         {
936                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
937                         if ( yy_accept[yy_current_state] )
938                                 {
939                                 (yy_last_accepting_state) = yy_current_state;
940                                 (yy_last_accepting_cpos) = yy_cp;
941                                 }
942                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
943                                 {
944                                 yy_current_state = (int) yy_def[yy_current_state];
945                                 if ( yy_current_state >= 246 )
946                                         yy_c = yy_meta[(unsigned int) yy_c];
947                                 }
948                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
949                         ++yy_cp;
950                         }
951                 while ( yy_base[yy_current_state] != 272 );
952
953 yy_find_action:
954                 yy_act = yy_accept[yy_current_state];
955                 if ( yy_act == 0 )
956                         { /* have to back up */
957                         yy_cp = (yy_last_accepting_cpos);
958                         yy_current_state = (yy_last_accepting_state);
959                         yy_act = yy_accept[yy_current_state];
960                         }
961
962                 YY_DO_BEFORE_ACTION;
963
964                 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
965                         {
966                         int yyl;
967                         for ( yyl = 0; yyl < yyleng; ++yyl )
968                                 if ( yytext[yyl] == '\n' )
969                                            
970     yylineno++;
971 ;
972                         }
973
974 do_action:      /* This label is used only to access EOF actions. */
975
976                 switch ( yy_act )
977         { /* beginning of action switch */
978                         case 0: /* must back up */
979                         /* undo the effects of YY_DO_BEFORE_ACTION */
980                         *yy_cp = (yy_hold_char);
981                         yy_cp = (yy_last_accepting_cpos);
982                         yy_current_state = (yy_last_accepting_state);
983                         goto yy_find_action;
984
985 case 1:
986 YY_RULE_SETUP
987 #line 74 "../../src/scanner.ll"
988 updateTokenInfo (-1); yylval.argtype = ARG_STRING; return TOK_ARGTYPE;
989         YY_BREAK
990 case 2:
991 YY_RULE_SETUP
992 #line 75 "../../src/scanner.ll"
993 updateTokenInfo (-1); yylval.argtype = ARG_INT; return TOK_ARGTYPE;
994         YY_BREAK
995 case 3:
996 YY_RULE_SETUP
997 #line 76 "../../src/scanner.ll"
998 updateTokenInfo (-1); yylval.argtype = ARG_SHORT; return TOK_ARGTYPE;
999         YY_BREAK
1000 case 4:
1001 YY_RULE_SETUP
1002 #line 77 "../../src/scanner.ll"
1003 updateTokenInfo (-1); yylval.argtype = ARG_LONG; return TOK_ARGTYPE;
1004         YY_BREAK
1005 case 5:
1006 YY_RULE_SETUP
1007 #line 78 "../../src/scanner.ll"
1008 updateTokenInfo (-1); yylval.argtype = ARG_FLOAT; return TOK_ARGTYPE;
1009         YY_BREAK
1010 case 6:
1011 YY_RULE_SETUP
1012 #line 79 "../../src/scanner.ll"
1013 updateTokenInfo (-1); yylval.argtype = ARG_DOUBLE; return TOK_ARGTYPE;
1014         YY_BREAK
1015 case 7:
1016 YY_RULE_SETUP
1017 #line 80 "../../src/scanner.ll"
1018 updateTokenInfo (-1); yylval.argtype = ARG_LONGDOUBLE; return TOK_ARGTYPE;
1019         YY_BREAK
1020 case 8:
1021 YY_RULE_SETUP
1022 #line 81 "../../src/scanner.ll"
1023 updateTokenInfo (-1); yylval.argtype = ARG_LONGLONG; return TOK_ARGTYPE;
1024         YY_BREAK
1025 case 9:
1026 YY_RULE_SETUP
1027 #line 82 "../../src/scanner.ll"
1028 updateTokenInfo (-1); yylval.argtype = ARG_ENUM; return TOK_ARGTYPE;
1029         YY_BREAK
1030 case 10:
1031 YY_RULE_SETUP
1032 #line 84 "../../src/scanner.ll"
1033 updateTokenInfo (-1); return TOK_PACKAGE;
1034         YY_BREAK
1035 case 11:
1036 YY_RULE_SETUP
1037 #line 85 "../../src/scanner.ll"
1038 updateTokenInfo (-1); return TOK_VERSION;
1039         YY_BREAK
1040 case 12:
1041 YY_RULE_SETUP
1042 #line 86 "../../src/scanner.ll"
1043 updateTokenInfo (-1); yylloc.first_line = gengetopt_count_line; return TOK_GROUPOPTION;
1044         YY_BREAK
1045 case 13:
1046 YY_RULE_SETUP
1047 #line 87 "../../src/scanner.ll"
1048 updateTokenInfo (-1); yylloc.first_line = gengetopt_count_line; return TOK_MODEOPTION;
1049         YY_BREAK
1050 case 14:
1051 YY_RULE_SETUP
1052 #line 88 "../../src/scanner.ll"
1053 updateTokenInfo (-1); return TOK_YES;
1054         YY_BREAK
1055 case 15:
1056 YY_RULE_SETUP
1057 #line 89 "../../src/scanner.ll"
1058 updateTokenInfo (-1); return TOK_NO;
1059         YY_BREAK
1060 case 16:
1061 YY_RULE_SETUP
1062 #line 90 "../../src/scanner.ll"
1063 updateTokenInfo (-1); yylloc.first_line = gengetopt_count_line; return TOK_OPTION;
1064         YY_BREAK
1065 case 17:
1066 YY_RULE_SETUP
1067 #line 91 "../../src/scanner.ll"
1068 updateTokenInfo (-1); return TOK_FLAG;
1069         YY_BREAK
1070 case 18:
1071 YY_RULE_SETUP
1072 #line 92 "../../src/scanner.ll"
1073 updateTokenInfo (-1); return TOK_ON;
1074         YY_BREAK
1075 case 19:
1076 YY_RULE_SETUP
1077 #line 93 "../../src/scanner.ll"
1078 updateTokenInfo (-1); return TOK_OFF;
1079         YY_BREAK
1080 case 20:
1081 YY_RULE_SETUP
1082 #line 94 "../../src/scanner.ll"
1083 updateTokenInfo (-1); return TOK_PURPOSE;
1084         YY_BREAK
1085 case 21:
1086 YY_RULE_SETUP
1087 #line 95 "../../src/scanner.ll"
1088 updateTokenInfo (-1); return TOK_DESCRIPTION;
1089         YY_BREAK
1090 case 22:
1091 YY_RULE_SETUP
1092 #line 96 "../../src/scanner.ll"
1093 updateTokenInfo (-1); return TOK_USAGE;
1094         YY_BREAK
1095 case 23:
1096 YY_RULE_SETUP
1097 #line 97 "../../src/scanner.ll"
1098 updateTokenInfo (-1); return TOK_DEFAULT;
1099         YY_BREAK
1100 case 24:
1101 YY_RULE_SETUP
1102 #line 98 "../../src/scanner.ll"
1103 updateTokenInfo (-1); return TOK_TYPESTR;
1104         YY_BREAK
1105 case 25:
1106 YY_RULE_SETUP
1107 #line 99 "../../src/scanner.ll"
1108 updateTokenInfo (-1); return TOK_GROUP;
1109         YY_BREAK
1110 case 26:
1111 YY_RULE_SETUP
1112 #line 100 "../../src/scanner.ll"
1113 updateTokenInfo (-1); return TOK_GROUPDESC;
1114         YY_BREAK
1115 case 27:
1116 YY_RULE_SETUP
1117 #line 101 "../../src/scanner.ll"
1118 updateTokenInfo (-1); return TOK_DEFGROUP;
1119         YY_BREAK
1120 case 28:
1121 YY_RULE_SETUP
1122 #line 102 "../../src/scanner.ll"
1123 updateTokenInfo (-1); return TOK_MODE;
1124         YY_BREAK
1125 case 29:
1126 YY_RULE_SETUP
1127 #line 103 "../../src/scanner.ll"
1128 updateTokenInfo (-1); return TOK_MODEDESC;
1129         YY_BREAK
1130 case 30:
1131 YY_RULE_SETUP
1132 #line 104 "../../src/scanner.ll"
1133 updateTokenInfo (-1); return TOK_DEFMODE;
1134         YY_BREAK
1135 case 31:
1136 YY_RULE_SETUP
1137 #line 105 "../../src/scanner.ll"
1138 updateTokenInfo (-1); return TOK_MULTIPLE;
1139         YY_BREAK
1140 case 32:
1141 YY_RULE_SETUP
1142 #line 106 "../../src/scanner.ll"
1143 updateTokenInfo (-1); return TOK_ARGOPTIONAL;
1144         YY_BREAK
1145 case 33:
1146 YY_RULE_SETUP
1147 #line 107 "../../src/scanner.ll"
1148 updateTokenInfo (-1); return TOK_SECTIONDESC;
1149         YY_BREAK
1150 case 34:
1151 YY_RULE_SETUP
1152 #line 108 "../../src/scanner.ll"
1153 updateTokenInfo (-1); return TOK_SECTION;
1154         YY_BREAK
1155 case 35:
1156 YY_RULE_SETUP
1157 #line 109 "../../src/scanner.ll"
1158 updateTokenInfo (-1); return TOK_VALUES;
1159         YY_BREAK
1160 case 36:
1161 YY_RULE_SETUP
1162 #line 110 "../../src/scanner.ll"
1163 updateTokenInfo (-1); return TOK_HIDDEN;
1164         YY_BREAK
1165 case 37:
1166 YY_RULE_SETUP
1167 #line 111 "../../src/scanner.ll"
1168 updateTokenInfo (-1); return TOK_DEPENDON;
1169         YY_BREAK
1170 case 38:
1171 YY_RULE_SETUP
1172 #line 112 "../../src/scanner.ll"
1173 updateTokenInfo (-1); return TOK_DETAILS;
1174         YY_BREAK
1175 case 39:
1176 YY_RULE_SETUP
1177 #line 113 "../../src/scanner.ll"
1178 updateTokenInfo (-1); return TOK_TEXT;
1179         YY_BREAK
1180 case 40:
1181 YY_RULE_SETUP
1182 #line 114 "../../src/scanner.ll"
1183 updateTokenInfo (-1); return TOK_ARGS;
1184         YY_BREAK
1185 case 41:
1186 YY_RULE_SETUP
1187 #line 116 "../../src/scanner.ll"
1188 { updateTokenInfo (-1); return '='; }
1189         YY_BREAK
1190 case 42:
1191 YY_RULE_SETUP
1192 #line 117 "../../src/scanner.ll"
1193 { updateTokenInfo (-1); return ','; }
1194         YY_BREAK
1195 case 43:
1196 YY_RULE_SETUP
1197 #line 119 "../../src/scanner.ll"
1198 { PUSH(SIZE_STATE); updateTokenInfo (-1); return '('; }
1199         YY_BREAK
1200 case 44:
1201 YY_RULE_SETUP
1202 #line 120 "../../src/scanner.ll"
1203 { updateTokenInfo (-1); return '-'; }
1204         YY_BREAK
1205 case 45:
1206 YY_RULE_SETUP
1207 #line 121 "../../src/scanner.ll"
1208 { updateTokenInfo (-1); yylval.str = strdup(yytext); return TOK_SIZE; }
1209         YY_BREAK
1210 case 46:
1211 YY_RULE_SETUP
1212 #line 122 "../../src/scanner.ll"
1213 { POP(); updateTokenInfo (-1); return ')'; }
1214         YY_BREAK
1215 case 47:
1216 YY_RULE_SETUP
1217 #line 124 "../../src/scanner.ll"
1218 updateTokenInfo (-1); yylval.chr = yytext[0]; return TOK_CHAR;
1219         YY_BREAK
1220 case 48:
1221 YY_RULE_SETUP
1222 #line 126 "../../src/scanner.ll"
1223 { updateTokenInfo (-1); DEB("start string"); PUSH(STRING_STATE) ; }
1224         YY_BREAK
1225 case 49:
1226 YY_RULE_SETUP
1227 #line 127 "../../src/scanner.ll"
1228 { updateTokenInfo (2); buffer("\\\\n"); }
1229         YY_BREAK
1230 case 50:
1231 YY_RULE_SETUP
1232 #line 128 "../../src/scanner.ll"
1233 { updateTokenInfo (1); buffer("\n"); }
1234         YY_BREAK
1235 case 51:
1236 /* rule 51 can match eol */
1237 YY_RULE_SETUP
1238 #line 129 "../../src/scanner.ll"
1239 {  update_count_line (yytext); buffer( yytext ) ; }
1240         YY_BREAK
1241 case 52:
1242 /* rule 52 can match eol */
1243 YY_RULE_SETUP
1244 #line 130 "../../src/scanner.ll"
1245 { update_count_line (yytext); /* a line break */ }
1246         YY_BREAK
1247 case 53:
1248 YY_RULE_SETUP
1249 #line 131 "../../src/scanner.ll"
1250 { updateTokenInfo (-1); buffer(yytext); }
1251         YY_BREAK
1252 case 54:
1253 YY_RULE_SETUP
1254 #line 132 "../../src/scanner.ll"
1255 { updateTokenInfo (-1); DEB("end string"); POP() ; yylval.str = flush_buffer(); return TOK_STRING; }
1256         YY_BREAK
1257 case 55:
1258 YY_RULE_SETUP
1259 #line 133 "../../src/scanner.ll"
1260 {  updateTokenInfo (-1); buffer( yytext ) ; }
1261         YY_BREAK
1262 case 56:
1263 YY_RULE_SETUP
1264 #line 135 "../../src/scanner.ll"
1265 updateTokenInfo (-1);
1266         YY_BREAK
1267 case 57:
1268 YY_RULE_SETUP
1269 #line 136 "../../src/scanner.ll"
1270 updateTokenInfo (8*yyleng);
1271         YY_BREAK
1272 case 58:
1273 YY_RULE_SETUP
1274 #line 138 "../../src/scanner.ll"
1275 /* comments begin with # in any place (but strings) */
1276         YY_BREAK
1277 case 59:
1278 /* rule 59 can match eol */
1279 YY_RULE_SETUP
1280 #line 139 "../../src/scanner.ll"
1281 update_count_line (0); yyless(1) ; /* give back all but the \n to rescan */
1282         YY_BREAK
1283 case 60:
1284 YY_RULE_SETUP
1285 #line 141 "../../src/scanner.ll"
1286 {}
1287         YY_BREAK
1288 case 61:
1289 YY_RULE_SETUP
1290 #line 143 "../../src/scanner.ll"
1291 {
1292   return 1000; /* little hack to produce a parse error too. */
1293 }
1294         YY_BREAK
1295 case 62:
1296 YY_RULE_SETUP
1297 #line 147 "../../src/scanner.ll"
1298 ECHO;
1299         YY_BREAK
1300 #line 1301 "../../src/scanner.cc"
1301 case YY_STATE_EOF(INITIAL):
1302 case YY_STATE_EOF(SIZE_STATE):
1303 case YY_STATE_EOF(STRING_STATE):
1304         yyterminate();
1305
1306         case YY_END_OF_BUFFER:
1307                 {
1308                 /* Amount of text matched not including the EOB char. */
1309                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1310
1311                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1312                 *yy_cp = (yy_hold_char);
1313                 YY_RESTORE_YY_MORE_OFFSET
1314
1315                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1316                         {
1317                         /* We're scanning a new file or input source.  It's
1318                          * possible that this happened because the user
1319                          * just pointed yyin at a new source and called
1320                          * yylex().  If so, then we have to assure
1321                          * consistency between YY_CURRENT_BUFFER and our
1322                          * globals.  Here is the right place to do so, because
1323                          * this is the first action (other than possibly a
1324                          * back-up) that will match for the new input source.
1325                          */
1326                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1327                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1328                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1329                         }
1330
1331                 /* Note that here we test for yy_c_buf_p "<=" to the position
1332                  * of the first EOB in the buffer, since yy_c_buf_p will
1333                  * already have been incremented past the NUL character
1334                  * (since all states make transitions on EOB to the
1335                  * end-of-buffer state).  Contrast this with the test
1336                  * in input().
1337                  */
1338                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1339                         { /* This was really a NUL. */
1340                         yy_state_type yy_next_state;
1341
1342                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1343
1344                         yy_current_state = yy_get_previous_state(  );
1345
1346                         /* Okay, we're now positioned to make the NUL
1347                          * transition.  We couldn't have
1348                          * yy_get_previous_state() go ahead and do it
1349                          * for us because it doesn't know how to deal
1350                          * with the possibility of jamming (and we don't
1351                          * want to build jamming into it because then it
1352                          * will run more slowly).
1353                          */
1354
1355                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1356
1357                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1358
1359                         if ( yy_next_state )
1360                                 {
1361                                 /* Consume the NUL. */
1362                                 yy_cp = ++(yy_c_buf_p);
1363                                 yy_current_state = yy_next_state;
1364                                 goto yy_match;
1365                                 }
1366
1367                         else
1368                                 {
1369                                 yy_cp = (yy_c_buf_p);
1370                                 goto yy_find_action;
1371                                 }
1372                         }
1373
1374                 else switch ( yy_get_next_buffer(  ) )
1375                         {
1376                         case EOB_ACT_END_OF_FILE:
1377                                 {
1378                                 (yy_did_buffer_switch_on_eof) = 0;
1379
1380                                 if ( yywrap( ) )
1381                                         {
1382                                         /* Note: because we've taken care in
1383                                          * yy_get_next_buffer() to have set up
1384                                          * yytext, we can now set up
1385                                          * yy_c_buf_p so that if some total
1386                                          * hoser (like flex itself) wants to
1387                                          * call the scanner after we return the
1388                                          * YY_NULL, it'll still work - another
1389                                          * YY_NULL will get returned.
1390                                          */
1391                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1392
1393                                         yy_act = YY_STATE_EOF(YY_START);
1394                                         goto do_action;
1395                                         }
1396
1397                                 else
1398                                         {
1399                                         if ( ! (yy_did_buffer_switch_on_eof) )
1400                                                 YY_NEW_FILE;
1401                                         }
1402                                 break;
1403                                 }
1404
1405                         case EOB_ACT_CONTINUE_SCAN:
1406                                 (yy_c_buf_p) =
1407                                         (yytext_ptr) + yy_amount_of_matched_text;
1408
1409                                 yy_current_state = yy_get_previous_state(  );
1410
1411                                 yy_cp = (yy_c_buf_p);
1412                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1413                                 goto yy_match;
1414
1415                         case EOB_ACT_LAST_MATCH:
1416                                 (yy_c_buf_p) =
1417                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1418
1419                                 yy_current_state = yy_get_previous_state(  );
1420
1421                                 yy_cp = (yy_c_buf_p);
1422                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1423                                 goto yy_find_action;
1424                         }
1425                 break;
1426                 }
1427
1428         default:
1429                 YY_FATAL_ERROR(
1430                         "fatal flex scanner internal error--no action found" );
1431         } /* end of action switch */
1432                 } /* end of scanning one token */
1433 } /* end of yylex */
1434
1435 /* yy_get_next_buffer - try to read in a new buffer
1436  *
1437  * Returns a code representing an action:
1438  *      EOB_ACT_LAST_MATCH -
1439  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1440  *      EOB_ACT_END_OF_FILE - end of file
1441  */
1442 static int yy_get_next_buffer (void)
1443 {
1444         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1445         register char *source = (yytext_ptr);
1446         register int number_to_move, i;
1447         int ret_val;
1448
1449         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1450                 YY_FATAL_ERROR(
1451                 "fatal flex scanner internal error--end of buffer missed" );
1452
1453         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1454                 { /* Don't try to fill the buffer, so this is an EOF. */
1455                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1456                         {
1457                         /* We matched a single character, the EOB, so
1458                          * treat this as a final EOF.
1459                          */
1460                         return EOB_ACT_END_OF_FILE;
1461                         }
1462
1463                 else
1464                         {
1465                         /* We matched some text prior to the EOB, first
1466                          * process it.
1467                          */
1468                         return EOB_ACT_LAST_MATCH;
1469                         }
1470                 }
1471
1472         /* Try to read more data. */
1473
1474         /* First move last chars to start of buffer. */
1475         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1476
1477         for ( i = 0; i < number_to_move; ++i )
1478                 *(dest++) = *(source++);
1479
1480         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1481                 /* don't do the read, it's not guaranteed to return an EOF,
1482                  * just force an EOF
1483                  */
1484                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1485
1486         else
1487                 {
1488                         int num_to_read =
1489                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1490
1491                 while ( num_to_read <= 0 )
1492                         { /* Not enough room in the buffer - grow it. */
1493
1494                         /* just a shorter name for the current buffer */
1495                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1496
1497                         int yy_c_buf_p_offset =
1498                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1499
1500                         if ( b->yy_is_our_buffer )
1501                                 {
1502                                 int new_size = b->yy_buf_size * 2;
1503
1504                                 if ( new_size <= 0 )
1505                                         b->yy_buf_size += b->yy_buf_size / 8;
1506                                 else
1507                                         b->yy_buf_size *= 2;
1508
1509                                 b->yy_ch_buf = (char *)
1510                                         /* Include room in for 2 EOB chars. */
1511                                         yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1512                                 }
1513                         else
1514                                 /* Can't grow it, we don't own it. */
1515                                 b->yy_ch_buf = 0;
1516
1517                         if ( ! b->yy_ch_buf )
1518                                 YY_FATAL_ERROR(
1519                                 "fatal error - scanner input buffer overflow" );
1520
1521                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1522
1523                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1524                                                 number_to_move - 1;
1525
1526                         }
1527
1528                 if ( num_to_read > YY_READ_BUF_SIZE )
1529                         num_to_read = YY_READ_BUF_SIZE;
1530
1531                 /* Read in more data. */
1532                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1533                         (yy_n_chars), (size_t) num_to_read );
1534
1535                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1536                 }
1537
1538         if ( (yy_n_chars) == 0 )
1539                 {
1540                 if ( number_to_move == YY_MORE_ADJ )
1541                         {
1542                         ret_val = EOB_ACT_END_OF_FILE;
1543                         yyrestart(yyin  );
1544                         }
1545
1546                 else
1547                         {
1548                         ret_val = EOB_ACT_LAST_MATCH;
1549                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1550                                 YY_BUFFER_EOF_PENDING;
1551                         }
1552                 }
1553
1554         else
1555                 ret_val = EOB_ACT_CONTINUE_SCAN;
1556
1557         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1558                 /* Extend the array by 50%, plus the number we really need. */
1559                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1560                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1561                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1562                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1563         }
1564
1565         (yy_n_chars) += number_to_move;
1566         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1567         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1568
1569         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1570
1571         return ret_val;
1572 }
1573
1574 /* yy_get_previous_state - get the state just before the EOB char was reached */
1575
1576     static yy_state_type yy_get_previous_state (void)
1577 {
1578         register yy_state_type yy_current_state;
1579         register char *yy_cp;
1580     
1581         yy_current_state = (yy_start);
1582
1583         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1584                 {
1585                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1586                 if ( yy_accept[yy_current_state] )
1587                         {
1588                         (yy_last_accepting_state) = yy_current_state;
1589                         (yy_last_accepting_cpos) = yy_cp;
1590                         }
1591                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1592                         {
1593                         yy_current_state = (int) yy_def[yy_current_state];
1594                         if ( yy_current_state >= 246 )
1595                                 yy_c = yy_meta[(unsigned int) yy_c];
1596                         }
1597                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1598                 }
1599
1600         return yy_current_state;
1601 }
1602
1603 /* yy_try_NUL_trans - try to make a transition on the NUL character
1604  *
1605  * synopsis
1606  *      next_state = yy_try_NUL_trans( current_state );
1607  */
1608     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1609 {
1610         register int yy_is_jam;
1611         register char *yy_cp = (yy_c_buf_p);
1612
1613         register YY_CHAR yy_c = 1;
1614         if ( yy_accept[yy_current_state] )
1615                 {
1616                 (yy_last_accepting_state) = yy_current_state;
1617                 (yy_last_accepting_cpos) = yy_cp;
1618                 }
1619         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1620                 {
1621                 yy_current_state = (int) yy_def[yy_current_state];
1622                 if ( yy_current_state >= 246 )
1623                         yy_c = yy_meta[(unsigned int) yy_c];
1624                 }
1625         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1626         yy_is_jam = (yy_current_state == 245);
1627
1628         return yy_is_jam ? 0 : yy_current_state;
1629 }
1630
1631 #ifndef YY_NO_INPUT
1632 #ifdef __cplusplus
1633     static int yyinput (void)
1634 #else
1635     static int input  (void)
1636 #endif
1637
1638 {
1639         int c;
1640     
1641         *(yy_c_buf_p) = (yy_hold_char);
1642
1643         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1644                 {
1645                 /* yy_c_buf_p now points to the character we want to return.
1646                  * If this occurs *before* the EOB characters, then it's a
1647                  * valid NUL; if not, then we've hit the end of the buffer.
1648                  */
1649                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1650                         /* This was really a NUL. */
1651                         *(yy_c_buf_p) = '\0';
1652
1653                 else
1654                         { /* need more input */
1655                         int offset = (yy_c_buf_p) - (yytext_ptr);
1656                         ++(yy_c_buf_p);
1657
1658                         switch ( yy_get_next_buffer(  ) )
1659                                 {
1660                                 case EOB_ACT_LAST_MATCH:
1661                                         /* This happens because yy_g_n_b()
1662                                          * sees that we've accumulated a
1663                                          * token and flags that we need to
1664                                          * try matching the token before
1665                                          * proceeding.  But for input(),
1666                                          * there's no matching to consider.
1667                                          * So convert the EOB_ACT_LAST_MATCH
1668                                          * to EOB_ACT_END_OF_FILE.
1669                                          */
1670
1671                                         /* Reset buffer status. */
1672                                         yyrestart(yyin );
1673
1674                                         /*FALLTHROUGH*/
1675
1676                                 case EOB_ACT_END_OF_FILE:
1677                                         {
1678                                         if ( yywrap( ) )
1679                                                 return EOF;
1680
1681                                         if ( ! (yy_did_buffer_switch_on_eof) )
1682                                                 YY_NEW_FILE;
1683 #ifdef __cplusplus
1684                                         return yyinput();
1685 #else
1686                                         return input();
1687 #endif
1688                                         }
1689
1690                                 case EOB_ACT_CONTINUE_SCAN:
1691                                         (yy_c_buf_p) = (yytext_ptr) + offset;
1692                                         break;
1693                                 }
1694                         }
1695                 }
1696
1697         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1698         *(yy_c_buf_p) = '\0';   /* preserve yytext */
1699         (yy_hold_char) = *++(yy_c_buf_p);
1700
1701         if ( c == '\n' )
1702                    
1703     yylineno++;
1704 ;
1705
1706         return c;
1707 }
1708 #endif  /* ifndef YY_NO_INPUT */
1709
1710 /** Immediately switch to a different input stream.
1711  * @param input_file A readable stream.
1712  * 
1713  * @note This function does not reset the start condition to @c INITIAL .
1714  */
1715     void yyrestart  (FILE * input_file )
1716 {
1717     
1718         if ( ! YY_CURRENT_BUFFER ){
1719         yyensure_buffer_stack ();
1720                 YY_CURRENT_BUFFER_LVALUE =
1721             yy_create_buffer(yyin,YY_BUF_SIZE );
1722         }
1723
1724         yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1725         yy_load_buffer_state( );
1726 }
1727
1728 /** Switch to a different input buffer.
1729  * @param new_buffer The new input buffer.
1730  * 
1731  */
1732     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1733 {
1734     
1735         /* TODO. We should be able to replace this entire function body
1736          * with
1737          *              yypop_buffer_state();
1738          *              yypush_buffer_state(new_buffer);
1739      */
1740         yyensure_buffer_stack ();
1741         if ( YY_CURRENT_BUFFER == new_buffer )
1742                 return;
1743
1744         if ( YY_CURRENT_BUFFER )
1745                 {
1746                 /* Flush out information for old buffer. */
1747                 *(yy_c_buf_p) = (yy_hold_char);
1748                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1749                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1750                 }
1751
1752         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1753         yy_load_buffer_state( );
1754
1755         /* We don't actually know whether we did this switch during
1756          * EOF (yywrap()) processing, but the only time this flag
1757          * is looked at is after yywrap() is called, so it's safe
1758          * to go ahead and always set it.
1759          */
1760         (yy_did_buffer_switch_on_eof) = 1;
1761 }
1762
1763 static void yy_load_buffer_state  (void)
1764 {
1765         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1766         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1767         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1768         (yy_hold_char) = *(yy_c_buf_p);
1769 }
1770
1771 /** Allocate and initialize an input buffer state.
1772  * @param file A readable stream.
1773  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1774  * 
1775  * @return the allocated buffer state.
1776  */
1777     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
1778 {
1779         YY_BUFFER_STATE b;
1780     
1781         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
1782         if ( ! b )
1783                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1784
1785         b->yy_buf_size = size;
1786
1787         /* yy_ch_buf has to be 2 characters longer than the size given because
1788          * we need to put in 2 end-of-buffer characters.
1789          */
1790         b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
1791         if ( ! b->yy_ch_buf )
1792                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1793
1794         b->yy_is_our_buffer = 1;
1795
1796         yy_init_buffer(b,file );
1797
1798         return b;
1799 }
1800
1801 /** Destroy the buffer.
1802  * @param b a buffer created with yy_create_buffer()
1803  * 
1804  */
1805     void yy_delete_buffer (YY_BUFFER_STATE  b )
1806 {
1807     
1808         if ( ! b )
1809                 return;
1810
1811         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1812                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1813
1814         if ( b->yy_is_our_buffer )
1815                 yyfree((void *) b->yy_ch_buf  );
1816
1817         yyfree((void *) b  );
1818 }
1819
1820 #ifndef __cplusplus
1821 extern int isatty (int );
1822 #endif /* __cplusplus */
1823     
1824 /* Initializes or reinitializes a buffer.
1825  * This function is sometimes called more than once on the same buffer,
1826  * such as during a yyrestart() or at EOF.
1827  */
1828     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1829
1830 {
1831         int oerrno = errno;
1832     
1833         yy_flush_buffer(b );
1834
1835         b->yy_input_file = file;
1836         b->yy_fill_buffer = 1;
1837
1838     /* If b is the current buffer, then yy_init_buffer was _probably_
1839      * called from yyrestart() or through yy_get_next_buffer.
1840      * In that case, we don't want to reset the lineno or column.
1841      */
1842     if (b != YY_CURRENT_BUFFER){
1843         b->yy_bs_lineno = 1;
1844         b->yy_bs_column = 0;
1845     }
1846
1847         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1848     
1849         errno = oerrno;
1850 }
1851
1852 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1853  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1854  * 
1855  */
1856     void yy_flush_buffer (YY_BUFFER_STATE  b )
1857 {
1858         if ( ! b )
1859                 return;
1860
1861         b->yy_n_chars = 0;
1862
1863         /* We always need two end-of-buffer characters.  The first causes
1864          * a transition to the end-of-buffer state.  The second causes
1865          * a jam in that state.
1866          */
1867         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1868         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1869
1870         b->yy_buf_pos = &b->yy_ch_buf[0];
1871
1872         b->yy_at_bol = 1;
1873         b->yy_buffer_status = YY_BUFFER_NEW;
1874
1875         if ( b == YY_CURRENT_BUFFER )
1876                 yy_load_buffer_state( );
1877 }
1878
1879 /** Pushes the new state onto the stack. The new state becomes
1880  *  the current state. This function will allocate the stack
1881  *  if necessary.
1882  *  @param new_buffer The new state.
1883  *  
1884  */
1885 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1886 {
1887         if (new_buffer == NULL)
1888                 return;
1889
1890         yyensure_buffer_stack();
1891
1892         /* This block is copied from yy_switch_to_buffer. */
1893         if ( YY_CURRENT_BUFFER )
1894                 {
1895                 /* Flush out information for old buffer. */
1896                 *(yy_c_buf_p) = (yy_hold_char);
1897                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1898                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1899                 }
1900
1901         /* Only push if top exists. Otherwise, replace top. */
1902         if (YY_CURRENT_BUFFER)
1903                 (yy_buffer_stack_top)++;
1904         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1905
1906         /* copied from yy_switch_to_buffer. */
1907         yy_load_buffer_state( );
1908         (yy_did_buffer_switch_on_eof) = 1;
1909 }
1910
1911 /** Removes and deletes the top of the stack, if present.
1912  *  The next element becomes the new top.
1913  *  
1914  */
1915 void yypop_buffer_state (void)
1916 {
1917         if (!YY_CURRENT_BUFFER)
1918                 return;
1919
1920         yy_delete_buffer(YY_CURRENT_BUFFER );
1921         YY_CURRENT_BUFFER_LVALUE = NULL;
1922         if ((yy_buffer_stack_top) > 0)
1923                 --(yy_buffer_stack_top);
1924
1925         if (YY_CURRENT_BUFFER) {
1926                 yy_load_buffer_state( );
1927                 (yy_did_buffer_switch_on_eof) = 1;
1928         }
1929 }
1930
1931 /* Allocates the stack if it does not exist.
1932  *  Guarantees space for at least one push.
1933  */
1934 static void yyensure_buffer_stack (void)
1935 {
1936         int num_to_alloc;
1937     
1938         if (!(yy_buffer_stack)) {
1939
1940                 /* First allocation is just for 2 elements, since we don't know if this
1941                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1942                  * immediate realloc on the next call.
1943          */
1944                 num_to_alloc = 1;
1945                 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1946                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
1947                                                                 );
1948                 if ( ! (yy_buffer_stack) )
1949                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1950                                                                   
1951                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1952                                 
1953                 (yy_buffer_stack_max) = num_to_alloc;
1954                 (yy_buffer_stack_top) = 0;
1955                 return;
1956         }
1957
1958         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1959
1960                 /* Increase the buffer to prepare for a possible push. */
1961                 int grow_size = 8 /* arbitrary grow size */;
1962
1963                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1964                 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1965                                                                 ((yy_buffer_stack),
1966                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
1967                                                                 );
1968                 if ( ! (yy_buffer_stack) )
1969                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1970
1971                 /* zero only the new slots.*/
1972                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1973                 (yy_buffer_stack_max) = num_to_alloc;
1974         }
1975 }
1976
1977 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1978  * @param base the character buffer
1979  * @param size the size in bytes of the character buffer
1980  * 
1981  * @return the newly allocated buffer state object. 
1982  */
1983 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
1984 {
1985         YY_BUFFER_STATE b;
1986     
1987         if ( size < 2 ||
1988              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1989              base[size-1] != YY_END_OF_BUFFER_CHAR )
1990                 /* They forgot to leave room for the EOB's. */
1991                 return 0;
1992
1993         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
1994         if ( ! b )
1995                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1996
1997         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1998         b->yy_buf_pos = b->yy_ch_buf = base;
1999         b->yy_is_our_buffer = 0;
2000         b->yy_input_file = 0;
2001         b->yy_n_chars = b->yy_buf_size;
2002         b->yy_is_interactive = 0;
2003         b->yy_at_bol = 1;
2004         b->yy_fill_buffer = 0;
2005         b->yy_buffer_status = YY_BUFFER_NEW;
2006
2007         yy_switch_to_buffer(b  );
2008
2009         return b;
2010 }
2011
2012 /** Setup the input buffer state to scan a string. The next call to yylex() will
2013  * scan from a @e copy of @a str.
2014  * @param yystr a NUL-terminated string to scan
2015  * 
2016  * @return the newly allocated buffer state object.
2017  * @note If you want to scan bytes that may contain NUL values, then use
2018  *       yy_scan_bytes() instead.
2019  */
2020 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2021 {
2022     
2023         return yy_scan_bytes(yystr,strlen(yystr) );
2024 }
2025
2026 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2027  * scan from a @e copy of @a bytes.
2028  * @param yybytes the byte buffer to scan
2029  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2030  * 
2031  * @return the newly allocated buffer state object.
2032  */
2033 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2034 {
2035         YY_BUFFER_STATE b;
2036         char *buf;
2037         yy_size_t n;
2038         int i;
2039     
2040         /* Get memory for full buffer, including space for trailing EOB's. */
2041         n = _yybytes_len + 2;
2042         buf = (char *) yyalloc(n  );
2043         if ( ! buf )
2044                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2045
2046         for ( i = 0; i < _yybytes_len; ++i )
2047                 buf[i] = yybytes[i];
2048
2049         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2050
2051         b = yy_scan_buffer(buf,n );
2052         if ( ! b )
2053                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2054
2055         /* It's okay to grow etc. this buffer, and we should throw it
2056          * away when we're done.
2057          */
2058         b->yy_is_our_buffer = 1;
2059
2060         return b;
2061 }
2062
2063     static void yy_push_state (int  new_state )
2064 {
2065         if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
2066                 {
2067                 yy_size_t new_size;
2068
2069                 (yy_start_stack_depth) += YY_START_STACK_INCR;
2070                 new_size = (yy_start_stack_depth) * sizeof( int );
2071
2072                 if ( ! (yy_start_stack) )
2073                         (yy_start_stack) = (int *) yyalloc(new_size  );
2074
2075                 else
2076                         (yy_start_stack) = (int *) yyrealloc((void *) (yy_start_stack),new_size  );
2077
2078                 if ( ! (yy_start_stack) )
2079                         YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2080                 }
2081
2082         (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
2083
2084         BEGIN(new_state);
2085 }
2086
2087     static void yy_pop_state  (void)
2088 {
2089         if ( --(yy_start_stack_ptr) < 0 )
2090                 YY_FATAL_ERROR( "start-condition stack underflow" );
2091
2092         BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2093 }
2094
2095     static int yy_top_state  (void)
2096 {
2097         return (yy_start_stack)[(yy_start_stack_ptr) - 1];
2098 }
2099
2100 #ifndef YY_EXIT_FAILURE
2101 #define YY_EXIT_FAILURE 2
2102 #endif
2103
2104 static void yy_fatal_error (yyconst char* msg )
2105 {
2106         (void) fprintf( stderr, "%s\n", msg );
2107         exit( YY_EXIT_FAILURE );
2108 }
2109
2110 /* Redefine yyless() so it works in section 3 code. */
2111
2112 #undef yyless
2113 #define yyless(n) \
2114         do \
2115                 { \
2116                 /* Undo effects of setting up yytext. */ \
2117         int yyless_macro_arg = (n); \
2118         YY_LESS_LINENO(yyless_macro_arg);\
2119                 yytext[yyleng] = (yy_hold_char); \
2120                 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2121                 (yy_hold_char) = *(yy_c_buf_p); \
2122                 *(yy_c_buf_p) = '\0'; \
2123                 yyleng = yyless_macro_arg; \
2124                 } \
2125         while ( 0 )
2126
2127 /* Accessor  methods (get/set functions) to struct members. */
2128
2129 /** Get the current line number.
2130  * 
2131  */
2132 int yyget_lineno  (void)
2133 {
2134         
2135     return yylineno;
2136 }
2137
2138 /** Get the input stream.
2139  * 
2140  */
2141 FILE *yyget_in  (void)
2142 {
2143         return yyin;
2144 }
2145
2146 /** Get the output stream.
2147  * 
2148  */
2149 FILE *yyget_out  (void)
2150 {
2151         return yyout;
2152 }
2153
2154 /** Get the length of the current token.
2155  * 
2156  */
2157 int yyget_leng  (void)
2158 {
2159         return yyleng;
2160 }
2161
2162 /** Get the current token.
2163  * 
2164  */
2165
2166 char *yyget_text  (void)
2167 {
2168         return yytext;
2169 }
2170
2171 /** Set the current line number.
2172  * @param line_number
2173  * 
2174  */
2175 void yyset_lineno (int  line_number )
2176 {
2177     
2178     yylineno = line_number;
2179 }
2180
2181 /** Set the input stream. This does not discard the current
2182  * input buffer.
2183  * @param in_str A readable stream.
2184  * 
2185  * @see yy_switch_to_buffer
2186  */
2187 void yyset_in (FILE *  in_str )
2188 {
2189         yyin = in_str ;
2190 }
2191
2192 void yyset_out (FILE *  out_str )
2193 {
2194         yyout = out_str ;
2195 }
2196
2197 int yyget_debug  (void)
2198 {
2199         return yy_flex_debug;
2200 }
2201
2202 void yyset_debug (int  bdebug )
2203 {
2204         yy_flex_debug = bdebug ;
2205 }
2206
2207 static int yy_init_globals (void)
2208 {
2209         /* Initialization is the same as for the non-reentrant scanner.
2210      * This function is called from yylex_destroy(), so don't allocate here.
2211      */
2212
2213     /* We do not touch yylineno unless the option is enabled. */
2214     yylineno =  1;
2215     
2216     (yy_buffer_stack) = 0;
2217     (yy_buffer_stack_top) = 0;
2218     (yy_buffer_stack_max) = 0;
2219     (yy_c_buf_p) = (char *) 0;
2220     (yy_init) = 0;
2221     (yy_start) = 0;
2222
2223     (yy_start_stack_ptr) = 0;
2224     (yy_start_stack_depth) = 0;
2225     (yy_start_stack) =  NULL;
2226
2227 /* Defined in main.c */
2228 #ifdef YY_STDINIT
2229     yyin = stdin;
2230     yyout = stdout;
2231 #else
2232     yyin = (FILE *) 0;
2233     yyout = (FILE *) 0;
2234 #endif
2235
2236     /* For future reference: Set errno on error, since we are called by
2237      * yylex_init()
2238      */
2239     return 0;
2240 }
2241
2242 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2243 int yylex_destroy  (void)
2244 {
2245     
2246     /* Pop the buffer stack, destroying each element. */
2247         while(YY_CURRENT_BUFFER){
2248                 yy_delete_buffer(YY_CURRENT_BUFFER  );
2249                 YY_CURRENT_BUFFER_LVALUE = NULL;
2250                 yypop_buffer_state();
2251         }
2252
2253         /* Destroy the stack itself. */
2254         yyfree((yy_buffer_stack) );
2255         (yy_buffer_stack) = NULL;
2256
2257     /* Destroy the start condition stack. */
2258         yyfree((yy_start_stack)  );
2259         (yy_start_stack) = NULL;
2260
2261     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2262      * yylex() is called, initialization will occur. */
2263     yy_init_globals( );
2264
2265     return 0;
2266 }
2267
2268 /*
2269  * Internal utility routines.
2270  */
2271
2272 #ifndef yytext_ptr
2273 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2274 {
2275         register int i;
2276         for ( i = 0; i < n; ++i )
2277                 s1[i] = s2[i];
2278 }
2279 #endif
2280
2281 #ifdef YY_NEED_STRLEN
2282 static int yy_flex_strlen (yyconst char * s )
2283 {
2284         register int n;
2285         for ( n = 0; s[n]; ++n )
2286                 ;
2287
2288         return n;
2289 }
2290 #endif
2291
2292 void *yyalloc (yy_size_t  size )
2293 {
2294         return (void *) malloc( size );
2295 }
2296
2297 void *yyrealloc  (void * ptr, yy_size_t  size )
2298 {
2299         /* The cast to (char *) in the following accommodates both
2300          * implementations that use char* generic pointers, and those
2301          * that use void* generic pointers.  It works with the latter
2302          * because both ANSI C and C++ allow castless assignment from
2303          * any pointer type to void*, and deal with argument conversions
2304          * as though doing an assignment.
2305          */
2306         return (void *) realloc( (char *) ptr, size );
2307 }
2308
2309 void yyfree (void * ptr )
2310 {
2311         free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
2312 }
2313
2314 #define YYTABLES_NAME "yytables"
2315
2316 #line 147 "../../src/scanner.ll"
2317
2318
2319
2320 /*
2321   Otherwise '\n' within a TOK_MLSTRING would not be counted
2322 */
2323 void
2324 update_count_line (char *str)
2325 {
2326   if (str)
2327     {
2328       char *p;
2329       for (p = str; *p; ++p)
2330         if (*p == '\n') {
2331           ++gengetopt_count_line;
2332           tokenpos = 0 ; /* reset token position */
2333           strncpy (linebuf, ( (p+1) ? p+1 : ""), LINEBUF_LEN - 1);
2334         }
2335     }
2336   else
2337     {
2338       ++gengetopt_count_line;
2339       tokenpos = 0 ; /* reset token position */
2340       strncpy (linebuf, yytext+1, LINEBUF_LEN - 1); /* save the next line */
2341     }
2342 }
2343
2344 void
2345 updateTokenInfo( int pos )
2346 {
2347   if ( pos >= 0 )
2348     tokenpos += pos ;
2349   else
2350     tokenpos += yyleng ;
2351 }
2352
2353 void buffer(const char *s)
2354 {
2355   buff << s;
2356 }
2357
2358 char *flush_buffer()
2359 {
2360   char *ret = strdup(buff.str().c_str());
2361   buff.str("");
2362   return ret;
2363 }
2364