blob: a955e2ecf2d4e1b3af326854f9d5be753c08f69b [file] [log] [blame]
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001
Sven Schnelle0fa50a12012-06-21 22:19:48 +02002#line 3 "/home/svens/coreboot/coreboot-i5000-latest/util/sconfig/lex.yy.c_shipped"
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00003
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define FLEX_SCANNER
9#define YY_FLEX_MAJOR_VERSION 2
10#define YY_FLEX_MINOR_VERSION 5
11#define YY_FLEX_SUBMINOR_VERSION 35
12#if YY_FLEX_SUBMINOR_VERSION > 0
13#define FLEX_BETA
14#endif
15
16/* First, we deal with platform-specific or compiler-specific issues. */
17
18/* begin standard C headers. */
19#include <stdio.h>
20#include <string.h>
21#include <errno.h>
22#include <stdlib.h>
23
24/* end standard C headers. */
25
26/* flex integer type definitions */
27
28#ifndef FLEXINT_H
29#define FLEXINT_H
30
31/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
Patrick Georgi8d313682010-05-05 13:12:42 +000036 * if you want the limit (max/min) macros for int types.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000037 */
38#ifndef __STDC_LIMIT_MACROS
39#define __STDC_LIMIT_MACROS 1
40#endif
41
42#include <inttypes.h>
43typedef int8_t flex_int8_t;
44typedef uint8_t flex_uint8_t;
45typedef int16_t flex_int16_t;
46typedef uint16_t flex_uint16_t;
47typedef int32_t flex_int32_t;
48typedef uint32_t flex_uint32_t;
49#else
50typedef signed char flex_int8_t;
51typedef short int flex_int16_t;
52typedef int flex_int32_t;
Patrick Georgi8d313682010-05-05 13:12:42 +000053typedef unsigned char flex_uint8_t;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000054typedef unsigned short int flex_uint16_t;
55typedef unsigned int flex_uint32_t;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000056
57/* Limits of integral types. */
58#ifndef INT8_MIN
59#define INT8_MIN (-128)
60#endif
61#ifndef INT16_MIN
62#define INT16_MIN (-32767-1)
63#endif
64#ifndef INT32_MIN
65#define INT32_MIN (-2147483647-1)
66#endif
67#ifndef INT8_MAX
68#define INT8_MAX (127)
69#endif
70#ifndef INT16_MAX
71#define INT16_MAX (32767)
72#endif
73#ifndef INT32_MAX
74#define INT32_MAX (2147483647)
75#endif
76#ifndef UINT8_MAX
77#define UINT8_MAX (255U)
78#endif
79#ifndef UINT16_MAX
80#define UINT16_MAX (65535U)
81#endif
82#ifndef UINT32_MAX
83#define UINT32_MAX (4294967295U)
84#endif
85
Patrick Georgi8d313682010-05-05 13:12:42 +000086#endif /* ! C99 */
87
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000088#endif /* ! FLEXINT_H */
89
90#ifdef __cplusplus
91
92/* The "const" storage-class-modifier is valid. */
93#define YY_USE_CONST
94
95#else /* ! __cplusplus */
96
97/* C99 requires __STDC__ to be defined as 1. */
98#if defined (__STDC__)
99
100#define YY_USE_CONST
101
102#endif /* defined (__STDC__) */
103#endif /* ! __cplusplus */
104
105#ifdef YY_USE_CONST
106#define yyconst const
107#else
108#define yyconst
109#endif
110
111/* Returned upon end-of-file. */
112#define YY_NULL 0
113
114/* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
117 * double cast.
118 */
119#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
121/* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
124 */
125#define BEGIN (yy_start) = 1 + 2 *
126
127/* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
129 * compatibility.
130 */
131#define YY_START (((yy_start) - 1) / 2)
132#define YYSTATE YY_START
133
134/* Action number for EOF rule of a given start state. */
135#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136
137/* Special action meaning "start processing a new file". */
138#define YY_NEW_FILE yyrestart(yyin )
139
140#define YY_END_OF_BUFFER_CHAR 0
141
142/* Size of default input buffer. */
143#ifndef YY_BUF_SIZE
Patrick Georgi8d313682010-05-05 13:12:42 +0000144#ifdef __ia64__
145/* On IA-64, the buffer size is 16k, not 8k.
146 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
147 * Ditto for the __ia64__ case accordingly.
148 */
149#define YY_BUF_SIZE 32768
150#else
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000151#define YY_BUF_SIZE 16384
Patrick Georgi8d313682010-05-05 13:12:42 +0000152#endif /* __ia64__ */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000153#endif
154
155/* The state buf must be large enough to hold one state per character in the main buffer.
156 */
157#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
158
159#ifndef YY_TYPEDEF_YY_BUFFER_STATE
160#define YY_TYPEDEF_YY_BUFFER_STATE
161typedef struct yy_buffer_state *YY_BUFFER_STATE;
162#endif
163
164extern int yyleng;
165
166extern FILE *yyin, *yyout;
167
168#define EOB_ACT_CONTINUE_SCAN 0
169#define EOB_ACT_END_OF_FILE 1
170#define EOB_ACT_LAST_MATCH 2
171
172 #define YY_LESS_LINENO(n)
Patrick Georgi8d313682010-05-05 13:12:42 +0000173
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000174/* Return all but the first "n" matched characters back to the input stream. */
175#define yyless(n) \
176 do \
177 { \
178 /* Undo effects of setting up yytext. */ \
179 int yyless_macro_arg = (n); \
180 YY_LESS_LINENO(yyless_macro_arg);\
181 *yy_cp = (yy_hold_char); \
182 YY_RESTORE_YY_MORE_OFFSET \
183 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
184 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
185 } \
186 while ( 0 )
187
188#define unput(c) yyunput( c, (yytext_ptr) )
189
190#ifndef YY_TYPEDEF_YY_SIZE_T
191#define YY_TYPEDEF_YY_SIZE_T
192typedef size_t yy_size_t;
193#endif
194
195#ifndef YY_STRUCT_YY_BUFFER_STATE
196#define YY_STRUCT_YY_BUFFER_STATE
197struct yy_buffer_state
198 {
199 FILE *yy_input_file;
200
201 char *yy_ch_buf; /* input buffer */
202 char *yy_buf_pos; /* current position in input buffer */
203
204 /* Size of input buffer in bytes, not including room for EOB
205 * characters.
206 */
207 yy_size_t yy_buf_size;
208
209 /* Number of characters read into yy_ch_buf, not including EOB
210 * characters.
211 */
212 int yy_n_chars;
213
214 /* Whether we "own" the buffer - i.e., we know we created it,
215 * and can realloc() it to grow it, and should free() it to
216 * delete it.
217 */
218 int yy_is_our_buffer;
219
220 /* Whether this is an "interactive" input source; if so, and
221 * if we're using stdio for input, then we want to use getc()
222 * instead of fread(), to make sure we stop fetching input after
223 * each newline.
224 */
225 int yy_is_interactive;
226
227 /* Whether we're considered to be at the beginning of a line.
228 * If so, '^' rules will be active on the next match, otherwise
229 * not.
230 */
231 int yy_at_bol;
232
233 int yy_bs_lineno; /**< The line count. */
234 int yy_bs_column; /**< The column count. */
Patrick Georgi8d313682010-05-05 13:12:42 +0000235
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000236 /* Whether to try to fill the input buffer when we reach the
237 * end of it.
238 */
239 int yy_fill_buffer;
240
241 int yy_buffer_status;
242
243#define YY_BUFFER_NEW 0
244#define YY_BUFFER_NORMAL 1
245 /* When an EOF's been seen but there's still some text to process
246 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
247 * shouldn't try reading from the input source any more. We might
248 * still have a bunch of tokens to match, though, because of
249 * possible backing-up.
250 *
251 * When we actually see the EOF, we change the status to "new"
252 * (via yyrestart()), so that the user can continue scanning by
253 * just pointing yyin at a new input file.
254 */
255#define YY_BUFFER_EOF_PENDING 2
256
257 };
258#endif /* !YY_STRUCT_YY_BUFFER_STATE */
259
260/* Stack of input buffers. */
261static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
262static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
263static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
264
265/* We provide macros for accessing buffer states in case in the
266 * future we want to put the buffer states in a more general
267 * "scanner state".
268 *
269 * Returns the top of the stack, or NULL.
270 */
271#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
272 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
273 : NULL)
274
275/* Same as previous macro, but useful when we know that the buffer stack is not
276 * NULL or when we need an lvalue. For internal use only.
277 */
278#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
279
280/* yy_hold_char holds the character lost when yytext is formed. */
281static char yy_hold_char;
282static int yy_n_chars; /* number of characters read into yy_ch_buf */
283int yyleng;
284
285/* Points to current character in buffer. */
286static char *yy_c_buf_p = (char *) 0;
287static int yy_init = 0; /* whether we need to initialize */
288static int yy_start = 0; /* start state number */
289
290/* Flag which is used to allow yywrap()'s to do buffer switches
291 * instead of setting up a fresh yyin. A bit of a hack ...
292 */
293static int yy_did_buffer_switch_on_eof;
294
295void yyrestart (FILE *input_file );
296void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
297YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
298void yy_delete_buffer (YY_BUFFER_STATE b );
299void yy_flush_buffer (YY_BUFFER_STATE b );
300void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
301void yypop_buffer_state (void );
302
303static void yyensure_buffer_stack (void );
304static void yy_load_buffer_state (void );
305static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
306
307#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
308
309YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
310YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
311YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
312
313void *yyalloc (yy_size_t );
314void *yyrealloc (void *,yy_size_t );
315void yyfree (void * );
316
317#define yy_new_buffer yy_create_buffer
318
319#define yy_set_interactive(is_interactive) \
320 { \
321 if ( ! YY_CURRENT_BUFFER ){ \
322 yyensure_buffer_stack (); \
323 YY_CURRENT_BUFFER_LVALUE = \
324 yy_create_buffer(yyin,YY_BUF_SIZE ); \
325 } \
326 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
327 }
328
329#define yy_set_bol(at_bol) \
330 { \
331 if ( ! YY_CURRENT_BUFFER ){\
332 yyensure_buffer_stack (); \
333 YY_CURRENT_BUFFER_LVALUE = \
334 yy_create_buffer(yyin,YY_BUF_SIZE ); \
335 } \
336 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
337 }
338
339#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
340
341/* Begin user sect3 */
342
343typedef unsigned char YY_CHAR;
344
345FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
346
347typedef int yy_state_type;
348
349extern int yylineno;
350
351int yylineno = 1;
352
353extern char *yytext;
354#define yytext_ptr yytext
355
356static yy_state_type yy_get_previous_state (void );
357static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
358static int yy_get_next_buffer (void );
359static void yy_fatal_error (yyconst char msg[] );
360
361/* Done after the current pattern has been matched and before the
362 * corresponding action - sets up yytext.
363 */
364#define YY_DO_BEFORE_ACTION \
365 (yytext_ptr) = yy_bp; \
366 yyleng = (size_t) (yy_cp - yy_bp); \
367 (yy_hold_char) = *yy_cp; \
368 *yy_cp = '\0'; \
369 (yy_c_buf_p) = yy_cp;
370
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200371#define YY_NUM_RULES 29
372#define YY_END_OF_BUFFER 30
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000373/* This struct is not used in this scanner,
374 but its presence is necessary. */
375struct yy_trans_info
376 {
377 flex_int32_t yy_verify;
378 flex_int32_t yy_nxt;
379 };
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200380static yyconst flex_int16_t yy_accept[112] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000381 { 0,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200382 0, 0, 30, 28, 1, 3, 28, 28, 28, 25,
383 25, 23, 26, 26, 26, 26, 28, 28, 28, 28,
384 28, 28, 28, 1, 3, 28, 0, 28, 0, 2,
385 25, 26, 28, 28, 26, 28, 28, 28, 28, 18,
386 28, 28, 28, 7, 28, 28, 28, 28, 27, 27,
387 24, 28, 28, 17, 22, 12, 28, 28, 16, 28,
388 8, 9, 11, 28, 28, 4, 28, 28, 28, 28,
389 28, 28, 28, 28, 28, 28, 13, 28, 28, 28,
390 5, 28, 10, 28, 28, 28, 28, 20, 28, 28,
391 28, 28, 28, 28, 28, 28, 6, 28, 28, 28,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000392
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200393 28, 28, 19, 28, 15, 28, 28, 21, 28, 14,
394 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000395 } ;
396
397static yyconst flex_int32_t yy_ec[256] =
398 { 0,
399 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
400 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 7, 1, 8, 7, 9,
404 7, 7, 7, 7, 7, 7, 7, 1, 1, 1,
405 10, 1, 1, 1, 11, 11, 11, 11, 11, 11,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000408 1, 1, 1, 1, 12, 1, 13, 14, 15, 16,
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000409
Sven Schnelle750edfd2011-03-01 21:43:57 +0000410 17, 18, 19, 20, 21, 1, 1, 22, 23, 24,
411 25, 26, 27, 28, 29, 30, 31, 32, 1, 33,
412 34, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1
427 } ;
428
Sven Schnelle750edfd2011-03-01 21:43:57 +0000429static yyconst flex_int32_t yy_meta[35] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000430 { 0,
431 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000434 1, 1, 1, 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000435 } ;
436
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200437static yyconst flex_int16_t yy_base[117] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000438 { 0,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200439 0, 0, 172, 0, 169, 173, 167, 33, 37, 34,
440 136, 0, 46, 49, 53, 56, 50, 155, 48, 22,
441 150, 135, 0, 163, 173, 74, 159, 65, 160, 173,
442 0, 75, 78, 141, 90, 134, 144, 144, 138, 144,
443 129, 129, 136, 0, 132, 126, 132, 136, 0, 173,
444 0, 123, 127, 0, 0, 0, 130, 120, 0, 124,
445 0, 132, 0, 122, 113, 0, 126, 112, 118, 123,
446 121, 107, 101, 117, 112, 117, 119, 96, 90, 90,
447 0, 88, 105, 101, 92, 97, 83, 0, 91, 89,
448 97, 81, 91, 79, 75, 84, 0, 81, 76, 73,
Patrick Georgi8d313682010-05-05 13:12:42 +0000449
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200450 77, 79, 0, 60, 0, 72, 56, 0, 43, 0,
451 173, 43, 122, 124, 126, 128
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000452 } ;
453
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200454static yyconst flex_int16_t yy_def[117] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000455 { 0,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200456 111, 1, 111, 112, 111, 111, 112, 113, 114, 112,
457 10, 112, 10, 10, 10, 10, 112, 112, 112, 112,
458 112, 112, 112, 111, 111, 113, 115, 114, 116, 111,
459 10, 10, 10, 112, 10, 112, 112, 112, 112, 112,
460 112, 112, 112, 112, 112, 112, 112, 112, 112, 111,
461 33, 112, 112, 112, 112, 112, 112, 112, 112, 112,
462 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
463 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
464 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
465 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
Patrick Georgi8d313682010-05-05 13:12:42 +0000466
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200467 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
468 0, 111, 111, 111, 111, 111
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000469 } ;
470
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200471static yyconst flex_int16_t yy_nxt[208] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000472 { 0,
473 4, 5, 6, 7, 8, 9, 10, 11, 10, 12,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000474 13, 4, 13, 13, 14, 15, 16, 13, 4, 4,
475 17, 18, 4, 4, 19, 20, 4, 21, 22, 4,
476 4, 4, 4, 4, 27, 27, 45, 23, 29, 30,
477 31, 31, 31, 23, 32, 46, 32, 32, 32, 32,
478 32, 32, 32, 32, 32, 32, 32, 32, 38, 32,
479 32, 32, 32, 32, 32, 43, 29, 30, 34, 35,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200480 110, 44, 109, 39, 40, 27, 27, 41, 49, 37,
481 36, 32, 32, 32, 51, 51, 51, 108, 51, 107,
482 51, 51, 51, 51, 51, 51, 32, 32, 32, 106,
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000483
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200484 105, 104, 103, 102, 101, 100, 99, 98, 97, 96,
485 95, 94, 93, 92, 91, 90, 89, 88, 87, 86,
486 85, 53, 26, 26, 28, 28, 27, 27, 29, 29,
487 84, 83, 82, 81, 80, 79, 78, 77, 76, 75,
488 74, 73, 72, 71, 70, 69, 68, 67, 66, 65,
489 64, 63, 62, 61, 60, 59, 58, 57, 56, 55,
490 54, 52, 30, 50, 24, 48, 47, 42, 33, 25,
491 24, 111, 3, 111, 111, 111, 111, 111, 111, 111,
492 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
493 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000494
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200495 111, 111, 111, 111, 111, 111, 111
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000496 } ;
497
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200498static yyconst flex_int16_t yy_chk[208] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000499 { 0,
500 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
501 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
502 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000503 1, 1, 1, 1, 8, 8, 20, 8, 9, 9,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200504 10, 10, 10, 112, 10, 20, 10, 10, 10, 10,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000505 10, 10, 13, 13, 13, 14, 14, 14, 17, 15,
506 15, 15, 16, 16, 16, 19, 28, 28, 14, 15,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200507 109, 19, 107, 17, 17, 26, 26, 17, 26, 16,
508 15, 32, 32, 32, 33, 33, 33, 106, 33, 104,
509 33, 33, 33, 33, 33, 33, 35, 35, 35, 102,
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000510
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200511 101, 100, 99, 98, 96, 95, 94, 93, 92, 91,
512 90, 89, 87, 86, 85, 84, 83, 82, 80, 79,
513 78, 35, 113, 113, 114, 114, 115, 115, 116, 116,
514 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
515 67, 65, 64, 62, 60, 58, 57, 53, 52, 48,
516 47, 46, 45, 43, 42, 41, 40, 39, 38, 37,
517 36, 34, 29, 27, 24, 22, 21, 18, 11, 7,
518 5, 3, 111, 111, 111, 111, 111, 111, 111, 111,
519 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
520 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000521
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200522 111, 111, 111, 111, 111, 111, 111
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000523 } ;
524
525static yy_state_type yy_last_accepting_state;
526static char *yy_last_accepting_cpos;
527
528extern int yy_flex_debug;
529int yy_flex_debug = 0;
530
531/* The intent behind this definition is that it'll catch
532 * any uses of REJECT which flex missed.
533 */
534#define REJECT reject_used_but_not_detected
535#define yymore() yymore_used_but_not_detected
536#define YY_MORE_ADJ 0
537#define YY_RESTORE_YY_MORE_OFFSET
538char *yytext;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000539/*
540 * sconfig, coreboot device tree compiler
541 *
542 * Copyright (C) 2010 coresystems GmbH
543 * written by Patrick Georgi <patrick.georgi@coresystems.de>
544 *
545 * This program is free software; you can redistribute it and/or modify
546 * it under the terms of the GNU General Public License as published by
547 * the Free Software Foundation; version 2 of the License.
548 *
549 * This program is distributed in the hope that it will be useful,
550 * but WITHOUT ANY WARRANTY; without even the implied warranty of
551 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
552 * GNU General Public License for more details.
553 *
554 * You should have received a copy of the GNU General Public License
555 * along with this program; if not, write to the Free Software
556 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
557 */
558
559#include "sconfig.tab.h"
560
561int linenum = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000562
563#define INITIAL 0
564
565#ifndef YY_NO_UNISTD_H
566/* Special case for "unistd.h", since it is non-ANSI. We include it way
567 * down here because we want the user's section 1 to have been scanned first.
568 * The user has a chance to override it with an option.
569 */
570#include <unistd.h>
571#endif
572
573#ifndef YY_EXTRA_TYPE
574#define YY_EXTRA_TYPE void *
575#endif
576
577static int yy_init_globals (void );
578
579/* Accessor methods to globals.
580 These are made visible to non-reentrant scanners for convenience. */
581
582int yylex_destroy (void );
583
584int yyget_debug (void );
585
586void yyset_debug (int debug_flag );
587
588YY_EXTRA_TYPE yyget_extra (void );
589
590void yyset_extra (YY_EXTRA_TYPE user_defined );
591
592FILE *yyget_in (void );
593
594void yyset_in (FILE * in_str );
595
596FILE *yyget_out (void );
597
598void yyset_out (FILE * out_str );
599
600int yyget_leng (void );
601
602char *yyget_text (void );
603
604int yyget_lineno (void );
605
606void yyset_lineno (int line_number );
607
608/* Macros after this point can all be overridden by user definitions in
609 * section 1.
610 */
611
612#ifndef YY_SKIP_YYWRAP
613#ifdef __cplusplus
614extern "C" int yywrap (void );
615#else
616extern int yywrap (void );
617#endif
618#endif
619
620 static void yyunput (int c,char *buf_ptr );
Patrick Georgi8d313682010-05-05 13:12:42 +0000621
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000622#ifndef yytext_ptr
623static void yy_flex_strncpy (char *,yyconst char *,int );
624#endif
625
626#ifdef YY_NEED_STRLEN
627static int yy_flex_strlen (yyconst char * );
628#endif
629
630#ifndef YY_NO_INPUT
631
632#ifdef __cplusplus
633static int yyinput (void );
634#else
635static int input (void );
636#endif
637
638#endif
639
640/* Amount of stuff to slurp up with each read. */
641#ifndef YY_READ_BUF_SIZE
Patrick Georgi8d313682010-05-05 13:12:42 +0000642#ifdef __ia64__
643/* On IA-64, the buffer size is 16k, not 8k */
644#define YY_READ_BUF_SIZE 16384
645#else
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000646#define YY_READ_BUF_SIZE 8192
Patrick Georgi8d313682010-05-05 13:12:42 +0000647#endif /* __ia64__ */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000648#endif
649
650/* Copy whatever the last rule matched to the standard output. */
651#ifndef ECHO
652/* This used to be an fputs(), but since the string might contain NUL's,
653 * we now use fwrite().
654 */
Patrick Georgi8d313682010-05-05 13:12:42 +0000655#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000656#endif
657
658/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
659 * is returned in "result".
660 */
661#ifndef YY_INPUT
662#define YY_INPUT(buf,result,max_size) \
663 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
664 { \
665 int c = '*'; \
Patrick Georgi8d313682010-05-05 13:12:42 +0000666 size_t n; \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000667 for ( n = 0; n < max_size && \
668 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
669 buf[n] = (char) c; \
670 if ( c == '\n' ) \
671 buf[n++] = (char) c; \
672 if ( c == EOF && ferror( yyin ) ) \
673 YY_FATAL_ERROR( "input in flex scanner failed" ); \
674 result = n; \
675 } \
676 else \
677 { \
678 errno=0; \
679 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
680 { \
681 if( errno != EINTR) \
682 { \
683 YY_FATAL_ERROR( "input in flex scanner failed" ); \
684 break; \
685 } \
686 errno=0; \
687 clearerr(yyin); \
688 } \
689 }\
690\
691
692#endif
693
694/* No semi-colon after return; correct usage is to write "yyterminate();" -
695 * we don't want an extra ';' after the "return" because that will cause
696 * some compilers to complain about unreachable statements.
697 */
698#ifndef yyterminate
699#define yyterminate() return YY_NULL
700#endif
701
702/* Number of entries by which start-condition stack grows. */
703#ifndef YY_START_STACK_INCR
704#define YY_START_STACK_INCR 25
705#endif
706
707/* Report a fatal error. */
708#ifndef YY_FATAL_ERROR
709#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
710#endif
711
712/* end tables serialization structures and prototypes */
713
714/* Default declaration of generated scanner - a define so the user can
715 * easily add parameters.
716 */
717#ifndef YY_DECL
718#define YY_DECL_IS_OURS 1
719
720extern int yylex (void);
721
722#define YY_DECL int yylex (void)
723#endif /* !YY_DECL */
724
725/* Code executed at the beginning of each rule, after yytext and yyleng
726 * have been set up.
727 */
728#ifndef YY_USER_ACTION
729#define YY_USER_ACTION
730#endif
731
732/* Code executed at the end of each rule. */
733#ifndef YY_BREAK
734#define YY_BREAK break;
735#endif
736
737#define YY_RULE_SETUP \
738 YY_USER_ACTION
739
740/** The main scanner function which does all the work.
741 */
742YY_DECL
743{
744 register yy_state_type yy_current_state;
745 register char *yy_cp, *yy_bp;
746 register int yy_act;
Patrick Georgi8d313682010-05-05 13:12:42 +0000747
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000748 if ( !(yy_init) )
749 {
750 (yy_init) = 1;
751
752#ifdef YY_USER_INIT
753 YY_USER_INIT;
754#endif
755
756 if ( ! (yy_start) )
757 (yy_start) = 1; /* first start state */
758
759 if ( ! yyin )
760 yyin = stdin;
761
762 if ( ! yyout )
763 yyout = stdout;
764
765 if ( ! YY_CURRENT_BUFFER ) {
766 yyensure_buffer_stack ();
767 YY_CURRENT_BUFFER_LVALUE =
768 yy_create_buffer(yyin,YY_BUF_SIZE );
769 }
770
771 yy_load_buffer_state( );
772 }
773
774 while ( 1 ) /* loops until end-of-file is reached */
775 {
776 yy_cp = (yy_c_buf_p);
777
778 /* Support of yytext. */
779 *yy_cp = (yy_hold_char);
780
781 /* yy_bp points to the position in yy_ch_buf of the start of
782 * the current run.
783 */
784 yy_bp = yy_cp;
785
786 yy_current_state = (yy_start);
787yy_match:
788 do
789 {
790 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
791 if ( yy_accept[yy_current_state] )
792 {
793 (yy_last_accepting_state) = yy_current_state;
794 (yy_last_accepting_cpos) = yy_cp;
795 }
796 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
797 {
798 yy_current_state = (int) yy_def[yy_current_state];
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200799 if ( yy_current_state >= 112 )
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000800 yy_c = yy_meta[(unsigned int) yy_c];
801 }
802 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
803 ++yy_cp;
804 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200805 while ( yy_base[yy_current_state] != 173 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000806
807yy_find_action:
808 yy_act = yy_accept[yy_current_state];
809 if ( yy_act == 0 )
810 { /* have to back up */
811 yy_cp = (yy_last_accepting_cpos);
812 yy_current_state = (yy_last_accepting_state);
813 yy_act = yy_accept[yy_current_state];
814 }
815
816 YY_DO_BEFORE_ACTION;
817
818do_action: /* This label is used only to access EOF actions. */
819
820 switch ( yy_act )
821 { /* beginning of action switch */
822 case 0: /* must back up */
823 /* undo the effects of YY_DO_BEFORE_ACTION */
824 *yy_cp = (yy_hold_char);
825 yy_cp = (yy_last_accepting_cpos);
826 yy_current_state = (yy_last_accepting_state);
827 goto yy_find_action;
828
829case 1:
830YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000831{}
832 YY_BREAK
833case 2:
834/* rule 2 can match eol */
835YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000836{linenum++;}
837 YY_BREAK
838case 3:
839/* rule 3 can match eol */
840YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000841{linenum++;}
842 YY_BREAK
843case 4:
844YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000845{return(CHIP);}
846 YY_BREAK
847case 5:
848YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000849{return(DEVICE);}
850 YY_BREAK
851case 6:
852YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000853{return(REGISTER);}
854 YY_BREAK
855case 7:
856YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000857{yylval.number=1; return(BOOL);}
858 YY_BREAK
859case 8:
860YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000861{yylval.number=0; return(BOOL);}
862 YY_BREAK
863case 9:
864YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000865{yylval.number=PCI; return(BUS);}
866 YY_BREAK
867case 10:
868YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200869{yylval.number=IOAPIC; return(BUS);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000870 YY_BREAK
871case 11:
872YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200873{yylval.number=PNP; return(BUS);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000874 YY_BREAK
875case 12:
876YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200877{yylval.number=I2C; return(BUS);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000878 YY_BREAK
879case 13:
880YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200881{yylval.number=APIC; return(BUS);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000882 YY_BREAK
883case 14:
884YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200885{yylval.number=APIC_CLUSTER; return(BUS);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000886 YY_BREAK
887case 15:
888YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200889{yylval.number=PCI_DOMAIN; return(BUS);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000890 YY_BREAK
891case 16:
892YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200893{yylval.number=IRQ; return(RESOURCE);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000894 YY_BREAK
895case 17:
896YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200897{yylval.number=DRQ; return(RESOURCE);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000898 YY_BREAK
899case 18:
900YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200901{yylval.number=IO; return(RESOURCE);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000902 YY_BREAK
903case 19:
904YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200905{return(IOAPIC_IRQ);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000906 YY_BREAK
907case 20:
908YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200909{return(INHERIT);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000910 YY_BREAK
911case 21:
912YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200913{return(SUBSYSTEMID);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000914 YY_BREAK
915case 22:
916YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200917{return(END);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000918 YY_BREAK
919case 23:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000920YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200921{return(EQUALS);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000922 YY_BREAK
923case 24:
924YY_RULE_SETUP
Sven Schnelle750edfd2011-03-01 21:43:57 +0000925{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000926 YY_BREAK
927case 25:
Sven Schnelle750edfd2011-03-01 21:43:57 +0000928YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200929{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
Sven Schnelle750edfd2011-03-01 21:43:57 +0000930 YY_BREAK
931case 26:
932YY_RULE_SETUP
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200933{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
Sven Schnelle750edfd2011-03-01 21:43:57 +0000934 YY_BREAK
935case 27:
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200936/* rule 27 can match eol */
937YY_RULE_SETUP
938{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
939 YY_BREAK
940case 28:
941YY_RULE_SETUP
942{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
943 YY_BREAK
944case 29:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000945YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000946ECHO;
947 YY_BREAK
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000948case YY_STATE_EOF(INITIAL):
949 yyterminate();
950
951 case YY_END_OF_BUFFER:
952 {
953 /* Amount of text matched not including the EOB char. */
954 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
955
956 /* Undo the effects of YY_DO_BEFORE_ACTION. */
957 *yy_cp = (yy_hold_char);
958 YY_RESTORE_YY_MORE_OFFSET
959
960 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
961 {
962 /* We're scanning a new file or input source. It's
963 * possible that this happened because the user
964 * just pointed yyin at a new source and called
965 * yylex(). If so, then we have to assure
966 * consistency between YY_CURRENT_BUFFER and our
967 * globals. Here is the right place to do so, because
968 * this is the first action (other than possibly a
969 * back-up) that will match for the new input source.
970 */
971 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
972 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
973 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
974 }
975
976 /* Note that here we test for yy_c_buf_p "<=" to the position
977 * of the first EOB in the buffer, since yy_c_buf_p will
978 * already have been incremented past the NUL character
979 * (since all states make transitions on EOB to the
980 * end-of-buffer state). Contrast this with the test
981 * in input().
982 */
983 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
984 { /* This was really a NUL. */
985 yy_state_type yy_next_state;
986
987 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
988
989 yy_current_state = yy_get_previous_state( );
990
991 /* Okay, we're now positioned to make the NUL
992 * transition. We couldn't have
993 * yy_get_previous_state() go ahead and do it
994 * for us because it doesn't know how to deal
995 * with the possibility of jamming (and we don't
996 * want to build jamming into it because then it
997 * will run more slowly).
998 */
999
1000 yy_next_state = yy_try_NUL_trans( yy_current_state );
1001
1002 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1003
1004 if ( yy_next_state )
1005 {
1006 /* Consume the NUL. */
1007 yy_cp = ++(yy_c_buf_p);
1008 yy_current_state = yy_next_state;
1009 goto yy_match;
1010 }
1011
1012 else
1013 {
1014 yy_cp = (yy_c_buf_p);
1015 goto yy_find_action;
1016 }
1017 }
1018
1019 else switch ( yy_get_next_buffer( ) )
1020 {
1021 case EOB_ACT_END_OF_FILE:
1022 {
1023 (yy_did_buffer_switch_on_eof) = 0;
1024
1025 if ( yywrap( ) )
1026 {
1027 /* Note: because we've taken care in
1028 * yy_get_next_buffer() to have set up
1029 * yytext, we can now set up
1030 * yy_c_buf_p so that if some total
1031 * hoser (like flex itself) wants to
1032 * call the scanner after we return the
1033 * YY_NULL, it'll still work - another
1034 * YY_NULL will get returned.
1035 */
1036 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1037
1038 yy_act = YY_STATE_EOF(YY_START);
1039 goto do_action;
1040 }
1041
1042 else
1043 {
1044 if ( ! (yy_did_buffer_switch_on_eof) )
1045 YY_NEW_FILE;
1046 }
1047 break;
1048 }
1049
1050 case EOB_ACT_CONTINUE_SCAN:
1051 (yy_c_buf_p) =
1052 (yytext_ptr) + yy_amount_of_matched_text;
1053
1054 yy_current_state = yy_get_previous_state( );
1055
1056 yy_cp = (yy_c_buf_p);
1057 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1058 goto yy_match;
1059
1060 case EOB_ACT_LAST_MATCH:
1061 (yy_c_buf_p) =
1062 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1063
1064 yy_current_state = yy_get_previous_state( );
1065
1066 yy_cp = (yy_c_buf_p);
1067 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1068 goto yy_find_action;
1069 }
1070 break;
1071 }
1072
1073 default:
1074 YY_FATAL_ERROR(
1075 "fatal flex scanner internal error--no action found" );
1076 } /* end of action switch */
1077 } /* end of scanning one token */
1078} /* end of yylex */
1079
1080/* yy_get_next_buffer - try to read in a new buffer
1081 *
1082 * Returns a code representing an action:
1083 * EOB_ACT_LAST_MATCH -
1084 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1085 * EOB_ACT_END_OF_FILE - end of file
1086 */
1087static int yy_get_next_buffer (void)
1088{
1089 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1090 register char *source = (yytext_ptr);
1091 register int number_to_move, i;
1092 int ret_val;
1093
1094 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1095 YY_FATAL_ERROR(
1096 "fatal flex scanner internal error--end of buffer missed" );
1097
1098 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1099 { /* Don't try to fill the buffer, so this is an EOF. */
1100 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1101 {
1102 /* We matched a single character, the EOB, so
1103 * treat this as a final EOF.
1104 */
1105 return EOB_ACT_END_OF_FILE;
1106 }
1107
1108 else
1109 {
1110 /* We matched some text prior to the EOB, first
1111 * process it.
1112 */
1113 return EOB_ACT_LAST_MATCH;
1114 }
1115 }
1116
1117 /* Try to read more data. */
1118
1119 /* First move last chars to start of buffer. */
1120 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1121
1122 for ( i = 0; i < number_to_move; ++i )
1123 *(dest++) = *(source++);
1124
1125 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1126 /* don't do the read, it's not guaranteed to return an EOF,
1127 * just force an EOF
1128 */
1129 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1130
1131 else
1132 {
1133 int num_to_read =
1134 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1135
1136 while ( num_to_read <= 0 )
1137 { /* Not enough room in the buffer - grow it. */
1138
1139 /* just a shorter name for the current buffer */
1140 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1141
1142 int yy_c_buf_p_offset =
1143 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1144
1145 if ( b->yy_is_our_buffer )
1146 {
1147 int new_size = b->yy_buf_size * 2;
1148
1149 if ( new_size <= 0 )
1150 b->yy_buf_size += b->yy_buf_size / 8;
1151 else
1152 b->yy_buf_size *= 2;
1153
1154 b->yy_ch_buf = (char *)
1155 /* Include room in for 2 EOB chars. */
1156 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1157 }
1158 else
1159 /* Can't grow it, we don't own it. */
1160 b->yy_ch_buf = 0;
1161
1162 if ( ! b->yy_ch_buf )
1163 YY_FATAL_ERROR(
1164 "fatal error - scanner input buffer overflow" );
1165
1166 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1167
1168 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1169 number_to_move - 1;
1170
1171 }
1172
1173 if ( num_to_read > YY_READ_BUF_SIZE )
1174 num_to_read = YY_READ_BUF_SIZE;
1175
1176 /* Read in more data. */
1177 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1178 (yy_n_chars), (size_t) num_to_read );
1179
1180 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1181 }
1182
1183 if ( (yy_n_chars) == 0 )
1184 {
1185 if ( number_to_move == YY_MORE_ADJ )
1186 {
1187 ret_val = EOB_ACT_END_OF_FILE;
1188 yyrestart(yyin );
1189 }
1190
1191 else
1192 {
1193 ret_val = EOB_ACT_LAST_MATCH;
1194 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1195 YY_BUFFER_EOF_PENDING;
1196 }
1197 }
1198
1199 else
1200 ret_val = EOB_ACT_CONTINUE_SCAN;
1201
1202 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1203 /* Extend the array by 50%, plus the number we really need. */
1204 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1205 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1206 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1207 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1208 }
1209
1210 (yy_n_chars) += number_to_move;
1211 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1212 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1213
1214 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1215
1216 return ret_val;
1217}
1218
1219/* yy_get_previous_state - get the state just before the EOB char was reached */
1220
1221 static yy_state_type yy_get_previous_state (void)
1222{
1223 register yy_state_type yy_current_state;
1224 register char *yy_cp;
Patrick Georgi8d313682010-05-05 13:12:42 +00001225
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001226 yy_current_state = (yy_start);
1227
1228 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1229 {
1230 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1231 if ( yy_accept[yy_current_state] )
1232 {
1233 (yy_last_accepting_state) = yy_current_state;
1234 (yy_last_accepting_cpos) = yy_cp;
1235 }
1236 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1237 {
1238 yy_current_state = (int) yy_def[yy_current_state];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001239 if ( yy_current_state >= 112 )
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001240 yy_c = yy_meta[(unsigned int) yy_c];
1241 }
1242 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1243 }
1244
1245 return yy_current_state;
1246}
1247
1248/* yy_try_NUL_trans - try to make a transition on the NUL character
1249 *
1250 * synopsis
1251 * next_state = yy_try_NUL_trans( current_state );
1252 */
1253 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1254{
1255 register int yy_is_jam;
1256 register char *yy_cp = (yy_c_buf_p);
1257
1258 register YY_CHAR yy_c = 1;
1259 if ( yy_accept[yy_current_state] )
1260 {
1261 (yy_last_accepting_state) = yy_current_state;
1262 (yy_last_accepting_cpos) = yy_cp;
1263 }
1264 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1265 {
1266 yy_current_state = (int) yy_def[yy_current_state];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001267 if ( yy_current_state >= 112 )
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001268 yy_c = yy_meta[(unsigned int) yy_c];
1269 }
1270 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001271 yy_is_jam = (yy_current_state == 111);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001272
1273 return yy_is_jam ? 0 : yy_current_state;
1274}
1275
1276 static void yyunput (int c, register char * yy_bp )
1277{
1278 register char *yy_cp;
Patrick Georgi8d313682010-05-05 13:12:42 +00001279
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001280 yy_cp = (yy_c_buf_p);
1281
1282 /* undo effects of setting up yytext */
1283 *yy_cp = (yy_hold_char);
1284
1285 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1286 { /* need to shift things up to make room */
1287 /* +2 for EOB chars. */
1288 register int number_to_move = (yy_n_chars) + 2;
1289 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1290 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1291 register char *source =
1292 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1293
1294 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1295 *--dest = *--source;
1296
1297 yy_cp += (int) (dest - source);
1298 yy_bp += (int) (dest - source);
1299 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1300 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1301
1302 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1303 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1304 }
1305
1306 *--yy_cp = (char) c;
1307
1308 (yytext_ptr) = yy_bp;
1309 (yy_hold_char) = *yy_cp;
1310 (yy_c_buf_p) = yy_cp;
1311}
1312
1313#ifndef YY_NO_INPUT
1314#ifdef __cplusplus
1315 static int yyinput (void)
1316#else
1317 static int input (void)
1318#endif
1319
1320{
1321 int c;
Patrick Georgi8d313682010-05-05 13:12:42 +00001322
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001323 *(yy_c_buf_p) = (yy_hold_char);
1324
1325 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1326 {
1327 /* yy_c_buf_p now points to the character we want to return.
1328 * If this occurs *before* the EOB characters, then it's a
1329 * valid NUL; if not, then we've hit the end of the buffer.
1330 */
1331 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1332 /* This was really a NUL. */
1333 *(yy_c_buf_p) = '\0';
1334
1335 else
1336 { /* need more input */
1337 int offset = (yy_c_buf_p) - (yytext_ptr);
1338 ++(yy_c_buf_p);
1339
1340 switch ( yy_get_next_buffer( ) )
1341 {
1342 case EOB_ACT_LAST_MATCH:
1343 /* This happens because yy_g_n_b()
1344 * sees that we've accumulated a
1345 * token and flags that we need to
1346 * try matching the token before
1347 * proceeding. But for input(),
1348 * there's no matching to consider.
1349 * So convert the EOB_ACT_LAST_MATCH
1350 * to EOB_ACT_END_OF_FILE.
1351 */
1352
1353 /* Reset buffer status. */
1354 yyrestart(yyin );
1355
1356 /*FALLTHROUGH*/
1357
1358 case EOB_ACT_END_OF_FILE:
1359 {
1360 if ( yywrap( ) )
1361 return EOF;
1362
1363 if ( ! (yy_did_buffer_switch_on_eof) )
1364 YY_NEW_FILE;
1365#ifdef __cplusplus
1366 return yyinput();
1367#else
1368 return input();
1369#endif
1370 }
1371
1372 case EOB_ACT_CONTINUE_SCAN:
1373 (yy_c_buf_p) = (yytext_ptr) + offset;
1374 break;
1375 }
1376 }
1377 }
1378
1379 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1380 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1381 (yy_hold_char) = *++(yy_c_buf_p);
1382
1383 return c;
1384}
1385#endif /* ifndef YY_NO_INPUT */
1386
1387/** Immediately switch to a different input stream.
1388 * @param input_file A readable stream.
Patrick Georgi8d313682010-05-05 13:12:42 +00001389 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001390 * @note This function does not reset the start condition to @c INITIAL .
1391 */
1392 void yyrestart (FILE * input_file )
1393{
Patrick Georgi8d313682010-05-05 13:12:42 +00001394
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001395 if ( ! YY_CURRENT_BUFFER ){
1396 yyensure_buffer_stack ();
1397 YY_CURRENT_BUFFER_LVALUE =
1398 yy_create_buffer(yyin,YY_BUF_SIZE );
1399 }
1400
1401 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1402 yy_load_buffer_state( );
1403}
1404
1405/** Switch to a different input buffer.
1406 * @param new_buffer The new input buffer.
Patrick Georgi8d313682010-05-05 13:12:42 +00001407 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001408 */
1409 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1410{
Patrick Georgi8d313682010-05-05 13:12:42 +00001411
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001412 /* TODO. We should be able to replace this entire function body
1413 * with
1414 * yypop_buffer_state();
1415 * yypush_buffer_state(new_buffer);
1416 */
1417 yyensure_buffer_stack ();
1418 if ( YY_CURRENT_BUFFER == new_buffer )
1419 return;
1420
1421 if ( YY_CURRENT_BUFFER )
1422 {
1423 /* Flush out information for old buffer. */
1424 *(yy_c_buf_p) = (yy_hold_char);
1425 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1426 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1427 }
1428
1429 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1430 yy_load_buffer_state( );
1431
1432 /* We don't actually know whether we did this switch during
1433 * EOF (yywrap()) processing, but the only time this flag
1434 * is looked at is after yywrap() is called, so it's safe
1435 * to go ahead and always set it.
1436 */
1437 (yy_did_buffer_switch_on_eof) = 1;
1438}
1439
1440static void yy_load_buffer_state (void)
1441{
1442 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1443 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1444 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1445 (yy_hold_char) = *(yy_c_buf_p);
1446}
1447
1448/** Allocate and initialize an input buffer state.
1449 * @param file A readable stream.
1450 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
Patrick Georgi8d313682010-05-05 13:12:42 +00001451 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001452 * @return the allocated buffer state.
1453 */
1454 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1455{
1456 YY_BUFFER_STATE b;
Patrick Georgi8d313682010-05-05 13:12:42 +00001457
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001458 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1459 if ( ! b )
1460 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1461
1462 b->yy_buf_size = size;
1463
1464 /* yy_ch_buf has to be 2 characters longer than the size given because
1465 * we need to put in 2 end-of-buffer characters.
1466 */
1467 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1468 if ( ! b->yy_ch_buf )
1469 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1470
1471 b->yy_is_our_buffer = 1;
1472
1473 yy_init_buffer(b,file );
1474
1475 return b;
1476}
1477
1478/** Destroy the buffer.
1479 * @param b a buffer created with yy_create_buffer()
Patrick Georgi8d313682010-05-05 13:12:42 +00001480 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001481 */
1482 void yy_delete_buffer (YY_BUFFER_STATE b )
1483{
Patrick Georgi8d313682010-05-05 13:12:42 +00001484
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001485 if ( ! b )
1486 return;
1487
1488 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1489 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1490
1491 if ( b->yy_is_our_buffer )
1492 yyfree((void *) b->yy_ch_buf );
1493
1494 yyfree((void *) b );
1495}
1496
1497#ifndef __cplusplus
1498extern int isatty (int );
1499#endif /* __cplusplus */
Patrick Georgi8d313682010-05-05 13:12:42 +00001500
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001501/* Initializes or reinitializes a buffer.
1502 * This function is sometimes called more than once on the same buffer,
1503 * such as during a yyrestart() or at EOF.
1504 */
1505 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1506
1507{
1508 int oerrno = errno;
Patrick Georgi8d313682010-05-05 13:12:42 +00001509
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001510 yy_flush_buffer(b );
1511
1512 b->yy_input_file = file;
1513 b->yy_fill_buffer = 1;
1514
1515 /* If b is the current buffer, then yy_init_buffer was _probably_
1516 * called from yyrestart() or through yy_get_next_buffer.
1517 * In that case, we don't want to reset the lineno or column.
1518 */
1519 if (b != YY_CURRENT_BUFFER){
1520 b->yy_bs_lineno = 1;
1521 b->yy_bs_column = 0;
1522 }
1523
1524 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
Patrick Georgi8d313682010-05-05 13:12:42 +00001525
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001526 errno = oerrno;
1527}
1528
1529/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1530 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
Patrick Georgi8d313682010-05-05 13:12:42 +00001531 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001532 */
1533 void yy_flush_buffer (YY_BUFFER_STATE b )
1534{
1535 if ( ! b )
1536 return;
1537
1538 b->yy_n_chars = 0;
1539
1540 /* We always need two end-of-buffer characters. The first causes
1541 * a transition to the end-of-buffer state. The second causes
1542 * a jam in that state.
1543 */
1544 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1545 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1546
1547 b->yy_buf_pos = &b->yy_ch_buf[0];
1548
1549 b->yy_at_bol = 1;
1550 b->yy_buffer_status = YY_BUFFER_NEW;
1551
1552 if ( b == YY_CURRENT_BUFFER )
1553 yy_load_buffer_state( );
1554}
1555
1556/** Pushes the new state onto the stack. The new state becomes
1557 * the current state. This function will allocate the stack
1558 * if necessary.
1559 * @param new_buffer The new state.
Patrick Georgi8d313682010-05-05 13:12:42 +00001560 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001561 */
1562void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1563{
1564 if (new_buffer == NULL)
1565 return;
1566
1567 yyensure_buffer_stack();
1568
1569 /* This block is copied from yy_switch_to_buffer. */
1570 if ( YY_CURRENT_BUFFER )
1571 {
1572 /* Flush out information for old buffer. */
1573 *(yy_c_buf_p) = (yy_hold_char);
1574 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1575 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1576 }
1577
1578 /* Only push if top exists. Otherwise, replace top. */
1579 if (YY_CURRENT_BUFFER)
1580 (yy_buffer_stack_top)++;
1581 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1582
1583 /* copied from yy_switch_to_buffer. */
1584 yy_load_buffer_state( );
1585 (yy_did_buffer_switch_on_eof) = 1;
1586}
1587
1588/** Removes and deletes the top of the stack, if present.
1589 * The next element becomes the new top.
Patrick Georgi8d313682010-05-05 13:12:42 +00001590 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001591 */
1592void yypop_buffer_state (void)
1593{
1594 if (!YY_CURRENT_BUFFER)
1595 return;
1596
1597 yy_delete_buffer(YY_CURRENT_BUFFER );
1598 YY_CURRENT_BUFFER_LVALUE = NULL;
1599 if ((yy_buffer_stack_top) > 0)
1600 --(yy_buffer_stack_top);
1601
1602 if (YY_CURRENT_BUFFER) {
1603 yy_load_buffer_state( );
1604 (yy_did_buffer_switch_on_eof) = 1;
1605 }
1606}
1607
1608/* Allocates the stack if it does not exist.
1609 * Guarantees space for at least one push.
1610 */
1611static void yyensure_buffer_stack (void)
1612{
1613 int num_to_alloc;
Patrick Georgi8d313682010-05-05 13:12:42 +00001614
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001615 if (!(yy_buffer_stack)) {
1616
1617 /* First allocation is just for 2 elements, since we don't know if this
1618 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1619 * immediate realloc on the next call.
1620 */
1621 num_to_alloc = 1;
1622 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1623 (num_to_alloc * sizeof(struct yy_buffer_state*)
1624 );
1625 if ( ! (yy_buffer_stack) )
1626 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
Patrick Georgi8d313682010-05-05 13:12:42 +00001627
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001628 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
Patrick Georgi8d313682010-05-05 13:12:42 +00001629
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001630 (yy_buffer_stack_max) = num_to_alloc;
1631 (yy_buffer_stack_top) = 0;
1632 return;
1633 }
1634
1635 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1636
1637 /* Increase the buffer to prepare for a possible push. */
1638 int grow_size = 8 /* arbitrary grow size */;
1639
1640 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1641 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1642 ((yy_buffer_stack),
1643 num_to_alloc * sizeof(struct yy_buffer_state*)
1644 );
1645 if ( ! (yy_buffer_stack) )
1646 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1647
1648 /* zero only the new slots.*/
1649 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1650 (yy_buffer_stack_max) = num_to_alloc;
1651 }
1652}
1653
1654/** Setup the input buffer state to scan directly from a user-specified character buffer.
1655 * @param base the character buffer
1656 * @param size the size in bytes of the character buffer
Patrick Georgi8d313682010-05-05 13:12:42 +00001657 *
1658 * @return the newly allocated buffer state object.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001659 */
1660YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1661{
1662 YY_BUFFER_STATE b;
Patrick Georgi8d313682010-05-05 13:12:42 +00001663
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001664 if ( size < 2 ||
1665 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1666 base[size-1] != YY_END_OF_BUFFER_CHAR )
1667 /* They forgot to leave room for the EOB's. */
1668 return 0;
1669
1670 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1671 if ( ! b )
1672 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1673
1674 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1675 b->yy_buf_pos = b->yy_ch_buf = base;
1676 b->yy_is_our_buffer = 0;
1677 b->yy_input_file = 0;
1678 b->yy_n_chars = b->yy_buf_size;
1679 b->yy_is_interactive = 0;
1680 b->yy_at_bol = 1;
1681 b->yy_fill_buffer = 0;
1682 b->yy_buffer_status = YY_BUFFER_NEW;
1683
1684 yy_switch_to_buffer(b );
1685
1686 return b;
1687}
1688
1689/** Setup the input buffer state to scan a string. The next call to yylex() will
1690 * scan from a @e copy of @a str.
1691 * @param yystr a NUL-terminated string to scan
Patrick Georgi8d313682010-05-05 13:12:42 +00001692 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001693 * @return the newly allocated buffer state object.
1694 * @note If you want to scan bytes that may contain NUL values, then use
1695 * yy_scan_bytes() instead.
1696 */
1697YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1698{
Patrick Georgi8d313682010-05-05 13:12:42 +00001699
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001700 return yy_scan_bytes(yystr,strlen(yystr) );
1701}
1702
1703/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1704 * scan from a @e copy of @a bytes.
Patrick Georgi8d313682010-05-05 13:12:42 +00001705 * @param yybytes the byte buffer to scan
1706 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1707 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001708 * @return the newly allocated buffer state object.
1709 */
1710YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1711{
1712 YY_BUFFER_STATE b;
1713 char *buf;
1714 yy_size_t n;
1715 int i;
Patrick Georgi8d313682010-05-05 13:12:42 +00001716
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001717 /* Get memory for full buffer, including space for trailing EOB's. */
1718 n = _yybytes_len + 2;
1719 buf = (char *) yyalloc(n );
1720 if ( ! buf )
1721 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1722
1723 for ( i = 0; i < _yybytes_len; ++i )
1724 buf[i] = yybytes[i];
1725
1726 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1727
1728 b = yy_scan_buffer(buf,n );
1729 if ( ! b )
1730 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1731
1732 /* It's okay to grow etc. this buffer, and we should throw it
1733 * away when we're done.
1734 */
1735 b->yy_is_our_buffer = 1;
1736
1737 return b;
1738}
1739
1740#ifndef YY_EXIT_FAILURE
1741#define YY_EXIT_FAILURE 2
1742#endif
1743
1744static void yy_fatal_error (yyconst char* msg )
1745{
1746 (void) fprintf( stderr, "%s\n", msg );
1747 exit( YY_EXIT_FAILURE );
1748}
1749
1750/* Redefine yyless() so it works in section 3 code. */
1751
1752#undef yyless
1753#define yyless(n) \
1754 do \
1755 { \
1756 /* Undo effects of setting up yytext. */ \
1757 int yyless_macro_arg = (n); \
1758 YY_LESS_LINENO(yyless_macro_arg);\
1759 yytext[yyleng] = (yy_hold_char); \
1760 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1761 (yy_hold_char) = *(yy_c_buf_p); \
1762 *(yy_c_buf_p) = '\0'; \
1763 yyleng = yyless_macro_arg; \
1764 } \
1765 while ( 0 )
1766
1767/* Accessor methods (get/set functions) to struct members. */
1768
1769/** Get the current line number.
Patrick Georgi8d313682010-05-05 13:12:42 +00001770 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001771 */
1772int yyget_lineno (void)
1773{
Patrick Georgi8d313682010-05-05 13:12:42 +00001774
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001775 return yylineno;
1776}
1777
1778/** Get the input stream.
Patrick Georgi8d313682010-05-05 13:12:42 +00001779 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001780 */
1781FILE *yyget_in (void)
1782{
1783 return yyin;
1784}
1785
1786/** Get the output stream.
Patrick Georgi8d313682010-05-05 13:12:42 +00001787 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001788 */
1789FILE *yyget_out (void)
1790{
1791 return yyout;
1792}
1793
1794/** Get the length of the current token.
Patrick Georgi8d313682010-05-05 13:12:42 +00001795 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001796 */
1797int yyget_leng (void)
1798{
1799 return yyleng;
1800}
1801
1802/** Get the current token.
Patrick Georgi8d313682010-05-05 13:12:42 +00001803 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001804 */
1805
1806char *yyget_text (void)
1807{
1808 return yytext;
1809}
1810
1811/** Set the current line number.
1812 * @param line_number
Patrick Georgi8d313682010-05-05 13:12:42 +00001813 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001814 */
1815void yyset_lineno (int line_number )
1816{
Patrick Georgi8d313682010-05-05 13:12:42 +00001817
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001818 yylineno = line_number;
1819}
1820
1821/** Set the input stream. This does not discard the current
1822 * input buffer.
1823 * @param in_str A readable stream.
Patrick Georgi8d313682010-05-05 13:12:42 +00001824 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001825 * @see yy_switch_to_buffer
1826 */
1827void yyset_in (FILE * in_str )
1828{
1829 yyin = in_str ;
1830}
1831
1832void yyset_out (FILE * out_str )
1833{
1834 yyout = out_str ;
1835}
1836
1837int yyget_debug (void)
1838{
1839 return yy_flex_debug;
1840}
1841
1842void yyset_debug (int bdebug )
1843{
1844 yy_flex_debug = bdebug ;
1845}
1846
1847static int yy_init_globals (void)
1848{
1849 /* Initialization is the same as for the non-reentrant scanner.
1850 * This function is called from yylex_destroy(), so don't allocate here.
1851 */
1852
1853 (yy_buffer_stack) = 0;
1854 (yy_buffer_stack_top) = 0;
1855 (yy_buffer_stack_max) = 0;
1856 (yy_c_buf_p) = (char *) 0;
1857 (yy_init) = 0;
1858 (yy_start) = 0;
1859
1860/* Defined in main.c */
1861#ifdef YY_STDINIT
1862 yyin = stdin;
1863 yyout = stdout;
1864#else
1865 yyin = (FILE *) 0;
1866 yyout = (FILE *) 0;
1867#endif
1868
1869 /* For future reference: Set errno on error, since we are called by
1870 * yylex_init()
1871 */
1872 return 0;
1873}
1874
1875/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1876int yylex_destroy (void)
1877{
Patrick Georgi8d313682010-05-05 13:12:42 +00001878
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001879 /* Pop the buffer stack, destroying each element. */
1880 while(YY_CURRENT_BUFFER){
1881 yy_delete_buffer(YY_CURRENT_BUFFER );
1882 YY_CURRENT_BUFFER_LVALUE = NULL;
1883 yypop_buffer_state();
1884 }
1885
1886 /* Destroy the stack itself. */
1887 yyfree((yy_buffer_stack) );
1888 (yy_buffer_stack) = NULL;
1889
1890 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1891 * yylex() is called, initialization will occur. */
1892 yy_init_globals( );
1893
1894 return 0;
1895}
1896
1897/*
1898 * Internal utility routines.
1899 */
1900
1901#ifndef yytext_ptr
1902static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1903{
1904 register int i;
1905 for ( i = 0; i < n; ++i )
1906 s1[i] = s2[i];
1907}
1908#endif
1909
1910#ifdef YY_NEED_STRLEN
1911static int yy_flex_strlen (yyconst char * s )
1912{
1913 register int n;
1914 for ( n = 0; s[n]; ++n )
1915 ;
1916
1917 return n;
1918}
1919#endif
1920
1921void *yyalloc (yy_size_t size )
1922{
1923 return (void *) malloc( size );
1924}
1925
1926void *yyrealloc (void * ptr, yy_size_t size )
1927{
1928 /* The cast to (char *) in the following accommodates both
1929 * implementations that use char* generic pointers, and those
1930 * that use void* generic pointers. It works with the latter
1931 * because both ANSI C and C++ allow castless assignment from
1932 * any pointer type to void*, and deal with argument conversions
1933 * as though doing an assignment.
1934 */
1935 return (void *) realloc( (char *) ptr, size );
1936}
1937
1938void yyfree (void * ptr )
1939{
1940 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1941}
1942
1943#define YYTABLES_NAME "yytables"
1944