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