cprover
assembler_lex.yy.cpp
Go to the documentation of this file.
1 #line 2 "assembler_lex.yy.cpp"
2 
3 #line 4 "assembler_lex.yy.cpp"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define yy_create_buffer yyassembler_create_buffer
10 #define yy_delete_buffer yyassembler_delete_buffer
11 #define yy_flex_debug yyassembler_flex_debug
12 #define yy_init_buffer yyassembler_init_buffer
13 #define yy_flush_buffer yyassembler_flush_buffer
14 #define yy_load_buffer_state yyassembler_load_buffer_state
15 #define yy_switch_to_buffer yyassembler_switch_to_buffer
16 #define yyin yyassemblerin
17 #define yyleng yyassemblerleng
18 #define yylex yyassemblerlex
19 #define yylineno yyassemblerlineno
20 #define yyout yyassemblerout
21 #define yyrestart yyassemblerrestart
22 #define yytext yyassemblertext
23 #define yywrap yyassemblerwrap
24 #define yyalloc yyassembleralloc
25 #define yyrealloc yyassemblerrealloc
26 #define yyfree yyassemblerfree
27 
28 #define FLEX_SCANNER
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 6
31 #define YY_FLEX_SUBMINOR_VERSION 1
32 #if YY_FLEX_SUBMINOR_VERSION > 0
33 #define FLEX_BETA
34 #endif
35 
36 /* First, we deal with platform-specific or compiler-specific issues. */
37 
38 /* begin standard C headers. */
39 #include <stdio.h>
40 #include <string.h>
41 #include <errno.h>
42 #include <stdlib.h>
43 
44 /* end standard C headers. */
45 
46 /* flex integer type definitions */
47 
48 #ifndef FLEXINT_H
49 #define FLEXINT_H
50 
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56  * if you want the limit (max/min) macros for int types.
57  */
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
60 #endif
61 
62 #include <inttypes.h>
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
69 #else
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
76 
77 /* Limits of integral types. */
78 #ifndef INT8_MIN
79 #define INT8_MIN (-128)
80 #endif
81 #ifndef INT16_MIN
82 #define INT16_MIN (-32767-1)
83 #endif
84 #ifndef INT32_MIN
85 #define INT32_MIN (-2147483647-1)
86 #endif
87 #ifndef INT8_MAX
88 #define INT8_MAX (127)
89 #endif
90 #ifndef INT16_MAX
91 #define INT16_MAX (32767)
92 #endif
93 #ifndef INT32_MAX
94 #define INT32_MAX (2147483647)
95 #endif
96 #ifndef UINT8_MAX
97 #define UINT8_MAX (255U)
98 #endif
99 #ifndef UINT16_MAX
100 #define UINT16_MAX (65535U)
101 #endif
102 #ifndef UINT32_MAX
103 #define UINT32_MAX (4294967295U)
104 #endif
105 
106 #endif /* ! C99 */
107 
108 #endif /* ! FLEXINT_H */
109 
110 /* TODO: this is always defined, so inline it */
111 #define yyconst const
112 
113 #if defined(__GNUC__) && __GNUC__ >= 3
114 #define yynoreturn __attribute__((__noreturn__))
115 #else
116 #define yynoreturn
117 #endif
118 
119 /* Returned upon end-of-file. */
120 #define YY_NULL 0
121 
122 /* Promotes a possibly negative, possibly signed char to an unsigned
123  * integer for use as an array index. If the signed char is negative,
124  * we want to instead treat it as an 8-bit unsigned char, hence the
125  * double cast.
126  */
127 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
128 
129 /* Enter a start condition. This macro really ought to take a parameter,
130  * but we do it the disgusting crufty way forced on us by the ()-less
131  * definition of BEGIN.
132  */
133 #define BEGIN (yy_start) = 1 + 2 *
134 
135 /* Translate the current start state into a value that can be later handed
136  * to BEGIN to return to the state. The YYSTATE alias is for lex
137  * compatibility.
138  */
139 #define YY_START (((yy_start) - 1) / 2)
140 #define YYSTATE YY_START
141 
142 /* Action number for EOF rule of a given start state. */
143 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
144 
145 /* Special action meaning "start processing a new file". */
146 #define YY_NEW_FILE yyassemblerrestart(yyassemblerin )
147 
148 #define YY_END_OF_BUFFER_CHAR 0
149 
150 /* Size of default input buffer. */
151 #ifndef YY_BUF_SIZE
152 #ifdef __ia64__
153 /* On IA-64, the buffer size is 16k, not 8k.
154  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
155  * Ditto for the __ia64__ case accordingly.
156  */
157 #define YY_BUF_SIZE 32768
158 #else
159 #define YY_BUF_SIZE 16384
160 #endif /* __ia64__ */
161 #endif
162 
163 /* The state buf must be large enough to hold one state per character in the main buffer.
164  */
165 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
166 
167 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
168 #define YY_TYPEDEF_YY_BUFFER_STATE
170 #endif
171 
172 #ifndef YY_TYPEDEF_YY_SIZE_T
173 #define YY_TYPEDEF_YY_SIZE_T
174 typedef size_t yy_size_t;
175 #endif
176 
177 extern int yyassemblerleng;
178 
179 extern FILE *yyassemblerin, *yyassemblerout;
180 
181 #define EOB_ACT_CONTINUE_SCAN 0
182 #define EOB_ACT_END_OF_FILE 1
183 #define EOB_ACT_LAST_MATCH 2
184 
185  #define YY_LESS_LINENO(n)
186  #define YY_LINENO_REWIND_TO(ptr)
187 
188 /* Return all but the first "n" matched characters back to the input stream. */
189 #define yyless(n) \
190  do \
191  { \
192  /* Undo effects of setting up yyassemblertext. */ \
193  yy_size_t yyless_macro_arg = (n); \
194  YY_LESS_LINENO(yyless_macro_arg);\
195  *yy_cp = (yy_hold_char); \
196  YY_RESTORE_YY_MORE_OFFSET \
197  (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198  YY_DO_BEFORE_ACTION; /* set up yyassemblertext again */ \
199  } \
200  while ( 0 )
201 
202 #define unput(c) yyunput( c, (yytext_ptr) )
203 
204 #ifndef YY_STRUCT_YY_BUFFER_STATE
205 #define YY_STRUCT_YY_BUFFER_STATE
206 struct yy_buffer_state
207  {
208  FILE *yy_input_file;
209 
210  char *yy_ch_buf; /* input buffer */
211  char *yy_buf_pos; /* current position in input buffer */
212 
213  /* Size of input buffer in bytes, not including room for EOB
214  * characters.
215  */
216  int yy_buf_size;
217 
218  /* Number of characters read into yy_ch_buf, not including EOB
219  * characters.
220  */
221  int yy_n_chars;
222 
223  /* Whether we "own" the buffer - i.e., we know we created it,
224  * and can realloc() it to grow it, and should free() it to
225  * delete it.
226  */
227  int yy_is_our_buffer;
228 
229  /* Whether this is an "interactive" input source; if so, and
230  * if we're using stdio for input, then we want to use getc()
231  * instead of fread(), to make sure we stop fetching input after
232  * each newline.
233  */
234  int yy_is_interactive;
235 
236  /* Whether we're considered to be at the beginning of a line.
237  * If so, '^' rules will be active on the next match, otherwise
238  * not.
239  */
240  int yy_at_bol;
241 
242  int yy_bs_lineno;
243  int yy_bs_column;
245  /* Whether to try to fill the input buffer when we reach the
246  * end of it.
247  */
248  int yy_fill_buffer;
249 
250  int yy_buffer_status;
251 
252 #define YY_BUFFER_NEW 0
253 #define YY_BUFFER_NORMAL 1
254  /* When an EOF's been seen but there's still some text to process
255  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
256  * shouldn't try reading from the input source any more. We might
257  * still have a bunch of tokens to match, though, because of
258  * possible backing-up.
259  *
260  * When we actually see the EOF, we change the status to "new"
261  * (via yyassemblerrestart()), so that the user can continue scanning by
262  * just pointing yyassemblerin at a new input file.
263  */
264 #define YY_BUFFER_EOF_PENDING 2
265 
266  };
267 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
268 
269 /* Stack of input buffers. */
270 static size_t yy_buffer_stack_top = 0;
271 static size_t yy_buffer_stack_max = 0;
272 static YY_BUFFER_STATE * yy_buffer_stack = NULL;
274 /* We provide macros for accessing buffer states in case in the
275  * future we want to put the buffer states in a more general
276  * "scanner state".
277  *
278  * Returns the top of the stack, or NULL.
279  */
280 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
281  ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
282  : NULL)
283 
284 /* Same as previous macro, but useful when we know that the buffer stack is not
285  * NULL or when we need an lvalue. For internal use only.
286  */
287 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
288 
289 /* yy_hold_char holds the character lost when yyassemblertext is formed. */
290 static char yy_hold_char;
291 static int yy_n_chars; /* number of characters read into yy_ch_buf */
293 
294 /* Points to current character in buffer. */
295 static char *yy_c_buf_p = NULL;
296 static int yy_init = 0; /* whether we need to initialize */
297 static int yy_start = 0; /* start state number */
298 
299 /* Flag which is used to allow yyassemblerwrap()'s to do buffer switches
300  * instead of setting up a fresh yyassemblerin. A bit of a hack ...
301  */
303 
304 void yyassemblerrestart (FILE *input_file );
305 void yyassembler_switch_to_buffer (YY_BUFFER_STATE new_buffer );
306 YY_BUFFER_STATE yyassembler_create_buffer (FILE *file,int size );
307 void yyassembler_delete_buffer (YY_BUFFER_STATE b );
308 void yyassembler_flush_buffer (YY_BUFFER_STATE b );
309 void yyassemblerpush_buffer_state (YY_BUFFER_STATE new_buffer );
310 void yyassemblerpop_buffer_state (void );
311 
312 static void yyassemblerensure_buffer_stack (void );
313 static void yyassembler_load_buffer_state (void );
314 static void yyassembler_init_buffer (YY_BUFFER_STATE b,FILE *file );
315 
316 #define YY_FLUSH_BUFFER yyassembler_flush_buffer(YY_CURRENT_BUFFER )
317 
318 YY_BUFFER_STATE yyassembler_scan_buffer (char *base,yy_size_t size );
319 YY_BUFFER_STATE yyassembler_scan_string (yyconst char *yy_str );
320 YY_BUFFER_STATE yyassembler_scan_bytes (yyconst char *bytes,int len );
321 
322 void *yyassembleralloc (yy_size_t );
323 void *yyassemblerrealloc (void *,yy_size_t );
324 void yyassemblerfree (void * );
325 
326 #define yy_new_buffer yyassembler_create_buffer
327 
328 #define yy_set_interactive(is_interactive) \
329  { \
330  if ( ! YY_CURRENT_BUFFER ){ \
331  yyassemblerensure_buffer_stack (); \
332  YY_CURRENT_BUFFER_LVALUE = \
333  yyassembler_create_buffer(yyassemblerin,YY_BUF_SIZE ); \
334  } \
335  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
336  }
337 
338 #define yy_set_bol(at_bol) \
339  { \
340  if ( ! YY_CURRENT_BUFFER ){\
341  yyassemblerensure_buffer_stack (); \
342  YY_CURRENT_BUFFER_LVALUE = \
343  yyassembler_create_buffer(yyassemblerin,YY_BUF_SIZE ); \
344  } \
345  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
346  }
347 
348 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
349 
350 /* Begin user sect3 */
351 
352 typedef unsigned char YY_CHAR;
353 
354 FILE *yyassemblerin = NULL, *yyassemblerout = NULL;
355 
356 typedef int yy_state_type;
357 
358 extern int yyassemblerlineno;
359 
361 
362 extern char *yyassemblertext;
363 #ifdef yytext_ptr
364 #undef yytext_ptr
365 #endif
366 #define yytext_ptr yyassemblertext
367 
368 static yy_state_type yy_get_previous_state (void );
369 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
370 static int yy_get_next_buffer (void );
371 static void yynoreturn yy_fatal_error (yyconst char* msg );
372 
373 /* Done after the current pattern has been matched and before the
374  * corresponding action - sets up yyassemblertext.
375  */
376 #define YY_DO_BEFORE_ACTION \
377  (yytext_ptr) = yy_bp; \
378  yyassemblerleng = (int) (yy_cp - yy_bp); \
379  (yy_hold_char) = *yy_cp; \
380  *yy_cp = '\0'; \
381  (yy_c_buf_p) = yy_cp;
382 
383 #define YY_NUM_RULES 14
384 #define YY_END_OF_BUFFER 15
385 /* This struct is not used in this scanner,
386  but its presence is necessary. */
387 struct yy_trans_info
388  {
389  flex_int32_t yy_verify;
391  };
393  { 0,
394  0, 0, 9, 9, 4, 4, 15, 1, 13, 7,
395  5, 5, 2, 10, 10, 6, 13, 13, 13, 4,
396  3, 7, 10, 10, 12, 11, 5, 4, 10, 10,
397  8, 0
398  } ;
399 
400 static yyconst YY_CHAR yy_ec[256] =
401  { 0,
402  1, 1, 1, 1, 1, 1, 1, 2, 2, 3,
403  4, 4, 2, 1, 1, 1, 1, 1, 1, 1,
404  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405  1, 2, 1, 1, 5, 6, 1, 1, 1, 1,
406  1, 1, 1, 1, 1, 7, 1, 8, 8, 8,
407  8, 8, 8, 8, 8, 8, 8, 1, 9, 10,
408  1, 11, 1, 1, 12, 12, 12, 12, 12, 12,
409  12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
410  12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
411  1, 13, 1, 1, 14, 1, 15, 16, 16, 17,
412 
413  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
414  16, 16, 16, 16, 16, 18, 16, 16, 16, 16,
415  16, 16, 1, 1, 1, 1, 1, 1, 1, 1,
416  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 
424  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429  1, 1, 1, 1, 1
430  } ;
431 
432 static yyconst YY_CHAR yy_meta[19] =
433  { 0,
434  1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
435  1, 1, 1, 1, 1, 1, 1, 1
436  } ;
437 
439  { 0,
440  0, 0, 0, 0, 41, 40, 42, 45, 45, 39,
441  45, 45, 45, 13, 23, 45, 29, 27, 34, 0,
442  45, 34, 0, 11, 45, 45, 45, 0, 6, 8,
443  0, 45, 31, 33, 21
444  } ;
445 
447  { 0,
448  33, 33, 32, 3, 34, 34, 32, 32, 32, 32,
449  32, 32, 32, 32, 14, 32, 32, 32, 32, 35,
450  32, 32, 14, 14, 32, 32, 32, 35, 14, 14,
451  14, 0, 32, 32, 32
452  } ;
453 
455  { 0,
456  9, 10, 11, 12, 13, 14, 15, 9, 16, 17,
457  18, 14, 19, 14, 14, 14, 14, 14, 23, 23,
458  23, 28, 31, 30, 23, 29, 23, 23, 23, 23,
459  23, 8, 8, 20, 20, 22, 27, 26, 25, 24,
460  22, 32, 21, 21, 7, 32, 32, 32, 32, 32,
461  32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
462  32, 32, 32
463  } ;
464 
466  { 0,
467  3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
468  3, 3, 3, 3, 3, 3, 3, 3, 14, 14,
469  14, 35, 30, 29, 14, 24, 14, 14, 14, 14,
470  14, 33, 33, 34, 34, 22, 19, 18, 17, 15,
471  10, 7, 6, 5, 32, 32, 32, 32, 32, 32,
472  32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
473  32, 32, 32
474  } ;
475 
478 
479 extern int yyassembler_flex_debug;
481 
482 /* The intent behind this definition is that it'll catch
483  * any uses of REJECT which flex missed.
484  */
485 #define REJECT reject_used_but_not_detected
486 #define yymore() yymore_used_but_not_detected
487 #define YY_MORE_ADJ 0
488 #define YY_RESTORE_YY_MORE_OFFSET
490 #line 1 "scanner.l"
491 #define YY_NO_INPUT 1
492 #line 5 "scanner.l"
493 
494 #ifdef _WIN32
495 #define YY_NO_UNISTD_H
496 static int isatty(int) { return 0; }
497 #endif
498 
499 #define PARSER assembler_parser
500 #define YYSTYPE unsigned
501 #undef ECHO
502 #define ECHO
503 
504 #include "assembler_parser.h"
505 
506 #include <util/pragma_wsign_compare.def>
507 #include <util/pragma_wnull_conversion.def>
508 #include <util/pragma_wdeprecated_register.def>
509 
510 /*** macros for easier rule definition **********************************/
511 
512 
513 #line 59 "scanner.l"
515 {
517  BEGIN(0);
518 }
519 #line 520 "assembler_lex.yy.cpp"
520 
521 #define INITIAL 0
522 #define GRAMMAR 1
523 #define LINE_COMMENT 2
524 
525 #ifndef YY_NO_UNISTD_H
526 /* Special case for "unistd.h", since it is non-ANSI. We include it way
527  * down here because we want the user's section 1 to have been scanned first.
528  * The user has a chance to override it with an option.
529  */
530 #include <unistd.h>
531 #endif
532 
533 #ifndef YY_EXTRA_TYPE
534 #define YY_EXTRA_TYPE void *
535 #endif
536 
537 static int yy_init_globals (void );
538 
539 /* Accessor methods to globals.
540  These are made visible to non-reentrant scanners for convenience. */
541 
542 int yyassemblerlex_destroy (void );
543 
544 int yyassemblerget_debug (void );
545 
546 void yyassemblerset_debug (int debug_flag );
547 
549 
550 void yyassemblerset_extra (YY_EXTRA_TYPE user_defined );
551 
552 FILE *yyassemblerget_in (void );
553 
554 void yyassemblerset_in (FILE * _in_str );
555 
556 FILE *yyassemblerget_out (void );
557 
558 void yyassemblerset_out (FILE * _out_str );
559 
560  int yyassemblerget_leng (void );
561 
562 char *yyassemblerget_text (void );
563 
564 int yyassemblerget_lineno (void );
565 
566 void yyassemblerset_lineno (int _line_number );
567 
568 /* Macros after this point can all be overridden by user definitions in
569  * section 1.
570  */
571 
572 #ifndef YY_SKIP_YYWRAP
573 #ifdef __cplusplus
574 extern "C" int yyassemblerwrap (void );
575 #else
576 extern int yyassemblerwrap (void );
577 #endif
578 #endif
579 
580 #ifndef YY_NO_UNPUT
581 
582 #endif
583 
584 #ifndef yytext_ptr
585 static void yy_flex_strncpy (char *,yyconst char *,int );
586 #endif
587 
588 #ifdef YY_NEED_STRLEN
589 static int yy_flex_strlen (yyconst char * );
590 #endif
591 
592 #ifndef YY_NO_INPUT
593 
594 #ifdef __cplusplus
595 static int yyinput (void );
596 #else
597 static int input (void );
598 #endif
599 
600 #endif
601 
602 /* Amount of stuff to slurp up with each read. */
603 #ifndef YY_READ_BUF_SIZE
604 #ifdef __ia64__
605 /* On IA-64, the buffer size is 16k, not 8k */
606 #define YY_READ_BUF_SIZE 16384
607 #else
608 #define YY_READ_BUF_SIZE 8192
609 #endif /* __ia64__ */
610 #endif
611 
612 /* Copy whatever the last rule matched to the standard output. */
613 #ifndef ECHO
614 /* This used to be an fputs(), but since the string might contain NUL's,
615  * we now use fwrite().
616  */
617 #define ECHO do { if (fwrite( yyassemblertext, (size_t) yyassemblerleng, 1, yyassemblerout )) {} } while (0)
618 #endif
619 
620 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
621  * is returned in "result".
622  */
623 #ifndef YY_INPUT
624 #define YY_INPUT(buf,result,max_size) \
625  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
626  { \
627  int c = '*'; \
628  int n; \
629  for ( n = 0; n < max_size && \
630  (c = getc( yyassemblerin )) != EOF && c != '\n'; ++n ) \
631  buf[n] = (char) c; \
632  if ( c == '\n' ) \
633  buf[n++] = (char) c; \
634  if ( c == EOF && ferror( yyassemblerin ) ) \
635  YY_FATAL_ERROR( "input in flex scanner failed" ); \
636  result = n; \
637  } \
638  else \
639  { \
640  errno=0; \
641  while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyassemblerin)) == 0 && ferror(yyassemblerin)) \
642  { \
643  if( errno != EINTR) \
644  { \
645  YY_FATAL_ERROR( "input in flex scanner failed" ); \
646  break; \
647  } \
648  errno=0; \
649  clearerr(yyassemblerin); \
650  } \
651  }\
652 \
653 
654 #endif
655 
656 /* No semi-colon after return; correct usage is to write "yyterminate();" -
657  * we don't want an extra ';' after the "return" because that will cause
658  * some compilers to complain about unreachable statements.
659  */
660 #ifndef yyterminate
661 #define yyterminate() return YY_NULL
662 #endif
663 
664 /* Number of entries by which start-condition stack grows. */
665 #ifndef YY_START_STACK_INCR
666 #define YY_START_STACK_INCR 25
667 #endif
668 
669 /* Report a fatal error. */
670 #ifndef YY_FATAL_ERROR
671 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
672 #endif
673 
674 /* end tables serialization structures and prototypes */
675 
676 /* Default declaration of generated scanner - a define so the user can
677  * easily add parameters.
678  */
679 #ifndef YY_DECL
680 #define YY_DECL_IS_OURS 1
681 
682 extern int yyassemblerlex (void);
683 
684 #define YY_DECL int yyassemblerlex (void)
685 #endif /* !YY_DECL */
686 
687 /* Code executed at the beginning of each rule, after yyassemblertext and yyassemblerleng
688  * have been set up.
689  */
690 #ifndef YY_USER_ACTION
691 #define YY_USER_ACTION
692 #endif
693 
694 /* Code executed at the end of each rule. */
695 #ifndef YY_BREAK
696 #define YY_BREAK /*LINTED*/break;
697 #endif
698 
699 #define YY_RULE_SETUP \
700  YY_USER_ACTION
701 
705 {
706  yy_state_type yy_current_state;
707  char *yy_cp, *yy_bp;
708  int yy_act;
709 
710  if ( !(yy_init) )
711  {
712  (yy_init) = 1;
713 
714 #ifdef YY_USER_INIT
715  YY_USER_INIT;
716 #endif
717 
718  if ( ! (yy_start) )
719  (yy_start) = 1; /* first start state */
720 
721  if ( ! yyassemblerin )
722  yyassemblerin = stdin;
723 
724  if ( ! yyassemblerout )
725  yyassemblerout = stdout;
726 
727  if ( ! YY_CURRENT_BUFFER ) {
731  }
732 
734  }
735 
736  {
737 #line 66 "scanner.l"
738 
739 
740 #line 741 "assembler_lex.yy.cpp"
741 
742  while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
743  {
744  yy_cp = (yy_c_buf_p);
745 
746  /* Support of yyassemblertext. */
747  *yy_cp = (yy_hold_char);
748 
749  /* yy_bp points to the position in yy_ch_buf of the start of
750  * the current run.
751  */
752  yy_bp = yy_cp;
753 
754  yy_current_state = (yy_start);
755 yy_match:
756  do
757  {
758  YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
759  if ( yy_accept[yy_current_state] )
760  {
761  (yy_last_accepting_state) = yy_current_state;
762  (yy_last_accepting_cpos) = yy_cp;
763  }
764  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
765  {
766  yy_current_state = (int) yy_def[yy_current_state];
767  if ( yy_current_state >= 33 )
768  yy_c = yy_meta[(unsigned int) yy_c];
769  }
770  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
771  ++yy_cp;
772  }
773  while ( yy_base[yy_current_state] != 45 );
774 
775 yy_find_action:
776  yy_act = yy_accept[yy_current_state];
777  if ( yy_act == 0 )
778  { /* have to back up */
779  yy_cp = (yy_last_accepting_cpos);
780  yy_current_state = (yy_last_accepting_state);
781  yy_act = yy_accept[yy_current_state];
782  }
783 
785 
786 do_action: /* This label is used only to access EOF actions. */
787 
788  switch ( yy_act )
789  { /* beginning of action switch */
790  case 0: /* must back up */
791  /* undo the effects of YY_DO_BEFORE_ACTION */
792  *yy_cp = (yy_hold_char);
793  yy_cp = (yy_last_accepting_cpos);
794  yy_current_state = (yy_last_accepting_state);
795  goto yy_find_action;
796 
797 case 1:
798 /* rule 1 can match eol */
800 #line 68 "scanner.l"
801 { BEGIN(GRAMMAR);
802  yyless(0); /* start again with this character */
803  }
804  YY_BREAK
805 case 2:
807 #line 72 "scanner.l"
808 { PARSER.new_instruction(); BEGIN(LINE_COMMENT); } /* begin comment state */
809  YY_BREAK
810 
811 case 3:
812 /* rule 3 can match eol */
814 #line 75 "scanner.l"
815 { BEGIN(GRAMMAR); } /* end comment state, back GRAMMAR */
816  YY_BREAK
817 case 4:
819 #line 76 "scanner.l"
820 { } /* all characters within comments are ignored */
821  YY_BREAK
822 
823 case 5:
824 /* rule 5 can match eol */
826 #line 79 "scanner.l"
827 { PARSER.new_instruction(); }
828  YY_BREAK
829 case 6:
831 #line 80 "scanner.l"
832 { PARSER.new_instruction(); }
833  YY_BREAK
834 case 7:
836 #line 81 "scanner.l"
837 { } /* skipped */
838  YY_BREAK
839 /*** keywords ***/
840 
841 case 8:
843 #line 86 "scanner.l"
844 { }
845  YY_BREAK
846 
847 /*** rest ***/
848 
849 case 9:
851 #line 92 "scanner.l"
852 { /* ignore */ }
853  YY_BREAK
854 case 10:
856 #line 93 "scanner.l"
857 { irept identifier(ID_symbol);
858  identifier.set(ID_identifier, yyassemblertext);
859  PARSER.add_token(identifier);
860  }
861  YY_BREAK
862 case 11:
864 #line 98 "scanner.l"
865 { PARSER.add_token(irept(ID_shr)); }
866  YY_BREAK
867 case 12:
869 #line 99 "scanner.l"
870 { PARSER.add_token(irept(ID_shl)); }
871  YY_BREAK
872 case 13:
874 #line 100 "scanner.l"
875 { std::string s;
876  s+=yyassemblertext[0];
877  PARSER.add_token(irept(s));
878  }
879  YY_BREAK
880 
881 case YY_STATE_EOF(INITIAL):
882 case YY_STATE_EOF(GRAMMAR):
884 #line 106 "scanner.l"
885 { yyterminate(); /* done! */ }
886  YY_BREAK
887 case 14:
889 #line 108 "scanner.l"
890 ECHO;
891  YY_BREAK
892 #line 893 "assembler_lex.yy.cpp"
893 
894  case YY_END_OF_BUFFER:
895  {
896  /* Amount of text matched not including the EOB char. */
897  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
898 
899  /* Undo the effects of YY_DO_BEFORE_ACTION. */
900  *yy_cp = (yy_hold_char);
902 
903  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
904  {
905  /* We're scanning a new file or input source. It's
906  * possible that this happened because the user
907  * just pointed yyassemblerin at a new source and called
908  * yyassemblerlex(). If so, then we have to assure
909  * consistency between YY_CURRENT_BUFFER and our
910  * globals. Here is the right place to do so, because
911  * this is the first action (other than possibly a
912  * back-up) that will match for the new input source.
913  */
914  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
915  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyassemblerin;
916  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
917  }
918 
919  /* Note that here we test for yy_c_buf_p "<=" to the position
920  * of the first EOB in the buffer, since yy_c_buf_p will
921  * already have been incremented past the NUL character
922  * (since all states make transitions on EOB to the
923  * end-of-buffer state). Contrast this with the test
924  * in input().
925  */
926  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
927  { /* This was really a NUL. */
928  yy_state_type yy_next_state;
929 
930  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
931 
932  yy_current_state = yy_get_previous_state( );
933 
934  /* Okay, we're now positioned to make the NUL
935  * transition. We couldn't have
936  * yy_get_previous_state() go ahead and do it
937  * for us because it doesn't know how to deal
938  * with the possibility of jamming (and we don't
939  * want to build jamming into it because then it
940  * will run more slowly).
941  */
942 
943  yy_next_state = yy_try_NUL_trans( yy_current_state );
944 
945  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
946 
947  if ( yy_next_state )
948  {
949  /* Consume the NUL. */
950  yy_cp = ++(yy_c_buf_p);
951  yy_current_state = yy_next_state;
952  goto yy_match;
953  }
954 
955  else
956  {
957  yy_cp = (yy_c_buf_p);
958  goto yy_find_action;
959  }
960  }
961 
962  else switch ( yy_get_next_buffer( ) )
963  {
964  case EOB_ACT_END_OF_FILE:
965  {
967 
968  if ( yyassemblerwrap( ) )
969  {
970  /* Note: because we've taken care in
971  * yy_get_next_buffer() to have set up
972  * yyassemblertext, we can now set up
973  * yy_c_buf_p so that if some total
974  * hoser (like flex itself) wants to
975  * call the scanner after we return the
976  * YY_NULL, it'll still work - another
977  * YY_NULL will get returned.
978  */
980 
981  yy_act = YY_STATE_EOF(YY_START);
982  goto do_action;
983  }
984 
985  else
986  {
987  if ( ! (yy_did_buffer_switch_on_eof) )
988  YY_NEW_FILE;
989  }
990  break;
991  }
992 
994  (yy_c_buf_p) =
995  (yytext_ptr) + yy_amount_of_matched_text;
996 
997  yy_current_state = yy_get_previous_state( );
998 
999  yy_cp = (yy_c_buf_p);
1000  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1001  goto yy_match;
1002 
1003  case EOB_ACT_LAST_MATCH:
1004  (yy_c_buf_p) =
1005  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1006 
1007  yy_current_state = yy_get_previous_state( );
1008 
1009  yy_cp = (yy_c_buf_p);
1010  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1011  goto yy_find_action;
1012  }
1013  break;
1014  }
1015 
1016  default:
1018  "fatal flex scanner internal error--no action found" );
1019  } /* end of action switch */
1020  } /* end of scanning one token */
1021  } /* end of user's declarations */
1022 } /* end of yyassemblerlex */
1023 
1024 /* yy_get_next_buffer - try to read in a new buffer
1025  *
1026  * Returns a code representing an action:
1027  * EOB_ACT_LAST_MATCH -
1028  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1029  * EOB_ACT_END_OF_FILE - end of file
1030  */
1031 static int yy_get_next_buffer (void)
1032 {
1033  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1034  char *source = (yytext_ptr);
1035  yy_size_t number_to_move, i;
1036  int ret_val;
1037 
1038  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1040  "fatal flex scanner internal error--end of buffer missed" );
1041 
1042  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1043  { /* Don't try to fill the buffer, so this is an EOF. */
1044  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1045  {
1046  /* We matched a single character, the EOB, so
1047  * treat this as a final EOF.
1048  */
1049  return EOB_ACT_END_OF_FILE;
1050  }
1051 
1052  else
1053  {
1054  /* We matched some text prior to the EOB, first
1055  * process it.
1056  */
1057  return EOB_ACT_LAST_MATCH;
1058  }
1059  }
1060 
1061  /* Try to read more data. */
1062 
1063  /* First move last chars to start of buffer. */
1064  number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1065 
1066  for ( i = 0; i < number_to_move; ++i )
1067  *(dest++) = *(source++);
1068 
1069  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1070  /* don't do the read, it's not guaranteed to return an EOF,
1071  * just force an EOF
1072  */
1073  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1074 
1075  else
1076  {
1077  int num_to_read =
1078  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1079 
1080  while ( num_to_read <= 0 )
1081  { /* Not enough room in the buffer - grow it. */
1082 
1083  /* just a shorter name for the current buffer */
1084  YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1085 
1086  int yy_c_buf_p_offset =
1087  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1088 
1089  if ( b->yy_is_our_buffer )
1090  {
1091  int new_size = b->yy_buf_size * 2;
1092 
1093  if ( new_size <= 0 )
1094  b->yy_buf_size += b->yy_buf_size / 8;
1095  else
1096  b->yy_buf_size *= 2;
1097 
1098  b->yy_ch_buf = (char *)
1099  /* Include room in for 2 EOB chars. */
1100  yyassemblerrealloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) );
1101  }
1102  else
1103  /* Can't grow it, we don't own it. */
1104  b->yy_ch_buf = NULL;
1105 
1106  if ( ! b->yy_ch_buf )
1108  "fatal error - scanner input buffer overflow" );
1109 
1110  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1111 
1112  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1113  number_to_move - 1;
1114 
1115  }
1116 
1117  if ( num_to_read > YY_READ_BUF_SIZE )
1118  num_to_read = YY_READ_BUF_SIZE;
1119 
1120  /* Read in more data. */
1121  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1122  (yy_n_chars), num_to_read );
1123 
1124  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1125  }
1126 
1127  if ( (yy_n_chars) == 0 )
1128  {
1129  if ( number_to_move == YY_MORE_ADJ )
1130  {
1131  ret_val = EOB_ACT_END_OF_FILE;
1133  }
1134 
1135  else
1136  {
1137  ret_val = EOB_ACT_LAST_MATCH;
1138  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1140  }
1141  }
1142 
1143  else
1144  ret_val = EOB_ACT_CONTINUE_SCAN;
1145 
1146  if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1147  /* Extend the array by 50%, plus the number we really need. */
1148  int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1149  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyassemblerrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size );
1150  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1151  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1152  }
1153 
1154  (yy_n_chars) += number_to_move;
1157 
1158  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1159 
1160  return ret_val;
1161 }
1162 
1163 /* yy_get_previous_state - get the state just before the EOB char was reached */
1164 
1166 {
1167  yy_state_type yy_current_state;
1168  char *yy_cp;
1169 
1170  yy_current_state = (yy_start);
1171 
1172  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1173  {
1174  YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1175  if ( yy_accept[yy_current_state] )
1176  {
1177  (yy_last_accepting_state) = yy_current_state;
1178  (yy_last_accepting_cpos) = yy_cp;
1179  }
1180  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1181  {
1182  yy_current_state = (int) yy_def[yy_current_state];
1183  if ( yy_current_state >= 33 )
1184  yy_c = yy_meta[(unsigned int) yy_c];
1185  }
1186  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1187  }
1188 
1189  return yy_current_state;
1190 }
1191 
1192 /* yy_try_NUL_trans - try to make a transition on the NUL character
1193  *
1194  * synopsis
1195  * next_state = yy_try_NUL_trans( current_state );
1196  */
1197  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1198 {
1199  int yy_is_jam;
1200  char *yy_cp = (yy_c_buf_p);
1201 
1202  YY_CHAR yy_c = 1;
1203  if ( yy_accept[yy_current_state] )
1204  {
1205  (yy_last_accepting_state) = yy_current_state;
1206  (yy_last_accepting_cpos) = yy_cp;
1207  }
1208  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1209  {
1210  yy_current_state = (int) yy_def[yy_current_state];
1211  if ( yy_current_state >= 33 )
1212  yy_c = yy_meta[(unsigned int) yy_c];
1213  }
1214  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1215  yy_is_jam = (yy_current_state == 32);
1216 
1217  return yy_is_jam ? 0 : yy_current_state;
1218 }
1219 
1220 #ifndef YY_NO_UNPUT
1221 
1222 #endif
1223 
1224 #ifndef YY_NO_INPUT
1225 #ifdef __cplusplus
1226  static int yyinput (void)
1227 #else
1228  static int input (void)
1229 #endif
1230 
1231 {
1232  int c;
1233 
1234  *(yy_c_buf_p) = (yy_hold_char);
1235 
1236  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1237  {
1238  /* yy_c_buf_p now points to the character we want to return.
1239  * If this occurs *before* the EOB characters, then it's a
1240  * valid NUL; if not, then we've hit the end of the buffer.
1241  */
1242  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1243  /* This was really a NUL. */
1244  *(yy_c_buf_p) = '\0';
1245 
1246  else
1247  { /* need more input */
1248  int offset = (yy_c_buf_p) - (yytext_ptr);
1249  ++(yy_c_buf_p);
1250 
1251  switch ( yy_get_next_buffer( ) )
1252  {
1253  case EOB_ACT_LAST_MATCH:
1254  /* This happens because yy_g_n_b()
1255  * sees that we've accumulated a
1256  * token and flags that we need to
1257  * try matching the token before
1258  * proceeding. But for input(),
1259  * there's no matching to consider.
1260  * So convert the EOB_ACT_LAST_MATCH
1261  * to EOB_ACT_END_OF_FILE.
1262  */
1263 
1264  /* Reset buffer status. */
1266 
1267  /*FALLTHROUGH*/
1268 
1269  case EOB_ACT_END_OF_FILE:
1270  {
1271  if ( yyassemblerwrap( ) )
1272  return 0;
1273 
1274  if ( ! (yy_did_buffer_switch_on_eof) )
1275  YY_NEW_FILE;
1276 #ifdef __cplusplus
1277  return yyinput();
1278 #else
1279  return input();
1280 #endif
1281  }
1282 
1283  case EOB_ACT_CONTINUE_SCAN:
1284  (yy_c_buf_p) = (yytext_ptr) + offset;
1285  break;
1286  }
1287  }
1288  }
1289 
1290  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1291  *(yy_c_buf_p) = '\0'; /* preserve yyassemblertext */
1292  (yy_hold_char) = *++(yy_c_buf_p);
1293 
1294  return c;
1295 }
1296 #endif /* ifndef YY_NO_INPUT */
1297 
1303  void yyassemblerrestart (FILE * input_file )
1304 {
1305 
1306  if ( ! YY_CURRENT_BUFFER ){
1310  }
1311 
1314 }
1315 
1320  void yyassembler_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1321 {
1322 
1323  /* TODO. We should be able to replace this entire function body
1324  * with
1325  * yyassemblerpop_buffer_state();
1326  * yyassemblerpush_buffer_state(new_buffer);
1327  */
1329  if ( YY_CURRENT_BUFFER == new_buffer )
1330  return;
1331 
1332  if ( YY_CURRENT_BUFFER )
1333  {
1334  /* Flush out information for old buffer. */
1335  *(yy_c_buf_p) = (yy_hold_char);
1336  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1337  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1338  }
1339 
1340  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1342 
1343  /* We don't actually know whether we did this switch during
1344  * EOF (yyassemblerwrap()) processing, but the only time this flag
1345  * is looked at is after yyassemblerwrap() is called, so it's safe
1346  * to go ahead and always set it.
1347  */
1349 }
1350 
1352 {
1353  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1354  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1355  yyassemblerin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1356  (yy_hold_char) = *(yy_c_buf_p);
1357 }
1358 
1365  YY_BUFFER_STATE yyassembler_create_buffer (FILE * file, int size )
1366 {
1367  YY_BUFFER_STATE b;
1368 
1369  b = (YY_BUFFER_STATE) yyassembleralloc(sizeof( struct yy_buffer_state ) );
1370  if ( ! b )
1371  YY_FATAL_ERROR( "out of dynamic memory in yyassembler_create_buffer()" );
1372 
1373  b->yy_buf_size = size;
1374 
1375  /* yy_ch_buf has to be 2 characters longer than the size given because
1376  * we need to put in 2 end-of-buffer characters.
1377  */
1378  b->yy_ch_buf = (char *) yyassembleralloc((yy_size_t) (b->yy_buf_size + 2) );
1379  if ( ! b->yy_ch_buf )
1380  YY_FATAL_ERROR( "out of dynamic memory in yyassembler_create_buffer()" );
1381 
1382  b->yy_is_our_buffer = 1;
1383 
1384  yyassembler_init_buffer(b,file );
1385 
1386  return b;
1387 }
1388 
1393  void yyassembler_delete_buffer (YY_BUFFER_STATE b )
1394 {
1395 
1396  if ( ! b )
1397  return;
1398 
1399  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1401 
1402  if ( b->yy_is_our_buffer )
1403  yyassemblerfree((void *) b->yy_ch_buf );
1404 
1405  yyassemblerfree((void *) b );
1406 }
1407 
1408 /* Initializes or reinitializes a buffer.
1409  * This function is sometimes called more than once on the same buffer,
1410  * such as during a yyassemblerrestart() or at EOF.
1411  */
1412  static void yyassembler_init_buffer (YY_BUFFER_STATE b, FILE * file )
1413 
1414 {
1415  int oerrno = errno;
1416 
1418 
1419  b->yy_input_file = file;
1420  b->yy_fill_buffer = 1;
1421 
1422  /* If b is the current buffer, then yyassembler_init_buffer was _probably_
1423  * called from yyassemblerrestart() or through yy_get_next_buffer.
1424  * In that case, we don't want to reset the lineno or column.
1425  */
1426  if (b != YY_CURRENT_BUFFER){
1427  b->yy_bs_lineno = 1;
1428  b->yy_bs_column = 0;
1429  }
1430 
1431  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1432 
1433  errno = oerrno;
1434 }
1435 
1440  void yyassembler_flush_buffer (YY_BUFFER_STATE b )
1441 {
1442  if ( ! b )
1443  return;
1444 
1445  b->yy_n_chars = 0;
1446 
1447  /* We always need two end-of-buffer characters. The first causes
1448  * a transition to the end-of-buffer state. The second causes
1449  * a jam in that state.
1450  */
1453 
1454  b->yy_buf_pos = &b->yy_ch_buf[0];
1455 
1456  b->yy_at_bol = 1;
1458 
1459  if ( b == YY_CURRENT_BUFFER )
1461 }
1462 
1469 void yyassemblerpush_buffer_state (YY_BUFFER_STATE new_buffer )
1470 {
1471  if (new_buffer == NULL)
1472  return;
1473 
1475 
1476  /* This block is copied from yyassembler_switch_to_buffer. */
1477  if ( YY_CURRENT_BUFFER )
1478  {
1479  /* Flush out information for old buffer. */
1480  *(yy_c_buf_p) = (yy_hold_char);
1481  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1482  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1483  }
1484 
1485  /* Only push if top exists. Otherwise, replace top. */
1486  if (YY_CURRENT_BUFFER)
1487  (yy_buffer_stack_top)++;
1488  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1489 
1490  /* copied from yyassembler_switch_to_buffer. */
1493 }
1494 
1500 {
1501  if (!YY_CURRENT_BUFFER)
1502  return;
1503 
1505  YY_CURRENT_BUFFER_LVALUE = NULL;
1506  if ((yy_buffer_stack_top) > 0)
1507  --(yy_buffer_stack_top);
1508 
1509  if (YY_CURRENT_BUFFER) {
1512  }
1513 }
1514 
1515 /* Allocates the stack if it does not exist.
1516  * Guarantees space for at least one push.
1517  */
1519 {
1520  int num_to_alloc;
1521 
1522  if (!(yy_buffer_stack)) {
1523 
1524  /* First allocation is just for 2 elements, since we don't know if this
1525  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1526  * immediate realloc on the next call.
1527  */
1528  num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1530  (num_to_alloc * sizeof(struct yy_buffer_state*)
1531  );
1532  if ( ! (yy_buffer_stack) )
1533  YY_FATAL_ERROR( "out of dynamic memory in yyassemblerensure_buffer_stack()" );
1534 
1535  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1536 
1537  (yy_buffer_stack_max) = num_to_alloc;
1538  (yy_buffer_stack_top) = 0;
1539  return;
1540  }
1541 
1542  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1543 
1544  /* Increase the buffer to prepare for a possible push. */
1545  yy_size_t grow_size = 8 /* arbitrary grow size */;
1546 
1547  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1549  ((yy_buffer_stack),
1550  num_to_alloc * sizeof(struct yy_buffer_state*)
1551  );
1552  if ( ! (yy_buffer_stack) )
1553  YY_FATAL_ERROR( "out of dynamic memory in yyassemblerensure_buffer_stack()" );
1554 
1555  /* zero only the new slots.*/
1556  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1557  (yy_buffer_stack_max) = num_to_alloc;
1558  }
1559 }
1560 
1567 YY_BUFFER_STATE yyassembler_scan_buffer (char * base, yy_size_t size )
1568 {
1569  YY_BUFFER_STATE b;
1570 
1571  if ( size < 2 ||
1572  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1573  base[size-1] != YY_END_OF_BUFFER_CHAR )
1574  /* They forgot to leave room for the EOB's. */
1575  return NULL;
1576 
1577  b = (YY_BUFFER_STATE) yyassembleralloc(sizeof( struct yy_buffer_state ) );
1578  if ( ! b )
1579  YY_FATAL_ERROR( "out of dynamic memory in yyassembler_scan_buffer()" );
1580 
1581  b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1582  b->yy_buf_pos = b->yy_ch_buf = base;
1583  b->yy_is_our_buffer = 0;
1584  b->yy_input_file = NULL;
1585  b->yy_n_chars = b->yy_buf_size;
1586  b->yy_is_interactive = 0;
1587  b->yy_at_bol = 1;
1588  b->yy_fill_buffer = 0;
1590 
1592 
1593  return b;
1594 }
1595 
1604 YY_BUFFER_STATE yyassembler_scan_string (yyconst char * yystr )
1605 {
1606 
1607  return yyassembler_scan_bytes(yystr,(int) strlen(yystr) );
1608 }
1609 
1617 YY_BUFFER_STATE yyassembler_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1618 {
1619  YY_BUFFER_STATE b;
1620  char *buf;
1621  yy_size_t n;
1622  yy_size_t i;
1623 
1624  /* Get memory for full buffer, including space for trailing EOB's. */
1625  n = (yy_size_t) _yybytes_len + 2;
1626  buf = (char *) yyassembleralloc(n );
1627  if ( ! buf )
1628  YY_FATAL_ERROR( "out of dynamic memory in yyassembler_scan_bytes()" );
1629 
1630  for ( i = 0; i < _yybytes_len; ++i )
1631  buf[i] = yybytes[i];
1632 
1633  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1634 
1635  b = yyassembler_scan_buffer(buf,n );
1636  if ( ! b )
1637  YY_FATAL_ERROR( "bad buffer in yyassembler_scan_bytes()" );
1638 
1639  /* It's okay to grow etc. this buffer, and we should throw it
1640  * away when we're done.
1641  */
1642  b->yy_is_our_buffer = 1;
1643 
1644  return b;
1645 }
1646 
1647 #ifndef YY_EXIT_FAILURE
1648 #define YY_EXIT_FAILURE 2
1649 #endif
1650 
1651 static void yynoreturn yy_fatal_error (yyconst char* msg )
1652 {
1653  (void) fprintf( stderr, "%s\n", msg );
1654  exit( YY_EXIT_FAILURE );
1655 }
1656 
1657 /* Redefine yyless() so it works in section 3 code. */
1658 
1659 #undef yyless
1660 #define yyless(n) \
1661  do \
1662  { \
1663  /* Undo effects of setting up yyassemblertext. */ \
1664  yy_size_t yyless_macro_arg = (n); \
1665  YY_LESS_LINENO(yyless_macro_arg);\
1666  yyassemblertext[yyassemblerleng] = (yy_hold_char); \
1667  (yy_c_buf_p) = yyassemblertext + yyless_macro_arg; \
1668  (yy_hold_char) = *(yy_c_buf_p); \
1669  *(yy_c_buf_p) = '\0'; \
1670  yyassemblerleng = yyless_macro_arg; \
1671  } \
1672  while ( 0 )
1673 
1674 /* Accessor methods (get/set functions) to struct members. */
1675 
1680 {
1681 
1682  return yyassemblerlineno;
1683 }
1684 
1688 FILE *yyassemblerget_in (void)
1689 {
1690  return yyassemblerin;
1691 }
1692 
1697 {
1698  return yyassemblerout;
1699 }
1700 
1705 {
1706  return yyassemblerleng;
1707 }
1708 
1714 {
1715  return yyassemblertext;
1716 }
1717 
1722 void yyassemblerset_lineno (int _line_number )
1723 {
1724 
1725  yyassemblerlineno = _line_number;
1726 }
1727 
1734 void yyassemblerset_in (FILE * _in_str )
1735 {
1736  yyassemblerin = _in_str ;
1737 }
1738 
1739 void yyassemblerset_out (FILE * _out_str )
1740 {
1741  yyassemblerout = _out_str ;
1742 }
1743 
1745 {
1746  return yyassembler_flex_debug;
1747 }
1748 
1749 void yyassemblerset_debug (int _bdebug )
1750 {
1751  yyassembler_flex_debug = _bdebug ;
1752 }
1753 
1754 static int yy_init_globals (void)
1755 {
1756  /* Initialization is the same as for the non-reentrant scanner.
1757  * This function is called from yyassemblerlex_destroy(), so don't allocate here.
1758  */
1759 
1760  (yy_buffer_stack) = NULL;
1761  (yy_buffer_stack_top) = 0;
1762  (yy_buffer_stack_max) = 0;
1763  (yy_c_buf_p) = NULL;
1764  (yy_init) = 0;
1765  (yy_start) = 0;
1766 
1767 /* Defined in main.c */
1768 #ifdef YY_STDINIT
1769  yyassemblerin = stdin;
1770  yyassemblerout = stdout;
1771 #else
1772  yyassemblerin = NULL;
1773  yyassemblerout = NULL;
1774 #endif
1775 
1776  /* For future reference: Set errno on error, since we are called by
1777  * yyassemblerlex_init()
1778  */
1779  return 0;
1780 }
1781 
1782 /* yyassemblerlex_destroy is for both reentrant and non-reentrant scanners. */
1784 {
1785 
1786  /* Pop the buffer stack, destroying each element. */
1787  while(YY_CURRENT_BUFFER){
1789  YY_CURRENT_BUFFER_LVALUE = NULL;
1791  }
1792 
1793  /* Destroy the stack itself. */
1794  yyassemblerfree((yy_buffer_stack) );
1795  (yy_buffer_stack) = NULL;
1796 
1797  /* Reset the globals. This is important in a non-reentrant scanner so the next time
1798  * yyassemblerlex() is called, initialization will occur. */
1799  yy_init_globals( );
1800 
1801  return 0;
1802 }
1803 
1804 /*
1805  * Internal utility routines.
1806  */
1807 
1808 #ifndef yytext_ptr
1809 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1810 {
1811 
1812  int i;
1813  for ( i = 0; i < n; ++i )
1814  s1[i] = s2[i];
1815 }
1816 #endif
1817 
1818 #ifdef YY_NEED_STRLEN
1819 static int yy_flex_strlen (yyconst char * s )
1820 {
1821  int n;
1822  for ( n = 0; s[n]; ++n )
1823  ;
1824 
1825  return n;
1826 }
1827 #endif
1828 
1830 {
1831  return malloc(size);
1832 }
1833 
1834 void *yyassemblerrealloc (void * ptr, yy_size_t size )
1835 {
1836 
1837  /* The cast to (char *) in the following accommodates both
1838  * implementations that use char* generic pointers, and those
1839  * that use void* generic pointers. It works with the latter
1840  * because both ANSI C and C++ allow castless assignment from
1841  * any pointer type to void*, and deal with argument conversions
1842  * as though doing an assignment.
1843  */
1844  return realloc(ptr, size);
1845 }
1846 
1847 void yyassemblerfree (void * ptr )
1848 {
1849  free( (char *) ptr ); /* see yyassemblerrealloc() for (char *) cast */
1850 }
1851 
1852 #define YYTABLES_NAME "yytables"
1853 
1854 #line 108 "scanner.l"
1855 
1856 
1857 
1858 int yyassemblerwrap() { return 1; }
1859 
void yyassemblerpush_buffer_state(YY_BUFFER_STATE new_buffer)
Pushes the new state onto the stack.
int yy_state_type
#define YY_BUFFER_NEW
unsigned int flex_uint32_t
#define YY_BUFFER_EOF_PENDING
static int yy_did_buffer_switch_on_eof
static const flex_int16_t yy_def[36]
int yyassemblerget_debug(void)
YY_BUFFER_STATE yyassembler_scan_buffer(char *base, yy_size_t size)
Setup the input buffer state to scan directly from a user-specified character buffer.
int yyassemblerlineno
static int yy_init_globals(void)
static const YY_CHAR yy_ec[256]
int yyassemblerlex_destroy(void)
#define YY_RESTORE_YY_MORE_OFFSET
size_t yy_size_t
static char yy_hold_char
#define YY_NEW_FILE
int yyassemblerget_leng(void)
Get the length of the current token.
unsigned char flex_uint8_t
#define yytext_ptr
static int yy_get_next_buffer(void)
void yyassemblerset_debug(int debug_flag)
int yyassemblerleng
static void yy_fatal_error(const char *msg)
YY_BUFFER_STATE yyassembler_scan_string(const char *yy_str)
Setup the input buffer state to scan a string.
#define YY_EXTRA_TYPE
#define YY_SC_TO_UI(c)
#define YY_EXIT_FAILURE
int yy_bs_lineno
The line count.
static const YY_CHAR yy_meta[19]
static size_t yy_buffer_stack_top
index of top of stack.
static int yy_init
FILE * yyassemblerget_in(void)
Get the input stream.
void yyassembler_delete_buffer(YY_BUFFER_STATE b)
Destroy the buffer.
static char * yy_last_accepting_cpos
void yyassemblerrestart(FILE *input_file)
Immediately switch to a different input stream.
int flex_int32_t
#define YY_MORE_ADJ
void yyassemblerset_extra(void *user_defined)
#define YY_FLUSH_BUFFER
void yyassembler_switch_to_buffer(YY_BUFFER_STATE new_buffer)
Switch to a different input buffer.
void free(void *)
#define yynoreturn
static yy_state_type yy_get_previous_state(void)
int yyassembler_flex_debug
short int flex_int16_t
int flex_int32_t
int yy_bs_column
The column count.
unsigned short int flex_uint16_t
char * yyassemblertext
FILE * yyassemblerin
void yyassembler_flush_buffer(YY_BUFFER_STATE b)
Discard all buffered characters.
#define ECHO
void assemlber_scanner_init()
static int yy_start
#define YY_BUFFER_NORMAL
Base class for tree-like data structures with sharing.
Definition: irep.h:87
#define EOB_ACT_LAST_MATCH
unsigned short int flex_uint16_t
#define YY_BREAK
#define EOB_ACT_END_OF_FILE
static YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
void * yyassembleralloc(yy_size_t)
unsigned char YY_CHAR
int yyassemblerget_lineno(void)
Get the current line number.
static const flex_int16_t yy_accept[33]
#define YY_CURRENT_BUFFER
#define YY_DECL
FILE * yyassemblerout
#define EOB_ACT_CONTINUE_SCAN
#define YY_END_OF_BUFFER
void yyassemblerpop_buffer_state(void)
Removes and deletes the top of the stack, if present.
static void yyassembler_init_buffer(YY_BUFFER_STATE b, FILE *file)
void yyassemblerfree(void *)
void * yyassemblerrealloc(void *, yy_size_t)
static size_t yy_buffer_stack_max
capacity of stack.
#define PARSER
#define YY_CURRENT_BUFFER_LVALUE
void yyassemblerset_lineno(int _line_number)
Set the current line number.
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
YY_BUFFER_STATE yyassembler_create_buffer(FILE *file, int size)
Allocate and initialize an input buffer state.
int yy_state_type
static yy_state_type yy_last_accepting_state
short int flex_int16_t
#define yyterminate()
#define YY_STATE_EOF(state)
#define LINE_COMMENT
void * yyassemblerget_extra(void)
static char * yy_c_buf_p
#define YY_START
void yyassemblerset_in(FILE *_in_str)
Set the input stream.
#define YY_END_OF_BUFFER_CHAR
YY_BUFFER_STATE yyassembler_scan_bytes(const char *bytes, int len)
Setup the input buffer state to scan the given bytes.
void * malloc(size_t)
#define YY_RULE_SETUP
FILE * yyassemblerget_out(void)
Get the output stream.
int8_t s1
Definition: bytecode_info.h:59
#define YY_DO_BEFORE_ACTION
int16_t s2
Definition: bytecode_info.h:60
void yyassemblerset_out(FILE *_out_str)
unsigned char YY_CHAR
#define YY_INPUT(buf, result, max_size)
#define yyless(n)
signed char flex_int8_t
#define yyconst
static const flex_uint16_t yy_base[36]
int yyassemblerwrap(void)
static void yyassembler_load_buffer_state(void)
#define GRAMMAR
#define BEGIN
static void yyassemblerensure_buffer_stack(void)
static const flex_int16_t yy_chk[64]
char * yyassemblerget_text(void)
Get the current token.
void set(const irep_namet &name, const irep_idt &value)
Definition: irep.h:214
#define YY_FATAL_ERROR(msg)
#define INITIAL
struct yy_buffer_state * YY_BUFFER_STATE
int yyassemblerlex(void)
The main scanner function which does all the work.
#define YY_READ_BUF_SIZE
size_t yy_size_t
#define YY_BUF_SIZE
Definition: kdev_t.h:19
static const flex_uint16_t yy_nxt[64]