yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
verilog_lexer.cc
Go to the documentation of this file.
1 #line 2 "frontends/verilog/verilog_lexer.cc"
2 
3 #line 4 "frontends/verilog/verilog_lexer.cc"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define yy_create_buffer frontend_verilog_yy_create_buffer
10 #define yy_delete_buffer frontend_verilog_yy_delete_buffer
11 #define yy_flex_debug frontend_verilog_yy_flex_debug
12 #define yy_init_buffer frontend_verilog_yy_init_buffer
13 #define yy_flush_buffer frontend_verilog_yy_flush_buffer
14 #define yy_load_buffer_state frontend_verilog_yy_load_buffer_state
15 #define yy_switch_to_buffer frontend_verilog_yy_switch_to_buffer
16 #define yyin frontend_verilog_yyin
17 #define yyleng frontend_verilog_yyleng
18 #define yylex frontend_verilog_yylex
19 #define yylineno frontend_verilog_yylineno
20 #define yyout frontend_verilog_yyout
21 #define yyrestart frontend_verilog_yyrestart
22 #define yytext frontend_verilog_yytext
23 #define yywrap frontend_verilog_yywrap
24 #define yyalloc frontend_verilog_yyalloc
25 #define yyrealloc frontend_verilog_yyrealloc
26 #define yyfree frontend_verilog_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 frontend_verilog_yyrestart(frontend_verilog_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 frontend_verilog_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 frontend_verilog_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-frontend_verilog_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 < frontend_verilog_yyleng; ++yyl )\
203  if ( frontend_verilog_yytext[yyl] == '\n' )\
204  --frontend_verilog_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 frontend_verilog_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 frontend_verilog_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
230 struct yy_buffer_state
231  {
232  FILE *yy_input_file;
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  */
245  int yy_n_chars;
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  */
251  int yy_is_our_buffer;
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  */
258  int yy_is_interactive;
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  */
264  int yy_at_bol;
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  */
272  int yy_fill_buffer;
273 
274  int yy_buffer_status;
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 frontend_verilog_yyrestart()), so that the user can continue scanning by
286  * just pointing frontend_verilog_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 frontend_verilog_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 frontend_verilog_yywrap()'s to do buffer switches
324  * instead of setting up a fresh frontend_verilog_yyin. A bit of a hack ...
325  */
327 
329 void frontend_verilog_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
330 YY_BUFFER_STATE frontend_verilog_yy_create_buffer (FILE *file,int size );
331 void frontend_verilog_yy_delete_buffer (YY_BUFFER_STATE b );
332 void frontend_verilog_yy_flush_buffer (YY_BUFFER_STATE b );
333 void frontend_verilog_yypush_buffer_state (YY_BUFFER_STATE new_buffer );
335 
336 static void frontend_verilog_yyensure_buffer_stack (void );
337 static void frontend_verilog_yy_load_buffer_state (void );
338 static void frontend_verilog_yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
339 
340 #define YY_FLUSH_BUFFER frontend_verilog_yy_flush_buffer(YY_CURRENT_BUFFER )
341 
342 YY_BUFFER_STATE frontend_verilog_yy_scan_buffer (char *base,yy_size_t size );
343 YY_BUFFER_STATE frontend_verilog_yy_scan_string (yyconst char *yy_str );
344 YY_BUFFER_STATE frontend_verilog_yy_scan_bytes (yyconst char *bytes,int len );
345 
347 void *frontend_verilog_yyrealloc (void *,yy_size_t );
348 void frontend_verilog_yyfree (void * );
349 
350 #define yy_new_buffer frontend_verilog_yy_create_buffer
351 
352 #define yy_set_interactive(is_interactive) \
353  { \
354  if ( ! YY_CURRENT_BUFFER ){ \
355  frontend_verilog_yyensure_buffer_stack (); \
356  YY_CURRENT_BUFFER_LVALUE = \
357  frontend_verilog_yy_create_buffer(frontend_verilog_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  frontend_verilog_yyensure_buffer_stack (); \
366  YY_CURRENT_BUFFER_LVALUE = \
367  frontend_verilog_yy_create_buffer(frontend_verilog_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 frontend_verilog_yywrap(n) 1
377 #define YY_SKIP_YYWRAP
378 
379 typedef unsigned char YY_CHAR;
380 
381 FILE *frontend_verilog_yyin = (FILE *) 0, *frontend_verilog_yyout = (FILE *) 0;
382 
383 typedef int yy_state_type;
384 
385 extern int frontend_verilog_yylineno;
386 
387 int frontend_verilog_yylineno = 1;
388 
389 extern char *frontend_verilog_yytext;
390 #define yytext_ptr frontend_verilog_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 frontend_verilog_yytext.
399  */
400 #define YY_DO_BEFORE_ACTION \
401  (yytext_ptr) = yy_bp; \
402  (yytext_ptr) -= (yy_more_len); \
403  frontend_verilog_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 115
409 #define YY_END_OF_BUFFER 116
410 /* This struct is not used in this scanner,
411  but its presence is necessary. */
412 struct yy_trans_info
413  {
416  };
418  { 0,
419  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
420  0, 0, 116, 114, 110, 110, 110, 114, 57, 114,
421  67, 114, 114, 114, 114, 114, 114, 114, 53, 114,
422  114, 114, 67, 114, 114, 114, 67, 67, 67, 67,
423  67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
424  67, 67, 67, 67, 114, 114, 114, 107, 108, 107,
425  60, 115, 59, 60, 69, 70, 69, 69, 75, 75,
426  75, 75, 81, 79, 79, 78, 80, 0, 0, 91,
427  113, 67, 67, 67, 67, 67, 67, 89, 0, 0,
428  83, 84, 87, 86, 104, 105, 106, 112, 0, 53,
429 
430  0, 0, 100, 92, 90, 93, 101, 82, 111, 99,
431  7, 7, 7, 7, 7, 67, 67, 67, 67, 67,
432  67, 67, 67, 67, 67, 67, 67, 67, 22, 67,
433  67, 67, 67, 67, 67, 67, 27, 67, 67, 67,
434  67, 67, 67, 67, 67, 67, 67, 67, 67, 85,
435  88, 96, 98, 97, 109, 58, 0, 0, 0, 76,
436  0, 0, 78, 95, 67, 67, 67, 67, 67, 67,
437  0, 54, 0, 0, 112, 55, 0, 56, 102, 94,
438  103, 7, 7, 7, 7, 7, 67, 61, 67, 67,
439  43, 61, 67, 67, 67, 21, 24, 67, 67, 67,
440 
441  67, 67, 67, 67, 67, 67, 67, 67, 67, 61,
442  67, 67, 67, 67, 67, 48, 67, 67, 67, 67,
443  67, 67, 67, 0, 0, 0, 0, 0, 0, 67,
444  67, 67, 67, 67, 67, 0, 55, 0, 7, 7,
445  7, 7, 67, 67, 67, 67, 67, 28, 67, 67,
446  23, 67, 67, 67, 67, 67, 67, 67, 67, 67,
447  67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
448  67, 67, 67, 52, 67, 67, 67, 12, 67, 47,
449  0, 0, 0, 0, 0, 67, 67, 67, 64, 67,
450  0, 0, 55, 7, 7, 7, 7, 67, 67, 67,
451 
452  20, 67, 29, 30, 67, 67, 67, 67, 67, 67,
453  67, 67, 67, 67, 67, 67, 46, 44, 67, 67,
454  42, 67, 67, 67, 67, 67, 67, 67, 67, 67,
455  67, 35, 0, 0, 0, 0, 0, 67, 67, 67,
456  67, 0, 0, 7, 7, 0, 7, 18, 40, 17,
457  67, 67, 67, 67, 67, 67, 67, 67, 67, 51,
458  67, 67, 67, 67, 8, 67, 45, 67, 67, 67,
459  36, 50, 67, 0, 0, 0, 0, 0, 67, 65,
460  67, 0, 0, 7, 7, 7, 0, 7, 67, 32,
461  67, 31, 67, 67, 67, 13, 67, 67, 0, 19,
462 
463  49, 67, 26, 67, 25, 67, 62, 63, 0, 0,
464  0, 0, 0, 67, 0, 0, 7, 7, 7, 7,
465  0, 7, 67, 67, 67, 16, 67, 67, 67, 10,
466  33, 0, 67, 67, 41, 0, 0, 0, 0, 0,
467  0, 66, 0, 0, 7, 7, 7, 7, 0, 7,
468  67, 38, 67, 67, 67, 9, 0, 67, 14, 0,
469  0, 0, 0, 73, 0, 0, 0, 7, 7, 0,
470  2, 7, 7, 0, 7, 67, 67, 67, 67, 0,
471  15, 0, 0, 0, 0, 72, 0, 7, 7, 1,
472  0, 0, 37, 67, 11, 34, 0, 0, 0, 0,
473 
474  0, 7, 7, 1, 0, 3, 0, 0, 0, 39,
475  0, 0, 0, 0, 0, 7, 7, 0, 5, 0,
476  0, 0, 74, 0, 7, 7, 5, 5, 0, 0,
477  0, 7, 4, 0, 0, 0, 7, 4, 0, 0,
478  0, 0, 0, 0, 0, 6, 0, 0, 0, 0,
479  0, 0, 0, 0, 0, 0, 0, 0, 77, 0,
480  0, 0, 0, 0, 0, 71, 68, 0
481  } ;
482 
484  { 0,
485  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
486  1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
487  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
488  1, 5, 6, 7, 8, 9, 1, 10, 11, 12,
489  13, 14, 15, 1, 16, 17, 18, 19, 20, 21,
490  21, 21, 21, 21, 21, 21, 21, 22, 23, 24,
491  25, 26, 27, 1, 28, 28, 29, 30, 31, 28,
492  32, 32, 33, 32, 32, 32, 32, 32, 32, 34,
493  32, 32, 32, 32, 32, 32, 32, 28, 32, 28,
494  1, 35, 1, 36, 37, 38, 39, 40, 41, 42,
495 
496  43, 44, 45, 46, 47, 32, 48, 49, 50, 51,
497  52, 53, 32, 54, 55, 56, 57, 58, 59, 60,
498  61, 62, 63, 64, 65, 66, 1, 1, 1, 1,
499  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
500  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
501  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
502  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
503  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
504  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
505  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 
507  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
508  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
509  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
510  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
511  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
512  1, 1, 1, 1, 1
513  } ;
514 
516  { 0,
517  1, 2, 3, 4, 5, 1, 1, 1, 6, 1,
518  1, 1, 1, 1, 1, 1, 7, 8, 9, 9,
519  9, 1, 1, 1, 1, 1, 10, 11, 11, 11,
520  11, 6, 6, 6, 1, 1, 11, 1, 11, 11,
521  11, 11, 11, 11, 6, 6, 6, 6, 6, 6,
522  6, 6, 6, 6, 6, 6, 6, 6, 6, 11,
523  6, 11, 1, 1, 1, 1
524  } ;
525 
527  { 0,
528  0, 0, 64, 65, 66, 67, 68, 69, 74, 77,
529  130, 0, 1053, 1054, 79, 1054, 1054, 1027, 1054, 0,
530  41, 1041, 53, 1036, 184, 1027, 1026, 86, 248, 51,
531  1022, 84, 0, 108, 980, 73, 65, 156, 1006, 1001,
532  43, 67, 1000, 156, 990, 989, 162, 69, 163, 997,
533  56, 1000, 162, 159, 1024, 973, 194, 1054, 1054, 1018,
534  1054, 1054, 1054, 0, 1054, 1054, 1021, 172, 1054, 1016,
535  976, 993, 1054, 1054, 1054, 0, 1054, 217, 183, 1006,
536  0, 0, 983, 982, 171, 981, 976, 1054, 229, 199,
537  1054, 1054, 1054, 1054, 1054, 1054, 235, 0, 223, 0,
538 
539  241, 255, 1002, 1054, 1000, 1054, 998, 243, 1054, 1054,
540  0, 980, 975, 974, 973, 960, 976, 962, 971, 959,
541  970, 958, 968, 956, 968, 955, 957, 956, 0, 953,
542  241, 179, 963, 953, 958, 198, 0, 946, 947, 945,
543  947, 242, 953, 944, 941, 948, 940, 941, 938, 1054,
544  1054, 1054, 1054, 1054, 1054, 1054, 261, 944, 943, 1054,
545  940, 934, 0, 1054, 932, 935, 940, 932, 933, 927,
546  297, 301, 268, 920, 0, 288, 291, 301, 1054, 1054,
547  1054, 0, 936, 930, 927, 927, 937, 0, 237, 928,
548  0, 927, 930, 173, 929, 285, 0, 930, 274, 918,
549 
550  913, 911, 910, 923, 926, 917, 906, 920, 918, 913,
551  906, 919, 914, 903, 906, 0, 911, 902, 899, 903,
552  901, 906, 894, 313, 886, 897, 894, 895, 904, 889,
553  894, 889, 886, 895, 890, 885, 323, 330, 896, 891,
554  890, 889, 870, 876, 884, 877, 883, 274, 869, 886,
555  0, 885, 866, 879, 869, 881, 863, 864, 878, 862,
556  868, 858, 857, 867, 862, 869, 860, 866, 863, 849,
557  855, 862, 860, 0, 863, 858, 851, 0, 856, 0,
558  847, 854, 853, 858, 845, 844, 837, 848, 0, 845,
559  281, 336, 342, 832, 851, 123, 832, 831, 829, 833,
560 
561  0, 263, 0, 0, 834, 828, 826, 829, 828, 836,
562  822, 829, 836, 820, 817, 833, 0, 0, 828, 817,
563  0, 826, 823, 294, 811, 823, 820, 810, 807, 820,
564  800, 0, 296, 823, 322, 818, 809, 818, 810, 813,
565  803, 800, 806, 802, 318, 370, 809, 812, 0, 0,
566  792, 808, 803, 804, 801, 786, 794, 789, 784, 0,
567  378, 790, 784, 798, 0, 793, 0, 779, 791, 777,
568  0, 0, 320, 779, 785, 777, 790, 785, 766, 0,
569  783, 770, 781, 767, 770, 301, 372, 782, 343, 0,
570  770, 0, 763, 764, 768, 0, 765, 772, 386, 0,
571 
572  0, 760, 0, 770, 0, 751, 0, 0, 756, 767,
573  307, 754, 759, 765, 745, 750, 767, 747, 749, 746,
574  392, 751, 747, 754, 758, 0, 749, 756, 751, 0,
575  0, 763, 753, 737, 0, 729, 734, 735, 732, 743,
576  748, 0, 729, 736, 731, 737, 399, 734, 0, 736,
577  725, 0, 715, 718, 703, 0, 715, 698, 0, 683,
578  684, 724, 680, 1054, 675, 464, 649, 641, 631, 679,
579  1054, 0, 667, 664, 393, 627, 624, 613, 612, 621,
580  0, 465, 593, 642, 607, 466, 586, 582, 580, 0,
581  469, 473, 0, 581, 0, 0, 248, 475, 569, 567,
582 
583  582, 564, 561, 0, 476, 1054, 606, 479, 483, 0,
584  487, 577, 565, 560, 549, 537, 508, 491, 492, 500,
585  542, 497, 1054, 488, 488, 535, 493, 505, 475, 464,
586  469, 474, 0, 463, 457, 461, 506, 0, 458, 448,
587  417, 510, 340, 330, 342, 511, 331, 333, 333, 313,
588  310, 244, 238, 225, 227, 521, 197, 192, 525, 531,
589  532, 533, 71, 537, 64, 1054, 1054, 1054, 551, 562,
590  573, 584, 590, 596, 607, 613, 624, 630, 640, 651,
591  657, 668, 679, 690, 701, 712, 723, 734, 745, 756,
592  767
593 
594  } ;
595 
597  { 0,
598  568, 1, 569, 569, 570, 570, 571, 571, 572, 572,
599  568, 11, 568, 568, 568, 568, 568, 568, 568, 573,
600  574, 568, 568, 568, 568, 568, 568, 568, 568, 568,
601  568, 568, 574, 575, 568, 576, 574, 574, 574, 574,
602  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
603  574, 574, 574, 574, 568, 568, 568, 568, 568, 568,
604  568, 568, 568, 577, 568, 568, 568, 568, 568, 568,
605  568, 568, 568, 568, 568, 578, 568, 568, 568, 568,
606  573, 574, 574, 574, 574, 574, 574, 568, 579, 568,
607  568, 568, 568, 568, 568, 568, 568, 580, 568, 29,
608 
609  568, 568, 568, 568, 568, 568, 568, 575, 568, 568,
610  581, 581, 581, 581, 581, 574, 574, 574, 574, 574,
611  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
612  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
613  574, 574, 574, 574, 574, 574, 574, 574, 574, 568,
614  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
615  568, 568, 578, 568, 574, 574, 574, 574, 574, 574,
616  579, 579, 568, 568, 580, 568, 568, 568, 568, 568,
617  568, 581, 581, 581, 581, 581, 574, 574, 574, 574,
618  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
619 
620  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
621  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
622  574, 574, 574, 568, 568, 568, 568, 568, 568, 574,
623  574, 574, 574, 574, 574, 568, 568, 568, 581, 581,
624  581, 581, 574, 574, 574, 574, 574, 574, 574, 574,
625  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
626  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
627  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
628  568, 568, 568, 568, 568, 574, 574, 574, 574, 574,
629  568, 568, 568, 581, 581, 581, 581, 574, 574, 574,
630 
631  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
632  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
633  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
634  574, 574, 568, 568, 568, 568, 568, 574, 574, 574,
635  574, 568, 568, 581, 581, 582, 581, 574, 574, 574,
636  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
637  574, 574, 574, 574, 574, 574, 574, 574, 574, 574,
638  574, 574, 574, 568, 568, 568, 568, 568, 574, 574,
639  574, 568, 568, 581, 581, 581, 582, 581, 574, 574,
640  574, 574, 574, 574, 574, 574, 574, 574, 568, 574,
641 
642  574, 574, 574, 574, 574, 574, 574, 574, 568, 568,
643  568, 568, 568, 574, 568, 568, 581, 581, 581, 581,
644  568, 581, 574, 574, 574, 574, 574, 574, 574, 574,
645  574, 568, 574, 574, 574, 568, 568, 568, 568, 568,
646  568, 574, 568, 568, 581, 581, 568, 581, 583, 581,
647  574, 574, 574, 574, 574, 574, 568, 574, 574, 568,
648  568, 584, 568, 568, 568, 568, 568, 581, 581, 584,
649  568, 447, 581, 583, 581, 574, 574, 574, 574, 568,
650  574, 568, 568, 568, 568, 568, 568, 581, 581, 585,
651  586, 587, 574, 574, 574, 574, 568, 568, 568, 568,
652 
653  568, 581, 581, 585, 586, 568, 588, 586, 587, 574,
654  568, 568, 568, 568, 568, 581, 581, 568, 589, 568,
655  568, 568, 568, 568, 581, 581, 589, 589, 568, 568,
656  568, 581, 590, 568, 568, 568, 581, 590, 568, 568,
657  568, 591, 568, 568, 568, 591, 568, 568, 568, 568,
658  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
659  568, 568, 568, 568, 568, 568, 568, 0, 568, 568,
660  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
661  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
662  568
663 
664  } ;
665 
667  { 0,
668  14, 15, 16, 17, 15, 18, 19, 20, 21, 22,
669  23, 24, 14, 25, 26, 27, 14, 28, 29, 29,
670  29, 14, 14, 30, 31, 32, 14, 33, 33, 33,
671  33, 33, 33, 33, 34, 35, 33, 36, 37, 38,
672  39, 40, 41, 42, 43, 33, 44, 33, 45, 46,
673  47, 48, 49, 50, 51, 52, 33, 33, 53, 54,
674  33, 33, 55, 56, 14, 57, 59, 59, 62, 62,
675  66, 66, 63, 63, 103, 104, 62, 60, 60, 62,
676  78, 567, 83, 78, 84, 67, 67, 70, 566, 79,
677  70, 124, 89, 125, 89, 85, 86, 87, 89, 97,
678 
679  64, 64, 143, 98, 89, 68, 68, 90, 106, 107,
680  109, 109, 144, 116, 112, 117, 113, 71, 126, 118,
681  71, 114, 137, 127, 346, 138, 72, 346, 115, 72,
682  73, 74, 75, 74, 74, 73, 73, 73, 76, 73,
683  73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
684  73, 73, 77, 73, 73, 73, 73, 76, 76, 76,
685  76, 76, 76, 76, 73, 73, 76, 73, 76, 76,
686  76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
687  76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
688  76, 76, 73, 73, 73, 73, 92, 93, 119, 129,
689 
690  134, 139, 120, 152, 135, 130, 131, 146, 147, 148,
691  149, 249, 121, 136, 140, 158, 141, 167, 78, 205,
692  159, 78, 89, 206, 89, 250, 168, 79, 89, 153,
693  171, 171, 171, 171, 89, 561, 173, 90, 89, 173,
694  89, 176, 176, 176, 89, 568, 568, 560, 94, 78,
695  89, 188, 78, 210, 511, 177, 177, 154, 79, 178,
696  178, 178, 224, 512, 99, 224, 100, 100, 100, 173,
697  558, 99, 173, 102, 102, 102, 557, 178, 101, 244,
698  215, 188, 188, 245, 102, 101, 216, 201, 556, 174,
699  101, 102, 202, 203, 217, 555, 204, 101, 171, 171,
700 
701  171, 171, 568, 568, 568, 568, 237, 237, 237, 178,
702  178, 178, 188, 188, 224, 225, 258, 224, 238, 178,
703  178, 178, 174, 346, 237, 252, 346, 178, 253, 254,
704  238, 259, 342, 303, 255, 304, 343, 178, 407, 408,
705  256, 237, 237, 237, 292, 292, 554, 374, 293, 293,
706  293, 375, 419, 238, 293, 293, 293, 420, 438, 237,
707  293, 293, 293, 439, 553, 238, 293, 225, 385, 552,
708  386, 346, 293, 421, 346, 551, 421, 550, 293, 399,
709  399, 399, 399, 423, 549, 548, 424, 399, 399, 399,
710  399, 425, 432, 421, 492, 547, 421, 492, 449, 470,
711 
712  470, 471, 470, 470, 470, 470, 470, 472, 470, 470,
713  470, 470, 470, 470, 470, 470, 470, 472, 472, 472,
714  470, 470, 470, 470, 470, 470, 472, 472, 472, 472,
715  472, 472, 472, 470, 470, 472, 470, 472, 472, 472,
716  472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
717  472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
718  472, 470, 470, 470, 470, 486, 498, 486, 486, 498,
719  486, 506, 545, 507, 492, 508, 498, 492, 506, 498,
720  507, 506, 508, 507, 518, 508, 544, 518, 520, 520,
721  520, 520, 518, 528, 568, 518, 528, 568, 543, 541,
722 
723  519, 520, 520, 520, 520, 540, 528, 542, 519, 528,
724  542, 542, 568, 539, 542, 568, 537, 536, 535, 487,
725  499, 487, 559, 559, 559, 559, 559, 559, 559, 559,
726  499, 534, 562, 564, 562, 562, 564, 562, 564, 533,
727  532, 564, 531, 529, 563, 565, 563, 530, 511, 526,
728  565, 58, 58, 58, 58, 58, 58, 58, 58, 58,
729  58, 58, 61, 61, 61, 61, 61, 61, 61, 61,
730  61, 61, 61, 65, 65, 65, 65, 65, 65, 65,
731  65, 65, 65, 65, 69, 69, 69, 69, 69, 69,
732  69, 69, 69, 69, 69, 81, 81, 525, 81, 524,
733 
734  81, 82, 523, 522, 82, 521, 82, 108, 506, 108,
735  108, 517, 108, 108, 108, 108, 108, 108, 111, 516,
736  515, 514, 513, 111, 156, 156, 510, 156, 156, 156,
737  156, 156, 156, 156, 156, 163, 503, 502, 163, 501,
738  163, 172, 172, 172, 172, 500, 490, 482, 172, 172,
739  172, 175, 175, 497, 496, 175, 175, 175, 175, 175,
740  175, 175, 182, 495, 494, 182, 493, 182, 387, 387,
741  491, 490, 387, 387, 387, 387, 387, 387, 387, 474,
742  474, 471, 489, 488, 474, 474, 474, 474, 474, 474,
743  470, 470, 470, 470, 470, 470, 470, 470, 470, 470,
744 
745  470, 504, 504, 466, 504, 504, 504, 504, 504, 504,
746  504, 504, 505, 505, 505, 485, 505, 505, 505, 505,
747  505, 505, 505, 509, 509, 484, 471, 509, 509, 509,
748  483, 509, 509, 509, 507, 507, 507, 482, 507, 507,
749  507, 507, 507, 507, 507, 527, 527, 481, 480, 527,
750  527, 527, 527, 527, 527, 527, 538, 538, 479, 538,
751  538, 538, 538, 538, 538, 538, 538, 546, 546, 478,
752  477, 546, 546, 546, 476, 546, 546, 546, 475, 473,
753  469, 468, 467, 466, 465, 464, 463, 462, 461, 460,
754  459, 458, 457, 456, 455, 454, 453, 452, 451, 450,
755 
756  448, 447, 446, 445, 444, 443, 442, 441, 440, 437,
757  436, 435, 434, 433, 431, 430, 429, 428, 427, 426,
758  422, 418, 417, 416, 415, 414, 289, 413, 412, 411,
759  410, 409, 406, 405, 404, 403, 402, 401, 400, 398,
760  397, 396, 395, 394, 393, 392, 391, 390, 389, 388,
761  384, 383, 382, 381, 380, 289, 379, 378, 377, 376,
762  373, 372, 371, 370, 369, 368, 367, 366, 365, 364,
763  363, 362, 361, 360, 359, 358, 357, 356, 355, 354,
764  353, 352, 351, 350, 349, 348, 347, 345, 344, 341,
765  340, 339, 338, 337, 336, 335, 334, 333, 332, 331,
766 
767  330, 329, 328, 327, 326, 325, 324, 323, 322, 321,
768  320, 319, 318, 317, 316, 315, 314, 313, 312, 311,
769  310, 309, 308, 307, 306, 305, 302, 301, 300, 299,
770  298, 297, 296, 295, 294, 291, 290, 289, 289, 288,
771  287, 286, 285, 284, 283, 282, 281, 188, 280, 279,
772  278, 277, 276, 275, 274, 273, 272, 271, 270, 269,
773  268, 188, 267, 266, 265, 264, 263, 262, 261, 260,
774  257, 251, 248, 247, 246, 243, 242, 241, 240, 239,
775  236, 235, 234, 233, 232, 231, 230, 229, 228, 227,
776  226, 188, 223, 222, 221, 220, 219, 218, 214, 213,
777 
778  212, 211, 209, 208, 207, 200, 199, 198, 197, 196,
779  195, 194, 193, 192, 191, 190, 189, 188, 187, 186,
780  185, 184, 183, 181, 180, 179, 170, 169, 166, 165,
781  164, 162, 161, 160, 157, 155, 151, 150, 145, 142,
782  133, 132, 128, 123, 122, 110, 105, 96, 95, 91,
783  88, 80, 568, 13, 568, 568, 568, 568, 568, 568,
784  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
785  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
786  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
787  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
788 
789  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
790  568, 568, 568, 568, 568, 568, 568, 568, 568, 568
791  } ;
792 
794  { 0,
795  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
796  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
797  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
798  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
799  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
800  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
801  1, 1, 1, 1, 1, 1, 3, 4, 5, 6,
802  7, 8, 5, 6, 30, 30, 9, 3, 4, 10,
803  15, 565, 21, 15, 21, 7, 8, 9, 563, 15,
804  10, 41, 23, 41, 23, 21, 21, 21, 23, 28,
805 
806  5, 6, 51, 28, 23, 7, 8, 23, 32, 32,
807  34, 34, 51, 37, 36, 37, 36, 9, 42, 37,
808  10, 36, 48, 42, 296, 48, 9, 296, 36, 10,
809  11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
810  11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
811  11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
812  11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
813  11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
814  11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
815  11, 11, 11, 11, 11, 11, 25, 25, 38, 44,
816 
817  47, 49, 38, 57, 47, 44, 44, 53, 53, 54,
818  54, 194, 38, 47, 49, 68, 49, 85, 78, 132,
819  68, 78, 79, 132, 79, 194, 85, 78, 79, 57,
820  89, 89, 89, 89, 79, 558, 97, 79, 90, 97,
821  90, 99, 99, 99, 90, 108, 108, 557, 25, 29,
822  90, 136, 29, 136, 497, 101, 101, 57, 29, 101,
823  101, 101, 157, 497, 29, 157, 29, 29, 29, 173,
824  555, 102, 173, 102, 102, 102, 554, 101, 29, 189,
825  142, 302, 302, 189, 29, 102, 142, 131, 553, 97,
826  29, 102, 131, 131, 142, 552, 131, 102, 171, 171,
827 
828  171, 171, 172, 172, 172, 172, 176, 176, 176, 177,
829  177, 177, 324, 324, 224, 157, 199, 224, 176, 178,
830  178, 178, 173, 335, 176, 196, 335, 177, 196, 196,
831  176, 199, 291, 248, 196, 248, 291, 178, 373, 373,
832  196, 237, 237, 237, 238, 238, 551, 333, 238, 238,
833  238, 333, 386, 237, 292, 292, 292, 386, 411, 237,
834  293, 293, 293, 411, 550, 237, 238, 224, 345, 549,
835  345, 346, 292, 387, 346, 548, 387, 547, 293, 361,
836  361, 361, 361, 389, 545, 544, 389, 399, 399, 399,
837  399, 389, 399, 421, 475, 543, 421, 475, 421, 447,
838 
839  447, 447, 447, 447, 447, 447, 447, 447, 447, 447,
840  447, 447, 447, 447, 447, 447, 447, 447, 447, 447,
841  447, 447, 447, 447, 447, 447, 447, 447, 447, 447,
842  447, 447, 447, 447, 447, 447, 447, 447, 447, 447,
843  447, 447, 447, 447, 447, 447, 447, 447, 447, 447,
844  447, 447, 447, 447, 447, 447, 447, 447, 447, 447,
845  447, 447, 447, 447, 447, 466, 482, 486, 466, 482,
846  486, 491, 541, 491, 492, 491, 498, 492, 505, 498,
847  505, 508, 505, 508, 509, 508, 540, 509, 511, 511,
848  511, 511, 518, 519, 527, 518, 519, 527, 539, 536,
849 
850  509, 520, 520, 520, 520, 535, 528, 537, 518, 528,
851  537, 542, 546, 534, 542, 546, 532, 531, 530, 466,
852  482, 486, 556, 556, 556, 556, 559, 559, 559, 559,
853  498, 529, 560, 561, 562, 560, 561, 562, 564, 526,
854  525, 564, 524, 520, 560, 561, 562, 522, 521, 517,
855  564, 569, 569, 569, 569, 569, 569, 569, 569, 569,
856  569, 569, 570, 570, 570, 570, 570, 570, 570, 570,
857  570, 570, 570, 571, 571, 571, 571, 571, 571, 571,
858  571, 571, 571, 571, 572, 572, 572, 572, 572, 572,
859  572, 572, 572, 572, 572, 573, 573, 516, 573, 515,
860 
861  573, 574, 514, 513, 574, 512, 574, 575, 507, 575,
862  575, 503, 575, 575, 575, 575, 575, 575, 576, 502,
863  501, 500, 499, 576, 577, 577, 494, 577, 577, 577,
864  577, 577, 577, 577, 577, 578, 489, 488, 578, 487,
865  578, 579, 579, 579, 579, 485, 484, 483, 579, 579,
866  579, 580, 580, 480, 479, 580, 580, 580, 580, 580,
867  580, 580, 581, 478, 477, 581, 476, 581, 582, 582,
868  474, 473, 582, 582, 582, 582, 582, 582, 582, 583,
869  583, 470, 469, 468, 583, 583, 583, 583, 583, 583,
870  584, 584, 584, 584, 584, 584, 584, 584, 584, 584,
871 
872  584, 585, 585, 467, 585, 585, 585, 585, 585, 585,
873  585, 585, 586, 586, 586, 465, 586, 586, 586, 586,
874  586, 586, 586, 587, 587, 463, 462, 587, 587, 587,
875  461, 587, 587, 587, 588, 588, 588, 460, 588, 588,
876  588, 588, 588, 588, 588, 589, 589, 458, 457, 589,
877  589, 589, 589, 589, 589, 589, 590, 590, 455, 590,
878  590, 590, 590, 590, 590, 590, 590, 591, 591, 454,
879  453, 591, 591, 591, 451, 591, 591, 591, 450, 448,
880  446, 445, 444, 443, 441, 440, 439, 438, 437, 436,
881  434, 433, 432, 429, 428, 427, 425, 424, 423, 422,
882 
883  420, 419, 418, 417, 416, 415, 414, 413, 412, 410,
884  409, 406, 404, 402, 398, 397, 395, 394, 393, 391,
885  388, 385, 384, 383, 382, 381, 379, 378, 377, 376,
886  375, 374, 370, 369, 368, 366, 364, 363, 362, 359,
887  358, 357, 356, 355, 354, 353, 352, 351, 348, 347,
888  344, 343, 342, 341, 340, 339, 338, 337, 336, 334,
889  331, 330, 329, 328, 327, 326, 325, 323, 322, 320,
890  319, 316, 315, 314, 313, 312, 311, 310, 309, 308,
891  307, 306, 305, 300, 299, 298, 297, 295, 294, 290,
892  288, 287, 286, 285, 284, 283, 282, 281, 279, 277,
893 
894  276, 275, 273, 272, 271, 270, 269, 268, 267, 266,
895  265, 264, 263, 262, 261, 260, 259, 258, 257, 256,
896  255, 254, 253, 252, 250, 249, 247, 246, 245, 244,
897  243, 242, 241, 240, 239, 236, 235, 234, 233, 232,
898  231, 230, 229, 228, 227, 226, 225, 223, 222, 221,
899  220, 219, 218, 217, 215, 214, 213, 212, 211, 210,
900  209, 208, 207, 206, 205, 204, 203, 202, 201, 200,
901  198, 195, 193, 192, 190, 187, 186, 185, 184, 183,
902  174, 170, 169, 168, 167, 166, 165, 162, 161, 159,
903  158, 149, 148, 147, 146, 145, 144, 143, 141, 140,
904 
905  139, 138, 135, 134, 133, 130, 128, 127, 126, 125,
906  124, 123, 122, 121, 120, 119, 118, 117, 116, 115,
907  114, 113, 112, 107, 105, 103, 87, 86, 84, 83,
908  80, 72, 71, 70, 67, 60, 56, 55, 52, 50,
909  46, 45, 43, 40, 39, 35, 31, 27, 26, 24,
910  22, 18, 13, 568, 568, 568, 568, 568, 568, 568,
911  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
912  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
913  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
914  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
915 
916  568, 568, 568, 568, 568, 568, 568, 568, 568, 568,
917  568, 568, 568, 568, 568, 568, 568, 568, 568, 568
918  } ;
919 
920 /* Table of booleans, true if rule could match eol. */
922  { 0,
923 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
924  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
925  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
926  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1,
927  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
928  0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, };
929 
930 static yy_state_type yy_last_accepting_state;
932 
934 int frontend_verilog_yy_flex_debug = 0;
935 
936 /* The intent behind this definition is that it'll catch
937  * any uses of REJECT which flex missed.
938  */
939 #define REJECT reject_used_but_not_detected
940 static int yy_more_flag = 0;
941 static int yy_more_len = 0;
942 #define yymore() ((yy_more_flag) = 1)
943 #define YY_MORE_ADJ (yy_more_len)
944 #define YY_RESTORE_YY_MORE_OFFSET
946 #line 1 "frontends/verilog/verilog_lexer.l"
947 /*
948  * yosys -- Yosys Open SYnthesis Suite
949  *
950  * Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
951  *
952  * Permission to use, copy, modify, and/or distribute this software for any
953  * purpose with or without fee is hereby granted, provided that the above
954  * copyright notice and this permission notice appear in all copies.
955  *
956  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
957  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
958  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
959  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
960  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
961  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
962  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
963  *
964  * ---
965  *
966  * The Verilog frontend.
967  *
968  * This frontend is using the AST frontend library (see frontends/ast/).
969  * Thus this frontend does not generate RTLIL code directly but creates an
970  * AST directly from the Verilog parse tree and then passes this AST to
971  * the AST frontend library.
972  *
973  * ---
974  *
975  * A simple lexer for Verilog code. Non-preprocessor compiler directives are
976  * handled here. The preprocessor stuff is handled in preproc.cc. Everything
977  * else is left to the bison parser (see parser.y).
978  *
979  */
980 #line 36 "frontends/verilog/verilog_lexer.l"
981 
982 #ifdef __clang__
983 // bison generates code using the 'register' storage class specifier
984 #pragma clang diagnostic ignored "-Wdeprecated-register"
985 #endif
986 
987 #include "kernel/log.h"
988 #include "verilog_frontend.h"
989 #include "frontends/ast/ast.h"
990 #include "verilog_parser.tab.h"
991 
993 using namespace AST;
994 using namespace VERILOG_FRONTEND;
995 
997 namespace VERILOG_FRONTEND {
998  std::vector<std::string> fn_stack;
999  std::vector<int> ln_stack;
1000 }
1002 
1003 #define SV_KEYWORD(_tok) \
1004  if (sv_mode) return _tok; \
1005  log("Lexer warning: The SystemVerilog keyword `%s' (at %s:%d) is not "\
1006  "recognized unless read_verilog is called with -sv!\n", frontend_verilog_yytext, \
1007  AST::current_filename.c_str(), frontend_verilog_yyget_lineno()); \
1008  frontend_verilog_yylval.string = new std::string(std::string("\\") + frontend_verilog_yytext); \
1009  return TOK_ID;
1010 
1011 #define YY_INPUT(buf,result,max_size) \
1012  result = readsome(*VERILOG_FRONTEND::lexin, buf, max_size)
1013 
1014 
1015 
1016 
1017 
1018 
1019 #line 1020 "frontends/verilog/verilog_lexer.cc"
1020 
1021 #define INITIAL 0
1022 #define COMMENT 1
1023 #define STRING 2
1024 #define SYNOPSYS_TRANSLATE_OFF 3
1025 #define SYNOPSYS_FLAGS 4
1026 #define IMPORT_DPI 5
1027 
1028 #ifndef YY_NO_UNISTD_H
1029 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1030  * down here because we want the user's section 1 to have been scanned first.
1031  * The user has a chance to override it with an option.
1032  */
1033 #include <unistd.h>
1034 #endif
1035 
1036 #ifndef YY_EXTRA_TYPE
1037 #define YY_EXTRA_TYPE void *
1038 #endif
1039 
1040 static int yy_init_globals (void );
1041 
1042 /* Accessor methods to globals.
1043  These are made visible to non-reentrant scanners for convenience. */
1044 
1045 int frontend_verilog_yylex_destroy (void );
1046 
1047 int frontend_verilog_yyget_debug (void );
1048 
1049 void frontend_verilog_yyset_debug (int debug_flag );
1050 
1052 
1053 void frontend_verilog_yyset_extra (YY_EXTRA_TYPE user_defined );
1054 
1055 FILE *frontend_verilog_yyget_in (void );
1056 
1057 void frontend_verilog_yyset_in (FILE * in_str );
1058 
1059 FILE *frontend_verilog_yyget_out (void );
1060 
1061 void frontend_verilog_yyset_out (FILE * out_str );
1062 
1063 int frontend_verilog_yyget_leng (void );
1064 
1065 char *frontend_verilog_yyget_text (void );
1066 
1067 int frontend_verilog_yyget_lineno (void );
1068 
1069 void frontend_verilog_yyset_lineno (int line_number );
1070 
1071 /* Macros after this point can all be overridden by user definitions in
1072  * section 1.
1073  */
1074 
1075 #ifndef YY_SKIP_YYWRAP
1076 #ifdef __cplusplus
1077 extern "C" int frontend_verilog_yywrap (void );
1078 #else
1079 extern int frontend_verilog_yywrap (void );
1080 #endif
1081 #endif
1082 
1083 #ifndef yytext_ptr
1084 static void yy_flex_strncpy (char *,yyconst char *,int );
1085 #endif
1086 
1087 #ifdef YY_NEED_STRLEN
1088 static int yy_flex_strlen (yyconst char * );
1089 #endif
1090 
1091 #ifndef YY_NO_INPUT
1092 
1093 #ifdef __cplusplus
1094 static int yyinput (void );
1095 #else
1096 static int input (void );
1097 #endif
1098 
1099 #endif
1100 
1101 /* Amount of stuff to slurp up with each read. */
1102 #ifndef YY_READ_BUF_SIZE
1103 #ifdef __ia64__
1104 /* On IA-64, the buffer size is 16k, not 8k */
1105 #define YY_READ_BUF_SIZE 16384
1106 #else
1107 #define YY_READ_BUF_SIZE 8192
1108 #endif /* __ia64__ */
1109 #endif
1110 
1111 /* Copy whatever the last rule matched to the standard output. */
1112 #ifndef ECHO
1113 /* This used to be an fputs(), but since the string might contain NUL's,
1114  * we now use fwrite().
1115  */
1116 #define ECHO do { if (fwrite( frontend_verilog_yytext, frontend_verilog_yyleng, 1, frontend_verilog_yyout )) {} } while (0)
1117 #endif
1118 
1119 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1120  * is returned in "result".
1121  */
1122 #ifndef YY_INPUT
1123 #define YY_INPUT(buf,result,max_size) \
1124  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1125  { \
1126  int c = '*'; \
1127  size_t n; \
1128  for ( n = 0; n < max_size && \
1129  (c = getc( frontend_verilog_yyin )) != EOF && c != '\n'; ++n ) \
1130  buf[n] = (char) c; \
1131  if ( c == '\n' ) \
1132  buf[n++] = (char) c; \
1133  if ( c == EOF && ferror( frontend_verilog_yyin ) ) \
1134  YY_FATAL_ERROR( "input in flex scanner failed" ); \
1135  result = n; \
1136  } \
1137  else \
1138  { \
1139  errno=0; \
1140  while ( (result = fread(buf, 1, max_size, frontend_verilog_yyin))==0 && ferror(frontend_verilog_yyin)) \
1141  { \
1142  if( errno != EINTR) \
1143  { \
1144  YY_FATAL_ERROR( "input in flex scanner failed" ); \
1145  break; \
1146  } \
1147  errno=0; \
1148  clearerr(frontend_verilog_yyin); \
1149  } \
1150  }\
1151 \
1152 
1153 #endif
1154 
1155 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1156  * we don't want an extra ';' after the "return" because that will cause
1157  * some compilers to complain about unreachable statements.
1158  */
1159 #ifndef yyterminate
1160 #define yyterminate() return YY_NULL
1161 #endif
1162 
1163 /* Number of entries by which start-condition stack grows. */
1164 #ifndef YY_START_STACK_INCR
1165 #define YY_START_STACK_INCR 25
1166 #endif
1167 
1168 /* Report a fatal error. */
1169 #ifndef YY_FATAL_ERROR
1170 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1171 #endif
1172 
1173 /* end tables serialization structures and prototypes */
1174 
1175 /* Default declaration of generated scanner - a define so the user can
1176  * easily add parameters.
1177  */
1178 #ifndef YY_DECL
1179 #define YY_DECL_IS_OURS 1
1180 
1181 extern int frontend_verilog_yylex (void);
1182 
1183 #define YY_DECL int frontend_verilog_yylex (void)
1184 #endif /* !YY_DECL */
1185 
1186 /* Code executed at the beginning of each rule, after frontend_verilog_yytext and frontend_verilog_yyleng
1187  * have been set up.
1188  */
1189 #ifndef YY_USER_ACTION
1190 #define YY_USER_ACTION
1191 #endif
1192 
1193 /* Code executed at the end of each rule. */
1194 #ifndef YY_BREAK
1195 #define YY_BREAK break;
1196 #endif
1197 
1198 #define YY_RULE_SETUP \
1199  YY_USER_ACTION
1200 
1201 /** The main scanner function which does all the work.
1202  */
1203 YY_DECL
1205  register yy_state_type yy_current_state;
1206  register char *yy_cp, *yy_bp;
1207  register int yy_act;
1208 
1209 #line 82 "frontends/verilog/verilog_lexer.l"
1210 
1211 
1212 #line 1213 "frontends/verilog/verilog_lexer.cc"
1213 
1214  if ( !(yy_init) )
1215  {
1216  (yy_init) = 1;
1217 
1218 #ifdef YY_USER_INIT
1219  YY_USER_INIT;
1220 #endif
1221 
1222  if ( ! (yy_start) )
1223  (yy_start) = 1; /* first start state */
1224 
1225  if ( ! frontend_verilog_yyin )
1226  frontend_verilog_yyin = stdin;
1227 
1228  if ( ! frontend_verilog_yyout )
1229  frontend_verilog_yyout = stdout;
1230 
1231  if ( ! YY_CURRENT_BUFFER ) {
1235  }
1236 
1238  }
1239 
1240  while ( 1 ) /* loops until end-of-file is reached */
1241  {
1242  (yy_more_len) = 0;
1243  if ( (yy_more_flag) )
1244  {
1245  (yy_more_len) = (yy_c_buf_p) - (yytext_ptr);
1246  (yy_more_flag) = 0;
1247  }
1248  yy_cp = (yy_c_buf_p);
1249 
1250  /* Support of frontend_verilog_yytext. */
1251  *yy_cp = (yy_hold_char);
1252 
1253  /* yy_bp points to the position in yy_ch_buf of the start of
1254  * the current run.
1255  */
1256  yy_bp = yy_cp;
1257 
1258  yy_current_state = (yy_start);
1259 yy_match:
1260  do
1261  {
1262  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1263  if ( yy_accept[yy_current_state] )
1264  {
1265  (yy_last_accepting_state) = yy_current_state;
1266  (yy_last_accepting_cpos) = yy_cp;
1267  }
1268  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1269  {
1270  yy_current_state = (int) yy_def[yy_current_state];
1271  if ( yy_current_state >= 569 )
1272  yy_c = yy_meta[(unsigned int) yy_c];
1273  }
1274  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1275  ++yy_cp;
1276  }
1277  while ( yy_base[yy_current_state] != 1054 );
1278 
1279 yy_find_action:
1280  yy_act = yy_accept[yy_current_state];
1281  if ( yy_act == 0 )
1282  { /* have to back up */
1283  yy_cp = (yy_last_accepting_cpos);
1284  yy_current_state = (yy_last_accepting_state);
1285  yy_act = yy_accept[yy_current_state];
1286  }
1287 
1289 
1290  if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1291  {
1292  int yyl;
1293  for ( yyl = (yy_more_len); yyl < frontend_verilog_yyleng; ++yyl )
1294  if ( frontend_verilog_yytext[yyl] == '\n' )
1295 
1296  frontend_verilog_yylineno++;
1297 ;
1298  }
1299 
1300 do_action: /* This label is used only to access EOF actions. */
1301 
1302  switch ( yy_act )
1303  { /* beginning of action switch */
1304  case 0: /* must back up */
1305  /* undo the effects of YY_DO_BEFORE_ACTION */
1306  *yy_cp = (yy_hold_char);
1307  yy_cp = (yy_last_accepting_cpos);
1308  yy_current_state = (yy_last_accepting_state);
1309  goto yy_find_action;
1310 
1311 case 1:
1313 #line 84 "frontends/verilog/verilog_lexer.l"
1314 {
1315  fn_stack.push_back(current_filename);
1317  current_filename = frontend_verilog_yytext+11;
1319 }
1320  YY_BREAK
1321 case 2:
1322 /* rule 2 can match eol */
1324 #line 91 "frontends/verilog/verilog_lexer.l"
1325 {
1326  current_filename = fn_stack.back();
1327  fn_stack.pop_back();
1329  ln_stack.pop_back();
1330 }
1331  YY_BREAK
1332 case 3:
1333 /* rule 3 can match eol */
1335 #line 98 "frontends/verilog/verilog_lexer.l"
1336 {
1337  char *p = frontend_verilog_yytext + 5;
1338  while (*p == ' ' || *p == '\t') p++;
1340  while (*p && *p != ' ' && *p != '\t') p++;
1341  while (*p == ' ' || *p == '\t') p++;
1342  char *q = *p ? p + 1 : p;
1343  while (*q && *q != '"') q++;
1344  current_filename = std::string(p).substr(1, q-p-1);
1345 }
1346  YY_BREAK
1347 case 4:
1349 #line 109 "frontends/verilog/verilog_lexer.l"
1350 {
1351  log_error("Can't open include file `%s'!\n", frontend_verilog_yytext + 15);
1352 }
1353  YY_BREAK
1354 case 5:
1356 #line 113 "frontends/verilog/verilog_lexer.l"
1357 /* ignore timescale directive */
1358  YY_BREAK
1359 case 6:
1361 #line 115 "frontends/verilog/verilog_lexer.l"
1362 {
1363  char *p = frontend_verilog_yytext;
1364  while (*p != 0 && *p != ' ' && *p != '\t') p++;
1365  while (*p == ' ' || *p == '\t') p++;
1366  if (!strcmp(p, "none"))
1368  else if (!strcmp(p, "wire"))
1370  else
1371  frontend_verilog_yyerror("Unsupported default nettype: %s", p);
1372 }
1373  YY_BREAK
1374 case 7:
1376 #line 127 "frontends/verilog/verilog_lexer.l"
1377 {
1378  frontend_verilog_yyerror("Unimplemented compiler directive or undefined macro %s.", frontend_verilog_yytext);
1379 }
1380  YY_BREAK
1381 case 8:
1383 #line 131 "frontends/verilog/verilog_lexer.l"
1384 { return TOK_MODULE; }
1385  YY_BREAK
1386 case 9:
1388 #line 132 "frontends/verilog/verilog_lexer.l"
1389 { return TOK_ENDMODULE; }
1390  YY_BREAK
1391 case 10:
1393 #line 133 "frontends/verilog/verilog_lexer.l"
1394 { return TOK_FUNCTION; }
1395  YY_BREAK
1396 case 11:
1398 #line 134 "frontends/verilog/verilog_lexer.l"
1399 { return TOK_ENDFUNCTION; }
1400  YY_BREAK
1401 case 12:
1403 #line 135 "frontends/verilog/verilog_lexer.l"
1404 { return TOK_TASK; }
1405  YY_BREAK
1406 case 13:
1408 #line 136 "frontends/verilog/verilog_lexer.l"
1409 { return TOK_ENDTASK; }
1410  YY_BREAK
1411 case 14:
1413 #line 137 "frontends/verilog/verilog_lexer.l"
1414 { return TOK_PARAMETER; }
1415  YY_BREAK
1416 case 15:
1418 #line 138 "frontends/verilog/verilog_lexer.l"
1419 { return TOK_LOCALPARAM; }
1420  YY_BREAK
1421 case 16:
1423 #line 139 "frontends/verilog/verilog_lexer.l"
1424 { return TOK_DEFPARAM; }
1425  YY_BREAK
1426 case 17:
1428 #line 140 "frontends/verilog/verilog_lexer.l"
1429 { return TOK_ASSIGN; }
1430  YY_BREAK
1431 case 18:
1433 #line 141 "frontends/verilog/verilog_lexer.l"
1434 { return TOK_ALWAYS; }
1435  YY_BREAK
1436 case 19:
1438 #line 142 "frontends/verilog/verilog_lexer.l"
1439 { return TOK_INITIAL; }
1440  YY_BREAK
1441 case 20:
1443 #line 143 "frontends/verilog/verilog_lexer.l"
1444 { return TOK_BEGIN; }
1445  YY_BREAK
1446 case 21:
1448 #line 144 "frontends/verilog/verilog_lexer.l"
1449 { return TOK_END; }
1450  YY_BREAK
1451 case 22:
1453 #line 145 "frontends/verilog/verilog_lexer.l"
1454 { return TOK_IF; }
1455  YY_BREAK
1456 case 23:
1458 #line 146 "frontends/verilog/verilog_lexer.l"
1459 { return TOK_ELSE; }
1460  YY_BREAK
1461 case 24:
1463 #line 147 "frontends/verilog/verilog_lexer.l"
1464 { return TOK_FOR; }
1465  YY_BREAK
1466 case 25:
1468 #line 148 "frontends/verilog/verilog_lexer.l"
1469 { return TOK_POSEDGE; }
1470  YY_BREAK
1471 case 26:
1473 #line 149 "frontends/verilog/verilog_lexer.l"
1474 { return TOK_NEGEDGE; }
1475  YY_BREAK
1476 case 27:
1478 #line 150 "frontends/verilog/verilog_lexer.l"
1479 { return TOK_OR; }
1480  YY_BREAK
1481 case 28:
1483 #line 151 "frontends/verilog/verilog_lexer.l"
1484 { return TOK_CASE; }
1485  YY_BREAK
1486 case 29:
1488 #line 152 "frontends/verilog/verilog_lexer.l"
1489 { return TOK_CASEX; }
1490  YY_BREAK
1491 case 30:
1493 #line 153 "frontends/verilog/verilog_lexer.l"
1494 { return TOK_CASEZ; }
1495  YY_BREAK
1496 case 31:
1498 #line 154 "frontends/verilog/verilog_lexer.l"
1499 { return TOK_ENDCASE; }
1500  YY_BREAK
1501 case 32:
1503 #line 155 "frontends/verilog/verilog_lexer.l"
1504 { return TOK_DEFAULT; }
1505  YY_BREAK
1506 case 33:
1508 #line 156 "frontends/verilog/verilog_lexer.l"
1509 { return TOK_GENERATE; }
1510  YY_BREAK
1511 case 34:
1513 #line 157 "frontends/verilog/verilog_lexer.l"
1514 { return TOK_ENDGENERATE; }
1515  YY_BREAK
1516 case 35:
1518 #line 158 "frontends/verilog/verilog_lexer.l"
1519 { return TOK_WHILE; }
1520  YY_BREAK
1521 case 36:
1523 #line 159 "frontends/verilog/verilog_lexer.l"
1524 { return TOK_REPEAT; }
1525  YY_BREAK
1526 case 37:
1528 #line 161 "frontends/verilog/verilog_lexer.l"
1529 { SV_KEYWORD(TOK_ALWAYS); }
1530  YY_BREAK
1531 case 38:
1533 #line 162 "frontends/verilog/verilog_lexer.l"
1534 { SV_KEYWORD(TOK_ALWAYS); }
1535  YY_BREAK
1536 case 39:
1538 #line 163 "frontends/verilog/verilog_lexer.l"
1539 { SV_KEYWORD(TOK_ALWAYS); }
1540  YY_BREAK
1541 case 40:
1543 #line 165 "frontends/verilog/verilog_lexer.l"
1544 { SV_KEYWORD(TOK_ASSERT); }
1545  YY_BREAK
1546 case 41:
1548 #line 166 "frontends/verilog/verilog_lexer.l"
1550  YY_BREAK
1551 case 42:
1553 #line 167 "frontends/verilog/verilog_lexer.l"
1554 { SV_KEYWORD(TOK_REG); }
1555  YY_BREAK
1556 case 43:
1558 #line 168 "frontends/verilog/verilog_lexer.l"
1559 { SV_KEYWORD(TOK_REG); }
1560  YY_BREAK
1561 case 44:
1563 #line 170 "frontends/verilog/verilog_lexer.l"
1564 { return TOK_INPUT; }
1565  YY_BREAK
1566 case 45:
1568 #line 171 "frontends/verilog/verilog_lexer.l"
1569 { return TOK_OUTPUT; }
1570  YY_BREAK
1571 case 46:
1573 #line 172 "frontends/verilog/verilog_lexer.l"
1574 { return TOK_INOUT; }
1575  YY_BREAK
1576 case 47:
1578 #line 173 "frontends/verilog/verilog_lexer.l"
1579 { return TOK_WIRE; }
1580  YY_BREAK
1581 case 48:
1583 #line 174 "frontends/verilog/verilog_lexer.l"
1584 { return TOK_REG; }
1585  YY_BREAK
1586 case 49:
1588 #line 175 "frontends/verilog/verilog_lexer.l"
1589 { return TOK_INTEGER; }
1590  YY_BREAK
1591 case 50:
1593 #line 176 "frontends/verilog/verilog_lexer.l"
1594 { return TOK_SIGNED; }
1595  YY_BREAK
1596 case 51:
1598 #line 177 "frontends/verilog/verilog_lexer.l"
1599 { return TOK_GENVAR; }
1600  YY_BREAK
1601 case 52:
1603 #line 178 "frontends/verilog/verilog_lexer.l"
1604 { return TOK_REAL; }
1605  YY_BREAK
1606 case 53:
1608 #line 180 "frontends/verilog/verilog_lexer.l"
1609 {
1610  frontend_verilog_yylval.string = new std::string(frontend_verilog_yytext);
1611  return TOK_CONST;
1612 }
1613  YY_BREAK
1614 case 54:
1615 /* rule 54 can match eol */
1617 #line 185 "frontends/verilog/verilog_lexer.l"
1618 {
1619  frontend_verilog_yylval.string = new std::string(frontend_verilog_yytext);
1620  return TOK_CONST;
1621 }
1622  YY_BREAK
1623 case 55:
1625 #line 190 "frontends/verilog/verilog_lexer.l"
1626 {
1627  frontend_verilog_yylval.string = new std::string(frontend_verilog_yytext);
1628  return TOK_REALVAL;
1629 }
1630  YY_BREAK
1631 case 56:
1633 #line 195 "frontends/verilog/verilog_lexer.l"
1634 {
1635  frontend_verilog_yylval.string = new std::string(frontend_verilog_yytext);
1636  return TOK_REALVAL;
1637 }
1638  YY_BREAK
1639 case 57:
1641 #line 200 "frontends/verilog/verilog_lexer.l"
1642 { BEGIN(STRING); }
1643  YY_BREAK
1644 case 58:
1646 #line 201 "frontends/verilog/verilog_lexer.l"
1647 { yymore(); }
1648  YY_BREAK
1649 case 59:
1651 #line 202 "frontends/verilog/verilog_lexer.l"
1652 {
1653  BEGIN(0);
1654  char *yystr = strdup(frontend_verilog_yytext);
1655  yystr[strlen(frontend_verilog_yytext) - 1] = 0;
1656  int i = 0, j = 0;
1657  while (yystr[i]) {
1658  if (yystr[i] == '\\' && yystr[i + 1]) {
1659  i++;
1660  if (yystr[i] == 'n')
1661  yystr[i] = '\n';
1662  else if (yystr[i] == 't')
1663  yystr[i] = '\t';
1664  else if ('0' <= yystr[i] && yystr[i] <= '7') {
1665  yystr[i] = yystr[i] - '0';
1666  if ('0' <= yystr[i + 1] && yystr[i + 1] <= '7') {
1667  yystr[i + 1] = yystr[i] * 8 + yystr[i + 1] - '0';
1668  i++;
1669  }
1670  if ('0' <= yystr[i + 1] && yystr[i + 1] <= '7') {
1671  yystr[i + 1] = yystr[i] * 8 + yystr[i + 1] - '0';
1672  i++;
1673  }
1674  }
1675  }
1676  yystr[j++] = yystr[i++];
1677  }
1678  yystr[j] = 0;
1679  frontend_verilog_yylval.string = new std::string(yystr);
1680  free(yystr);
1681  return TOK_STRING;
1682 }
1683  YY_BREAK
1684 case 60:
1686 #line 233 "frontends/verilog/verilog_lexer.l"
1687 { yymore(); }
1688  YY_BREAK
1689 case 61:
1691 #line 235 "frontends/verilog/verilog_lexer.l"
1692 {
1693  frontend_verilog_yylval.string = new std::string(frontend_verilog_yytext);
1694  return TOK_PRIMITIVE;
1695 }
1696  YY_BREAK
1697 case 62:
1699 #line 240 "frontends/verilog/verilog_lexer.l"
1700 { return TOK_SUPPLY0; }
1701  YY_BREAK
1702 case 63:
1704 #line 241 "frontends/verilog/verilog_lexer.l"
1705 { return TOK_SUPPLY1; }
1706  YY_BREAK
1707 case 64:
1709 #line 243 "frontends/verilog/verilog_lexer.l"
1710 {
1711  frontend_verilog_yylval.string = new std::string(frontend_verilog_yytext);
1712  return TOK_ID;
1713 }
1714  YY_BREAK
1715 case 65:
1717 #line 248 "frontends/verilog/verilog_lexer.l"
1718 { return TOK_TO_SIGNED; }
1719  YY_BREAK
1720 case 66:
1722 #line 249 "frontends/verilog/verilog_lexer.l"
1723 { return TOK_TO_UNSIGNED; }
1724  YY_BREAK
1725 case 67:
1727 #line 251 "frontends/verilog/verilog_lexer.l"
1728 {
1729  frontend_verilog_yylval.string = new std::string(std::string("\\") + frontend_verilog_yytext);
1730  return TOK_ID;
1731 }
1732  YY_BREAK
1733 case 68:
1735 #line 256 "frontends/verilog/verilog_lexer.l"
1736 {
1737  log("Warning: Found one of those horrible `(synopsys|synthesis) translate_off' comments.\n");
1738  log("It is strongly suggested to use `ifdef constructs instead!\n");
1740 }
1741  YY_BREAK
1742 case 69:
1744 #line 261 "frontends/verilog/verilog_lexer.l"
1745 /* ignore synopsys translate_off body */
1746  YY_BREAK
1747 case 70:
1748 /* rule 70 can match eol */
1750 #line 262 "frontends/verilog/verilog_lexer.l"
1751 /* ignore synopsys translate_off body */
1752  YY_BREAK
1753 case 71:
1755 #line 263 "frontends/verilog/verilog_lexer.l"
1756 { BEGIN(0); }
1757  YY_BREAK
1758 case 72:
1760 #line 265 "frontends/verilog/verilog_lexer.l"
1761 {
1763 }
1764  YY_BREAK
1765 case 73:
1767 #line 268 "frontends/verilog/verilog_lexer.l"
1768 {
1769  log("Warning: Found one of those horrible `(synopsys|synthesis) full_case' comments.\n");
1770  log("It is strongly suggested to use verilog x-values and default branches instead!\n");
1771  return TOK_SYNOPSYS_FULL_CASE;
1772 }
1773  YY_BREAK
1774 case 74:
1776 #line 273 "frontends/verilog/verilog_lexer.l"
1777 {
1778  log("Warning: Found one of those horrible `(synopsys|synthesis) parallel_case' comments.\n");
1779  log("It is strongly suggested to use verilog `parallel_case' attributes instead!\n");
1781 }
1782  YY_BREAK
1783 case 75:
1785 #line 278 "frontends/verilog/verilog_lexer.l"
1786 /* ignore everything else */
1787  YY_BREAK
1788 case 76:
1790 #line 279 "frontends/verilog/verilog_lexer.l"
1791 { BEGIN(0); }
1792  YY_BREAK
1793 case 77:
1794 /* rule 77 can match eol */
1796 #line 281 "frontends/verilog/verilog_lexer.l"
1797 {
1798  BEGIN(IMPORT_DPI);
1799  return TOK_DPI_FUNCTION;
1800 }
1801  YY_BREAK
1802 case 78:
1804 #line 286 "frontends/verilog/verilog_lexer.l"
1805 {
1806  frontend_verilog_yylval.string = new std::string(std::string("\\") + frontend_verilog_yytext);
1807  return TOK_ID;
1808 }
1809  YY_BREAK
1810 case 79:
1811 /* rule 79 can match eol */
1813 #line 291 "frontends/verilog/verilog_lexer.l"
1814 /* ignore whitespaces */
1815  YY_BREAK
1816 case 80:
1818 #line 293 "frontends/verilog/verilog_lexer.l"
1819 {
1820  BEGIN(0);
1821  return *frontend_verilog_yytext;
1822 }
1823  YY_BREAK
1824 case 81:
1826 #line 298 "frontends/verilog/verilog_lexer.l"
1827 {
1828  return *frontend_verilog_yytext;
1829 }
1830  YY_BREAK
1831 case 82:
1833 #line 302 "frontends/verilog/verilog_lexer.l"
1834 {
1835  frontend_verilog_yylval.string = new std::string(frontend_verilog_yytext);
1836  return TOK_ID;
1837 }
1838  YY_BREAK
1839 case 83:
1841 #line 307 "frontends/verilog/verilog_lexer.l"
1842 { return ATTR_BEGIN; }
1843  YY_BREAK
1844 case 84:
1846 #line 308 "frontends/verilog/verilog_lexer.l"
1847 { return ATTR_END; }
1848  YY_BREAK
1849 case 85:
1851 #line 310 "frontends/verilog/verilog_lexer.l"
1852 { return DEFATTR_BEGIN; }
1853  YY_BREAK
1854 case 86:
1856 #line 311 "frontends/verilog/verilog_lexer.l"
1857 { return DEFATTR_END; }
1858  YY_BREAK
1859 case 87:
1861 #line 313 "frontends/verilog/verilog_lexer.l"
1862 { return OP_POW; }
1863  YY_BREAK
1864 case 88:
1866 #line 314 "frontends/verilog/verilog_lexer.l"
1867 { return OP_LOR; }
1868  YY_BREAK
1869 case 89:
1871 #line 315 "frontends/verilog/verilog_lexer.l"
1872 { return OP_LAND; }
1873  YY_BREAK
1874 case 90:
1876 #line 316 "frontends/verilog/verilog_lexer.l"
1877 { return OP_EQ; }
1878  YY_BREAK
1879 case 91:
1881 #line 317 "frontends/verilog/verilog_lexer.l"
1882 { return OP_NE; }
1883  YY_BREAK
1884 case 92:
1886 #line 318 "frontends/verilog/verilog_lexer.l"
1887 { return OP_LE; }
1888  YY_BREAK
1889 case 93:
1891 #line 319 "frontends/verilog/verilog_lexer.l"
1892 { return OP_GE; }
1893  YY_BREAK
1894 case 94:
1896 #line 321 "frontends/verilog/verilog_lexer.l"
1897 { return OP_EQX; }
1898  YY_BREAK
1899 case 95:
1901 #line 322 "frontends/verilog/verilog_lexer.l"
1902 { return OP_NEX; }
1903  YY_BREAK
1904 case 96:
1906 #line 324 "frontends/verilog/verilog_lexer.l"
1907 { return OP_NAND; }
1908  YY_BREAK
1909 case 97:
1911 #line 325 "frontends/verilog/verilog_lexer.l"
1912 { return OP_NOR; }
1913  YY_BREAK
1914 case 98:
1916 #line 326 "frontends/verilog/verilog_lexer.l"
1917 { return OP_XNOR; }
1918  YY_BREAK
1919 case 99:
1921 #line 327 "frontends/verilog/verilog_lexer.l"
1922 { return OP_XNOR; }
1923  YY_BREAK
1924 case 100:
1926 #line 329 "frontends/verilog/verilog_lexer.l"
1927 { return OP_SHL; }
1928  YY_BREAK
1929 case 101:
1931 #line 330 "frontends/verilog/verilog_lexer.l"
1932 { return OP_SHR; }
1933  YY_BREAK
1934 case 102:
1936 #line 331 "frontends/verilog/verilog_lexer.l"
1937 { return OP_SSHL; }
1938  YY_BREAK
1939 case 103:
1941 #line 332 "frontends/verilog/verilog_lexer.l"
1942 { return OP_SSHR; }
1943  YY_BREAK
1944 case 104:
1946 #line 334 "frontends/verilog/verilog_lexer.l"
1947 { return TOK_POS_INDEXED; }
1948  YY_BREAK
1949 case 105:
1951 #line 335 "frontends/verilog/verilog_lexer.l"
1952 { return TOK_NEG_INDEXED; }
1953  YY_BREAK
1954 case 106:
1956 #line 337 "frontends/verilog/verilog_lexer.l"
1957 { BEGIN(COMMENT); }
1958  YY_BREAK
1959 case 107:
1961 #line 338 "frontends/verilog/verilog_lexer.l"
1962 /* ignore comment body */
1963  YY_BREAK
1964 case 108:
1965 /* rule 108 can match eol */
1967 #line 339 "frontends/verilog/verilog_lexer.l"
1968 /* ignore comment body */
1969  YY_BREAK
1970 case 109:
1972 #line 340 "frontends/verilog/verilog_lexer.l"
1973 { BEGIN(0); }
1974  YY_BREAK
1975 case 110:
1976 /* rule 110 can match eol */
1978 #line 342 "frontends/verilog/verilog_lexer.l"
1979 /* ignore whitespaces */
1980  YY_BREAK
1981 case 111:
1982 /* rule 111 can match eol */
1984 #line 343 "frontends/verilog/verilog_lexer.l"
1985 /* ignore continuation sequence */
1986  YY_BREAK
1987 case 112:
1989 #line 344 "frontends/verilog/verilog_lexer.l"
1990 /* ignore one-line comments */
1991  YY_BREAK
1992 case 113:
1994 #line 345 "frontends/verilog/verilog_lexer.l"
1995 /* ignore simulation timings */
1996  YY_BREAK
1997 case 114:
1999 #line 347 "frontends/verilog/verilog_lexer.l"
2000 { return *frontend_verilog_yytext; }
2001  YY_BREAK
2002 case 115:
2004 #line 349 "frontends/verilog/verilog_lexer.l"
2005 ECHO;
2006  YY_BREAK
2007 #line 2008 "frontends/verilog/verilog_lexer.cc"
2008 case YY_STATE_EOF(INITIAL):
2009 case YY_STATE_EOF(COMMENT):
2010 case YY_STATE_EOF(STRING):
2013 case YY_STATE_EOF(IMPORT_DPI):
2014  yyterminate();
2015 
2016  case YY_END_OF_BUFFER:
2017  {
2018  /* Amount of text matched not including the EOB char. */
2019  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2020 
2021  /* Undo the effects of YY_DO_BEFORE_ACTION. */
2022  *yy_cp = (yy_hold_char);
2024 
2025  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2026  {
2027  /* We're scanning a new file or input source. It's
2028  * possible that this happened because the user
2029  * just pointed frontend_verilog_yyin at a new source and called
2030  * frontend_verilog_yylex(). If so, then we have to assure
2031  * consistency between YY_CURRENT_BUFFER and our
2032  * globals. Here is the right place to do so, because
2033  * this is the first action (other than possibly a
2034  * back-up) that will match for the new input source.
2035  */
2036  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2038  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2039  }
2040 
2041  /* Note that here we test for yy_c_buf_p "<=" to the position
2042  * of the first EOB in the buffer, since yy_c_buf_p will
2043  * already have been incremented past the NUL character
2044  * (since all states make transitions on EOB to the
2045  * end-of-buffer state). Contrast this with the test
2046  * in input().
2047  */
2048  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2049  { /* This was really a NUL. */
2050  yy_state_type yy_next_state;
2051 
2052  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2053 
2054  yy_current_state = yy_get_previous_state( );
2055 
2056  /* Okay, we're now positioned to make the NUL
2057  * transition. We couldn't have
2058  * yy_get_previous_state() go ahead and do it
2059  * for us because it doesn't know how to deal
2060  * with the possibility of jamming (and we don't
2061  * want to build jamming into it because then it
2062  * will run more slowly).
2063  */
2064 
2065  yy_next_state = yy_try_NUL_trans( yy_current_state );
2066 
2067  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2068 
2069  if ( yy_next_state )
2070  {
2071  /* Consume the NUL. */
2072  yy_cp = ++(yy_c_buf_p);
2073  yy_current_state = yy_next_state;
2074  goto yy_match;
2075  }
2076 
2077  else
2078  {
2079  yy_cp = (yy_c_buf_p);
2080  goto yy_find_action;
2081  }
2082  }
2083 
2084  else switch ( yy_get_next_buffer( ) )
2085  {
2086  case EOB_ACT_END_OF_FILE:
2087  {
2089 
2090  if ( frontend_verilog_yywrap( ) )
2091  {
2092  /* Note: because we've taken care in
2093  * yy_get_next_buffer() to have set up
2094  * frontend_verilog_yytext, we can now set up
2095  * yy_c_buf_p so that if some total
2096  * hoser (like flex itself) wants to
2097  * call the scanner after we return the
2098  * YY_NULL, it'll still work - another
2099  * YY_NULL will get returned.
2100  */
2102 
2103  yy_act = YY_STATE_EOF(YY_START);
2104  goto do_action;
2105  }
2106 
2107  else
2108  {
2109  if ( ! (yy_did_buffer_switch_on_eof) )
2110  YY_NEW_FILE;
2111  }
2112  break;
2113  }
2114 
2115  case EOB_ACT_CONTINUE_SCAN:
2116  (yy_c_buf_p) =
2117  (yytext_ptr) + yy_amount_of_matched_text;
2118 
2119  yy_current_state = yy_get_previous_state( );
2120 
2121  yy_cp = (yy_c_buf_p);
2122  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2123  goto yy_match;
2124 
2125  case EOB_ACT_LAST_MATCH:
2126  (yy_c_buf_p) =
2127  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2128 
2129  yy_current_state = yy_get_previous_state( );
2130 
2131  yy_cp = (yy_c_buf_p);
2132  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2133  goto yy_find_action;
2134  }
2135  break;
2136  }
2137 
2138  default:
2140  "fatal flex scanner internal error--no action found" );
2141  } /* end of action switch */
2142  } /* end of scanning one token */
2143 } /* end of frontend_verilog_yylex */
2144 
2145 /* yy_get_next_buffer - try to read in a new buffer
2146  *
2147  * Returns a code representing an action:
2148  * EOB_ACT_LAST_MATCH -
2149  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2150  * EOB_ACT_END_OF_FILE - end of file
2151  */
2152 static int yy_get_next_buffer (void)
2153 {
2154  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2155  register char *source = (yytext_ptr);
2156  register int number_to_move, i;
2157  int ret_val;
2158 
2159  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2161  "fatal flex scanner internal error--end of buffer missed" );
2162 
2163  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2164  { /* Don't try to fill the buffer, so this is an EOF. */
2165  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2166  {
2167  /* We matched a single character, the EOB, so
2168  * treat this as a final EOF.
2169  */
2170  return EOB_ACT_END_OF_FILE;
2171  }
2172 
2173  else
2174  {
2175  /* We matched some text prior to the EOB, first
2176  * process it.
2177  */
2178  return EOB_ACT_LAST_MATCH;
2179  }
2180  }
2181 
2182  /* Try to read more data. */
2183 
2184  /* First move last chars to start of buffer. */
2185  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
2186 
2187  for ( i = 0; i < number_to_move; ++i )
2188  *(dest++) = *(source++);
2189 
2190  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2191  /* don't do the read, it's not guaranteed to return an EOF,
2192  * just force an EOF
2193  */
2194  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2195 
2196  else
2197  {
2198  int num_to_read =
2199  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2200 
2201  while ( num_to_read <= 0 )
2202  { /* Not enough room in the buffer - grow it. */
2203 
2204  /* just a shorter name for the current buffer */
2205  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2206 
2207  int yy_c_buf_p_offset =
2208  (int) ((yy_c_buf_p) - b->yy_ch_buf);
2209 
2210  if ( b->yy_is_our_buffer )
2211  {
2212  int new_size = b->yy_buf_size * 2;
2213 
2214  if ( new_size <= 0 )
2215  b->yy_buf_size += b->yy_buf_size / 8;
2216  else
2217  b->yy_buf_size *= 2;
2218 
2219  b->yy_ch_buf = (char *)
2220  /* Include room in for 2 EOB chars. */
2221  frontend_verilog_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
2222  }
2223  else
2224  /* Can't grow it, we don't own it. */
2225  b->yy_ch_buf = 0;
2226 
2227  if ( ! b->yy_ch_buf )
2229  "fatal error - scanner input buffer overflow" );
2230 
2231  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2232 
2233  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2234  number_to_move - 1;
2235 
2236  }
2237 
2238  if ( num_to_read > YY_READ_BUF_SIZE )
2239  num_to_read = YY_READ_BUF_SIZE;
2240 
2241  /* Read in more data. */
2242  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2243  (yy_n_chars), (size_t) num_to_read );
2244 
2245  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2246  }
2247 
2248  if ( (yy_n_chars) == 0 )
2249  {
2250  if ( number_to_move == YY_MORE_ADJ )
2251  {
2252  ret_val = EOB_ACT_END_OF_FILE;
2254  }
2255 
2256  else
2257  {
2258  ret_val = EOB_ACT_LAST_MATCH;
2259  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2261  }
2262  }
2263 
2264  else
2265  ret_val = EOB_ACT_CONTINUE_SCAN;
2266 
2267  if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2268  /* Extend the array by 50%, plus the number we really need. */
2269  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2270  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) frontend_verilog_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
2271  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2272  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2273  }
2274 
2275  (yy_n_chars) += number_to_move;
2278 
2279  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2280 
2281  return ret_val;
2282 }
2283 
2284 /* yy_get_previous_state - get the state just before the EOB char was reached */
2285 
2286  static yy_state_type yy_get_previous_state (void)
2287 {
2288  register yy_state_type yy_current_state;
2289  register char *yy_cp;
2290 
2291  yy_current_state = (yy_start);
2292 
2293  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2294  {
2295  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2296  if ( yy_accept[yy_current_state] )
2297  {
2298  (yy_last_accepting_state) = yy_current_state;
2299  (yy_last_accepting_cpos) = yy_cp;
2300  }
2301  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2302  {
2303  yy_current_state = (int) yy_def[yy_current_state];
2304  if ( yy_current_state >= 569 )
2305  yy_c = yy_meta[(unsigned int) yy_c];
2306  }
2307  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2308  }
2309 
2310  return yy_current_state;
2311 }
2312 
2313 /* yy_try_NUL_trans - try to make a transition on the NUL character
2314  *
2315  * synopsis
2316  * next_state = yy_try_NUL_trans( current_state );
2317  */
2318  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2319 {
2320  register int yy_is_jam;
2321  register char *yy_cp = (yy_c_buf_p);
2322 
2323  register YY_CHAR yy_c = 1;
2324  if ( yy_accept[yy_current_state] )
2325  {
2326  (yy_last_accepting_state) = yy_current_state;
2327  (yy_last_accepting_cpos) = yy_cp;
2328  }
2329  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2330  {
2331  yy_current_state = (int) yy_def[yy_current_state];
2332  if ( yy_current_state >= 569 )
2333  yy_c = yy_meta[(unsigned int) yy_c];
2334  }
2335  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2336  yy_is_jam = (yy_current_state == 568);
2337 
2338  return yy_is_jam ? 0 : yy_current_state;
2339 }
2340 
2341 #ifndef YY_NO_INPUT
2342 #ifdef __cplusplus
2343  static int yyinput (void)
2344 #else
2345  static int input (void)
2346 #endif
2347 
2348 {
2349  int c;
2350 
2351  *(yy_c_buf_p) = (yy_hold_char);
2352 
2353  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2354  {
2355  /* yy_c_buf_p now points to the character we want to return.
2356  * If this occurs *before* the EOB characters, then it's a
2357  * valid NUL; if not, then we've hit the end of the buffer.
2358  */
2359  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2360  /* This was really a NUL. */
2361  *(yy_c_buf_p) = '\0';
2362 
2363  else
2364  { /* need more input */
2365  int offset = (yy_c_buf_p) - (yytext_ptr);
2366  ++(yy_c_buf_p);
2367 
2368  switch ( yy_get_next_buffer( ) )
2369  {
2370  case EOB_ACT_LAST_MATCH:
2371  /* This happens because yy_g_n_b()
2372  * sees that we've accumulated a
2373  * token and flags that we need to
2374  * try matching the token before
2375  * proceeding. But for input(),
2376  * there's no matching to consider.
2377  * So convert the EOB_ACT_LAST_MATCH
2378  * to EOB_ACT_END_OF_FILE.
2379  */
2380 
2381  /* Reset buffer status. */
2383 
2384  /*FALLTHROUGH*/
2385 
2386  case EOB_ACT_END_OF_FILE:
2387  {
2388  if ( frontend_verilog_yywrap( ) )
2389  return EOF;
2390 
2391  if ( ! (yy_did_buffer_switch_on_eof) )
2392  YY_NEW_FILE;
2393 #ifdef __cplusplus
2394  return yyinput();
2395 #else
2396  return input();
2397 #endif
2398  }
2399 
2400  case EOB_ACT_CONTINUE_SCAN:
2401  (yy_c_buf_p) = (yytext_ptr) + offset;
2402  break;
2403  }
2404  }
2405  }
2406 
2407  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2408  *(yy_c_buf_p) = '\0'; /* preserve frontend_verilog_yytext */
2409  (yy_hold_char) = *++(yy_c_buf_p);
2410 
2411  if ( c == '\n' )
2412 
2413  frontend_verilog_yylineno++;
2414 ;
2415 
2416  return c;
2417 }
2418 #endif /* ifndef YY_NO_INPUT */
2419 
2420 /** Immediately switch to a different input stream.
2421  * @param input_file A readable stream.
2422  *
2423  * @note This function does not reset the start condition to @c INITIAL .
2424  */
2426 {
2427 
2428  if ( ! YY_CURRENT_BUFFER ){
2432  }
2433 
2436 }
2437 
2438 /** Switch to a different input buffer.
2439  * @param new_buffer The new input buffer.
2440  *
2441  */
2442  void frontend_verilog_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2443 {
2444 
2445  /* TODO. We should be able to replace this entire function body
2446  * with
2447  * frontend_verilog_yypop_buffer_state();
2448  * frontend_verilog_yypush_buffer_state(new_buffer);
2449  */
2451  if ( YY_CURRENT_BUFFER == new_buffer )
2452  return;
2453 
2454  if ( YY_CURRENT_BUFFER )
2455  {
2456  /* Flush out information for old buffer. */
2457  *(yy_c_buf_p) = (yy_hold_char);
2458  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2459  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2460  }
2461 
2462  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2464 
2465  /* We don't actually know whether we did this switch during
2466  * EOF (frontend_verilog_yywrap()) processing, but the only time this flag
2467  * is looked at is after frontend_verilog_yywrap() is called, so it's safe
2468  * to go ahead and always set it.
2469  */
2471 }
2472 
2474 {
2475  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2476  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2478  (yy_hold_char) = *(yy_c_buf_p);
2479 }
2480 
2481 /** Allocate and initialize an input buffer state.
2482  * @param file A readable stream.
2483  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2484  *
2485  * @return the allocated buffer state.
2486  */
2487  YY_BUFFER_STATE frontend_verilog_yy_create_buffer (FILE * file, int size )
2488 {
2489  YY_BUFFER_STATE b;
2490 
2491  b = (YY_BUFFER_STATE) frontend_verilog_yyalloc(sizeof( struct yy_buffer_state ) );
2492  if ( ! b )
2493  YY_FATAL_ERROR( "out of dynamic memory in frontend_verilog_yy_create_buffer()" );
2494 
2495  b->yy_buf_size = size;
2496 
2497  /* yy_ch_buf has to be 2 characters longer than the size given because
2498  * we need to put in 2 end-of-buffer characters.
2499  */
2500  b->yy_ch_buf = (char *) frontend_verilog_yyalloc(b->yy_buf_size + 2 );
2501  if ( ! b->yy_ch_buf )
2502  YY_FATAL_ERROR( "out of dynamic memory in frontend_verilog_yy_create_buffer()" );
2503 
2504  b->yy_is_our_buffer = 1;
2505 
2507 
2508  return b;
2509 }
2510 
2511 /** Destroy the buffer.
2512  * @param b a buffer created with frontend_verilog_yy_create_buffer()
2513  *
2514  */
2515  void frontend_verilog_yy_delete_buffer (YY_BUFFER_STATE b )
2516 {
2517 
2518  if ( ! b )
2519  return;
2520 
2521  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2523 
2524  if ( b->yy_is_our_buffer )
2525  frontend_verilog_yyfree((void *) b->yy_ch_buf );
2526 
2527  frontend_verilog_yyfree((void *) b );
2528 }
2529 
2530 #ifndef __cplusplus
2531 extern int isatty (int );
2532 #endif /* __cplusplus */
2533 
2534 /* Initializes or reinitializes a buffer.
2535  * This function is sometimes called more than once on the same buffer,
2536  * such as during a frontend_verilog_yyrestart() or at EOF.
2537  */
2538  static void frontend_verilog_yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2539 
2540 {
2541  int oerrno = errno;
2542 
2544 
2545  b->yy_input_file = file;
2546  b->yy_fill_buffer = 1;
2547 
2548  /* If b is the current buffer, then frontend_verilog_yy_init_buffer was _probably_
2549  * called from frontend_verilog_yyrestart() or through yy_get_next_buffer.
2550  * In that case, we don't want to reset the lineno or column.
2551  */
2552  if (b != YY_CURRENT_BUFFER){
2553  b->yy_bs_lineno = 1;
2554  b->yy_bs_column = 0;
2555  }
2556 
2557  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2558 
2559  errno = oerrno;
2560 }
2561 
2562 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2563  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2564  *
2565  */
2566  void frontend_verilog_yy_flush_buffer (YY_BUFFER_STATE b )
2567 {
2568  if ( ! b )
2569  return;
2570 
2571  b->yy_n_chars = 0;
2572 
2573  /* We always need two end-of-buffer characters. The first causes
2574  * a transition to the end-of-buffer state. The second causes
2575  * a jam in that state.
2576  */
2579 
2580  b->yy_buf_pos = &b->yy_ch_buf[0];
2581 
2582  b->yy_at_bol = 1;
2584 
2585  if ( b == YY_CURRENT_BUFFER )
2587 }
2588 
2589 /** Pushes the new state onto the stack. The new state becomes
2590  * the current state. This function will allocate the stack
2591  * if necessary.
2592  * @param new_buffer The new state.
2593  *
2594  */
2595 void frontend_verilog_yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2596 {
2597  if (new_buffer == NULL)
2598  return;
2599 
2601 
2602  /* This block is copied from frontend_verilog_yy_switch_to_buffer. */
2603  if ( YY_CURRENT_BUFFER )
2604  {
2605  /* Flush out information for old buffer. */
2606  *(yy_c_buf_p) = (yy_hold_char);
2607  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2608  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2609  }
2610 
2611  /* Only push if top exists. Otherwise, replace top. */
2612  if (YY_CURRENT_BUFFER)
2613  (yy_buffer_stack_top)++;
2614  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2615 
2616  /* copied from frontend_verilog_yy_switch_to_buffer. */
2619 }
2620 
2621 /** Removes and deletes the top of the stack, if present.
2622  * The next element becomes the new top.
2623  *
2624  */
2626 {
2627  if (!YY_CURRENT_BUFFER)
2628  return;
2629 
2632  if ((yy_buffer_stack_top) > 0)
2633  --(yy_buffer_stack_top);
2634 
2635  if (YY_CURRENT_BUFFER) {
2638  }
2639 }
2640 
2641 /* Allocates the stack if it does not exist.
2642  * Guarantees space for at least one push.
2643  */
2645 {
2646  int num_to_alloc;
2647 
2648  if (!(yy_buffer_stack)) {
2649 
2650  /* First allocation is just for 2 elements, since we don't know if this
2651  * scanner will even need a stack. We use 2 instead of 1 to avoid an
2652  * immediate realloc on the next call.
2653  */
2654  num_to_alloc = 1;
2656  (num_to_alloc * sizeof(struct yy_buffer_state*)
2657  );
2658  if ( ! (yy_buffer_stack) )
2659  YY_FATAL_ERROR( "out of dynamic memory in frontend_verilog_yyensure_buffer_stack()" );
2660 
2661  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2662 
2663  (yy_buffer_stack_max) = num_to_alloc;
2664  (yy_buffer_stack_top) = 0;
2665  return;
2666  }
2667 
2668  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2669 
2670  /* Increase the buffer to prepare for a possible push. */
2671  int grow_size = 8 /* arbitrary grow size */;
2672 
2673  num_to_alloc = (yy_buffer_stack_max) + grow_size;
2675  ((yy_buffer_stack),
2676  num_to_alloc * sizeof(struct yy_buffer_state*)
2677  );
2678  if ( ! (yy_buffer_stack) )
2679  YY_FATAL_ERROR( "out of dynamic memory in frontend_verilog_yyensure_buffer_stack()" );
2680 
2681  /* zero only the new slots.*/
2682  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2683  (yy_buffer_stack_max) = num_to_alloc;
2684  }
2685 }
2686 
2687 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2688  * @param base the character buffer
2689  * @param size the size in bytes of the character buffer
2690  *
2691  * @return the newly allocated buffer state object.
2692  */
2693 YY_BUFFER_STATE frontend_verilog_yy_scan_buffer (char * base, yy_size_t size )
2694 {
2695  YY_BUFFER_STATE b;
2696 
2697  if ( size < 2 ||
2698  base[size-2] != YY_END_OF_BUFFER_CHAR ||
2699  base[size-1] != YY_END_OF_BUFFER_CHAR )
2700  /* They forgot to leave room for the EOB's. */
2701  return 0;
2702 
2703  b = (YY_BUFFER_STATE) frontend_verilog_yyalloc(sizeof( struct yy_buffer_state ) );
2704  if ( ! b )
2705  YY_FATAL_ERROR( "out of dynamic memory in frontend_verilog_yy_scan_buffer()" );
2706 
2707  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2708  b->yy_buf_pos = b->yy_ch_buf = base;
2709  b->yy_is_our_buffer = 0;
2710  b->yy_input_file = 0;
2711  b->yy_n_chars = b->yy_buf_size;
2712  b->yy_is_interactive = 0;
2713  b->yy_at_bol = 1;
2714  b->yy_fill_buffer = 0;
2716 
2718 
2719  return b;
2720 }
2721 
2722 /** Setup the input buffer state to scan a string. The next call to frontend_verilog_yylex() will
2723  * scan from a @e copy of @a str.
2724  * @param yystr a NUL-terminated string to scan
2725  *
2726  * @return the newly allocated buffer state object.
2727  * @note If you want to scan bytes that may contain NUL values, then use
2728  * frontend_verilog_yy_scan_bytes() instead.
2729  */
2730 YY_BUFFER_STATE frontend_verilog_yy_scan_string (yyconst char * yystr )
2731 {
2732 
2733  return frontend_verilog_yy_scan_bytes(yystr,strlen(yystr) );
2734 }
2735 
2736 /** Setup the input buffer state to scan the given bytes. The next call to frontend_verilog_yylex() will
2737  * scan from a @e copy of @a bytes.
2738  * @param yybytes the byte buffer to scan
2739  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2740  *
2741  * @return the newly allocated buffer state object.
2742  */
2743 YY_BUFFER_STATE frontend_verilog_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2744 {
2745  YY_BUFFER_STATE b;
2746  char *buf;
2747  yy_size_t n;
2748  int i;
2749 
2750  /* Get memory for full buffer, including space for trailing EOB's. */
2751  n = _yybytes_len + 2;
2752  buf = (char *) frontend_verilog_yyalloc(n );
2753  if ( ! buf )
2754  YY_FATAL_ERROR( "out of dynamic memory in frontend_verilog_yy_scan_bytes()" );
2755 
2756  for ( i = 0; i < _yybytes_len; ++i )
2757  buf[i] = yybytes[i];
2758 
2759  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2760 
2761  b = frontend_verilog_yy_scan_buffer(buf,n );
2762  if ( ! b )
2763  YY_FATAL_ERROR( "bad buffer in frontend_verilog_yy_scan_bytes()" );
2764 
2765  /* It's okay to grow etc. this buffer, and we should throw it
2766  * away when we're done.
2767  */
2768  b->yy_is_our_buffer = 1;
2769 
2770  return b;
2771 }
2772 
2773 #ifndef YY_EXIT_FAILURE
2774 #define YY_EXIT_FAILURE 2
2775 #endif
2776 
2777 static void yy_fatal_error (yyconst char* msg )
2778 {
2779  (void) fprintf( stderr, "%s\n", msg );
2780  exit( YY_EXIT_FAILURE );
2781 }
2782 
2783 /* Redefine yyless() so it works in section 3 code. */
2784 
2785 #undef yyless
2786 #define yyless(n) \
2787  do \
2788  { \
2789  /* Undo effects of setting up frontend_verilog_yytext. */ \
2790  int yyless_macro_arg = (n); \
2791  YY_LESS_LINENO(yyless_macro_arg);\
2792  frontend_verilog_yytext[frontend_verilog_yyleng] = (yy_hold_char); \
2793  (yy_c_buf_p) = frontend_verilog_yytext + yyless_macro_arg; \
2794  (yy_hold_char) = *(yy_c_buf_p); \
2795  *(yy_c_buf_p) = '\0'; \
2796  frontend_verilog_yyleng = yyless_macro_arg; \
2797  } \
2798  while ( 0 )
2799 
2800 /* Accessor methods (get/set functions) to struct members. */
2801 
2802 /** Get the current line number.
2803  *
2804  */
2806 {
2807 
2809 }
2810 
2811 /** Get the input stream.
2812  *
2813  */
2815 {
2816  return frontend_verilog_yyin;
2817 }
2818 
2819 /** Get the output stream.
2820  *
2821  */
2823 {
2824  return frontend_verilog_yyout;
2825 }
2826 
2827 /** Get the length of the current token.
2828  *
2829  */
2831 {
2832  return frontend_verilog_yyleng;
2833 }
2834 
2835 /** Get the current token.
2836  *
2837  */
2838 
2840 {
2841  return frontend_verilog_yytext;
2842 }
2843 
2844 /** Set the current line number.
2845  * @param line_number
2846  *
2847  */
2848 void frontend_verilog_yyset_lineno (int line_number )
2849 {
2850 
2851  frontend_verilog_yylineno = line_number;
2852 }
2853 
2854 /** Set the input stream. This does not discard the current
2855  * input buffer.
2856  * @param in_str A readable stream.
2857  *
2858  * @see frontend_verilog_yy_switch_to_buffer
2859  */
2860 void frontend_verilog_yyset_in (FILE * in_str )
2861 {
2862  frontend_verilog_yyin = in_str ;
2863 }
2864 
2865 void frontend_verilog_yyset_out (FILE * out_str )
2866 {
2867  frontend_verilog_yyout = out_str ;
2868 }
2869 
2871 {
2873 }
2874 
2876 {
2877  frontend_verilog_yy_flex_debug = bdebug ;
2878 }
2879 
2880 static int yy_init_globals (void)
2881 {
2882  /* Initialization is the same as for the non-reentrant scanner.
2883  * This function is called from frontend_verilog_yylex_destroy(), so don't allocate here.
2884  */
2885 
2886  /* We do not touch frontend_verilog_yylineno unless the option is enabled. */
2887  frontend_verilog_yylineno = 1;
2888 
2889  (yy_buffer_stack) = 0;
2890  (yy_buffer_stack_top) = 0;
2891  (yy_buffer_stack_max) = 0;
2892  (yy_c_buf_p) = (char *) 0;
2893  (yy_init) = 0;
2894  (yy_start) = 0;
2895 
2896 /* Defined in main.c */
2897 #ifdef YY_STDINIT
2898  frontend_verilog_yyin = stdin;
2899  frontend_verilog_yyout = stdout;
2900 #else
2901  frontend_verilog_yyin = (FILE *) 0;
2902  frontend_verilog_yyout = (FILE *) 0;
2903 #endif
2904 
2905  /* For future reference: Set errno on error, since we are called by
2906  * frontend_verilog_yylex_init()
2907  */
2908  return 0;
2909 }
2910 
2911 /* frontend_verilog_yylex_destroy is for both reentrant and non-reentrant scanners. */
2913 {
2914 
2915  /* Pop the buffer stack, destroying each element. */
2916  while(YY_CURRENT_BUFFER){
2920  }
2921 
2922  /* Destroy the stack itself. */
2923  frontend_verilog_yyfree((yy_buffer_stack) );
2924  (yy_buffer_stack) = NULL;
2925 
2926  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2927  * frontend_verilog_yylex() is called, initialization will occur. */
2928  yy_init_globals( );
2929 
2930  return 0;
2931 }
2932 
2933 /*
2934  * Internal utility routines.
2935  */
2936 
2937 #ifndef yytext_ptr
2938 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2939 {
2940  register int i;
2941  for ( i = 0; i < n; ++i )
2942  s1[i] = s2[i];
2943 }
2944 #endif
2945 
2946 #ifdef YY_NEED_STRLEN
2947 static int yy_flex_strlen (yyconst char * s )
2948 {
2949  register int n;
2950  for ( n = 0; s[n]; ++n )
2951  ;
2952 
2953  return n;
2954 }
2955 #endif
2956 
2958 {
2959  return (void *) malloc( size );
2960 }
2961 
2962 void *frontend_verilog_yyrealloc (void * ptr, yy_size_t size )
2963 {
2964  /* The cast to (char *) in the following accommodates both
2965  * implementations that use char* generic pointers, and those
2966  * that use void* generic pointers. It works with the latter
2967  * because both ANSI C and C++ allow castless assignment from
2968  * any pointer type to void*, and deal with argument conversions
2969  * as though doing an assignment.
2970  */
2971  return (void *) realloc( (char *) ptr, size );
2972 }
2973 
2974 void frontend_verilog_yyfree (void * ptr )
2975 {
2976  free( (char *) ptr ); /* see frontend_verilog_yyrealloc() for (char *) cast */
2977 }
2978 
2979 #define YYTABLES_NAME "yytables"
2980 
2981 #line 349 "frontends/verilog/verilog_lexer.l"
2982 
2983 
2984 
2985 // this is a hack to avoid the 'yyinput defined but not used' error msgs
2987  return (void*)&yyinput;
2988 }
2989 
2990 
static yyconst flex_int16_t yy_accept[569]
char * frontend_verilog_yytext
static size_t yy_buffer_stack_max
void frontend_verilog_yyset_debug(int debug_flag)
static yyconst flex_int16_t yy_chk[1121]
int yy_state_type
static char * yy_c_buf_p
YYSTYPE frontend_verilog_yylval
FILE * yy_input_file
Definition: ilang_lexer.cc:232
#define YY_RESTORE_YY_MORE_OFFSET
static int yy_init
int frontend_verilog_yyleng
void free(void *)
static yyconst flex_int16_t yy_def[592]
#define YY_CURRENT_BUFFER
void * malloc(YYSIZE_T)
#define frontend_verilog_yywrap(n)
int frontend_verilog_yy_flex_debug
#define YY_MORE_ADJ
static char * yy_last_accepting_cpos
unsigned int flex_uint32_t
#define YOSYS_NAMESPACE_END
Definition: yosys.h:100
FILE * frontend_verilog_yyout
int flex_int32_t
Definition: ilang_lexer.cc:72
YOSYS_NAMESPACE_END void frontend_verilog_yyerror(char const *fmt,...)
#define EOB_ACT_LAST_MATCH
static yyconst flex_int32_t yy_meta[67]
void log_error(const char *format,...)
Definition: log.cc:204
unsigned char YY_CHAR
Definition: ilang_lexer.cc:379
YY_BUFFER_STATE frontend_verilog_yy_scan_bytes(yyconst char *bytes, int len)
void frontend_verilog_yyrestart(FILE *input_file)
register char * yy_bp
#define COMMENT
void * frontend_verilog_avoid_input_warnings()
register int yy_act
int frontend_verilog_yylineno
static yy_state_type yy_get_previous_state(void)
FILE * frontend_verilog_yyin
yy_size_t yy_buf_size
Definition: ilang_lexer.cc:240
tuple n
Definition: fsm/generate.py:59
void * frontend_verilog_yyrealloc(void *, yy_size_t)
#define YY_NEW_FILE
static char yy_hold_char
static int yy_more_flag
#define SYNOPSYS_TRANSLATE_OFF
#define YY_START
#define YY_BUFFER_NEW
short int flex_int16_t
#define yytext_ptr
int frontend_verilog_yyget_leng(void)
void frontend_verilog_yyset_out(FILE *out_str)
unsigned char YY_CHAR
void * frontend_verilog_yyalloc(yy_size_t)
#define YY_END_OF_BUFFER_CHAR
#define YY_STATE_EOF(state)
#define YY_EXTRA_TYPE
static yyconst flex_int16_t yy_base[592]
#define yymore()
size_t yy_size_t
Definition: ilang_lexer.cc:225
static int yy_more_len
#define YY_DO_BEFORE_ACTION
int flex_int32_t
#define SV_KEYWORD(_tok)
size_t yy_size_t
static YY_BUFFER_STATE * yy_buffer_stack
void frontend_verilog_yyset_lineno(int line_number)
static void frontend_verilog_yy_init_buffer(YY_BUFFER_STATE b, FILE *file)
#define YY_RULE_SETUP
static int yy_get_next_buffer(void)
#define YY_BREAK
void frontend_verilog_yy_flush_buffer(YY_BUFFER_STATE b)
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
void frontend_verilog_yyset_in(FILE *in_str)
static void yy_fatal_error(yyconst char msg[])
unsigned short int flex_uint16_t
static size_t yy_buffer_stack_top
void frontend_verilog_yypush_buffer_state(YY_BUFFER_STATE new_buffer)
#define BEGIN
#define EOB_ACT_CONTINUE_SCAN
#define USING_YOSYS_NAMESPACE
Definition: yosys.h:102
#define YY_BUF_SIZE
char * frontend_verilog_yyget_text(void)
int frontend_verilog_yylex(void)
std::string current_filename
Definition: ast.cc:49
struct yy_buffer_state * YY_BUFFER_STATE
#define YY_DECL
static int yy_init_globals(void)
#define NULL
static int yy_did_buffer_switch_on_eof
#define YOSYS_NAMESPACE_BEGIN
Definition: yosys.h:99
YY_EXTRA_TYPE frontend_verilog_yyget_extra(void)
#define STRING
static int yy_start
#define YY_INPUT(buf, result, max_size)
#define YY_SC_TO_UI(c)
signed char flex_int8_t
flex_int32_t yy_verify
Definition: ilang_lexer.cc:414
void log(const char *format,...)
Definition: log.cc:180
static yyconst flex_int16_t yy_nxt[1121]
static yyconst flex_int32_t yy_ec[256]
#define YY_EXIT_FAILURE
int frontend_verilog_yyget_debug(void)
short int flex_int16_t
Definition: ilang_lexer.cc:71
#define YY_BUFFER_NORMAL
static yyconst flex_int32_t yy_rule_can_match_eol[116]
#define YY_READ_BUF_SIZE
std::vector< int > ln_stack
#define EOB_ACT_END_OF_FILE
FILE * frontend_verilog_yyget_out(void)
#define YY_BUFFER_EOF_PENDING
flex_int32_t yy_nxt
Definition: ilang_lexer.cc:415
#define yyterminate()
void frontend_verilog_yyset_extra(YY_EXTRA_TYPE user_defined)
void frontend_verilog_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)
void frontend_verilog_yypop_buffer_state(void)
static int input(void)
static void frontend_verilog_yy_load_buffer_state(void)
static yy_state_type yy_last_accepting_state
static void frontend_verilog_yyensure_buffer_stack(void)
#define ECHO
FILE * frontend_verilog_yyget_in(void)
#define YY_FATAL_ERROR(msg)
#define YY_END_OF_BUFFER
YY_BUFFER_STATE frontend_verilog_yy_create_buffer(FILE *file, int size)
register char * yy_cp
YY_BUFFER_STATE frontend_verilog_yy_scan_buffer(char *base, yy_size_t size)
static void input_file(std::istream &f, std::string filename)
Definition: preproc.cc:196
int isatty(int)
void frontend_verilog_yy_delete_buffer(YY_BUFFER_STATE b)
YY_BUFFER_STATE frontend_verilog_yy_scan_string(yyconst char *yy_str)
unsigned char flex_uint8_t
int frontend_verilog_yylex_destroy(void)
static int yy_n_chars
#define IMPORT_DPI
std::vector< std::string > fn_stack
#define yyconst
#define YY_CURRENT_BUFFER_LVALUE
void frontend_verilog_yyfree(void *)
#define SYNOPSYS_FLAGS
int frontend_verilog_yyget_lineno(void)
#define INITIAL