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