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;
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 );
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 
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  {
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 #define YY_NO_UNISTD_H 1
493 #line 7 "scanner.l"
494 
495 #define PARSER assembler_parser
496 #define YYSTYPE unsigned
497 #undef ECHO
498 #define ECHO
499 
500 #include "assembler_parser.h"
501 
502 #include <util/pragma_wsign_compare.def>
503 #include <util/pragma_wnull_conversion.def>
504 #include <util/pragma_wdeprecated_register.def>
505 
506 /*** macros for easier rule definition **********************************/
507 
508 
509 #line 56 "scanner.l"
511 {
513  BEGIN(0);
514 }
515 #line 516 "assembler_lex.yy.cpp"
516 
517 #define INITIAL 0
518 #define GRAMMAR 1
519 #define LINE_COMMENT 2
520 
521 #ifndef YY_NO_UNISTD_H
522 /* Special case for "unistd.h", since it is non-ANSI. We include it way
523  * down here because we want the user's section 1 to have been scanned first.
524  * The user has a chance to override it with an option.
525  */
526 #include <unistd.h>
527 #endif
528 
529 #ifndef YY_EXTRA_TYPE
530 #define YY_EXTRA_TYPE void *
531 #endif
532 
533 static int yy_init_globals (void );
534 
535 /* Accessor methods to globals.
536  These are made visible to non-reentrant scanners for convenience. */
537 
538 int yyassemblerlex_destroy (void );
539 
540 int yyassemblerget_debug (void );
541 
542 void yyassemblerset_debug (int debug_flag );
543 
545 
546 void yyassemblerset_extra (YY_EXTRA_TYPE user_defined );
547 
548 FILE *yyassemblerget_in (void );
549 
550 void yyassemblerset_in (FILE * _in_str );
551 
552 FILE *yyassemblerget_out (void );
553 
554 void yyassemblerset_out (FILE * _out_str );
555 
556  int yyassemblerget_leng (void );
557 
558 char *yyassemblerget_text (void );
559 
560 int yyassemblerget_lineno (void );
561 
562 void yyassemblerset_lineno (int _line_number );
563 
564 /* Macros after this point can all be overridden by user definitions in
565  * section 1.
566  */
567 
568 #ifndef YY_SKIP_YYWRAP
569 #ifdef __cplusplus
570 extern "C" int yyassemblerwrap (void );
571 #else
572 extern int yyassemblerwrap (void );
573 #endif
574 #endif
575 
576 #ifndef YY_NO_UNPUT
577 
578 #endif
579 
580 #ifndef yytext_ptr
581 static void yy_flex_strncpy (char *,yyconst char *,int );
582 #endif
583 
584 #ifdef YY_NEED_STRLEN
585 static int yy_flex_strlen (yyconst char * );
586 #endif
587 
588 #ifndef YY_NO_INPUT
589 
590 #ifdef __cplusplus
591 static int yyinput (void );
592 #else
593 static int input (void );
594 #endif
595 
596 #endif
597 
598 /* Amount of stuff to slurp up with each read. */
599 #ifndef YY_READ_BUF_SIZE
600 #ifdef __ia64__
601 /* On IA-64, the buffer size is 16k, not 8k */
602 #define YY_READ_BUF_SIZE 16384
603 #else
604 #define YY_READ_BUF_SIZE 8192
605 #endif /* __ia64__ */
606 #endif
607 
608 /* Copy whatever the last rule matched to the standard output. */
609 #ifndef ECHO
610 /* This used to be an fputs(), but since the string might contain NUL's,
611  * we now use fwrite().
612  */
613 #define ECHO do { if (fwrite( yyassemblertext, (size_t) yyassemblerleng, 1, yyassemblerout )) {} } while (0)
614 #endif
615 
616 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
617  * is returned in "result".
618  */
619 #ifndef YY_INPUT
620 #define YY_INPUT(buf,result,max_size) \
621  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
622  { \
623  int c = '*'; \
624  int n; \
625  for ( n = 0; n < max_size && \
626  (c = getc( yyassemblerin )) != EOF && c != '\n'; ++n ) \
627  buf[n] = (char) c; \
628  if ( c == '\n' ) \
629  buf[n++] = (char) c; \
630  if ( c == EOF && ferror( yyassemblerin ) ) \
631  YY_FATAL_ERROR( "input in flex scanner failed" ); \
632  result = n; \
633  } \
634  else \
635  { \
636  errno=0; \
637  while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyassemblerin)) == 0 && ferror(yyassemblerin)) \
638  { \
639  if( errno != EINTR) \
640  { \
641  YY_FATAL_ERROR( "input in flex scanner failed" ); \
642  break; \
643  } \
644  errno=0; \
645  clearerr(yyassemblerin); \
646  } \
647  }\
648 \
649 
650 #endif
651 
652 /* No semi-colon after return; correct usage is to write "yyterminate();" -
653  * we don't want an extra ';' after the "return" because that will cause
654  * some compilers to complain about unreachable statements.
655  */
656 #ifndef yyterminate
657 #define yyterminate() return YY_NULL
658 #endif
659 
660 /* Number of entries by which start-condition stack grows. */
661 #ifndef YY_START_STACK_INCR
662 #define YY_START_STACK_INCR 25
663 #endif
664 
665 /* Report a fatal error. */
666 #ifndef YY_FATAL_ERROR
667 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
668 #endif
669 
670 /* end tables serialization structures and prototypes */
671 
672 /* Default declaration of generated scanner - a define so the user can
673  * easily add parameters.
674  */
675 #ifndef YY_DECL
676 #define YY_DECL_IS_OURS 1
677 
678 extern int yyassemblerlex (void);
679 
680 #define YY_DECL int yyassemblerlex (void)
681 #endif /* !YY_DECL */
682 
683 /* Code executed at the beginning of each rule, after yyassemblertext and yyassemblerleng
684  * have been set up.
685  */
686 #ifndef YY_USER_ACTION
687 #define YY_USER_ACTION
688 #endif
689 
690 /* Code executed at the end of each rule. */
691 #ifndef YY_BREAK
692 #define YY_BREAK /*LINTED*/break;
693 #endif
694 
695 #define YY_RULE_SETUP \
696  YY_USER_ACTION
697 
701 {
702  yy_state_type yy_current_state;
703  char *yy_cp, *yy_bp;
704  int yy_act;
705 
706  if ( !(yy_init) )
707  {
708  (yy_init) = 1;
709 
710 #ifdef YY_USER_INIT
711  YY_USER_INIT;
712 #endif
713 
714  if ( ! (yy_start) )
715  (yy_start) = 1; /* first start state */
716 
717  if ( ! yyassemblerin )
718  yyassemblerin = stdin;
719 
720  if ( ! yyassemblerout )
721  yyassemblerout = stdout;
722 
723  if ( ! YY_CURRENT_BUFFER ) {
727  }
728 
730  }
731 
732  {
733 #line 63 "scanner.l"
734 
735 
736 #line 737 "assembler_lex.yy.cpp"
737 
738  while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
739  {
740  yy_cp = (yy_c_buf_p);
741 
742  /* Support of yyassemblertext. */
743  *yy_cp = (yy_hold_char);
744 
745  /* yy_bp points to the position in yy_ch_buf of the start of
746  * the current run.
747  */
748  yy_bp = yy_cp;
749 
750  yy_current_state = (yy_start);
751 yy_match:
752  do
753  {
754  YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
755  if ( yy_accept[yy_current_state] )
756  {
757  (yy_last_accepting_state) = yy_current_state;
758  (yy_last_accepting_cpos) = yy_cp;
759  }
760  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
761  {
762  yy_current_state = (int) yy_def[yy_current_state];
763  if ( yy_current_state >= 33 )
764  yy_c = yy_meta[(unsigned int) yy_c];
765  }
766  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
767  ++yy_cp;
768  }
769  while ( yy_current_state != 32 );
770  yy_cp = (yy_last_accepting_cpos);
771  yy_current_state = (yy_last_accepting_state);
772 
773 yy_find_action:
774  yy_act = yy_accept[yy_current_state];
775 
777 
778 do_action: /* This label is used only to access EOF actions. */
779 
780  switch ( yy_act )
781  { /* beginning of action switch */
782  case 0: /* must back up */
783  /* undo the effects of YY_DO_BEFORE_ACTION */
784  *yy_cp = (yy_hold_char);
785  yy_cp = (yy_last_accepting_cpos);
786  yy_current_state = (yy_last_accepting_state);
787  goto yy_find_action;
788 
789 case 1:
790 /* rule 1 can match eol */
792 #line 65 "scanner.l"
793 { BEGIN(GRAMMAR);
794  yyless(0); /* start again with this character */
795  }
796  YY_BREAK
797 case 2:
799 #line 69 "scanner.l"
800 { PARSER.new_instruction(); BEGIN(LINE_COMMENT); } /* begin comment state */
801  YY_BREAK
802 
803 case 3:
804 /* rule 3 can match eol */
806 #line 72 "scanner.l"
807 { BEGIN(GRAMMAR); } /* end comment state, back GRAMMAR */
808  YY_BREAK
809 case 4:
811 #line 73 "scanner.l"
812 { } /* all characters within comments are ignored */
813  YY_BREAK
814 
815 case 5:
816 /* rule 5 can match eol */
818 #line 76 "scanner.l"
819 { PARSER.new_instruction(); }
820  YY_BREAK
821 case 6:
823 #line 77 "scanner.l"
824 { PARSER.new_instruction(); }
825  YY_BREAK
826 case 7:
828 #line 78 "scanner.l"
829 { } /* skipped */
830  YY_BREAK
831 /*** keywords ***/
832 
833 case 8:
835 #line 83 "scanner.l"
836 { }
837  YY_BREAK
838 
839 /*** rest ***/
840 
841 case 9:
843 #line 89 "scanner.l"
844 { /* ignore */ }
845  YY_BREAK
846 case 10:
848 #line 90 "scanner.l"
849 { irept identifier(ID_symbol);
850  identifier.set(ID_identifier, yyassemblertext);
851  PARSER.add_token(identifier);
852  }
853  YY_BREAK
854 case 11:
856 #line 95 "scanner.l"
857 { PARSER.add_token(irept(ID_shr)); }
858  YY_BREAK
859 case 12:
861 #line 96 "scanner.l"
862 { PARSER.add_token(irept(ID_shl)); }
863  YY_BREAK
864 case 13:
866 #line 97 "scanner.l"
867 { std::string s;
868  s+=yyassemblertext[0];
869  PARSER.add_token(irept(s));
870  }
871  YY_BREAK
872 
873 case YY_STATE_EOF(INITIAL):
874 case YY_STATE_EOF(GRAMMAR):
876 #line 103 "scanner.l"
877 { yyterminate(); /* done! */ }
878  YY_BREAK
879 case 14:
881 #line 105 "scanner.l"
882 ECHO;
883  YY_BREAK
884 #line 885 "assembler_lex.yy.cpp"
885 
886  case YY_END_OF_BUFFER:
887  {
888  /* Amount of text matched not including the EOB char. */
889  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
890 
891  /* Undo the effects of YY_DO_BEFORE_ACTION. */
892  *yy_cp = (yy_hold_char);
894 
895  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
896  {
897  /* We're scanning a new file or input source. It's
898  * possible that this happened because the user
899  * just pointed yyassemblerin at a new source and called
900  * yyassemblerlex(). If so, then we have to assure
901  * consistency between YY_CURRENT_BUFFER and our
902  * globals. Here is the right place to do so, because
903  * this is the first action (other than possibly a
904  * back-up) that will match for the new input source.
905  */
906  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
907  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyassemblerin;
908  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
909  }
910 
911  /* Note that here we test for yy_c_buf_p "<=" to the position
912  * of the first EOB in the buffer, since yy_c_buf_p will
913  * already have been incremented past the NUL character
914  * (since all states make transitions on EOB to the
915  * end-of-buffer state). Contrast this with the test
916  * in input().
917  */
918  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
919  { /* This was really a NUL. */
920  yy_state_type yy_next_state;
921 
922  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
923 
924  yy_current_state = yy_get_previous_state( );
925 
926  /* Okay, we're now positioned to make the NUL
927  * transition. We couldn't have
928  * yy_get_previous_state() go ahead and do it
929  * for us because it doesn't know how to deal
930  * with the possibility of jamming (and we don't
931  * want to build jamming into it because then it
932  * will run more slowly).
933  */
934 
935  yy_next_state = yy_try_NUL_trans( yy_current_state );
936 
937  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
938 
939  if ( yy_next_state )
940  {
941  /* Consume the NUL. */
942  yy_cp = ++(yy_c_buf_p);
943  yy_current_state = yy_next_state;
944  goto yy_match;
945  }
946 
947  else
948  {
949  yy_cp = (yy_last_accepting_cpos);
950  yy_current_state = (yy_last_accepting_state);
951  goto yy_find_action;
952  }
953  }
954 
955  else switch ( yy_get_next_buffer( ) )
956  {
957  case EOB_ACT_END_OF_FILE:
958  {
960 
961  if ( yyassemblerwrap( ) )
962  {
963  /* Note: because we've taken care in
964  * yy_get_next_buffer() to have set up
965  * yyassemblertext, we can now set up
966  * yy_c_buf_p so that if some total
967  * hoser (like flex itself) wants to
968  * call the scanner after we return the
969  * YY_NULL, it'll still work - another
970  * YY_NULL will get returned.
971  */
973 
974  yy_act = YY_STATE_EOF(YY_START);
975  goto do_action;
976  }
977 
978  else
979  {
980  if ( ! (yy_did_buffer_switch_on_eof) )
981  YY_NEW_FILE;
982  }
983  break;
984  }
985 
987  (yy_c_buf_p) =
988  (yytext_ptr) + yy_amount_of_matched_text;
989 
990  yy_current_state = yy_get_previous_state( );
991 
992  yy_cp = (yy_c_buf_p);
993  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
994  goto yy_match;
995 
996  case EOB_ACT_LAST_MATCH:
997  (yy_c_buf_p) =
998  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
999 
1000  yy_current_state = yy_get_previous_state( );
1001 
1002  yy_cp = (yy_c_buf_p);
1003  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1004  goto yy_find_action;
1005  }
1006  break;
1007  }
1008 
1009  default:
1011  "fatal flex scanner internal error--no action found" );
1012  } /* end of action switch */
1013  } /* end of scanning one token */
1014  } /* end of user's declarations */
1015 } /* end of yyassemblerlex */
1016 
1017 /* yy_get_next_buffer - try to read in a new buffer
1018  *
1019  * Returns a code representing an action:
1020  * EOB_ACT_LAST_MATCH -
1021  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1022  * EOB_ACT_END_OF_FILE - end of file
1023  */
1024 static int yy_get_next_buffer (void)
1025 {
1026  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1027  char *source = (yytext_ptr);
1028  yy_size_t number_to_move, i;
1029  int ret_val;
1030 
1031  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1033  "fatal flex scanner internal error--end of buffer missed" );
1034 
1035  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1036  { /* Don't try to fill the buffer, so this is an EOF. */
1037  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1038  {
1039  /* We matched a single character, the EOB, so
1040  * treat this as a final EOF.
1041  */
1042  return EOB_ACT_END_OF_FILE;
1043  }
1044 
1045  else
1046  {
1047  /* We matched some text prior to the EOB, first
1048  * process it.
1049  */
1050  return EOB_ACT_LAST_MATCH;
1051  }
1052  }
1053 
1054  /* Try to read more data. */
1055 
1056  /* First move last chars to start of buffer. */
1057  number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1058 
1059  for ( i = 0; i < number_to_move; ++i )
1060  *(dest++) = *(source++);
1061 
1062  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1063  /* don't do the read, it's not guaranteed to return an EOF,
1064  * just force an EOF
1065  */
1066  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1067 
1068  else
1069  {
1070  int num_to_read =
1071  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1072 
1073  while ( num_to_read <= 0 )
1074  { /* Not enough room in the buffer - grow it. */
1075 
1076  /* just a shorter name for the current buffer */
1078 
1079  int yy_c_buf_p_offset =
1080  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1081 
1082  if ( b->yy_is_our_buffer )
1083  {
1084  int new_size = b->yy_buf_size * 2;
1085 
1086  if ( new_size <= 0 )
1087  b->yy_buf_size += b->yy_buf_size / 8;
1088  else
1089  b->yy_buf_size *= 2;
1090 
1091  b->yy_ch_buf = (char *)
1092  /* Include room in for 2 EOB chars. */
1093  yyassemblerrealloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) );
1094  }
1095  else
1096  /* Can't grow it, we don't own it. */
1097  b->yy_ch_buf = NULL;
1098 
1099  if ( ! b->yy_ch_buf )
1101  "fatal error - scanner input buffer overflow" );
1102 
1103  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1104 
1105  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1106  number_to_move - 1;
1107 
1108  }
1109 
1110  if ( num_to_read > YY_READ_BUF_SIZE )
1111  num_to_read = YY_READ_BUF_SIZE;
1112 
1113  /* Read in more data. */
1114  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1115  (yy_n_chars), num_to_read );
1116 
1117  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1118  }
1119 
1120  if ( (yy_n_chars) == 0 )
1121  {
1122  if ( number_to_move == YY_MORE_ADJ )
1123  {
1124  ret_val = EOB_ACT_END_OF_FILE;
1126  }
1127 
1128  else
1129  {
1130  ret_val = EOB_ACT_LAST_MATCH;
1131  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1133  }
1134  }
1135 
1136  else
1137  ret_val = EOB_ACT_CONTINUE_SCAN;
1138 
1139  if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1140  /* Extend the array by 50%, plus the number we really need. */
1141  int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1142  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyassemblerrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size );
1143  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1144  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1145  }
1146 
1147  (yy_n_chars) += number_to_move;
1150 
1151  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1152 
1153  return ret_val;
1154 }
1155 
1156 /* yy_get_previous_state - get the state just before the EOB char was reached */
1157 
1159 {
1160  yy_state_type yy_current_state;
1161  char *yy_cp;
1162 
1163  yy_current_state = (yy_start);
1164 
1165  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1166  {
1167  YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1168  if ( yy_accept[yy_current_state] )
1169  {
1170  (yy_last_accepting_state) = yy_current_state;
1171  (yy_last_accepting_cpos) = yy_cp;
1172  }
1173  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1174  {
1175  yy_current_state = (int) yy_def[yy_current_state];
1176  if ( yy_current_state >= 33 )
1177  yy_c = yy_meta[(unsigned int) yy_c];
1178  }
1179  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1180  }
1181 
1182  return yy_current_state;
1183 }
1184 
1185 /* yy_try_NUL_trans - try to make a transition on the NUL character
1186  *
1187  * synopsis
1188  * next_state = yy_try_NUL_trans( current_state );
1189  */
1190  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1191 {
1192  int yy_is_jam;
1193  char *yy_cp = (yy_c_buf_p);
1194 
1195  YY_CHAR yy_c = 1;
1196  if ( yy_accept[yy_current_state] )
1197  {
1198  (yy_last_accepting_state) = yy_current_state;
1199  (yy_last_accepting_cpos) = yy_cp;
1200  }
1201  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1202  {
1203  yy_current_state = (int) yy_def[yy_current_state];
1204  if ( yy_current_state >= 33 )
1205  yy_c = yy_meta[(unsigned int) yy_c];
1206  }
1207  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1208  yy_is_jam = (yy_current_state == 32);
1209 
1210  return yy_is_jam ? 0 : yy_current_state;
1211 }
1212 
1213 #ifndef YY_NO_UNPUT
1214 
1215 #endif
1216 
1217 #ifndef YY_NO_INPUT
1218 #ifdef __cplusplus
1219  static int yyinput (void)
1220 #else
1221  static int input (void)
1222 #endif
1223 
1224 {
1225  int c;
1226 
1227  *(yy_c_buf_p) = (yy_hold_char);
1228 
1229  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1230  {
1231  /* yy_c_buf_p now points to the character we want to return.
1232  * If this occurs *before* the EOB characters, then it's a
1233  * valid NUL; if not, then we've hit the end of the buffer.
1234  */
1235  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1236  /* This was really a NUL. */
1237  *(yy_c_buf_p) = '\0';
1238 
1239  else
1240  { /* need more input */
1241  int offset = (yy_c_buf_p) - (yytext_ptr);
1242  ++(yy_c_buf_p);
1243 
1244  switch ( yy_get_next_buffer( ) )
1245  {
1246  case EOB_ACT_LAST_MATCH:
1247  /* This happens because yy_g_n_b()
1248  * sees that we've accumulated a
1249  * token and flags that we need to
1250  * try matching the token before
1251  * proceeding. But for input(),
1252  * there's no matching to consider.
1253  * So convert the EOB_ACT_LAST_MATCH
1254  * to EOB_ACT_END_OF_FILE.
1255  */
1256 
1257  /* Reset buffer status. */
1259 
1260  /*FALLTHROUGH*/
1261 
1262  case EOB_ACT_END_OF_FILE:
1263  {
1264  if ( yyassemblerwrap( ) )
1265  return 0;
1266 
1267  if ( ! (yy_did_buffer_switch_on_eof) )
1268  YY_NEW_FILE;
1269 #ifdef __cplusplus
1270  return yyinput();
1271 #else
1272  return input();
1273 #endif
1274  }
1275 
1276  case EOB_ACT_CONTINUE_SCAN:
1277  (yy_c_buf_p) = (yytext_ptr) + offset;
1278  break;
1279  }
1280  }
1281  }
1282 
1283  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1284  *(yy_c_buf_p) = '\0'; /* preserve yyassemblertext */
1285  (yy_hold_char) = *++(yy_c_buf_p);
1286 
1287  return c;
1288 }
1289 #endif /* ifndef YY_NO_INPUT */
1290 
1296  void yyassemblerrestart (FILE * input_file )
1297 {
1298 
1299  if ( ! YY_CURRENT_BUFFER ){
1303  }
1304 
1307 }
1308 
1314 {
1315 
1316  /* TODO. We should be able to replace this entire function body
1317  * with
1318  * yyassemblerpop_buffer_state();
1319  * yyassemblerpush_buffer_state(new_buffer);
1320  */
1322  if ( YY_CURRENT_BUFFER == new_buffer )
1323  return;
1324 
1325  if ( YY_CURRENT_BUFFER )
1326  {
1327  /* Flush out information for old buffer. */
1328  *(yy_c_buf_p) = (yy_hold_char);
1329  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1330  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1331  }
1332 
1333  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1335 
1336  /* We don't actually know whether we did this switch during
1337  * EOF (yyassemblerwrap()) processing, but the only time this flag
1338  * is looked at is after yyassemblerwrap() is called, so it's safe
1339  * to go ahead and always set it.
1340  */
1342 }
1343 
1345 {
1346  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1347  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1348  yyassemblerin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1349  (yy_hold_char) = *(yy_c_buf_p);
1350 }
1351 
1359 {
1360  YY_BUFFER_STATE b;
1361 
1362  b = (YY_BUFFER_STATE) yyassembleralloc(sizeof( struct yy_buffer_state ) );
1363  if ( ! b )
1364  YY_FATAL_ERROR( "out of dynamic memory in yyassembler_create_buffer()" );
1365 
1366  b->yy_buf_size = size;
1367 
1368  /* yy_ch_buf has to be 2 characters longer than the size given because
1369  * we need to put in 2 end-of-buffer characters.
1370  */
1371  b->yy_ch_buf = (char *) yyassembleralloc((yy_size_t) (b->yy_buf_size + 2) );
1372  if ( ! b->yy_ch_buf )
1373  YY_FATAL_ERROR( "out of dynamic memory in yyassembler_create_buffer()" );
1374 
1375  b->yy_is_our_buffer = 1;
1376 
1378 
1379  return b;
1380 }
1381 
1387 {
1388 
1389  if ( ! b )
1390  return;
1391 
1392  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1394 
1395  if ( b->yy_is_our_buffer )
1396  yyassemblerfree((void *) b->yy_ch_buf );
1397 
1398  yyassemblerfree((void *) b );
1399 }
1400 
1401 /* Initializes or reinitializes a buffer.
1402  * This function is sometimes called more than once on the same buffer,
1403  * such as during a yyassemblerrestart() or at EOF.
1404  */
1406 
1407 {
1408  int oerrno = errno;
1409 
1411 
1412  b->yy_input_file = file;
1413  b->yy_fill_buffer = 1;
1414 
1415  /* If b is the current buffer, then yyassembler_init_buffer was _probably_
1416  * called from yyassemblerrestart() or through yy_get_next_buffer.
1417  * In that case, we don't want to reset the lineno or column.
1418  */
1419  if (b != YY_CURRENT_BUFFER){
1420  b->yy_bs_lineno = 1;
1421  b->yy_bs_column = 0;
1422  }
1423 
1424  b->yy_is_interactive = 0;
1425 
1426  errno = oerrno;
1427 }
1428 
1434 {
1435  if ( ! b )
1436  return;
1437 
1438  b->yy_n_chars = 0;
1439 
1440  /* We always need two end-of-buffer characters. The first causes
1441  * a transition to the end-of-buffer state. The second causes
1442  * a jam in that state.
1443  */
1446 
1447  b->yy_buf_pos = &b->yy_ch_buf[0];
1448 
1449  b->yy_at_bol = 1;
1451 
1452  if ( b == YY_CURRENT_BUFFER )
1454 }
1455 
1463 {
1464  if (new_buffer == NULL)
1465  return;
1466 
1468 
1469  /* This block is copied from yyassembler_switch_to_buffer. */
1470  if ( YY_CURRENT_BUFFER )
1471  {
1472  /* Flush out information for old buffer. */
1473  *(yy_c_buf_p) = (yy_hold_char);
1474  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1475  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1476  }
1477 
1478  /* Only push if top exists. Otherwise, replace top. */
1479  if (YY_CURRENT_BUFFER)
1480  (yy_buffer_stack_top)++;
1481  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1482 
1483  /* copied from yyassembler_switch_to_buffer. */
1486 }
1487 
1493 {
1494  if (!YY_CURRENT_BUFFER)
1495  return;
1496 
1498  YY_CURRENT_BUFFER_LVALUE = NULL;
1499  if ((yy_buffer_stack_top) > 0)
1500  --(yy_buffer_stack_top);
1501 
1502  if (YY_CURRENT_BUFFER) {
1505  }
1506 }
1507 
1508 /* Allocates the stack if it does not exist.
1509  * Guarantees space for at least one push.
1510  */
1512 {
1513  int num_to_alloc;
1514 
1515  if (!(yy_buffer_stack)) {
1516 
1517  /* First allocation is just for 2 elements, since we don't know if this
1518  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1519  * immediate realloc on the next call.
1520  */
1521  num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1523  (num_to_alloc * sizeof(struct yy_buffer_state*)
1524  );
1525  if ( ! (yy_buffer_stack) )
1526  YY_FATAL_ERROR( "out of dynamic memory in yyassemblerensure_buffer_stack()" );
1527 
1528  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1529 
1530  (yy_buffer_stack_max) = num_to_alloc;
1531  (yy_buffer_stack_top) = 0;
1532  return;
1533  }
1534 
1535  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1536 
1537  /* Increase the buffer to prepare for a possible push. */
1538  yy_size_t grow_size = 8 /* arbitrary grow size */;
1539 
1540  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1542  ((yy_buffer_stack),
1543  num_to_alloc * sizeof(struct yy_buffer_state*)
1544  );
1545  if ( ! (yy_buffer_stack) )
1546  YY_FATAL_ERROR( "out of dynamic memory in yyassemblerensure_buffer_stack()" );
1547 
1548  /* zero only the new slots.*/
1549  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1550  (yy_buffer_stack_max) = num_to_alloc;
1551  }
1552 }
1553 
1561 {
1562  YY_BUFFER_STATE b;
1563 
1564  if ( size < 2 ||
1565  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1566  base[size-1] != YY_END_OF_BUFFER_CHAR )
1567  /* They forgot to leave room for the EOB's. */
1568  return NULL;
1569 
1570  b = (YY_BUFFER_STATE) yyassembleralloc(sizeof( struct yy_buffer_state ) );
1571  if ( ! b )
1572  YY_FATAL_ERROR( "out of dynamic memory in yyassembler_scan_buffer()" );
1573 
1574  b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1575  b->yy_buf_pos = b->yy_ch_buf = base;
1576  b->yy_is_our_buffer = 0;
1577  b->yy_input_file = NULL;
1578  b->yy_n_chars = b->yy_buf_size;
1579  b->yy_is_interactive = 0;
1580  b->yy_at_bol = 1;
1581  b->yy_fill_buffer = 0;
1583 
1585 
1586  return b;
1587 }
1588 
1598 {
1599 
1600  return yyassembler_scan_bytes(yystr,(int) strlen(yystr) );
1601 }
1602 
1610 YY_BUFFER_STATE yyassembler_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1611 {
1612  YY_BUFFER_STATE b;
1613  char *buf;
1614  yy_size_t n;
1615  int i;
1616 
1617  /* Get memory for full buffer, including space for trailing EOB's. */
1618  n = (yy_size_t) (_yybytes_len + 2);
1619  buf = (char *) yyassembleralloc(n );
1620  if ( ! buf )
1621  YY_FATAL_ERROR( "out of dynamic memory in yyassembler_scan_bytes()" );
1622 
1623  for ( i = 0; i < _yybytes_len; ++i )
1624  buf[i] = yybytes[i];
1625 
1626  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1627 
1628  b = yyassembler_scan_buffer(buf,n );
1629  if ( ! b )
1630  YY_FATAL_ERROR( "bad buffer in yyassembler_scan_bytes()" );
1631 
1632  /* It's okay to grow etc. this buffer, and we should throw it
1633  * away when we're done.
1634  */
1635  b->yy_is_our_buffer = 1;
1636 
1637  return b;
1638 }
1639 
1640 #ifndef YY_EXIT_FAILURE
1641 #define YY_EXIT_FAILURE 2
1642 #endif
1643 
1644 static void yynoreturn yy_fatal_error (yyconst char* msg )
1645 {
1646  (void) fprintf( stderr, "%s\n", msg );
1647  exit( YY_EXIT_FAILURE );
1648 }
1649 
1650 /* Redefine yyless() so it works in section 3 code. */
1651 
1652 #undef yyless
1653 #define yyless(n) \
1654  do \
1655  { \
1656  /* Undo effects of setting up yyassemblertext. */ \
1657  yy_size_t yyless_macro_arg = (n); \
1658  YY_LESS_LINENO(yyless_macro_arg);\
1659  yyassemblertext[yyassemblerleng] = (yy_hold_char); \
1660  (yy_c_buf_p) = yyassemblertext + yyless_macro_arg; \
1661  (yy_hold_char) = *(yy_c_buf_p); \
1662  *(yy_c_buf_p) = '\0'; \
1663  yyassemblerleng = yyless_macro_arg; \
1664  } \
1665  while ( 0 )
1666 
1667 /* Accessor methods (get/set functions) to struct members. */
1668 
1673 {
1674 
1675  return yyassemblerlineno;
1676 }
1677 
1681 FILE *yyassemblerget_in (void)
1682 {
1683  return yyassemblerin;
1684 }
1685 
1690 {
1691  return yyassemblerout;
1692 }
1693 
1698 {
1699  return yyassemblerleng;
1700 }
1701 
1707 {
1708  return yyassemblertext;
1709 }
1710 
1715 void yyassemblerset_lineno (int _line_number )
1716 {
1717 
1718  yyassemblerlineno = _line_number;
1719 }
1720 
1727 void yyassemblerset_in (FILE * _in_str )
1728 {
1729  yyassemblerin = _in_str ;
1730 }
1731 
1732 void yyassemblerset_out (FILE * _out_str )
1733 {
1734  yyassemblerout = _out_str ;
1735 }
1736 
1738 {
1739  return yyassembler_flex_debug;
1740 }
1741 
1742 void yyassemblerset_debug (int _bdebug )
1743 {
1744  yyassembler_flex_debug = _bdebug ;
1745 }
1746 
1747 static int yy_init_globals (void)
1748 {
1749  /* Initialization is the same as for the non-reentrant scanner.
1750  * This function is called from yyassemblerlex_destroy(), so don't allocate here.
1751  */
1752 
1753  (yy_buffer_stack) = NULL;
1754  (yy_buffer_stack_top) = 0;
1755  (yy_buffer_stack_max) = 0;
1756  (yy_c_buf_p) = NULL;
1757  (yy_init) = 0;
1758  (yy_start) = 0;
1759 
1760 /* Defined in main.c */
1761 #ifdef YY_STDINIT
1762  yyassemblerin = stdin;
1763  yyassemblerout = stdout;
1764 #else
1765  yyassemblerin = NULL;
1766  yyassemblerout = NULL;
1767 #endif
1768 
1769  /* For future reference: Set errno on error, since we are called by
1770  * yyassemblerlex_init()
1771  */
1772  return 0;
1773 }
1774 
1775 /* yyassemblerlex_destroy is for both reentrant and non-reentrant scanners. */
1777 {
1778 
1779  /* Pop the buffer stack, destroying each element. */
1780  while(YY_CURRENT_BUFFER){
1782  YY_CURRENT_BUFFER_LVALUE = NULL;
1784  }
1785 
1786  /* Destroy the stack itself. */
1788  (yy_buffer_stack) = NULL;
1789 
1790  /* Reset the globals. This is important in a non-reentrant scanner so the next time
1791  * yyassemblerlex() is called, initialization will occur. */
1792  yy_init_globals( );
1793 
1794  return 0;
1795 }
1796 
1797 /*
1798  * Internal utility routines.
1799  */
1800 
1801 #ifndef yytext_ptr
1802 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1803 {
1804 
1805  int i;
1806  for ( i = 0; i < n; ++i )
1807  s1[i] = s2[i];
1808 }
1809 #endif
1810 
1811 #ifdef YY_NEED_STRLEN
1812 static int yy_flex_strlen (yyconst char * s )
1813 {
1814  int n;
1815  for ( n = 0; s[n]; ++n )
1816  ;
1817 
1818  return n;
1819 }
1820 #endif
1821 
1823 {
1824  return malloc(size);
1825 }
1826 
1827 void *yyassemblerrealloc (void * ptr, yy_size_t size )
1828 {
1829 
1830  /* The cast to (char *) in the following accommodates both
1831  * implementations that use char* generic pointers, and those
1832  * that use void* generic pointers. It works with the latter
1833  * because both ANSI C and C++ allow castless assignment from
1834  * any pointer type to void*, and deal with argument conversions
1835  * as though doing an assignment.
1836  */
1837  return realloc(ptr, size);
1838 }
1839 
1840 void yyassemblerfree (void * ptr )
1841 {
1842  free( (char *) ptr ); /* see yyassemblerrealloc() for (char *) cast */
1843 }
1844 
1845 #define YYTABLES_NAME "yytables"
1846 
1847 #line 105 "scanner.l"
1848 
1849 
1850 
1851 int yyassemblerwrap() { return 1; }
1852 
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:86
#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 *)
static int yy_n_chars
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
flex_int32_t yy_verify
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)
flex_int32_t yy_nxt
#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]