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