My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
scan_vcd.cpp
Go to the documentation of this file.
1 #line 2 "scan_vcd.cpp"
2 
3 #line 4 "scan_vcd.cpp"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define yy_create_buffer vcd__create_buffer
10 #define yy_delete_buffer vcd__delete_buffer
11 #define yy_flex_debug vcd__flex_debug
12 #define yy_init_buffer vcd__init_buffer
13 #define yy_flush_buffer vcd__flush_buffer
14 #define yy_load_buffer_state vcd__load_buffer_state
15 #define yy_switch_to_buffer vcd__switch_to_buffer
16 #define yyin vcd_in
17 #define yyleng vcd_leng
18 #define yylex vcd_lex
19 #define yylineno vcd_lineno
20 #define yyout vcd_out
21 #define yyrestart vcd_restart
22 #define yytext vcd_text
23 #define yywrap vcd_wrap
24 #define yyalloc vcd_alloc
25 #define yyrealloc vcd_realloc
26 #define yyfree vcd_free
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 vcd_restart(vcd_in )
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 vcd_leng;
185 
186 extern FILE *vcd_in, *vcd_out;
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 vcd_lex.
195  * One obvious solution it to make yy_act a global. I tried that, and saw
196  * a 5% performance hit in a non-vcd_lineno 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 < vcd_leng; ++yyl )\
203  if ( vcd_text[yyl] == '\n' )\
204  --vcd_lineno;\
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 vcd_text. */ \
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 vcd_text 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;
267  int yy_bs_column;
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 vcd_restart()), so that the user can continue scanning by
286  * just pointing vcd_in 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;
295 static size_t yy_buffer_stack_max = 0;
296 static YY_BUFFER_STATE * yy_buffer_stack = 0;
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 vcd_text 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 vcd_wrap()'s to do buffer switches
324  * instead of setting up a fresh vcd_in. A bit of a hack ...
325  */
326 static int yy_did_buffer_switch_on_eof;
327 
328 void vcd_restart (FILE *input_file );
329 void vcd__switch_to_buffer (YY_BUFFER_STATE new_buffer );
330 YY_BUFFER_STATE vcd__create_buffer (FILE *file,int size );
331 void vcd__delete_buffer (YY_BUFFER_STATE b );
332 void vcd__flush_buffer (YY_BUFFER_STATE b );
333 void vcd_push_buffer_state (YY_BUFFER_STATE new_buffer );
334 void vcd_pop_buffer_state (void );
335 
336 static void vcd_ensure_buffer_stack (void );
337 static void vcd__load_buffer_state (void );
338 static void vcd__init_buffer (YY_BUFFER_STATE b,FILE *file );
339 
340 #define YY_FLUSH_BUFFER vcd__flush_buffer(YY_CURRENT_BUFFER )
341 
342 YY_BUFFER_STATE vcd__scan_buffer (char *base,yy_size_t size );
343 YY_BUFFER_STATE vcd__scan_string (yyconst char *yy_str );
344 YY_BUFFER_STATE vcd__scan_bytes (yyconst char *bytes,int len );
345 
346 void *vcd_alloc (yy_size_t );
347 void *vcd_realloc (void *,yy_size_t );
348 void vcd_free (void * );
349 
350 #define yy_new_buffer vcd__create_buffer
351 
352 #define yy_set_interactive(is_interactive) \
353  { \
354  if ( ! YY_CURRENT_BUFFER ){ \
355  vcd_ensure_buffer_stack (); \
356  YY_CURRENT_BUFFER_LVALUE = \
357  vcd__create_buffer(vcd_in,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  vcd_ensure_buffer_stack (); \
366  YY_CURRENT_BUFFER_LVALUE = \
367  vcd__create_buffer(vcd_in,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 vcd_wrap(n) 1
377 #define YY_SKIP_YYWRAP
378 
379 typedef unsigned char YY_CHAR;
380 
381 FILE *vcd_in = (FILE *) 0, *vcd_out = (FILE *) 0;
382 
383 typedef int yy_state_type;
384 
385 extern int vcd_lineno;
386 
387 int vcd_lineno = 1;
388 
389 extern char *vcd_text;
390 #define yytext_ptr vcd_text
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 vcd_text.
399  */
400 #define YY_DO_BEFORE_ACTION \
401  (yytext_ptr) = yy_bp; \
402  vcd_leng = (size_t) (yy_cp - yy_bp); \
403  (yy_hold_char) = *yy_cp; \
404  *yy_cp = '\0'; \
405  (yy_c_buf_p) = yy_cp;
406 
407 #define YY_NUM_RULES 69
408 #define YY_END_OF_BUFFER 70
409 /* This struct is not used in this scanner,
410  but its presence is necessary. */
411 struct yy_trans_info
412  {
415  };
416 static yyconst flex_int16_t yy_accept[249] =
417  { 0,
418  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
419  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
420  0, 0, 0, 0, 0, 0, 0, 0, 70, 68,
421  67, 67, 67, 54, 68, 36, 35, 41, 40, 37,
422  38, 66, 66, 66, 66, 68, 7, 68, 68, 68,
423  68, 10, 68, 55, 55, 55, 55, 55, 56, 68,
424  68, 68, 68, 68, 68, 68, 57, 58, 62, 63,
425  64, 61, 59, 60, 39, 65, 43, 68, 42, 67,
426  0, 0, 0, 0, 0, 0, 0, 0, 8, 15,
427  11, 13, 14, 12, 55, 55, 55, 55, 55, 55,
428 
429  56, 0, 0, 0, 0, 0, 0, 0, 0, 0,
430  0, 57, 58, 64, 39, 65, 43, 42, 0, 0,
431  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
432  9, 55, 55, 55, 55, 55, 0, 0, 0, 0,
433  22, 0, 0, 26, 0, 0, 34, 42, 0, 42,
434  0, 0, 0, 1, 0, 0, 0, 17, 0, 1,
435  55, 52, 55, 55, 50, 0, 0, 0, 21, 0,
436  25, 30, 31, 0, 0, 0, 32, 33, 0, 3,
437  0, 0, 0, 0, 0, 0, 53, 55, 55, 18,
438  0, 0, 0, 0, 28, 0, 0, 0, 0, 0,
439 
440  0, 5, 0, 0, 0, 55, 49, 0, 0, 0,
441  27, 29, 0, 0, 0, 47, 0, 0, 0, 0,
442  0, 55, 19, 0, 23, 24, 2, 45, 46, 0,
443  0, 0, 16, 44, 51, 0, 48, 0, 0, 20,
444  0, 6, 0, 0, 0, 0, 4, 0
445  } ;
446 
447 static yyconst flex_int32_t yy_ec[256] =
448  { 0,
449  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
450  1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
451  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452  1, 2, 5, 5, 6, 7, 5, 5, 5, 8,
453  9, 5, 10, 5, 11, 12, 5, 13, 14, 15,
454  15, 15, 15, 15, 15, 15, 15, 16, 5, 5,
455  5, 5, 5, 5, 17, 18, 17, 17, 19, 17,
456  17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
457  17, 20, 17, 17, 17, 17, 17, 21, 17, 22,
458  23, 5, 24, 5, 17, 5, 25, 26, 27, 28,
459 
460  29, 30, 31, 17, 32, 17, 33, 34, 35, 36,
461  37, 38, 17, 39, 40, 41, 42, 43, 44, 21,
462  45, 22, 5, 5, 5, 5, 1, 1, 1, 1,
463  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
465  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
466  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
467  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
468  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 
471  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
473  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
475  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
476  1, 1, 1, 1, 1
477  } ;
478 
479 static yyconst flex_int32_t yy_meta[46] =
480  { 0,
481  1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
482  3, 3, 3, 3, 3, 2, 3, 3, 3, 3,
483  3, 3, 2, 2, 3, 3, 3, 3, 3, 3,
484  3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
485  3, 3, 3, 3, 3
486  } ;
487 
488 static yyconst flex_int16_t yy_base[258] =
489  { 0,
490  0, 38, 8, 21, 76, 0, 118, 0, 27, 46,
491  162, 0, 34, 64, 206, 230, 253, 0, 2, 10,
492  59, 82, 90, 97, 276, 297, 318, 332, 461, 462,
493  462, 462, 457, 462, 321, 462, 462, 462, 462, 462,
494  462, 462, 462, 456, 429, 428, 443, 415, 414, 413,
495  412, 462, 411, 0, 421, 33, 412, 423, 74, 404,
496  410, 420, 415, 401, 15, 44, 0, 0, 462, 462,
497  89, 462, 462, 462, 94, 0, 157, 154, 168, 462,
498  405, 147, 405, 413, 407, 400, 88, 401, 423, 462,
499  462, 462, 462, 462, 0, 404, 395, 397, 404, 391,
500 
501  171, 401, 388, 389, 2, 389, 391, 393, 388, 384,
502  383, 0, 0, 210, 213, 0, 237, 273, 234, 260,
503  386, 379, 384, 390, 380, 381, 375, 375, 374, 384,
504  462, 379, 377, 382, 366, 374, 370, 376, 379, 369,
505  462, 364, 372, 268, 372, 370, 462, 311, 250, 281,
506  363, 368, 358, 367, 356, 364, 365, 462, 351, 462,
507  354, 0, 348, 354, 0, 346, 355, 350, 462, 350,
508  462, 462, 462, 324, 320, 329, 462, 462, 328, 462,
509  266, 327, 326, 314, 316, 320, 0, 319, 315, 462,
510  312, 310, 293, 309, 462, 296, 287, 283, 160, 291,
511 
512  285, 462, 287, 275, 275, 271, 0, 267, 263, 160,
513  462, 462, 243, 249, 242, 462, 213, 173, 179, 170,
514  162, 159, 462, 164, 462, 462, 462, 462, 462, 152,
515  152, 81, 462, 462, 0, 71, 462, 73, 53, 462,
516  30, 462, 25, 18, 10, 3, 462, 462, 364, 367,
517  370, 373, 376, 16, 378, 2, 380
518  } ;
519 
520 static yyconst flex_int16_t yy_def[258] =
521  { 0,
522  249, 249, 250, 250, 249, 5, 248, 7, 250, 250,
523  249, 11, 251, 251, 252, 252, 249, 17, 2, 2,
524  249, 249, 253, 253, 249, 249, 249, 249, 248, 248,
525  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
526  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
527  248, 248, 248, 254, 254, 254, 254, 254, 248, 248,
528  248, 248, 248, 248, 248, 248, 255, 256, 248, 248,
529  248, 248, 248, 248, 248, 257, 248, 248, 248, 248,
530  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
531  248, 248, 248, 248, 254, 254, 254, 254, 254, 254,
532 
533  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
534  248, 255, 256, 248, 248, 257, 248, 248, 248, 248,
535  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
536  248, 254, 254, 254, 254, 254, 248, 248, 248, 248,
537  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
538  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
539  254, 254, 254, 254, 254, 248, 248, 248, 248, 248,
540  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
541  248, 248, 248, 248, 248, 248, 254, 254, 254, 248,
542  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
543 
544  248, 248, 248, 248, 248, 254, 254, 248, 248, 248,
545  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
546  248, 254, 248, 248, 248, 248, 248, 248, 248, 248,
547  248, 248, 248, 248, 254, 248, 248, 248, 248, 248,
548  248, 248, 248, 248, 248, 248, 248, 0, 248, 248,
549  248, 248, 248, 248, 248, 248, 248
550  } ;
551 
552 static yyconst flex_int16_t yy_nxt[508] =
553  { 0,
554  248, 31, 32, 33, 113, 34, 35, 30, 46, 43,
555  32, 44, 36, 37, 45, 30, 46, 38, 95, 39,
556  40, 41, 43, 32, 44, 38, 140, 45, 43, 32,
557  44, 248, 141, 45, 30, 31, 32, 33, 39, 31,
558  32, 33, 247, 34, 35, 246, 107, 43, 32, 44,
559  36, 37, 45, 108, 245, 38, 244, 39, 40, 41,
560  31, 32, 33, 38, 30, 31, 32, 33, 109, 97,
561  243, 75, 75, 75, 98, 110, 39, 31, 32, 33,
562  111, 242, 46, 31, 32, 33, 101, 101, 101, 47,
563  30, 31, 32, 33, 75, 75, 75, 30, 31, 32,
564 
565  33, 114, 114, 114, 241, 48, 115, 115, 115, 240,
566  49, 50, 128, 51, 239, 52, 129, 53, 30, 31,
567  32, 33, 30, 30, 46, 30, 30, 30, 30, 30,
568  30, 30, 30, 30, 54, 54, 54, 54, 54, 54,
569  30, 30, 54, 55, 54, 54, 54, 56, 54, 54,
570  54, 54, 57, 54, 54, 54, 54, 54, 58, 54,
571  54, 54, 54, 31, 32, 33, 118, 118, 118, 117,
572  117, 122, 225, 226, 59, 59, 59, 117, 117, 119,
573  118, 118, 118, 101, 101, 101, 120, 238, 123, 215,
574  60, 237, 236, 61, 235, 216, 120, 234, 233, 62,
575 
576  63, 64, 65, 232, 231, 66, 30, 31, 32, 33,
577  30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
578  30, 30, 114, 114, 114, 115, 115, 115, 30, 30,
579  30, 31, 32, 33, 30, 30, 30, 30, 30, 30,
580  30, 30, 30, 30, 30, 30, 148, 148, 148, 117,
581  117, 230, 30, 30, 31, 32, 33, 117, 117, 46,
582  69, 70, 150, 150, 150, 71, 71, 71, 72, 149,
583  149, 229, 150, 150, 150, 73, 74, 31, 32, 33,
584  172, 173, 228, 227, 119, 118, 118, 118, 77, 77,
585  198, 120, 174, 150, 150, 150, 77, 77, 31, 32,
586 
587  33, 120, 199, 224, 175, 223, 176, 222, 200, 77,
588  77, 221, 220, 219, 218, 217, 214, 77, 77, 31,
589  32, 33, 213, 148, 148, 148, 212, 78, 78, 120,
590  79, 79, 79, 31, 32, 33, 211, 210, 209, 120,
591  208, 78, 78, 207, 79, 79, 79, 81, 82, 83,
592  206, 205, 204, 203, 202, 201, 197, 196, 195, 194,
593  84, 85, 86, 87, 30, 30, 30, 42, 42, 42,
594  67, 67, 67, 68, 68, 68, 76, 76, 76, 112,
595  112, 116, 116, 193, 192, 191, 190, 189, 188, 187,
596  186, 185, 184, 183, 182, 181, 180, 179, 178, 177,
597 
598  171, 170, 169, 168, 167, 166, 165, 164, 163, 162,
599  161, 160, 159, 158, 157, 156, 155, 154, 153, 152,
600  151, 147, 146, 145, 144, 143, 142, 139, 138, 137,
601  136, 135, 134, 133, 132, 131, 130, 127, 126, 125,
602  124, 121, 106, 105, 104, 103, 102, 100, 99, 96,
603  94, 93, 92, 91, 90, 89, 88, 88, 80, 80,
604  248, 29, 248, 248, 248, 248, 248, 248, 248, 248,
605  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
606  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
607  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
608 
609  248, 248, 248, 248, 248, 248, 248
610  } ;
611 
612 static yyconst flex_int16_t yy_chk[508] =
613  { 0,
614  0, 1, 1, 1, 256, 1, 1, 19, 19, 3,
615  3, 3, 1, 1, 3, 20, 20, 1, 254, 1,
616  1, 1, 4, 4, 4, 1, 105, 4, 9, 9,
617  9, 0, 105, 9, 13, 13, 13, 13, 1, 2,
618  2, 2, 246, 2, 2, 245, 65, 10, 10, 10,
619  2, 2, 10, 65, 244, 2, 243, 2, 2, 2,
620  21, 21, 21, 2, 14, 14, 14, 14, 66, 56,
621  241, 21, 21, 21, 56, 66, 2, 5, 5, 5,
622  66, 239, 5, 22, 22, 22, 59, 59, 59, 5,
623  23, 23, 23, 23, 22, 22, 22, 24, 24, 24,
624 
625  24, 71, 71, 71, 238, 5, 75, 75, 75, 236,
626  5, 5, 87, 5, 232, 5, 87, 5, 7, 7,
627  7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
628  7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
629  7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
630  7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
631  7, 7, 7, 11, 11, 11, 78, 78, 78, 77,
632  77, 82, 210, 210, 11, 11, 11, 77, 77, 79,
633  79, 79, 79, 101, 101, 101, 79, 231, 82, 199,
634  11, 230, 224, 11, 222, 199, 79, 221, 220, 11,
635 
636  11, 11, 11, 219, 218, 11, 15, 15, 15, 15,
637  15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
638  15, 15, 114, 114, 114, 115, 115, 115, 15, 15,
639  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
640  16, 16, 16, 16, 16, 16, 119, 119, 119, 117,
641  117, 217, 16, 16, 17, 17, 17, 117, 117, 17,
642  17, 17, 149, 149, 149, 17, 17, 17, 17, 120,
643  120, 215, 120, 120, 120, 17, 17, 25, 25, 25,
644  144, 144, 214, 213, 118, 118, 118, 118, 25, 25,
645  181, 118, 144, 150, 150, 150, 25, 25, 26, 26,
646 
647  26, 118, 181, 209, 144, 208, 144, 206, 181, 26,
648  26, 205, 204, 203, 201, 200, 198, 26, 26, 27,
649  27, 27, 197, 148, 148, 148, 196, 27, 27, 148,
650  27, 27, 27, 28, 28, 28, 194, 193, 192, 148,
651  191, 28, 28, 189, 28, 28, 28, 35, 35, 35,
652  188, 186, 185, 184, 183, 182, 179, 176, 175, 174,
653  35, 35, 35, 35, 249, 249, 249, 250, 250, 250,
654  251, 251, 251, 252, 252, 252, 253, 253, 253, 255,
655  255, 257, 257, 170, 168, 167, 166, 164, 163, 161,
656  159, 157, 156, 155, 154, 153, 152, 151, 146, 145,
657 
658  143, 142, 140, 139, 138, 137, 136, 135, 134, 133,
659  132, 130, 129, 128, 127, 126, 125, 124, 123, 122,
660  121, 111, 110, 109, 108, 107, 106, 104, 103, 102,
661  100, 99, 98, 97, 96, 89, 88, 86, 85, 84,
662  83, 81, 64, 63, 62, 61, 60, 58, 57, 55,
663  53, 51, 50, 49, 48, 47, 46, 45, 44, 33,
664  29, 248, 248, 248, 248, 248, 248, 248, 248, 248,
665  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
666  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
667  248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
668 
669  248, 248, 248, 248, 248, 248, 248
670  } ;
671 
672 /* Table of booleans, true if rule could match eol. */
673 static yyconst flex_int32_t yy_rule_can_match_eol[70] =
674  { 0,
675 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
676  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
677  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
678  0, 0, 0, 0, 0, 0, 0, 1, 0, 0, };
679 
680 static yy_state_type yy_last_accepting_state;
681 static char *yy_last_accepting_cpos;
682 
683 extern int vcd__flex_debug;
684 int vcd__flex_debug = 0;
685 
686 /* The intent behind this definition is that it'll catch
687  * any uses of REJECT which flex missed.
688  */
689 #define REJECT reject_used_but_not_detected
690 #define yymore() yymore_used_but_not_detected
691 #define YY_MORE_ADJ 0
692 #define YY_RESTORE_YY_MORE_OFFSET
693 char *vcd_text;
694 #line 1 "scan_vcd.l"
695 /* -*-c-*- */
696 #line 4 "scan_vcd.l"
697 /*
698  * scan_vcd.l - scanner for a VCD data file
699  *
700  * Copyright (C) 2005 Raimund Jacob <raimi@lkcc.org>
701  * Copyright (C) 2006, 2007, 2008 Stefan Jahn <stefan@lkcc.org>
702  *
703  * This is free software; you can redistribute it and/or modify
704  * it under the terms of the GNU General Public License as published by
705  * the Free Software Foundation; either version 2, or (at your option)
706  * any later version.
707  *
708  * This software is distributed in the hope that it will be useful,
709  * but WITHOUT ANY WARRANTY; without even the implied warranty of
710  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
711  * GNU General Public License for more details.
712  *
713  * You should have received a copy of the GNU General Public License
714  * along with this package; see the file COPYING. If not, write to
715  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
716  * Boston, MA 02110-1301, USA.
717  *
718  * $Id: scan_vcd.l 1825 2011-03-11 20:42:14Z ela $
719  *
720  */
721 
722 #if HAVE_CONFIG_H
723 # include <config.h>
724 #endif
725 
726 #include <stdio.h>
727 #include <stdlib.h>
728 #include <string.h>
729 #include <ctype.h>
730 
731 #ifdef __MINGW32__
732 #include <io.h>
733 #endif
734 
735 #ifdef HAVE_UNISTD_H
736 #include <unistd.h>
737 #endif
738 
739 #include "check_vcd.h"
740 #include "tokens_vcd.h"
741 
742 #if !HAVE_STRCHR
743 # define strchr index
744 # define strrchr rindex
745 #endif
746 
747 
748 
749 #line 750 "scan_vcd.cpp"
750 
751 #define INITIAL 0
752 #define COMMENT 1
753 #define SCALE 2
754 #define SCOPE 3
755 #define IGNORE 4
756 #define VAR 5
757 #define VAR2 6
758 #define VAR3 7
759 #define VAR4 8
760 #define DUMP 9
761 #define TIMESTAMP 10
762 #define CHANGE 11
763 #define BIN 12
764 #define FLOAT 13
765 
766 #ifndef YY_EXTRA_TYPE
767 #define YY_EXTRA_TYPE void *
768 #endif
769 
770 static int yy_init_globals (void );
771 
772 /* Accessor methods to globals.
773  These are made visible to non-reentrant scanners for convenience. */
774 
775 int vcd_lex_destroy (void );
776 
777 int vcd_get_debug (void );
778 
779 void vcd_set_debug (int debug_flag );
780 
782 
783 void vcd_set_extra (YY_EXTRA_TYPE user_defined );
784 
785 FILE *vcd_get_in (void );
786 
787 void vcd_set_in (FILE * in_str );
788 
789 FILE *vcd_get_out (void );
790 
791 void vcd_set_out (FILE * out_str );
792 
793 int vcd_get_leng (void );
794 
795 char *vcd_get_text (void );
796 
797 int vcd_get_lineno (void );
798 
799 void vcd_set_lineno (int line_number );
800 
801 /* Macros after this point can all be overridden by user definitions in
802  * section 1.
803  */
804 
805 #ifndef YY_SKIP_YYWRAP
806 #ifdef __cplusplus
807 extern "C" int vcd_wrap (void );
808 #else
809 extern int vcd_wrap (void );
810 #endif
811 #endif
812 
813 #ifndef yytext_ptr
814 static void yy_flex_strncpy (char *,yyconst char *,int );
815 #endif
816 
817 #ifdef YY_NEED_STRLEN
818 static int yy_flex_strlen (yyconst char * );
819 #endif
820 
821 #ifndef YY_NO_INPUT
822 
823 #ifdef __cplusplus
824 static int yyinput (void );
825 #else
826 static int input (void );
827 #endif
828 
829 #endif
830 
831 /* Amount of stuff to slurp up with each read. */
832 #ifndef YY_READ_BUF_SIZE
833 #ifdef __ia64__
834 /* On IA-64, the buffer size is 16k, not 8k */
835 #define YY_READ_BUF_SIZE 16384
836 #else
837 #define YY_READ_BUF_SIZE 8192
838 #endif /* __ia64__ */
839 #endif
840 
841 /* Copy whatever the last rule matched to the standard output. */
842 #ifndef ECHO
843 /* This used to be an fputs(), but since the string might contain NUL's,
844  * we now use fwrite().
845  */
846 #define ECHO do { if (fwrite( vcd_text, vcd_leng, 1, vcd_out )) {} } while (0)
847 #endif
848 
849 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
850  * is returned in "result".
851  */
852 #ifndef YY_INPUT
853 #define YY_INPUT(buf,result,max_size) \
854  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
855  { \
856  int c = '*'; \
857  size_t n; \
858  for ( n = 0; n < max_size && \
859  (c = getc( vcd_in )) != EOF && c != '\n'; ++n ) \
860  buf[n] = (char) c; \
861  if ( c == '\n' ) \
862  buf[n++] = (char) c; \
863  if ( c == EOF && ferror( vcd_in ) ) \
864  YY_FATAL_ERROR( "input in flex scanner failed" ); \
865  result = n; \
866  } \
867  else \
868  { \
869  errno=0; \
870  while ( (result = fread(buf, 1, max_size, vcd_in))==0 && ferror(vcd_in)) \
871  { \
872  if( errno != EINTR) \
873  { \
874  YY_FATAL_ERROR( "input in flex scanner failed" ); \
875  break; \
876  } \
877  errno=0; \
878  clearerr(vcd_in); \
879  } \
880  }\
881 \
882 
883 #endif
884 
885 /* No semi-colon after return; correct usage is to write "yyterminate();" -
886  * we don't want an extra ';' after the "return" because that will cause
887  * some compilers to complain about unreachable statements.
888  */
889 #ifndef yyterminate
890 #define yyterminate() return YY_NULL
891 #endif
892 
893 /* Number of entries by which start-condition stack grows. */
894 #ifndef YY_START_STACK_INCR
895 #define YY_START_STACK_INCR 25
896 #endif
897 
898 /* Report a fatal error. */
899 #ifndef YY_FATAL_ERROR
900 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
901 #endif
902 
903 /* end tables serialization structures and prototypes */
904 
905 /* Default declaration of generated scanner - a define so the user can
906  * easily add parameters.
907  */
908 #ifndef YY_DECL
909 #define YY_DECL_IS_OURS 1
910 
911 extern int vcd_lex (void);
912 
913 #define YY_DECL int vcd_lex (void)
914 #endif /* !YY_DECL */
915 
916 /* Code executed at the beginning of each rule, after vcd_text and vcd_leng
917  * have been set up.
918  */
919 #ifndef YY_USER_ACTION
920 #define YY_USER_ACTION
921 #endif
922 
923 /* Code executed at the end of each rule. */
924 #ifndef YY_BREAK
925 #define YY_BREAK break;
926 #endif
927 
928 #define YY_RULE_SETUP \
929  YY_USER_ACTION
930 
933 YY_DECL
934 {
935  register yy_state_type yy_current_state;
936  register char *yy_cp, *yy_bp;
937  register int yy_act;
938 
939 #line 72 "scan_vcd.l"
940 
941 
942 #line 943 "scan_vcd.cpp"
943 
944  if ( !(yy_init) )
945  {
946  (yy_init) = 1;
947 
948 #ifdef YY_USER_INIT
949  YY_USER_INIT;
950 #endif
951 
952  if ( ! (yy_start) )
953  (yy_start) = 1; /* first start state */
954 
955  if ( ! vcd_in )
956  vcd_in = stdin;
957 
958  if ( ! vcd_out )
959  vcd_out = stdout;
960 
961  if ( ! YY_CURRENT_BUFFER ) {
962  vcd_ensure_buffer_stack ();
965  }
966 
967  vcd__load_buffer_state( );
968  }
969 
970  while ( 1 ) /* loops until end-of-file is reached */
971  {
972  yy_cp = (yy_c_buf_p);
973 
974  /* Support of vcd_text. */
975  *yy_cp = (yy_hold_char);
976 
977  /* yy_bp points to the position in yy_ch_buf of the start of
978  * the current run.
979  */
980  yy_bp = yy_cp;
981 
982  yy_current_state = (yy_start);
983 yy_match:
984  do
985  {
986  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
987  if ( yy_accept[yy_current_state] )
988  {
989  (yy_last_accepting_state) = yy_current_state;
990  (yy_last_accepting_cpos) = yy_cp;
991  }
992  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
993  {
994  yy_current_state = (int) yy_def[yy_current_state];
995  if ( yy_current_state >= 249 )
996  yy_c = yy_meta[(unsigned int) yy_c];
997  }
998  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
999  ++yy_cp;
1000  }
1001  while ( yy_base[yy_current_state] != 462 );
1002 
1003 yy_find_action:
1004  yy_act = yy_accept[yy_current_state];
1005  if ( yy_act == 0 )
1006  { /* have to back up */
1007  yy_cp = (yy_last_accepting_cpos);
1008  yy_current_state = (yy_last_accepting_state);
1009  yy_act = yy_accept[yy_current_state];
1010  }
1011 
1013 
1014  if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1015  {
1016  int yyl;
1017  for ( yyl = 0; yyl < vcd_leng; ++yyl )
1018  if ( vcd_text[yyl] == '\n' )
1019 
1020  vcd_lineno++;
1021 ;
1022  }
1023 
1024 do_action: /* This label is used only to access EOF actions. */
1025 
1026  switch ( yy_act )
1027  { /* beginning of action switch */
1028  case 0: /* must back up */
1029  /* undo the effects of YY_DO_BEFORE_ACTION */
1030  *yy_cp = (yy_hold_char);
1031  yy_cp = (yy_last_accepting_cpos);
1032  yy_current_state = (yy_last_accepting_state);
1033  goto yy_find_action;
1034 
1035 case 1:
1037 #line 74 "scan_vcd.l"
1038 {
1039  BEGIN(INITIAL);
1040  return t_END;
1041 }
1042  YY_BREAK
1043 case 2:
1045 #line 79 "scan_vcd.l"
1046 {
1047  BEGIN(COMMENT);
1048  return t_COMMENT;
1049 }
1050  YY_BREAK
1051 case 3:
1053 #line 84 "scan_vcd.l"
1054 {
1055  BEGIN(IGNORE);
1056  return t_DATE;
1057 }
1058  YY_BREAK
1059 case 4:
1061 #line 89 "scan_vcd.l"
1062 {
1063  return t_ENDDEFINITIONS;
1064 }
1065  YY_BREAK
1066 case 5:
1068 #line 93 "scan_vcd.l"
1069 {
1070  BEGIN(SCOPE);
1071  return t_SCOPE;
1072 }
1073  YY_BREAK
1074 case 6:
1076 #line 98 "scan_vcd.l"
1077 {
1078  BEGIN(SCALE);
1079  return t_TIMESCALE;
1080 }
1081  YY_BREAK
1082 case 7:
1084 #line 103 "scan_vcd.l"
1085 { return ONE; }
1086  YY_BREAK
1087 case 8:
1089 #line 104 "scan_vcd.l"
1090 { return TEN; }
1091  YY_BREAK
1092 case 9:
1094 #line 105 "scan_vcd.l"
1095 { return HUNDRET; }
1096  YY_BREAK
1097 case 10:
1099 #line 107 "scan_vcd.l"
1100 { return SECOND; }
1101  YY_BREAK
1102 case 11:
1104 #line 108 "scan_vcd.l"
1105 { return MILLI; }
1106  YY_BREAK
1107 case 12:
1109 #line 109 "scan_vcd.l"
1110 { return MICRO; }
1111  YY_BREAK
1112 case 13:
1114 #line 110 "scan_vcd.l"
1115 { return NANO; }
1116  YY_BREAK
1117 case 14:
1119 #line 111 "scan_vcd.l"
1120 { return PICO; }
1121  YY_BREAK
1122 case 15:
1124 #line 112 "scan_vcd.l"
1125 { return FEMTO; }
1126  YY_BREAK
1127 case 16:
1129 #line 114 "scan_vcd.l"
1130 {
1131  return t_UPSCOPE;
1132 }
1133  YY_BREAK
1134 case 17:
1136 #line 118 "scan_vcd.l"
1137 {
1138  BEGIN(VAR);
1139  return t_VAR;
1140 }
1141  YY_BREAK
1142 case 18:
1144 #line 123 "scan_vcd.l"
1145 { return EVENT; }
1146  YY_BREAK
1147 case 19:
1149 #line 124 "scan_vcd.l"
1150 { return INTEGER; }
1151  YY_BREAK
1152 case 20:
1154 #line 125 "scan_vcd.l"
1155 { return PARAMETER; }
1156  YY_BREAK
1157 case 21:
1159 #line 126 "scan_vcd.l"
1160 { return REAL; }
1161  YY_BREAK
1162 case 22:
1164 #line 127 "scan_vcd.l"
1165 { return REG; }
1166  YY_BREAK
1167 case 23:
1169 #line 128 "scan_vcd.l"
1170 { return SUPPLY0; }
1171  YY_BREAK
1172 case 24:
1174 #line 129 "scan_vcd.l"
1175 { return SUPPLY1; }
1176  YY_BREAK
1177 case 25:
1179 #line 130 "scan_vcd.l"
1180 { return TIME; }
1181  YY_BREAK
1182 case 26:
1184 #line 131 "scan_vcd.l"
1185 { return TRI; }
1186  YY_BREAK
1187 case 27:
1189 #line 132 "scan_vcd.l"
1190 { return TRIAND; }
1191  YY_BREAK
1192 case 28:
1194 #line 133 "scan_vcd.l"
1195 { return TRIOR; }
1196  YY_BREAK
1197 case 29:
1199 #line 134 "scan_vcd.l"
1200 { return TRIREG; }
1201  YY_BREAK
1202 case 30:
1204 #line 135 "scan_vcd.l"
1205 { return TRI0; }
1206  YY_BREAK
1207 case 31:
1209 #line 136 "scan_vcd.l"
1210 { return TRI1; }
1211  YY_BREAK
1212 case 32:
1214 #line 137 "scan_vcd.l"
1215 { return WAND; }
1216  YY_BREAK
1217 case 33:
1219 #line 138 "scan_vcd.l"
1220 { return WIRE; }
1221  YY_BREAK
1222 case 34:
1224 #line 139 "scan_vcd.l"
1225 { return WOR; }
1226  YY_BREAK
1227 case 35:
1229 #line 141 "scan_vcd.l"
1230 {
1231  vcd_lval.value = strdup (vcd_text);
1232  BEGIN(CHANGE);
1233  return ONE;
1234 }
1235  YY_BREAK
1236 case 36:
1238 #line 147 "scan_vcd.l"
1239 {
1240  vcd_lval.value = strdup (vcd_text);
1241  BEGIN(CHANGE);
1242  return ZERO;
1243 }
1244  YY_BREAK
1245 case 37:
1247 #line 153 "scan_vcd.l"
1248 {
1249  vcd_lval.value = strdup ("X");
1250  BEGIN(CHANGE);
1251  return X;
1252 }
1253  YY_BREAK
1254 case 38:
1256 #line 159 "scan_vcd.l"
1257 {
1258  vcd_lval.value = strdup ("Z");
1259  BEGIN(CHANGE);
1260  return Z;
1261 }
1262  YY_BREAK
1263 case 39:
1265 #line 165 "scan_vcd.l"
1266 {
1267  vcd_lval.real = strtod (vcd_text, NULL);
1268  BEGIN(INITIAL);
1269  return PositiveHugeInteger;
1270 }
1271  YY_BREAK
1272 case 40:
1274 #line 171 "scan_vcd.l"
1275 {
1276  BEGIN(FLOAT);
1277  return 'R';
1278 }
1279  YY_BREAK
1280 case 41:
1282 #line 176 "scan_vcd.l"
1283 {
1284  BEGIN(BIN);
1285  return 'B';
1286 }
1287  YY_BREAK
1288 case 42:
1290 #line 181 "scan_vcd.l"
1291 {
1292  vcd_lval.value = strdup (vcd_text);
1293  BEGIN(CHANGE);
1294  return Real;
1295 }
1296  YY_BREAK
1297 case 43:
1299 #line 187 "scan_vcd.l"
1300 {
1301  vcd_lval.value = strdup (vcd_text);
1302  char * p = vcd_lval.value;
1303  while (*p) { *p = toupper (*p); p++; }
1304  BEGIN(CHANGE);
1305  return Binary;
1306 }
1307  YY_BREAK
1308 case 44:
1310 #line 195 "scan_vcd.l"
1311 {
1312  BEGIN(IGNORE);
1313  return t_VERSION;
1314 }
1315  YY_BREAK
1316 case 45:
1318 #line 200 "scan_vcd.l"
1319 {
1320  return t_DUMPALL;
1321 }
1322  YY_BREAK
1323 case 46:
1325 #line 204 "scan_vcd.l"
1326 {
1327  return t_DUMPOFF;
1328 }
1329  YY_BREAK
1330 case 47:
1332 #line 208 "scan_vcd.l"
1333 {
1334  return t_DUMPON;
1335 }
1336  YY_BREAK
1337 case 48:
1339 #line 212 "scan_vcd.l"
1340 {
1341  BEGIN(DUMP);
1342  return t_DUMPVARS;
1343 }
1344  YY_BREAK
1345 case 49:
1347 #line 217 "scan_vcd.l"
1348 { return s_MODULE; }
1349  YY_BREAK
1350 case 50:
1352 #line 218 "scan_vcd.l"
1353 { return s_TASK; }
1354  YY_BREAK
1355 case 51:
1357 #line 219 "scan_vcd.l"
1358 { return s_FUNCTION; }
1359  YY_BREAK
1360 case 52:
1362 #line 220 "scan_vcd.l"
1363 { return s_FORK; }
1364  YY_BREAK
1365 case 53:
1367 #line 221 "scan_vcd.l"
1368 { return s_BEGIN; }
1369  YY_BREAK
1370 case 54:
1372 #line 223 "scan_vcd.l"
1373 {
1374  BEGIN(TIMESTAMP);
1375  return HASHMARK;
1376 }
1377  YY_BREAK
1378 case 55:
1380 #line 228 "scan_vcd.l"
1381 {
1382  vcd_lval.ident = strdup (vcd_text);
1383  return Identifier;
1384 }
1385  YY_BREAK
1386 case 56:
1388 #line 233 "scan_vcd.l"
1389 {
1390  vcd_lval.integer = atoi (vcd_text);
1391  BEGIN(VAR2);
1392  return PositiveInteger;
1393 }
1394  YY_BREAK
1395 case 57:
1397 #line 239 "scan_vcd.l"
1398 {
1399  vcd_lval.ident = strdup (vcd_text);
1400  BEGIN(VAR3);
1401  return IdentifierCode;
1402 }
1403  YY_BREAK
1404 case 58:
1406 #line 245 "scan_vcd.l"
1407 {
1408  vcd_lval.ident = strdup (vcd_text);
1409  BEGIN(VAR4);
1410  return Reference;
1411 }
1412  YY_BREAK
1413 case 59:
1415 #line 251 "scan_vcd.l"
1416 { /* pass the '[' to the parser */ return '['; }
1417  YY_BREAK
1418 case 60:
1420 #line 252 "scan_vcd.l"
1421 { /* pass the ']' to the parser */ return ']'; }
1422  YY_BREAK
1423 case 61:
1425 #line 253 "scan_vcd.l"
1426 { /* pass the ':' to the parser */ return ':'; }
1427  YY_BREAK
1428 case 62:
1430 #line 254 "scan_vcd.l"
1431 { /* pass the '(' to the parser */ return '('; }
1432  YY_BREAK
1433 case 63:
1435 #line 255 "scan_vcd.l"
1436 { /* pass the ')' to the parser */ return ')'; }
1437  YY_BREAK
1438 case 64:
1440 #line 257 "scan_vcd.l"
1441 {
1442  vcd_lval.integer = atoi (vcd_text);
1443  return PositiveInteger;
1444 }
1445  YY_BREAK
1446 case 65:
1448 #line 262 "scan_vcd.l"
1449 {
1450  vcd_lval.ident = strdup (vcd_text);
1451  BEGIN(INITIAL);
1452  return IdentifierCode;
1453 }
1454  YY_BREAK
1455 case 66:
1457 #line 268 "scan_vcd.l"
1458 { /* skip any character in here */ }
1459  YY_BREAK
1460 case 67:
1461 /* rule 67 can match eol */
1463 #line 269 "scan_vcd.l"
1464 { /* skip end of line and spaces */ }
1465  YY_BREAK
1466 case 68:
1468 #line 271 "scan_vcd.l"
1469 { /* any other character is invalid */
1470  fprintf (stderr,
1471  "line %d: syntax error, unrecognized character: `%s'\n",
1472  vcd_lineno, vcd_text);
1473  return InvalidCharacter;
1474 }
1475  YY_BREAK
1476 case 69:
1478 #line 278 "scan_vcd.l"
1479 ECHO;
1480  YY_BREAK
1481 #line 1482 "scan_vcd.cpp"
1482 case YY_STATE_EOF(INITIAL):
1483 case YY_STATE_EOF(COMMENT):
1484 case YY_STATE_EOF(SCALE):
1485 case YY_STATE_EOF(SCOPE):
1486 case YY_STATE_EOF(IGNORE):
1487 case YY_STATE_EOF(VAR):
1488 case YY_STATE_EOF(VAR2):
1489 case YY_STATE_EOF(VAR3):
1490 case YY_STATE_EOF(VAR4):
1491 case YY_STATE_EOF(DUMP):
1492 case YY_STATE_EOF(TIMESTAMP):
1493 case YY_STATE_EOF(CHANGE):
1494 case YY_STATE_EOF(BIN):
1495 case YY_STATE_EOF(FLOAT):
1496  yyterminate();
1497 
1498  case YY_END_OF_BUFFER:
1499  {
1500  /* Amount of text matched not including the EOB char. */
1501  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1502 
1503  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1504  *yy_cp = (yy_hold_char);
1506 
1507  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1508  {
1509  /* We're scanning a new file or input source. It's
1510  * possible that this happened because the user
1511  * just pointed vcd_in at a new source and called
1512  * vcd_lex(). If so, then we have to assure
1513  * consistency between YY_CURRENT_BUFFER and our
1514  * globals. Here is the right place to do so, because
1515  * this is the first action (other than possibly a
1516  * back-up) that will match for the new input source.
1517  */
1518  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1519  YY_CURRENT_BUFFER_LVALUE->yy_input_file = vcd_in;
1520  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1521  }
1522 
1523  /* Note that here we test for yy_c_buf_p "<=" to the position
1524  * of the first EOB in the buffer, since yy_c_buf_p will
1525  * already have been incremented past the NUL character
1526  * (since all states make transitions on EOB to the
1527  * end-of-buffer state). Contrast this with the test
1528  * in input().
1529  */
1530  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1531  { /* This was really a NUL. */
1532  yy_state_type yy_next_state;
1533 
1534  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1535 
1536  yy_current_state = yy_get_previous_state( );
1537 
1538  /* Okay, we're now positioned to make the NUL
1539  * transition. We couldn't have
1540  * yy_get_previous_state() go ahead and do it
1541  * for us because it doesn't know how to deal
1542  * with the possibility of jamming (and we don't
1543  * want to build jamming into it because then it
1544  * will run more slowly).
1545  */
1546 
1547  yy_next_state = yy_try_NUL_trans( yy_current_state );
1548 
1549  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1550 
1551  if ( yy_next_state )
1552  {
1553  /* Consume the NUL. */
1554  yy_cp = ++(yy_c_buf_p);
1555  yy_current_state = yy_next_state;
1556  goto yy_match;
1557  }
1558 
1559  else
1560  {
1561  yy_cp = (yy_c_buf_p);
1562  goto yy_find_action;
1563  }
1564  }
1565 
1566  else switch ( yy_get_next_buffer( ) )
1567  {
1568  case EOB_ACT_END_OF_FILE:
1569  {
1570  (yy_did_buffer_switch_on_eof) = 0;
1571 
1572  if ( vcd_wrap( ) )
1573  {
1574  /* Note: because we've taken care in
1575  * yy_get_next_buffer() to have set up
1576  * vcd_text, we can now set up
1577  * yy_c_buf_p so that if some total
1578  * hoser (like flex itself) wants to
1579  * call the scanner after we return the
1580  * YY_NULL, it'll still work - another
1581  * YY_NULL will get returned.
1582  */
1583  (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1584 
1585  yy_act = YY_STATE_EOF(YY_START);
1586  goto do_action;
1587  }
1588 
1589  else
1590  {
1591  if ( ! (yy_did_buffer_switch_on_eof) )
1592  YY_NEW_FILE;
1593  }
1594  break;
1595  }
1596 
1597  case EOB_ACT_CONTINUE_SCAN:
1598  (yy_c_buf_p) =
1599  (yytext_ptr) + yy_amount_of_matched_text;
1600 
1601  yy_current_state = yy_get_previous_state( );
1602 
1603  yy_cp = (yy_c_buf_p);
1604  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1605  goto yy_match;
1606 
1607  case EOB_ACT_LAST_MATCH:
1608  (yy_c_buf_p) =
1609  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1610 
1611  yy_current_state = yy_get_previous_state( );
1612 
1613  yy_cp = (yy_c_buf_p);
1614  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1615  goto yy_find_action;
1616  }
1617  break;
1618  }
1619 
1620  default:
1622  "fatal flex scanner internal error--no action found" );
1623  } /* end of action switch */
1624  } /* end of scanning one token */
1625 } /* end of vcd_lex */
1626 
1627 /* yy_get_next_buffer - try to read in a new buffer
1628  *
1629  * Returns a code representing an action:
1630  * EOB_ACT_LAST_MATCH -
1631  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1632  * EOB_ACT_END_OF_FILE - end of file
1633  */
1634 static int yy_get_next_buffer (void)
1635 {
1636  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1637  register char *source = (yytext_ptr);
1638  register int number_to_move, i;
1639  int ret_val;
1640 
1641  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1643  "fatal flex scanner internal error--end of buffer missed" );
1644 
1645  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1646  { /* Don't try to fill the buffer, so this is an EOF. */
1647  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1648  {
1649  /* We matched a single character, the EOB, so
1650  * treat this as a final EOF.
1651  */
1652  return EOB_ACT_END_OF_FILE;
1653  }
1654 
1655  else
1656  {
1657  /* We matched some text prior to the EOB, first
1658  * process it.
1659  */
1660  return EOB_ACT_LAST_MATCH;
1661  }
1662  }
1663 
1664  /* Try to read more data. */
1665 
1666  /* First move last chars to start of buffer. */
1667  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1668 
1669  for ( i = 0; i < number_to_move; ++i )
1670  *(dest++) = *(source++);
1671 
1672  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1673  /* don't do the read, it's not guaranteed to return an EOF,
1674  * just force an EOF
1675  */
1676  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1677 
1678  else
1679  {
1680  int num_to_read =
1681  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1682 
1683  while ( num_to_read <= 0 )
1684  { /* Not enough room in the buffer - grow it. */
1685 
1686  /* just a shorter name for the current buffer */
1687  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1688 
1689  int yy_c_buf_p_offset =
1690  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1691 
1692  if ( b->yy_is_our_buffer )
1693  {
1694  int new_size = b->yy_buf_size * 2;
1695 
1696  if ( new_size <= 0 )
1697  b->yy_buf_size += b->yy_buf_size / 8;
1698  else
1699  b->yy_buf_size *= 2;
1700 
1701  b->yy_ch_buf = (char *)
1702  /* Include room in for 2 EOB chars. */
1703  vcd_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1704  }
1705  else
1706  /* Can't grow it, we don't own it. */
1707  b->yy_ch_buf = 0;
1708 
1709  if ( ! b->yy_ch_buf )
1711  "fatal error - scanner input buffer overflow" );
1712 
1713  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1714 
1715  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1716  number_to_move - 1;
1717 
1718  }
1719 
1720  if ( num_to_read > YY_READ_BUF_SIZE )
1721  num_to_read = YY_READ_BUF_SIZE;
1722 
1723  /* Read in more data. */
1724  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1725  (yy_n_chars), (size_t) num_to_read );
1726 
1727  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1728  }
1729 
1730  if ( (yy_n_chars) == 0 )
1731  {
1732  if ( number_to_move == YY_MORE_ADJ )
1733  {
1734  ret_val = EOB_ACT_END_OF_FILE;
1735  vcd_restart(vcd_in );
1736  }
1737 
1738  else
1739  {
1740  ret_val = EOB_ACT_LAST_MATCH;
1741  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1743  }
1744  }
1745 
1746  else
1747  ret_val = EOB_ACT_CONTINUE_SCAN;
1748 
1749  if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1750  /* Extend the array by 50%, plus the number we really need. */
1751  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1752  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) vcd_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1753  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1754  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1755  }
1756 
1757  (yy_n_chars) += number_to_move;
1758  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1759  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1760 
1761  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1762 
1763  return ret_val;
1764 }
1765 
1766 /* yy_get_previous_state - get the state just before the EOB char was reached */
1767 
1768  static yy_state_type yy_get_previous_state (void)
1769 {
1770  register yy_state_type yy_current_state;
1771  register char *yy_cp;
1772 
1773  yy_current_state = (yy_start);
1774 
1775  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1776  {
1777  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1778  if ( yy_accept[yy_current_state] )
1779  {
1780  (yy_last_accepting_state) = yy_current_state;
1781  (yy_last_accepting_cpos) = yy_cp;
1782  }
1783  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1784  {
1785  yy_current_state = (int) yy_def[yy_current_state];
1786  if ( yy_current_state >= 249 )
1787  yy_c = yy_meta[(unsigned int) yy_c];
1788  }
1789  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1790  }
1791 
1792  return yy_current_state;
1793 }
1794 
1795 /* yy_try_NUL_trans - try to make a transition on the NUL character
1796  *
1797  * synopsis
1798  * next_state = yy_try_NUL_trans( current_state );
1799  */
1800  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1801 {
1802  register int yy_is_jam;
1803  register char *yy_cp = (yy_c_buf_p);
1804 
1805  register YY_CHAR yy_c = 1;
1806  if ( yy_accept[yy_current_state] )
1807  {
1808  (yy_last_accepting_state) = yy_current_state;
1809  (yy_last_accepting_cpos) = yy_cp;
1810  }
1811  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1812  {
1813  yy_current_state = (int) yy_def[yy_current_state];
1814  if ( yy_current_state >= 249 )
1815  yy_c = yy_meta[(unsigned int) yy_c];
1816  }
1817  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1818  yy_is_jam = (yy_current_state == 248);
1819 
1820  return yy_is_jam ? 0 : yy_current_state;
1821 }
1822 
1823 #ifndef YY_NO_INPUT
1824 #ifdef __cplusplus
1825  static int yyinput (void)
1826 #else
1827  static int input (void)
1828 #endif
1829 
1830 {
1831  int c;
1832 
1833  *(yy_c_buf_p) = (yy_hold_char);
1834 
1835  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1836  {
1837  /* yy_c_buf_p now points to the character we want to return.
1838  * If this occurs *before* the EOB characters, then it's a
1839  * valid NUL; if not, then we've hit the end of the buffer.
1840  */
1841  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1842  /* This was really a NUL. */
1843  *(yy_c_buf_p) = '\0';
1844 
1845  else
1846  { /* need more input */
1847  int offset = (yy_c_buf_p) - (yytext_ptr);
1848  ++(yy_c_buf_p);
1849 
1850  switch ( yy_get_next_buffer( ) )
1851  {
1852  case EOB_ACT_LAST_MATCH:
1853  /* This happens because yy_g_n_b()
1854  * sees that we've accumulated a
1855  * token and flags that we need to
1856  * try matching the token before
1857  * proceeding. But for input(),
1858  * there's no matching to consider.
1859  * So convert the EOB_ACT_LAST_MATCH
1860  * to EOB_ACT_END_OF_FILE.
1861  */
1862 
1863  /* Reset buffer status. */
1864  vcd_restart(vcd_in );
1865 
1866  /*FALLTHROUGH*/
1867 
1868  case EOB_ACT_END_OF_FILE:
1869  {
1870  if ( vcd_wrap( ) )
1871  return EOF;
1872 
1873  if ( ! (yy_did_buffer_switch_on_eof) )
1874  YY_NEW_FILE;
1875 #ifdef __cplusplus
1876  return yyinput();
1877 #else
1878  return input();
1879 #endif
1880  }
1881 
1882  case EOB_ACT_CONTINUE_SCAN:
1883  (yy_c_buf_p) = (yytext_ptr) + offset;
1884  break;
1885  }
1886  }
1887  }
1888 
1889  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1890  *(yy_c_buf_p) = '\0'; /* preserve vcd_text */
1891  (yy_hold_char) = *++(yy_c_buf_p);
1892 
1893  if ( c == '\n' )
1894 
1895  vcd_lineno++;
1896 ;
1897 
1898  return c;
1899 }
1900 #endif /* ifndef YY_NO_INPUT */
1901 
1907  void vcd_restart (FILE * input_file )
1908 {
1909 
1910  if ( ! YY_CURRENT_BUFFER ){
1911  vcd_ensure_buffer_stack ();
1914  }
1915 
1916  vcd__init_buffer(YY_CURRENT_BUFFER,input_file );
1917  vcd__load_buffer_state( );
1918 }
1919 
1924  void vcd__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1925 {
1926 
1927  /* TODO. We should be able to replace this entire function body
1928  * with
1929  * vcd_pop_buffer_state();
1930  * vcd_push_buffer_state(new_buffer);
1931  */
1932  vcd_ensure_buffer_stack ();
1933  if ( YY_CURRENT_BUFFER == new_buffer )
1934  return;
1935 
1936  if ( YY_CURRENT_BUFFER )
1937  {
1938  /* Flush out information for old buffer. */
1939  *(yy_c_buf_p) = (yy_hold_char);
1940  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1941  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1942  }
1943 
1944  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1945  vcd__load_buffer_state( );
1946 
1947  /* We don't actually know whether we did this switch during
1948  * EOF (vcd_wrap()) processing, but the only time this flag
1949  * is looked at is after vcd_wrap() is called, so it's safe
1950  * to go ahead and always set it.
1951  */
1952  (yy_did_buffer_switch_on_eof) = 1;
1953 }
1954 
1955 static void vcd__load_buffer_state (void)
1956 {
1957  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1958  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1959  vcd_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1960  (yy_hold_char) = *(yy_c_buf_p);
1961 }
1962 
1969  YY_BUFFER_STATE vcd__create_buffer (FILE * file, int size )
1970 {
1971  YY_BUFFER_STATE b;
1972 
1973  b = (YY_BUFFER_STATE) vcd_alloc(sizeof( struct yy_buffer_state ) );
1974  if ( ! b )
1975  YY_FATAL_ERROR( "out of dynamic memory in vcd__create_buffer()" );
1976 
1977  b->yy_buf_size = size;
1978 
1979  /* yy_ch_buf has to be 2 characters longer than the size given because
1980  * we need to put in 2 end-of-buffer characters.
1981  */
1982  b->yy_ch_buf = (char *) vcd_alloc(b->yy_buf_size + 2 );
1983  if ( ! b->yy_ch_buf )
1984  YY_FATAL_ERROR( "out of dynamic memory in vcd__create_buffer()" );
1985 
1986  b->yy_is_our_buffer = 1;
1987 
1988  vcd__init_buffer(b,file );
1989 
1990  return b;
1991 }
1992 
1997  void vcd__delete_buffer (YY_BUFFER_STATE b )
1998 {
1999 
2000  if ( ! b )
2001  return;
2002 
2003  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2005 
2006  if ( b->yy_is_our_buffer )
2007  vcd_free((void *) b->yy_ch_buf );
2008 
2009  vcd_free((void *) b );
2010 }
2011 
2012 #ifndef __cplusplus
2013 extern int isatty (int );
2014 #endif /* __cplusplus */
2015 
2016 /* Initializes or reinitializes a buffer.
2017  * This function is sometimes called more than once on the same buffer,
2018  * such as during a vcd_restart() or at EOF.
2019  */
2020  static void vcd__init_buffer (YY_BUFFER_STATE b, FILE * file )
2021 
2022 {
2023  int oerrno = errno;
2024 
2025  vcd__flush_buffer(b );
2026 
2027  b->yy_input_file = file;
2028  b->yy_fill_buffer = 1;
2029 
2030  /* If b is the current buffer, then vcd__init_buffer was _probably_
2031  * called from vcd_restart() or through yy_get_next_buffer.
2032  * In that case, we don't want to reset the lineno or column.
2033  */
2034  if (b != YY_CURRENT_BUFFER){
2035  b->yy_bs_lineno = 1;
2036  b->yy_bs_column = 0;
2037  }
2038 
2039  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2040 
2041  errno = oerrno;
2042 }
2043 
2048  void vcd__flush_buffer (YY_BUFFER_STATE b )
2049 {
2050  if ( ! b )
2051  return;
2052 
2053  b->yy_n_chars = 0;
2054 
2055  /* We always need two end-of-buffer characters. The first causes
2056  * a transition to the end-of-buffer state. The second causes
2057  * a jam in that state.
2058  */
2061 
2062  b->yy_buf_pos = &b->yy_ch_buf[0];
2063 
2064  b->yy_at_bol = 1;
2066 
2067  if ( b == YY_CURRENT_BUFFER )
2068  vcd__load_buffer_state( );
2069 }
2070 
2077 void vcd_push_buffer_state (YY_BUFFER_STATE new_buffer )
2078 {
2079  if (new_buffer == NULL)
2080  return;
2081 
2082  vcd_ensure_buffer_stack();
2083 
2084  /* This block is copied from vcd__switch_to_buffer. */
2085  if ( YY_CURRENT_BUFFER )
2086  {
2087  /* Flush out information for old buffer. */
2088  *(yy_c_buf_p) = (yy_hold_char);
2089  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2090  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2091  }
2092 
2093  /* Only push if top exists. Otherwise, replace top. */
2094  if (YY_CURRENT_BUFFER)
2095  (yy_buffer_stack_top)++;
2096  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2097 
2098  /* copied from vcd__switch_to_buffer. */
2099  vcd__load_buffer_state( );
2100  (yy_did_buffer_switch_on_eof) = 1;
2101 }
2102 
2108 {
2109  if (!YY_CURRENT_BUFFER)
2110  return;
2111 
2113  YY_CURRENT_BUFFER_LVALUE = NULL;
2114  if ((yy_buffer_stack_top) > 0)
2115  --(yy_buffer_stack_top);
2116 
2117  if (YY_CURRENT_BUFFER) {
2118  vcd__load_buffer_state( );
2119  (yy_did_buffer_switch_on_eof) = 1;
2120  }
2121 }
2122 
2123 /* Allocates the stack if it does not exist.
2124  * Guarantees space for at least one push.
2125  */
2126 static void vcd_ensure_buffer_stack (void)
2127 {
2128  int num_to_alloc;
2129 
2130  if (!(yy_buffer_stack)) {
2131 
2132  /* First allocation is just for 2 elements, since we don't know if this
2133  * scanner will even need a stack. We use 2 instead of 1 to avoid an
2134  * immediate realloc on the next call.
2135  */
2136  num_to_alloc = 1;
2137  (yy_buffer_stack) = (struct yy_buffer_state**)vcd_alloc
2138  (num_to_alloc * sizeof(struct yy_buffer_state*)
2139  );
2140  if ( ! (yy_buffer_stack) )
2141  YY_FATAL_ERROR( "out of dynamic memory in vcd_ensure_buffer_stack()" );
2142 
2143  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2144 
2145  (yy_buffer_stack_max) = num_to_alloc;
2146  (yy_buffer_stack_top) = 0;
2147  return;
2148  }
2149 
2150  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2151 
2152  /* Increase the buffer to prepare for a possible push. */
2153  int grow_size = 8 /* arbitrary grow size */;
2154 
2155  num_to_alloc = (yy_buffer_stack_max) + grow_size;
2156  (yy_buffer_stack) = (struct yy_buffer_state**)vcd_realloc
2157  ((yy_buffer_stack),
2158  num_to_alloc * sizeof(struct yy_buffer_state*)
2159  );
2160  if ( ! (yy_buffer_stack) )
2161  YY_FATAL_ERROR( "out of dynamic memory in vcd_ensure_buffer_stack()" );
2162 
2163  /* zero only the new slots.*/
2164  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2165  (yy_buffer_stack_max) = num_to_alloc;
2166  }
2167 }
2168 
2175 YY_BUFFER_STATE vcd__scan_buffer (char * base, yy_size_t size )
2176 {
2177  YY_BUFFER_STATE b;
2178 
2179  if ( size < 2 ||
2180  base[size-2] != YY_END_OF_BUFFER_CHAR ||
2181  base[size-1] != YY_END_OF_BUFFER_CHAR )
2182  /* They forgot to leave room for the EOB's. */
2183  return 0;
2184 
2185  b = (YY_BUFFER_STATE) vcd_alloc(sizeof( struct yy_buffer_state ) );
2186  if ( ! b )
2187  YY_FATAL_ERROR( "out of dynamic memory in vcd__scan_buffer()" );
2188 
2189  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2190  b->yy_buf_pos = b->yy_ch_buf = base;
2191  b->yy_is_our_buffer = 0;
2192  b->yy_input_file = 0;
2193  b->yy_n_chars = b->yy_buf_size;
2194  b->yy_is_interactive = 0;
2195  b->yy_at_bol = 1;
2196  b->yy_fill_buffer = 0;
2198 
2200 
2201  return b;
2202 }
2203 
2212 YY_BUFFER_STATE vcd__scan_string (yyconst char * yystr )
2213 {
2214 
2215  return vcd__scan_bytes(yystr,strlen(yystr) );
2216 }
2217 
2225 YY_BUFFER_STATE vcd__scan_bytes (yyconst char * yybytes, int _yybytes_len )
2226 {
2227  YY_BUFFER_STATE b;
2228  char *buf;
2229  yy_size_t n;
2230  int i;
2231 
2232  /* Get memory for full buffer, including space for trailing EOB's. */
2233  n = _yybytes_len + 2;
2234  buf = (char *) vcd_alloc(n );
2235  if ( ! buf )
2236  YY_FATAL_ERROR( "out of dynamic memory in vcd__scan_bytes()" );
2237 
2238  for ( i = 0; i < _yybytes_len; ++i )
2239  buf[i] = yybytes[i];
2240 
2241  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2242 
2243  b = vcd__scan_buffer(buf,n );
2244  if ( ! b )
2245  YY_FATAL_ERROR( "bad buffer in vcd__scan_bytes()" );
2246 
2247  /* It's okay to grow etc. this buffer, and we should throw it
2248  * away when we're done.
2249  */
2250  b->yy_is_our_buffer = 1;
2251 
2252  return b;
2253 }
2254 
2255 #ifndef YY_EXIT_FAILURE
2256 #define YY_EXIT_FAILURE 2
2257 #endif
2258 
2259 static void yy_fatal_error (yyconst char* msg )
2260 {
2261  (void) fprintf( stderr, "%s\n", msg );
2262  exit( YY_EXIT_FAILURE );
2263 }
2264 
2265 /* Redefine yyless() so it works in section 3 code. */
2266 
2267 #undef yyless
2268 #define yyless(n) \
2269  do \
2270  { \
2271  /* Undo effects of setting up vcd_text. */ \
2272  int yyless_macro_arg = (n); \
2273  YY_LESS_LINENO(yyless_macro_arg);\
2274  vcd_text[vcd_leng] = (yy_hold_char); \
2275  (yy_c_buf_p) = vcd_text + yyless_macro_arg; \
2276  (yy_hold_char) = *(yy_c_buf_p); \
2277  *(yy_c_buf_p) = '\0'; \
2278  vcd_leng = yyless_macro_arg; \
2279  } \
2280  while ( 0 )
2281 
2282 /* Accessor methods (get/set functions) to struct members. */
2283 
2287 int vcd_get_lineno (void)
2288 {
2289 
2290  return vcd_lineno;
2291 }
2292 
2296 FILE *vcd_get_in (void)
2297 {
2298  return vcd_in;
2299 }
2300 
2304 FILE *vcd_get_out (void)
2305 {
2306  return vcd_out;
2307 }
2308 
2312 int vcd_get_leng (void)
2313 {
2314  return vcd_leng;
2315 }
2316 
2321 char *vcd_get_text (void)
2322 {
2323  return vcd_text;
2324 }
2325 
2330 void vcd_set_lineno (int line_number )
2331 {
2332 
2333  vcd_lineno = line_number;
2334 }
2335 
2342 void vcd_set_in (FILE * in_str )
2343 {
2344  vcd_in = in_str ;
2345 }
2346 
2347 void vcd_set_out (FILE * out_str )
2348 {
2349  vcd_out = out_str ;
2350 }
2351 
2352 int vcd_get_debug (void)
2353 {
2354  return vcd__flex_debug;
2355 }
2356 
2357 void vcd_set_debug (int bdebug )
2358 {
2359  vcd__flex_debug = bdebug ;
2360 }
2361 
2362 static int yy_init_globals (void)
2363 {
2364  /* Initialization is the same as for the non-reentrant scanner.
2365  * This function is called from vcd_lex_destroy(), so don't allocate here.
2366  */
2367 
2368  /* We do not touch vcd_lineno unless the option is enabled. */
2369  vcd_lineno = 1;
2370 
2371  (yy_buffer_stack) = 0;
2372  (yy_buffer_stack_top) = 0;
2373  (yy_buffer_stack_max) = 0;
2374  (yy_c_buf_p) = (char *) 0;
2375  (yy_init) = 0;
2376  (yy_start) = 0;
2377 
2378 /* Defined in main.c */
2379 #ifdef YY_STDINIT
2380  vcd_in = stdin;
2381  vcd_out = stdout;
2382 #else
2383  vcd_in = (FILE *) 0;
2384  vcd_out = (FILE *) 0;
2385 #endif
2386 
2387  /* For future reference: Set errno on error, since we are called by
2388  * vcd_lex_init()
2389  */
2390  return 0;
2391 }
2392 
2393 /* vcd_lex_destroy is for both reentrant and non-reentrant scanners. */
2395 {
2396 
2397  /* Pop the buffer stack, destroying each element. */
2398  while(YY_CURRENT_BUFFER){
2400  YY_CURRENT_BUFFER_LVALUE = NULL;
2402  }
2403 
2404  /* Destroy the stack itself. */
2405  vcd_free((yy_buffer_stack) );
2406  (yy_buffer_stack) = NULL;
2407 
2408  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2409  * vcd_lex() is called, initialization will occur. */
2410  yy_init_globals( );
2411 
2412  return 0;
2413 }
2414 
2415 /*
2416  * Internal utility routines.
2417  */
2418 
2419 #ifndef yytext_ptr
2420 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2421 {
2422  register int i;
2423  for ( i = 0; i < n; ++i )
2424  s1[i] = s2[i];
2425 }
2426 #endif
2427 
2428 #ifdef YY_NEED_STRLEN
2429 static int yy_flex_strlen (yyconst char * s )
2430 {
2431  register int n;
2432  for ( n = 0; s[n]; ++n )
2433  ;
2434 
2435  return n;
2436 }
2437 #endif
2438 
2439 void *vcd_alloc (yy_size_t size )
2440 {
2441  return (void *) malloc( size );
2442 }
2443 
2444 void *vcd_realloc (void * ptr, yy_size_t size )
2445 {
2446  /* The cast to (char *) in the following accommodates both
2447  * implementations that use char* generic pointers, and those
2448  * that use void* generic pointers. It works with the latter
2449  * because both ANSI C and C++ allow castless assignment from
2450  * any pointer type to void*, and deal with argument conversions
2451  * as though doing an assignment.
2452  */
2453  return (void *) realloc( (char *) ptr, size );
2454 }
2455 
2456 void vcd_free (void * ptr )
2457 {
2458  free( (char *) ptr ); /* see vcd_realloc() for (char *) cast */
2459 }
2460 
2461 #define YYTABLES_NAME "yytables"
2462 
2463 #line 278 "scan_vcd.l"
2464 
2465 
2466