blob: 5b02db843c49ac58c6f3551d7d017a4736d3f12d [file] [log] [blame]
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001
Sven Schnelle750edfd2011-03-01 21:43:57 +00002#line 3 "/home/svens/coreboot/coreboot-svn/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 Schnelle750edfd2011-03-01 21:43:57 +0000371#define YY_NUM_RULES 27
372#define YY_END_OF_BUFFER 28
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 Schnelle750edfd2011-03-01 21:43:57 +0000380static yyconst flex_int16_t yy_accept[104] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000381 { 0,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000382 0, 0, 28, 26, 1, 3, 26, 26, 26, 23,
383 23, 21, 24, 24, 24, 24, 26, 26, 26, 26,
384 26, 26, 26, 1, 3, 26, 0, 26, 0, 2,
385 23, 24, 26, 26, 24, 26, 26, 26, 26, 17,
386 26, 26, 26, 7, 26, 26, 26, 26, 25, 25,
387 22, 26, 26, 16, 20, 11, 26, 15, 26, 8,
388 9, 10, 26, 26, 4, 26, 26, 26, 26, 26,
389 26, 26, 26, 12, 26, 26, 26, 5, 26, 26,
390 26, 26, 26, 18, 26, 26, 26, 26, 26, 26,
391 6, 26, 26, 26, 26, 26, 14, 26, 26, 19,
392
393 26, 13, 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000394 } ;
395
396static yyconst flex_int32_t yy_ec[256] =
397 { 0,
398 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
399 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 7, 1, 8, 7, 9,
403 7, 7, 7, 7, 7, 7, 7, 1, 1, 1,
404 10, 1, 1, 1, 11, 11, 11, 11, 11, 11,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000407 1, 1, 1, 1, 12, 1, 13, 14, 15, 16,
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000408
Sven Schnelle750edfd2011-03-01 21:43:57 +0000409 17, 18, 19, 20, 21, 1, 1, 22, 23, 24,
410 25, 26, 27, 28, 29, 30, 31, 32, 1, 33,
411 34, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 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
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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
426 } ;
427
Sven Schnelle750edfd2011-03-01 21:43:57 +0000428static yyconst flex_int32_t yy_meta[35] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000429 { 0,
430 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000433 1, 1, 1, 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000434 } ;
435
Sven Schnelle750edfd2011-03-01 21:43:57 +0000436static yyconst flex_int16_t yy_base[109] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000437 { 0,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000438 0, 0, 164, 0, 161, 165, 159, 33, 37, 34,
439 128, 0, 46, 49, 53, 56, 50, 147, 48, 22,
440 142, 127, 0, 155, 165, 74, 151, 65, 152, 165,
441 0, 75, 78, 133, 90, 126, 136, 136, 130, 0,
442 122, 122, 129, 0, 125, 119, 125, 129, 0, 165,
443 0, 116, 120, 0, 0, 0, 123, 0, 118, 0,
444 126, 0, 116, 107, 0, 120, 106, 118, 116, 102,
445 87, 103, 98, 106, 92, 86, 86, 0, 84, 98,
446 89, 94, 80, 0, 87, 95, 79, 89, 74, 83,
447 0, 80, 73, 77, 79, 60, 0, 72, 56, 0,
Patrick Georgi8d313682010-05-05 13:12:42 +0000448
Sven Schnelle750edfd2011-03-01 21:43:57 +0000449 43, 0, 165, 43, 122, 124, 126, 128
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000450 } ;
451
Sven Schnelle750edfd2011-03-01 21:43:57 +0000452static yyconst flex_int16_t yy_def[109] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000453 { 0,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000454 103, 1, 103, 104, 103, 103, 104, 105, 106, 104,
455 10, 104, 10, 10, 10, 10, 104, 104, 104, 104,
456 104, 104, 104, 103, 103, 105, 107, 106, 108, 103,
457 10, 10, 10, 104, 10, 104, 104, 104, 104, 104,
458 104, 104, 104, 104, 104, 104, 104, 104, 104, 103,
459 33, 104, 104, 104, 104, 104, 104, 104, 104, 104,
460 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
461 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
462 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
463 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
Patrick Georgi8d313682010-05-05 13:12:42 +0000464
Sven Schnelle750edfd2011-03-01 21:43:57 +0000465 104, 104, 0, 103, 103, 103, 103, 103
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000466 } ;
467
Sven Schnelle750edfd2011-03-01 21:43:57 +0000468static yyconst flex_int16_t yy_nxt[200] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000469 { 0,
470 4, 5, 6, 7, 8, 9, 10, 11, 10, 12,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000471 13, 4, 13, 13, 14, 15, 16, 13, 4, 4,
472 17, 18, 4, 4, 19, 20, 4, 21, 22, 4,
473 4, 4, 4, 4, 27, 27, 45, 23, 29, 30,
474 31, 31, 31, 23, 32, 46, 32, 32, 32, 32,
475 32, 32, 32, 32, 32, 32, 32, 32, 38, 32,
476 32, 32, 32, 32, 32, 43, 29, 30, 34, 35,
477 102, 44, 101, 39, 40, 27, 27, 41, 49, 37,
478 36, 32, 32, 32, 51, 51, 51, 100, 51, 99,
479 51, 51, 51, 51, 51, 51, 32, 32, 32, 98,
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000480
Sven Schnelle750edfd2011-03-01 21:43:57 +0000481 97, 96, 95, 94, 93, 92, 91, 90, 89, 88,
482 87, 86, 85, 84, 83, 82, 81, 80, 79, 78,
483 77, 53, 26, 26, 28, 28, 27, 27, 29, 29,
484 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
485 66, 65, 64, 63, 62, 61, 60, 59, 58, 57,
486 56, 55, 54, 52, 30, 50, 24, 48, 47, 42,
487 33, 25, 24, 103, 3, 103, 103, 103, 103, 103,
488 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
489 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
490 103, 103, 103, 103, 103, 103, 103, 103, 103
491
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000492 } ;
493
Sven Schnelle750edfd2011-03-01 21:43:57 +0000494static yyconst flex_int16_t yy_chk[200] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000495 { 0,
496 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
497 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
498 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Sven Schnelle750edfd2011-03-01 21:43:57 +0000499 1, 1, 1, 1, 8, 8, 20, 8, 9, 9,
500 10, 10, 10, 104, 10, 20, 10, 10, 10, 10,
501 10, 10, 13, 13, 13, 14, 14, 14, 17, 15,
502 15, 15, 16, 16, 16, 19, 28, 28, 14, 15,
503 101, 19, 99, 17, 17, 26, 26, 17, 26, 16,
504 15, 32, 32, 32, 33, 33, 33, 98, 33, 96,
505 33, 33, 33, 33, 33, 33, 35, 35, 35, 95,
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000506
Sven Schnelle750edfd2011-03-01 21:43:57 +0000507 94, 93, 92, 90, 89, 88, 87, 86, 85, 83,
508 82, 81, 80, 79, 77, 76, 75, 74, 73, 72,
509 71, 35, 105, 105, 106, 106, 107, 107, 108, 108,
510 70, 69, 68, 67, 66, 64, 63, 61, 59, 57,
511 53, 52, 48, 47, 46, 45, 43, 42, 41, 39,
512 38, 37, 36, 34, 29, 27, 24, 22, 21, 18,
513 11, 7, 5, 3, 103, 103, 103, 103, 103, 103,
514 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
515 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
516 103, 103, 103, 103, 103, 103, 103, 103, 103
517
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000518 } ;
519
520static yy_state_type yy_last_accepting_state;
521static char *yy_last_accepting_cpos;
522
523extern int yy_flex_debug;
524int yy_flex_debug = 0;
525
526/* The intent behind this definition is that it'll catch
527 * any uses of REJECT which flex missed.
528 */
529#define REJECT reject_used_but_not_detected
530#define yymore() yymore_used_but_not_detected
531#define YY_MORE_ADJ 0
532#define YY_RESTORE_YY_MORE_OFFSET
533char *yytext;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000534/*
535 * sconfig, coreboot device tree compiler
536 *
537 * Copyright (C) 2010 coresystems GmbH
538 * written by Patrick Georgi <patrick.georgi@coresystems.de>
539 *
540 * This program is free software; you can redistribute it and/or modify
541 * it under the terms of the GNU General Public License as published by
542 * the Free Software Foundation; version 2 of the License.
543 *
544 * This program is distributed in the hope that it will be useful,
545 * but WITHOUT ANY WARRANTY; without even the implied warranty of
546 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
547 * GNU General Public License for more details.
548 *
549 * You should have received a copy of the GNU General Public License
550 * along with this program; if not, write to the Free Software
551 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
552 */
553
554#include "sconfig.tab.h"
555
556int linenum = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000557
558#define INITIAL 0
559
560#ifndef YY_NO_UNISTD_H
561/* Special case for "unistd.h", since it is non-ANSI. We include it way
562 * down here because we want the user's section 1 to have been scanned first.
563 * The user has a chance to override it with an option.
564 */
565#include <unistd.h>
566#endif
567
568#ifndef YY_EXTRA_TYPE
569#define YY_EXTRA_TYPE void *
570#endif
571
572static int yy_init_globals (void );
573
574/* Accessor methods to globals.
575 These are made visible to non-reentrant scanners for convenience. */
576
577int yylex_destroy (void );
578
579int yyget_debug (void );
580
581void yyset_debug (int debug_flag );
582
583YY_EXTRA_TYPE yyget_extra (void );
584
585void yyset_extra (YY_EXTRA_TYPE user_defined );
586
587FILE *yyget_in (void );
588
589void yyset_in (FILE * in_str );
590
591FILE *yyget_out (void );
592
593void yyset_out (FILE * out_str );
594
595int yyget_leng (void );
596
597char *yyget_text (void );
598
599int yyget_lineno (void );
600
601void yyset_lineno (int line_number );
602
603/* Macros after this point can all be overridden by user definitions in
604 * section 1.
605 */
606
607#ifndef YY_SKIP_YYWRAP
608#ifdef __cplusplus
609extern "C" int yywrap (void );
610#else
611extern int yywrap (void );
612#endif
613#endif
614
615 static void yyunput (int c,char *buf_ptr );
Patrick Georgi8d313682010-05-05 13:12:42 +0000616
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000617#ifndef yytext_ptr
618static void yy_flex_strncpy (char *,yyconst char *,int );
619#endif
620
621#ifdef YY_NEED_STRLEN
622static int yy_flex_strlen (yyconst char * );
623#endif
624
625#ifndef YY_NO_INPUT
626
627#ifdef __cplusplus
628static int yyinput (void );
629#else
630static int input (void );
631#endif
632
633#endif
634
635/* Amount of stuff to slurp up with each read. */
636#ifndef YY_READ_BUF_SIZE
Patrick Georgi8d313682010-05-05 13:12:42 +0000637#ifdef __ia64__
638/* On IA-64, the buffer size is 16k, not 8k */
639#define YY_READ_BUF_SIZE 16384
640#else
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000641#define YY_READ_BUF_SIZE 8192
Patrick Georgi8d313682010-05-05 13:12:42 +0000642#endif /* __ia64__ */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000643#endif
644
645/* Copy whatever the last rule matched to the standard output. */
646#ifndef ECHO
647/* This used to be an fputs(), but since the string might contain NUL's,
648 * we now use fwrite().
649 */
Patrick Georgi8d313682010-05-05 13:12:42 +0000650#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000651#endif
652
653/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
654 * is returned in "result".
655 */
656#ifndef YY_INPUT
657#define YY_INPUT(buf,result,max_size) \
658 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
659 { \
660 int c = '*'; \
Patrick Georgi8d313682010-05-05 13:12:42 +0000661 size_t n; \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000662 for ( n = 0; n < max_size && \
663 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
664 buf[n] = (char) c; \
665 if ( c == '\n' ) \
666 buf[n++] = (char) c; \
667 if ( c == EOF && ferror( yyin ) ) \
668 YY_FATAL_ERROR( "input in flex scanner failed" ); \
669 result = n; \
670 } \
671 else \
672 { \
673 errno=0; \
674 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
675 { \
676 if( errno != EINTR) \
677 { \
678 YY_FATAL_ERROR( "input in flex scanner failed" ); \
679 break; \
680 } \
681 errno=0; \
682 clearerr(yyin); \
683 } \
684 }\
685\
686
687#endif
688
689/* No semi-colon after return; correct usage is to write "yyterminate();" -
690 * we don't want an extra ';' after the "return" because that will cause
691 * some compilers to complain about unreachable statements.
692 */
693#ifndef yyterminate
694#define yyterminate() return YY_NULL
695#endif
696
697/* Number of entries by which start-condition stack grows. */
698#ifndef YY_START_STACK_INCR
699#define YY_START_STACK_INCR 25
700#endif
701
702/* Report a fatal error. */
703#ifndef YY_FATAL_ERROR
704#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
705#endif
706
707/* end tables serialization structures and prototypes */
708
709/* Default declaration of generated scanner - a define so the user can
710 * easily add parameters.
711 */
712#ifndef YY_DECL
713#define YY_DECL_IS_OURS 1
714
715extern int yylex (void);
716
717#define YY_DECL int yylex (void)
718#endif /* !YY_DECL */
719
720/* Code executed at the beginning of each rule, after yytext and yyleng
721 * have been set up.
722 */
723#ifndef YY_USER_ACTION
724#define YY_USER_ACTION
725#endif
726
727/* Code executed at the end of each rule. */
728#ifndef YY_BREAK
729#define YY_BREAK break;
730#endif
731
732#define YY_RULE_SETUP \
733 YY_USER_ACTION
734
735/** The main scanner function which does all the work.
736 */
737YY_DECL
738{
739 register yy_state_type yy_current_state;
740 register char *yy_cp, *yy_bp;
741 register int yy_act;
Patrick Georgi8d313682010-05-05 13:12:42 +0000742
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000743 if ( !(yy_init) )
744 {
745 (yy_init) = 1;
746
747#ifdef YY_USER_INIT
748 YY_USER_INIT;
749#endif
750
751 if ( ! (yy_start) )
752 (yy_start) = 1; /* first start state */
753
754 if ( ! yyin )
755 yyin = stdin;
756
757 if ( ! yyout )
758 yyout = stdout;
759
760 if ( ! YY_CURRENT_BUFFER ) {
761 yyensure_buffer_stack ();
762 YY_CURRENT_BUFFER_LVALUE =
763 yy_create_buffer(yyin,YY_BUF_SIZE );
764 }
765
766 yy_load_buffer_state( );
767 }
768
769 while ( 1 ) /* loops until end-of-file is reached */
770 {
771 yy_cp = (yy_c_buf_p);
772
773 /* Support of yytext. */
774 *yy_cp = (yy_hold_char);
775
776 /* yy_bp points to the position in yy_ch_buf of the start of
777 * the current run.
778 */
779 yy_bp = yy_cp;
780
781 yy_current_state = (yy_start);
782yy_match:
783 do
784 {
785 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
786 if ( yy_accept[yy_current_state] )
787 {
788 (yy_last_accepting_state) = yy_current_state;
789 (yy_last_accepting_cpos) = yy_cp;
790 }
791 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
792 {
793 yy_current_state = (int) yy_def[yy_current_state];
Sven Schnelle750edfd2011-03-01 21:43:57 +0000794 if ( yy_current_state >= 104 )
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000795 yy_c = yy_meta[(unsigned int) yy_c];
796 }
797 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
798 ++yy_cp;
799 }
Sven Schnelle750edfd2011-03-01 21:43:57 +0000800 while ( yy_base[yy_current_state] != 165 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000801
802yy_find_action:
803 yy_act = yy_accept[yy_current_state];
804 if ( yy_act == 0 )
805 { /* have to back up */
806 yy_cp = (yy_last_accepting_cpos);
807 yy_current_state = (yy_last_accepting_state);
808 yy_act = yy_accept[yy_current_state];
809 }
810
811 YY_DO_BEFORE_ACTION;
812
813do_action: /* This label is used only to access EOF actions. */
814
815 switch ( yy_act )
816 { /* beginning of action switch */
817 case 0: /* must back up */
818 /* undo the effects of YY_DO_BEFORE_ACTION */
819 *yy_cp = (yy_hold_char);
820 yy_cp = (yy_last_accepting_cpos);
821 yy_current_state = (yy_last_accepting_state);
822 goto yy_find_action;
823
824case 1:
825YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000826{}
827 YY_BREAK
828case 2:
829/* rule 2 can match eol */
830YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000831{linenum++;}
832 YY_BREAK
833case 3:
834/* rule 3 can match eol */
835YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000836{linenum++;}
837 YY_BREAK
838case 4:
839YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000840{return(CHIP);}
841 YY_BREAK
842case 5:
843YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000844{return(DEVICE);}
845 YY_BREAK
846case 6:
847YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000848{return(REGISTER);}
849 YY_BREAK
850case 7:
851YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000852{yylval.number=1; return(BOOL);}
853 YY_BREAK
854case 8:
855YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000856{yylval.number=0; return(BOOL);}
857 YY_BREAK
858case 9:
859YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000860{yylval.number=PCI; return(BUS);}
861 YY_BREAK
862case 10:
863YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000864{yylval.number=PNP; return(BUS);}
865 YY_BREAK
866case 11:
867YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000868{yylval.number=I2C; return(BUS);}
869 YY_BREAK
870case 12:
871YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000872{yylval.number=APIC; return(BUS);}
873 YY_BREAK
874case 13:
875YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000876{yylval.number=APIC_CLUSTER; return(BUS);}
877 YY_BREAK
878case 14:
879YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000880{yylval.number=PCI_DOMAIN; return(BUS);}
881 YY_BREAK
882case 15:
883YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000884{yylval.number=IRQ; return(RESOURCE);}
885 YY_BREAK
886case 16:
887YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000888{yylval.number=DRQ; return(RESOURCE);}
889 YY_BREAK
890case 17:
891YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000892{yylval.number=IO; return(RESOURCE);}
893 YY_BREAK
894case 18:
895YY_RULE_SETUP
Sven Schnelle750edfd2011-03-01 21:43:57 +0000896{return(INHERIT);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000897 YY_BREAK
898case 19:
899YY_RULE_SETUP
Sven Schnelle750edfd2011-03-01 21:43:57 +0000900{return(SUBSYSTEMID);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000901 YY_BREAK
902case 20:
903YY_RULE_SETUP
Sven Schnelle750edfd2011-03-01 21:43:57 +0000904{return(END);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000905 YY_BREAK
906case 21:
907YY_RULE_SETUP
Sven Schnelle750edfd2011-03-01 21:43:57 +0000908{return(EQUALS);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000909 YY_BREAK
910case 22:
911YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000912{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
913 YY_BREAK
914case 23:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000915YY_RULE_SETUP
Sven Schnelle750edfd2011-03-01 21:43:57 +0000916{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000917 YY_BREAK
918case 24:
919YY_RULE_SETUP
Sven Schnelle750edfd2011-03-01 21:43:57 +0000920{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000921 YY_BREAK
922case 25:
Sven Schnelle750edfd2011-03-01 21:43:57 +0000923/* rule 25 can match eol */
924YY_RULE_SETUP
925{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
926 YY_BREAK
927case 26:
928YY_RULE_SETUP
929{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
930 YY_BREAK
931case 27:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000932YY_RULE_SETUP
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000933ECHO;
934 YY_BREAK
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000935case YY_STATE_EOF(INITIAL):
936 yyterminate();
937
938 case YY_END_OF_BUFFER:
939 {
940 /* Amount of text matched not including the EOB char. */
941 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
942
943 /* Undo the effects of YY_DO_BEFORE_ACTION. */
944 *yy_cp = (yy_hold_char);
945 YY_RESTORE_YY_MORE_OFFSET
946
947 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
948 {
949 /* We're scanning a new file or input source. It's
950 * possible that this happened because the user
951 * just pointed yyin at a new source and called
952 * yylex(). If so, then we have to assure
953 * consistency between YY_CURRENT_BUFFER and our
954 * globals. Here is the right place to do so, because
955 * this is the first action (other than possibly a
956 * back-up) that will match for the new input source.
957 */
958 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
959 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
960 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
961 }
962
963 /* Note that here we test for yy_c_buf_p "<=" to the position
964 * of the first EOB in the buffer, since yy_c_buf_p will
965 * already have been incremented past the NUL character
966 * (since all states make transitions on EOB to the
967 * end-of-buffer state). Contrast this with the test
968 * in input().
969 */
970 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
971 { /* This was really a NUL. */
972 yy_state_type yy_next_state;
973
974 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
975
976 yy_current_state = yy_get_previous_state( );
977
978 /* Okay, we're now positioned to make the NUL
979 * transition. We couldn't have
980 * yy_get_previous_state() go ahead and do it
981 * for us because it doesn't know how to deal
982 * with the possibility of jamming (and we don't
983 * want to build jamming into it because then it
984 * will run more slowly).
985 */
986
987 yy_next_state = yy_try_NUL_trans( yy_current_state );
988
989 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
990
991 if ( yy_next_state )
992 {
993 /* Consume the NUL. */
994 yy_cp = ++(yy_c_buf_p);
995 yy_current_state = yy_next_state;
996 goto yy_match;
997 }
998
999 else
1000 {
1001 yy_cp = (yy_c_buf_p);
1002 goto yy_find_action;
1003 }
1004 }
1005
1006 else switch ( yy_get_next_buffer( ) )
1007 {
1008 case EOB_ACT_END_OF_FILE:
1009 {
1010 (yy_did_buffer_switch_on_eof) = 0;
1011
1012 if ( yywrap( ) )
1013 {
1014 /* Note: because we've taken care in
1015 * yy_get_next_buffer() to have set up
1016 * yytext, we can now set up
1017 * yy_c_buf_p so that if some total
1018 * hoser (like flex itself) wants to
1019 * call the scanner after we return the
1020 * YY_NULL, it'll still work - another
1021 * YY_NULL will get returned.
1022 */
1023 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1024
1025 yy_act = YY_STATE_EOF(YY_START);
1026 goto do_action;
1027 }
1028
1029 else
1030 {
1031 if ( ! (yy_did_buffer_switch_on_eof) )
1032 YY_NEW_FILE;
1033 }
1034 break;
1035 }
1036
1037 case EOB_ACT_CONTINUE_SCAN:
1038 (yy_c_buf_p) =
1039 (yytext_ptr) + yy_amount_of_matched_text;
1040
1041 yy_current_state = yy_get_previous_state( );
1042
1043 yy_cp = (yy_c_buf_p);
1044 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1045 goto yy_match;
1046
1047 case EOB_ACT_LAST_MATCH:
1048 (yy_c_buf_p) =
1049 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1050
1051 yy_current_state = yy_get_previous_state( );
1052
1053 yy_cp = (yy_c_buf_p);
1054 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1055 goto yy_find_action;
1056 }
1057 break;
1058 }
1059
1060 default:
1061 YY_FATAL_ERROR(
1062 "fatal flex scanner internal error--no action found" );
1063 } /* end of action switch */
1064 } /* end of scanning one token */
1065} /* end of yylex */
1066
1067/* yy_get_next_buffer - try to read in a new buffer
1068 *
1069 * Returns a code representing an action:
1070 * EOB_ACT_LAST_MATCH -
1071 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1072 * EOB_ACT_END_OF_FILE - end of file
1073 */
1074static int yy_get_next_buffer (void)
1075{
1076 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1077 register char *source = (yytext_ptr);
1078 register int number_to_move, i;
1079 int ret_val;
1080
1081 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1082 YY_FATAL_ERROR(
1083 "fatal flex scanner internal error--end of buffer missed" );
1084
1085 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1086 { /* Don't try to fill the buffer, so this is an EOF. */
1087 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1088 {
1089 /* We matched a single character, the EOB, so
1090 * treat this as a final EOF.
1091 */
1092 return EOB_ACT_END_OF_FILE;
1093 }
1094
1095 else
1096 {
1097 /* We matched some text prior to the EOB, first
1098 * process it.
1099 */
1100 return EOB_ACT_LAST_MATCH;
1101 }
1102 }
1103
1104 /* Try to read more data. */
1105
1106 /* First move last chars to start of buffer. */
1107 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1108
1109 for ( i = 0; i < number_to_move; ++i )
1110 *(dest++) = *(source++);
1111
1112 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1113 /* don't do the read, it's not guaranteed to return an EOF,
1114 * just force an EOF
1115 */
1116 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1117
1118 else
1119 {
1120 int num_to_read =
1121 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1122
1123 while ( num_to_read <= 0 )
1124 { /* Not enough room in the buffer - grow it. */
1125
1126 /* just a shorter name for the current buffer */
1127 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1128
1129 int yy_c_buf_p_offset =
1130 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1131
1132 if ( b->yy_is_our_buffer )
1133 {
1134 int new_size = b->yy_buf_size * 2;
1135
1136 if ( new_size <= 0 )
1137 b->yy_buf_size += b->yy_buf_size / 8;
1138 else
1139 b->yy_buf_size *= 2;
1140
1141 b->yy_ch_buf = (char *)
1142 /* Include room in for 2 EOB chars. */
1143 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1144 }
1145 else
1146 /* Can't grow it, we don't own it. */
1147 b->yy_ch_buf = 0;
1148
1149 if ( ! b->yy_ch_buf )
1150 YY_FATAL_ERROR(
1151 "fatal error - scanner input buffer overflow" );
1152
1153 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1154
1155 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1156 number_to_move - 1;
1157
1158 }
1159
1160 if ( num_to_read > YY_READ_BUF_SIZE )
1161 num_to_read = YY_READ_BUF_SIZE;
1162
1163 /* Read in more data. */
1164 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1165 (yy_n_chars), (size_t) num_to_read );
1166
1167 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1168 }
1169
1170 if ( (yy_n_chars) == 0 )
1171 {
1172 if ( number_to_move == YY_MORE_ADJ )
1173 {
1174 ret_val = EOB_ACT_END_OF_FILE;
1175 yyrestart(yyin );
1176 }
1177
1178 else
1179 {
1180 ret_val = EOB_ACT_LAST_MATCH;
1181 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1182 YY_BUFFER_EOF_PENDING;
1183 }
1184 }
1185
1186 else
1187 ret_val = EOB_ACT_CONTINUE_SCAN;
1188
1189 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1190 /* Extend the array by 50%, plus the number we really need. */
1191 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1192 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1193 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1194 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1195 }
1196
1197 (yy_n_chars) += number_to_move;
1198 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1199 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1200
1201 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1202
1203 return ret_val;
1204}
1205
1206/* yy_get_previous_state - get the state just before the EOB char was reached */
1207
1208 static yy_state_type yy_get_previous_state (void)
1209{
1210 register yy_state_type yy_current_state;
1211 register char *yy_cp;
Patrick Georgi8d313682010-05-05 13:12:42 +00001212
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001213 yy_current_state = (yy_start);
1214
1215 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1216 {
1217 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1218 if ( yy_accept[yy_current_state] )
1219 {
1220 (yy_last_accepting_state) = yy_current_state;
1221 (yy_last_accepting_cpos) = yy_cp;
1222 }
1223 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1224 {
1225 yy_current_state = (int) yy_def[yy_current_state];
Sven Schnelle750edfd2011-03-01 21:43:57 +00001226 if ( yy_current_state >= 104 )
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001227 yy_c = yy_meta[(unsigned int) yy_c];
1228 }
1229 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1230 }
1231
1232 return yy_current_state;
1233}
1234
1235/* yy_try_NUL_trans - try to make a transition on the NUL character
1236 *
1237 * synopsis
1238 * next_state = yy_try_NUL_trans( current_state );
1239 */
1240 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1241{
1242 register int yy_is_jam;
1243 register char *yy_cp = (yy_c_buf_p);
1244
1245 register YY_CHAR yy_c = 1;
1246 if ( yy_accept[yy_current_state] )
1247 {
1248 (yy_last_accepting_state) = yy_current_state;
1249 (yy_last_accepting_cpos) = yy_cp;
1250 }
1251 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1252 {
1253 yy_current_state = (int) yy_def[yy_current_state];
Sven Schnelle750edfd2011-03-01 21:43:57 +00001254 if ( yy_current_state >= 104 )
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001255 yy_c = yy_meta[(unsigned int) yy_c];
1256 }
1257 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Sven Schnelle750edfd2011-03-01 21:43:57 +00001258 yy_is_jam = (yy_current_state == 103);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001259
1260 return yy_is_jam ? 0 : yy_current_state;
1261}
1262
1263 static void yyunput (int c, register char * yy_bp )
1264{
1265 register char *yy_cp;
Patrick Georgi8d313682010-05-05 13:12:42 +00001266
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001267 yy_cp = (yy_c_buf_p);
1268
1269 /* undo effects of setting up yytext */
1270 *yy_cp = (yy_hold_char);
1271
1272 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1273 { /* need to shift things up to make room */
1274 /* +2 for EOB chars. */
1275 register int number_to_move = (yy_n_chars) + 2;
1276 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1277 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1278 register char *source =
1279 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1280
1281 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1282 *--dest = *--source;
1283
1284 yy_cp += (int) (dest - source);
1285 yy_bp += (int) (dest - source);
1286 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1287 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1288
1289 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1290 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1291 }
1292
1293 *--yy_cp = (char) c;
1294
1295 (yytext_ptr) = yy_bp;
1296 (yy_hold_char) = *yy_cp;
1297 (yy_c_buf_p) = yy_cp;
1298}
1299
1300#ifndef YY_NO_INPUT
1301#ifdef __cplusplus
1302 static int yyinput (void)
1303#else
1304 static int input (void)
1305#endif
1306
1307{
1308 int c;
Patrick Georgi8d313682010-05-05 13:12:42 +00001309
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001310 *(yy_c_buf_p) = (yy_hold_char);
1311
1312 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1313 {
1314 /* yy_c_buf_p now points to the character we want to return.
1315 * If this occurs *before* the EOB characters, then it's a
1316 * valid NUL; if not, then we've hit the end of the buffer.
1317 */
1318 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1319 /* This was really a NUL. */
1320 *(yy_c_buf_p) = '\0';
1321
1322 else
1323 { /* need more input */
1324 int offset = (yy_c_buf_p) - (yytext_ptr);
1325 ++(yy_c_buf_p);
1326
1327 switch ( yy_get_next_buffer( ) )
1328 {
1329 case EOB_ACT_LAST_MATCH:
1330 /* This happens because yy_g_n_b()
1331 * sees that we've accumulated a
1332 * token and flags that we need to
1333 * try matching the token before
1334 * proceeding. But for input(),
1335 * there's no matching to consider.
1336 * So convert the EOB_ACT_LAST_MATCH
1337 * to EOB_ACT_END_OF_FILE.
1338 */
1339
1340 /* Reset buffer status. */
1341 yyrestart(yyin );
1342
1343 /*FALLTHROUGH*/
1344
1345 case EOB_ACT_END_OF_FILE:
1346 {
1347 if ( yywrap( ) )
1348 return EOF;
1349
1350 if ( ! (yy_did_buffer_switch_on_eof) )
1351 YY_NEW_FILE;
1352#ifdef __cplusplus
1353 return yyinput();
1354#else
1355 return input();
1356#endif
1357 }
1358
1359 case EOB_ACT_CONTINUE_SCAN:
1360 (yy_c_buf_p) = (yytext_ptr) + offset;
1361 break;
1362 }
1363 }
1364 }
1365
1366 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1367 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1368 (yy_hold_char) = *++(yy_c_buf_p);
1369
1370 return c;
1371}
1372#endif /* ifndef YY_NO_INPUT */
1373
1374/** Immediately switch to a different input stream.
1375 * @param input_file A readable stream.
Patrick Georgi8d313682010-05-05 13:12:42 +00001376 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001377 * @note This function does not reset the start condition to @c INITIAL .
1378 */
1379 void yyrestart (FILE * input_file )
1380{
Patrick Georgi8d313682010-05-05 13:12:42 +00001381
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001382 if ( ! YY_CURRENT_BUFFER ){
1383 yyensure_buffer_stack ();
1384 YY_CURRENT_BUFFER_LVALUE =
1385 yy_create_buffer(yyin,YY_BUF_SIZE );
1386 }
1387
1388 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1389 yy_load_buffer_state( );
1390}
1391
1392/** Switch to a different input buffer.
1393 * @param new_buffer The new input buffer.
Patrick Georgi8d313682010-05-05 13:12:42 +00001394 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001395 */
1396 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1397{
Patrick Georgi8d313682010-05-05 13:12:42 +00001398
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001399 /* TODO. We should be able to replace this entire function body
1400 * with
1401 * yypop_buffer_state();
1402 * yypush_buffer_state(new_buffer);
1403 */
1404 yyensure_buffer_stack ();
1405 if ( YY_CURRENT_BUFFER == new_buffer )
1406 return;
1407
1408 if ( YY_CURRENT_BUFFER )
1409 {
1410 /* Flush out information for old buffer. */
1411 *(yy_c_buf_p) = (yy_hold_char);
1412 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1413 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1414 }
1415
1416 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1417 yy_load_buffer_state( );
1418
1419 /* We don't actually know whether we did this switch during
1420 * EOF (yywrap()) processing, but the only time this flag
1421 * is looked at is after yywrap() is called, so it's safe
1422 * to go ahead and always set it.
1423 */
1424 (yy_did_buffer_switch_on_eof) = 1;
1425}
1426
1427static void yy_load_buffer_state (void)
1428{
1429 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1430 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1431 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1432 (yy_hold_char) = *(yy_c_buf_p);
1433}
1434
1435/** Allocate and initialize an input buffer state.
1436 * @param file A readable stream.
1437 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
Patrick Georgi8d313682010-05-05 13:12:42 +00001438 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001439 * @return the allocated buffer state.
1440 */
1441 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1442{
1443 YY_BUFFER_STATE b;
Patrick Georgi8d313682010-05-05 13:12:42 +00001444
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001445 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1446 if ( ! b )
1447 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1448
1449 b->yy_buf_size = size;
1450
1451 /* yy_ch_buf has to be 2 characters longer than the size given because
1452 * we need to put in 2 end-of-buffer characters.
1453 */
1454 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1455 if ( ! b->yy_ch_buf )
1456 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1457
1458 b->yy_is_our_buffer = 1;
1459
1460 yy_init_buffer(b,file );
1461
1462 return b;
1463}
1464
1465/** Destroy the buffer.
1466 * @param b a buffer created with yy_create_buffer()
Patrick Georgi8d313682010-05-05 13:12:42 +00001467 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001468 */
1469 void yy_delete_buffer (YY_BUFFER_STATE b )
1470{
Patrick Georgi8d313682010-05-05 13:12:42 +00001471
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001472 if ( ! b )
1473 return;
1474
1475 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1476 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1477
1478 if ( b->yy_is_our_buffer )
1479 yyfree((void *) b->yy_ch_buf );
1480
1481 yyfree((void *) b );
1482}
1483
1484#ifndef __cplusplus
1485extern int isatty (int );
1486#endif /* __cplusplus */
Patrick Georgi8d313682010-05-05 13:12:42 +00001487
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001488/* Initializes or reinitializes a buffer.
1489 * This function is sometimes called more than once on the same buffer,
1490 * such as during a yyrestart() or at EOF.
1491 */
1492 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1493
1494{
1495 int oerrno = errno;
Patrick Georgi8d313682010-05-05 13:12:42 +00001496
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001497 yy_flush_buffer(b );
1498
1499 b->yy_input_file = file;
1500 b->yy_fill_buffer = 1;
1501
1502 /* If b is the current buffer, then yy_init_buffer was _probably_
1503 * called from yyrestart() or through yy_get_next_buffer.
1504 * In that case, we don't want to reset the lineno or column.
1505 */
1506 if (b != YY_CURRENT_BUFFER){
1507 b->yy_bs_lineno = 1;
1508 b->yy_bs_column = 0;
1509 }
1510
1511 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
Patrick Georgi8d313682010-05-05 13:12:42 +00001512
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001513 errno = oerrno;
1514}
1515
1516/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1517 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
Patrick Georgi8d313682010-05-05 13:12:42 +00001518 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001519 */
1520 void yy_flush_buffer (YY_BUFFER_STATE b )
1521{
1522 if ( ! b )
1523 return;
1524
1525 b->yy_n_chars = 0;
1526
1527 /* We always need two end-of-buffer characters. The first causes
1528 * a transition to the end-of-buffer state. The second causes
1529 * a jam in that state.
1530 */
1531 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1532 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1533
1534 b->yy_buf_pos = &b->yy_ch_buf[0];
1535
1536 b->yy_at_bol = 1;
1537 b->yy_buffer_status = YY_BUFFER_NEW;
1538
1539 if ( b == YY_CURRENT_BUFFER )
1540 yy_load_buffer_state( );
1541}
1542
1543/** Pushes the new state onto the stack. The new state becomes
1544 * the current state. This function will allocate the stack
1545 * if necessary.
1546 * @param new_buffer The new state.
Patrick Georgi8d313682010-05-05 13:12:42 +00001547 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001548 */
1549void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1550{
1551 if (new_buffer == NULL)
1552 return;
1553
1554 yyensure_buffer_stack();
1555
1556 /* This block is copied from yy_switch_to_buffer. */
1557 if ( YY_CURRENT_BUFFER )
1558 {
1559 /* Flush out information for old buffer. */
1560 *(yy_c_buf_p) = (yy_hold_char);
1561 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1562 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1563 }
1564
1565 /* Only push if top exists. Otherwise, replace top. */
1566 if (YY_CURRENT_BUFFER)
1567 (yy_buffer_stack_top)++;
1568 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1569
1570 /* copied from yy_switch_to_buffer. */
1571 yy_load_buffer_state( );
1572 (yy_did_buffer_switch_on_eof) = 1;
1573}
1574
1575/** Removes and deletes the top of the stack, if present.
1576 * The next element becomes the new top.
Patrick Georgi8d313682010-05-05 13:12:42 +00001577 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001578 */
1579void yypop_buffer_state (void)
1580{
1581 if (!YY_CURRENT_BUFFER)
1582 return;
1583
1584 yy_delete_buffer(YY_CURRENT_BUFFER );
1585 YY_CURRENT_BUFFER_LVALUE = NULL;
1586 if ((yy_buffer_stack_top) > 0)
1587 --(yy_buffer_stack_top);
1588
1589 if (YY_CURRENT_BUFFER) {
1590 yy_load_buffer_state( );
1591 (yy_did_buffer_switch_on_eof) = 1;
1592 }
1593}
1594
1595/* Allocates the stack if it does not exist.
1596 * Guarantees space for at least one push.
1597 */
1598static void yyensure_buffer_stack (void)
1599{
1600 int num_to_alloc;
Patrick Georgi8d313682010-05-05 13:12:42 +00001601
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001602 if (!(yy_buffer_stack)) {
1603
1604 /* First allocation is just for 2 elements, since we don't know if this
1605 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1606 * immediate realloc on the next call.
1607 */
1608 num_to_alloc = 1;
1609 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1610 (num_to_alloc * sizeof(struct yy_buffer_state*)
1611 );
1612 if ( ! (yy_buffer_stack) )
1613 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
Patrick Georgi8d313682010-05-05 13:12:42 +00001614
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001615 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
Patrick Georgi8d313682010-05-05 13:12:42 +00001616
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001617 (yy_buffer_stack_max) = num_to_alloc;
1618 (yy_buffer_stack_top) = 0;
1619 return;
1620 }
1621
1622 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1623
1624 /* Increase the buffer to prepare for a possible push. */
1625 int grow_size = 8 /* arbitrary grow size */;
1626
1627 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1628 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1629 ((yy_buffer_stack),
1630 num_to_alloc * sizeof(struct yy_buffer_state*)
1631 );
1632 if ( ! (yy_buffer_stack) )
1633 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1634
1635 /* zero only the new slots.*/
1636 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1637 (yy_buffer_stack_max) = num_to_alloc;
1638 }
1639}
1640
1641/** Setup the input buffer state to scan directly from a user-specified character buffer.
1642 * @param base the character buffer
1643 * @param size the size in bytes of the character buffer
Patrick Georgi8d313682010-05-05 13:12:42 +00001644 *
1645 * @return the newly allocated buffer state object.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001646 */
1647YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1648{
1649 YY_BUFFER_STATE b;
Patrick Georgi8d313682010-05-05 13:12:42 +00001650
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001651 if ( size < 2 ||
1652 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1653 base[size-1] != YY_END_OF_BUFFER_CHAR )
1654 /* They forgot to leave room for the EOB's. */
1655 return 0;
1656
1657 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1658 if ( ! b )
1659 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1660
1661 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1662 b->yy_buf_pos = b->yy_ch_buf = base;
1663 b->yy_is_our_buffer = 0;
1664 b->yy_input_file = 0;
1665 b->yy_n_chars = b->yy_buf_size;
1666 b->yy_is_interactive = 0;
1667 b->yy_at_bol = 1;
1668 b->yy_fill_buffer = 0;
1669 b->yy_buffer_status = YY_BUFFER_NEW;
1670
1671 yy_switch_to_buffer(b );
1672
1673 return b;
1674}
1675
1676/** Setup the input buffer state to scan a string. The next call to yylex() will
1677 * scan from a @e copy of @a str.
1678 * @param yystr a NUL-terminated string to scan
Patrick Georgi8d313682010-05-05 13:12:42 +00001679 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001680 * @return the newly allocated buffer state object.
1681 * @note If you want to scan bytes that may contain NUL values, then use
1682 * yy_scan_bytes() instead.
1683 */
1684YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1685{
Patrick Georgi8d313682010-05-05 13:12:42 +00001686
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001687 return yy_scan_bytes(yystr,strlen(yystr) );
1688}
1689
1690/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1691 * scan from a @e copy of @a bytes.
Patrick Georgi8d313682010-05-05 13:12:42 +00001692 * @param yybytes the byte buffer to scan
1693 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1694 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001695 * @return the newly allocated buffer state object.
1696 */
1697YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1698{
1699 YY_BUFFER_STATE b;
1700 char *buf;
1701 yy_size_t n;
1702 int i;
Patrick Georgi8d313682010-05-05 13:12:42 +00001703
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001704 /* Get memory for full buffer, including space for trailing EOB's. */
1705 n = _yybytes_len + 2;
1706 buf = (char *) yyalloc(n );
1707 if ( ! buf )
1708 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1709
1710 for ( i = 0; i < _yybytes_len; ++i )
1711 buf[i] = yybytes[i];
1712
1713 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1714
1715 b = yy_scan_buffer(buf,n );
1716 if ( ! b )
1717 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1718
1719 /* It's okay to grow etc. this buffer, and we should throw it
1720 * away when we're done.
1721 */
1722 b->yy_is_our_buffer = 1;
1723
1724 return b;
1725}
1726
1727#ifndef YY_EXIT_FAILURE
1728#define YY_EXIT_FAILURE 2
1729#endif
1730
1731static void yy_fatal_error (yyconst char* msg )
1732{
1733 (void) fprintf( stderr, "%s\n", msg );
1734 exit( YY_EXIT_FAILURE );
1735}
1736
1737/* Redefine yyless() so it works in section 3 code. */
1738
1739#undef yyless
1740#define yyless(n) \
1741 do \
1742 { \
1743 /* Undo effects of setting up yytext. */ \
1744 int yyless_macro_arg = (n); \
1745 YY_LESS_LINENO(yyless_macro_arg);\
1746 yytext[yyleng] = (yy_hold_char); \
1747 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1748 (yy_hold_char) = *(yy_c_buf_p); \
1749 *(yy_c_buf_p) = '\0'; \
1750 yyleng = yyless_macro_arg; \
1751 } \
1752 while ( 0 )
1753
1754/* Accessor methods (get/set functions) to struct members. */
1755
1756/** Get the current line number.
Patrick Georgi8d313682010-05-05 13:12:42 +00001757 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001758 */
1759int yyget_lineno (void)
1760{
Patrick Georgi8d313682010-05-05 13:12:42 +00001761
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001762 return yylineno;
1763}
1764
1765/** Get the input stream.
Patrick Georgi8d313682010-05-05 13:12:42 +00001766 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001767 */
1768FILE *yyget_in (void)
1769{
1770 return yyin;
1771}
1772
1773/** Get the output stream.
Patrick Georgi8d313682010-05-05 13:12:42 +00001774 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001775 */
1776FILE *yyget_out (void)
1777{
1778 return yyout;
1779}
1780
1781/** Get the length of the current token.
Patrick Georgi8d313682010-05-05 13:12:42 +00001782 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001783 */
1784int yyget_leng (void)
1785{
1786 return yyleng;
1787}
1788
1789/** Get the current token.
Patrick Georgi8d313682010-05-05 13:12:42 +00001790 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001791 */
1792
1793char *yyget_text (void)
1794{
1795 return yytext;
1796}
1797
1798/** Set the current line number.
1799 * @param line_number
Patrick Georgi8d313682010-05-05 13:12:42 +00001800 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001801 */
1802void yyset_lineno (int line_number )
1803{
Patrick Georgi8d313682010-05-05 13:12:42 +00001804
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001805 yylineno = line_number;
1806}
1807
1808/** Set the input stream. This does not discard the current
1809 * input buffer.
1810 * @param in_str A readable stream.
Patrick Georgi8d313682010-05-05 13:12:42 +00001811 *
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001812 * @see yy_switch_to_buffer
1813 */
1814void yyset_in (FILE * in_str )
1815{
1816 yyin = in_str ;
1817}
1818
1819void yyset_out (FILE * out_str )
1820{
1821 yyout = out_str ;
1822}
1823
1824int yyget_debug (void)
1825{
1826 return yy_flex_debug;
1827}
1828
1829void yyset_debug (int bdebug )
1830{
1831 yy_flex_debug = bdebug ;
1832}
1833
1834static int yy_init_globals (void)
1835{
1836 /* Initialization is the same as for the non-reentrant scanner.
1837 * This function is called from yylex_destroy(), so don't allocate here.
1838 */
1839
1840 (yy_buffer_stack) = 0;
1841 (yy_buffer_stack_top) = 0;
1842 (yy_buffer_stack_max) = 0;
1843 (yy_c_buf_p) = (char *) 0;
1844 (yy_init) = 0;
1845 (yy_start) = 0;
1846
1847/* Defined in main.c */
1848#ifdef YY_STDINIT
1849 yyin = stdin;
1850 yyout = stdout;
1851#else
1852 yyin = (FILE *) 0;
1853 yyout = (FILE *) 0;
1854#endif
1855
1856 /* For future reference: Set errno on error, since we are called by
1857 * yylex_init()
1858 */
1859 return 0;
1860}
1861
1862/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1863int yylex_destroy (void)
1864{
Patrick Georgi8d313682010-05-05 13:12:42 +00001865
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001866 /* Pop the buffer stack, destroying each element. */
1867 while(YY_CURRENT_BUFFER){
1868 yy_delete_buffer(YY_CURRENT_BUFFER );
1869 YY_CURRENT_BUFFER_LVALUE = NULL;
1870 yypop_buffer_state();
1871 }
1872
1873 /* Destroy the stack itself. */
1874 yyfree((yy_buffer_stack) );
1875 (yy_buffer_stack) = NULL;
1876
1877 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1878 * yylex() is called, initialization will occur. */
1879 yy_init_globals( );
1880
1881 return 0;
1882}
1883
1884/*
1885 * Internal utility routines.
1886 */
1887
1888#ifndef yytext_ptr
1889static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1890{
1891 register int i;
1892 for ( i = 0; i < n; ++i )
1893 s1[i] = s2[i];
1894}
1895#endif
1896
1897#ifdef YY_NEED_STRLEN
1898static int yy_flex_strlen (yyconst char * s )
1899{
1900 register int n;
1901 for ( n = 0; s[n]; ++n )
1902 ;
1903
1904 return n;
1905}
1906#endif
1907
1908void *yyalloc (yy_size_t size )
1909{
1910 return (void *) malloc( size );
1911}
1912
1913void *yyrealloc (void * ptr, yy_size_t size )
1914{
1915 /* The cast to (char *) in the following accommodates both
1916 * implementations that use char* generic pointers, and those
1917 * that use void* generic pointers. It works with the latter
1918 * because both ANSI C and C++ allow castless assignment from
1919 * any pointer type to void*, and deal with argument conversions
1920 * as though doing an assignment.
1921 */
1922 return (void *) realloc( (char *) ptr, size );
1923}
1924
1925void yyfree (void * ptr )
1926{
1927 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1928}
1929
1930#define YYTABLES_NAME "yytables"
1931