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