My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
scan_zvr.cpp
Go to the documentation of this file.
1 #line 2 "scan_zvr.cpp"
2 
3 #line 4 "scan_zvr.cpp"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define yy_create_buffer zvr__create_buffer
10 #define yy_delete_buffer zvr__delete_buffer
11 #define yy_flex_debug zvr__flex_debug
12 #define yy_init_buffer zvr__init_buffer
13 #define yy_flush_buffer zvr__flush_buffer
14 #define yy_load_buffer_state zvr__load_buffer_state
15 #define yy_switch_to_buffer zvr__switch_to_buffer
16 #define yyin zvr_in
17 #define yyleng zvr_leng
18 #define yylex zvr_lex
19 #define yylineno zvr_lineno
20 #define yyout zvr_out
21 #define yyrestart zvr_restart
22 #define yytext zvr_text
23 #define yywrap zvr_wrap
24 #define yyalloc zvr_alloc
25 #define yyrealloc zvr_realloc
26 #define yyfree zvr_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 zvr_restart(zvr_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 zvr_leng;
185 
186 extern FILE *zvr_in, *zvr_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 zvr_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-zvr_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 < zvr_leng; ++yyl )\
203  if ( zvr_text[yyl] == '\n' )\
204  --zvr_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 zvr_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 zvr_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 zvr_restart()), so that the user can continue scanning by
286  * just pointing zvr_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 zvr_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 zvr_wrap()'s to do buffer switches
324  * instead of setting up a fresh zvr_in. A bit of a hack ...
325  */
326 static int yy_did_buffer_switch_on_eof;
327 
328 void zvr_restart (FILE *input_file );
329 void zvr__switch_to_buffer (YY_BUFFER_STATE new_buffer );
330 YY_BUFFER_STATE zvr__create_buffer (FILE *file,int size );
331 void zvr__delete_buffer (YY_BUFFER_STATE b );
332 void zvr__flush_buffer (YY_BUFFER_STATE b );
333 void zvr_push_buffer_state (YY_BUFFER_STATE new_buffer );
334 void zvr_pop_buffer_state (void );
335 
336 static void zvr_ensure_buffer_stack (void );
337 static void zvr__load_buffer_state (void );
338 static void zvr__init_buffer (YY_BUFFER_STATE b,FILE *file );
339 
340 #define YY_FLUSH_BUFFER zvr__flush_buffer(YY_CURRENT_BUFFER )
341 
342 YY_BUFFER_STATE zvr__scan_buffer (char *base,yy_size_t size );
343 YY_BUFFER_STATE zvr__scan_string (yyconst char *yy_str );
344 YY_BUFFER_STATE zvr__scan_bytes (yyconst char *bytes,int len );
345 
346 void *zvr_alloc (yy_size_t );
347 void *zvr_realloc (void *,yy_size_t );
348 void zvr_free (void * );
349 
350 #define yy_new_buffer zvr__create_buffer
351 
352 #define yy_set_interactive(is_interactive) \
353  { \
354  if ( ! YY_CURRENT_BUFFER ){ \
355  zvr_ensure_buffer_stack (); \
356  YY_CURRENT_BUFFER_LVALUE = \
357  zvr__create_buffer(zvr_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  zvr_ensure_buffer_stack (); \
366  YY_CURRENT_BUFFER_LVALUE = \
367  zvr__create_buffer(zvr_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 zvr_wrap(n) 1
377 #define YY_SKIP_YYWRAP
378 
379 typedef unsigned char YY_CHAR;
380 
381 FILE *zvr_in = (FILE *) 0, *zvr_out = (FILE *) 0;
382 
383 typedef int yy_state_type;
384 
385 extern int zvr_lineno;
386 
387 int zvr_lineno = 1;
388 
389 extern char *zvr_text;
390 #define yytext_ptr zvr_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 zvr_text.
399  */
400 #define YY_DO_BEFORE_ACTION \
401  (yytext_ptr) = yy_bp; \
402  zvr_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 12
408 #define YY_END_OF_BUFFER 13
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[71] =
417  { 0,
418  0, 0, 0, 0, 13, 11, 10, 10, 10, 11,
419  3, 9, 6, 6, 6, 6, 6, 6, 6, 6,
420  7, 7, 7, 7, 7, 7, 7, 11, 10, 3,
421  0, 0, 7, 6, 7, 5, 4, 5, 7, 7,
422  7, 7, 7, 7, 0, 0, 3, 0, 3, 6,
423  7, 7, 7, 7, 7, 7, 2, 7, 7, 7,
424  1, 8, 7, 7, 8, 7, 7, 7, 7, 0
425  } ;
426 
427 static yyconst flex_int32_t yy_ec[256] =
428  { 0,
429  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
430  1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
431  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432  1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
433  1, 1, 5, 6, 7, 8, 1, 9, 9, 9,
434  9, 9, 9, 9, 9, 9, 9, 1, 10, 1,
435  1, 1, 1, 1, 11, 12, 13, 14, 15, 16,
436  17, 18, 19, 16, 16, 20, 21, 22, 23, 24,
437  16, 25, 26, 27, 28, 29, 16, 30, 16, 31,
438  1, 1, 1, 1, 1, 1, 32, 33, 34, 35,
439 
440  36, 34, 37, 34, 38, 34, 34, 34, 39, 40,
441  41, 34, 34, 42, 34, 34, 34, 34, 34, 34,
442  34, 43, 1, 1, 1, 1, 1, 1, 1, 1,
443  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
444  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
446  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 
451  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
455  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
456  1, 1, 1, 1, 1
457  } ;
458 
459 static yyconst flex_int32_t yy_meta[44] =
460  { 0,
461  1, 1, 1, 1, 1, 1, 2, 1, 3, 1,
462  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465  2, 2, 2
466  } ;
467 
468 static yyconst flex_int16_t yy_base[74] =
469  { 0,
470  0, 0, 42, 45, 173, 174, 174, 174, 169, 162,
471  44, 174, 161, 41, 46, 47, 51, 48, 52, 54,
472  56, 160, 58, 59, 60, 63, 64, 66, 174, 69,
473  159, 80, 158, 157, 67, 156, 155, 77, 70, 84,
474  73, 104, 86, 88, 154, 93, 97, 147, 146, 174,
475  90, 94, 98, 109, 144, 99, 143, 110, 108, 111,
476  174, 113, 116, 123, 174, 104, 120, 140, 142, 174,
477  157, 159, 119
478  } ;
479 
480 static yyconst flex_int16_t yy_def[74] =
481  { 0,
482  70, 1, 71, 71, 70, 70, 70, 70, 70, 70,
483  70, 70, 72, 72, 72, 72, 72, 72, 72, 72,
484  72, 72, 72, 72, 72, 72, 72, 70, 70, 70,
485  70, 70, 72, 70, 72, 72, 72, 72, 72, 72,
486  72, 73, 72, 72, 70, 70, 70, 70, 70, 70,
487  72, 72, 72, 72, 72, 72, 70, 72, 72, 72,
488  70, 70, 72, 72, 70, 72, 72, 72, 72, 0,
489  70, 70, 70
490  } ;
491 
492 static yyconst flex_int16_t yy_nxt[218] =
493  { 0,
494  6, 7, 8, 9, 10, 6, 10, 6, 11, 12,
495  13, 13, 14, 15, 13, 13, 13, 16, 13, 13,
496  17, 13, 13, 18, 19, 13, 13, 13, 13, 13,
497  20, 21, 22, 22, 23, 22, 22, 24, 25, 26,
498  22, 27, 22, 7, 8, 9, 7, 8, 9, 34,
499  28, 31, 30, 28, 34, 34, 34, 36, 32, 34,
500  34, 38, 34, 35, 70, 39, 70, 70, 70, 37,
501  36, 70, 70, 45, 46, 70, 31, 30, 70, 32,
502  53, 70, 40, 32, 48, 70, 48, 51, 49, 37,
503  42, 43, 70, 52, 70, 41, 70, 42, 70, 42,
504 
505  45, 46, 70, 44, 32, 47, 70, 70, 54, 42,
506  33, 32, 70, 58, 61, 59, 70, 70, 70, 70,
507  55, 65, 42, 60, 70, 36, 64, 56, 70, 63,
508  66, 70, 32, 36, 37, 33, 33, 33, 33, 33,
509  33, 33, 33, 33, 33, 33, 33, 68, 70, 67,
510  70, 57, 62, 69, 49, 49, 36, 6, 6, 6,
511  33, 33, 57, 70, 70, 50, 70, 47, 70, 34,
512  30, 29, 70, 5, 70, 70, 70, 70, 70, 70,
513  70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
514  70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
515 
516  70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
517  70, 70, 70, 70, 70, 70, 70
518  } ;
519 
520 static yyconst flex_int16_t yy_chk[218] =
521  { 0,
522  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
523  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
524  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
525  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
526  1, 1, 1, 3, 3, 3, 4, 4, 4, 14,
527  3, 11, 11, 4, 15, 16, 18, 15, 11, 17,
528  19, 17, 20, 14, 21, 18, 23, 24, 25, 23,
529  19, 26, 27, 28, 28, 35, 30, 30, 39, 11,
530  39, 41, 20, 30, 32, 38, 32, 35, 32, 16,
531  23, 25, 40, 38, 43, 21, 44, 24, 51, 27,
532 
533  46, 46, 52, 26, 30, 47, 53, 56, 40, 41,
534  42, 47, 66, 51, 54, 52, 59, 54, 58, 60,
535  73, 62, 43, 53, 63, 60, 59, 44, 67, 58,
536  63, 64, 47, 66, 56, 42, 42, 42, 42, 42,
537  42, 42, 42, 42, 42, 42, 42, 67, 68, 64,
538  69, 57, 55, 68, 49, 48, 69, 71, 71, 71,
539  72, 72, 45, 37, 36, 34, 33, 31, 22, 13,
540  10, 9, 5, 70, 70, 70, 70, 70, 70, 70,
541  70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
542  70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
543 
544  70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
545  70, 70, 70, 70, 70, 70, 70
546  } ;
547 
548 /* Table of booleans, true if rule could match eol. */
549 static yyconst flex_int32_t yy_rule_can_match_eol[13] =
550  { 0,
551 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, };
552 
553 static yy_state_type yy_last_accepting_state;
554 static char *yy_last_accepting_cpos;
555 
556 extern int zvr__flex_debug;
557 int zvr__flex_debug = 0;
558 
559 /* The intent behind this definition is that it'll catch
560  * any uses of REJECT which flex missed.
561  */
562 #define REJECT reject_used_but_not_detected
563 #define yymore() yymore_used_but_not_detected
564 #define YY_MORE_ADJ 0
565 #define YY_RESTORE_YY_MORE_OFFSET
566 char *zvr_text;
567 #line 1 "scan_zvr.l"
568 /* -*-c-*- */
569 #line 4 "scan_zvr.l"
570 /*
571  * scan_zvr.l - scanner for a ZVR data file
572  *
573  * Copyright (C) 2006, 2007 Stefan Jahn <stefan@lkcc.org>
574  *
575  * This is free software; you can redistribute it and/or modify
576  * it under the terms of the GNU General Public License as published by
577  * the Free Software Foundation; either version 2, or (at your option)
578  * any later version.
579  *
580  * This software is distributed in the hope that it will be useful,
581  * but WITHOUT ANY WARRANTY; without even the implied warranty of
582  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
583  * GNU General Public License for more details.
584  *
585  * You should have received a copy of the GNU General Public License
586  * along with this package; see the file COPYING. If not, write to
587  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
588  * Boston, MA 02110-1301, USA.
589  *
590  * $Id: scan_zvr.l 1825 2011-03-11 20:42:14Z ela $
591  *
592  */
593 
594 #if HAVE_CONFIG_H
595 # include <config.h>
596 #endif
597 
598 #include <stdio.h>
599 #include <stdlib.h>
600 #include <string.h>
601 #include <ctype.h>
602 
603 #ifdef __MINGW32__
604 #include <io.h>
605 #endif
606 
607 #ifdef HAVE_UNISTD_H
608 #include <unistd.h>
609 #endif
610 
611 #include "check_zvr.h"
612 #include "tokens_zvr.h"
613 
614 #if !HAVE_STRCHR
615 # define strchr index
616 # define strrchr rindex
617 #endif
618 
619 
620 #line 621 "scan_zvr.cpp"
621 
622 #define INITIAL 0
623 #define VERSION 1
624 
625 #ifndef YY_EXTRA_TYPE
626 #define YY_EXTRA_TYPE void *
627 #endif
628 
629 static int yy_init_globals (void );
630 
631 /* Accessor methods to globals.
632  These are made visible to non-reentrant scanners for convenience. */
633 
634 int zvr_lex_destroy (void );
635 
636 int zvr_get_debug (void );
637 
638 void zvr_set_debug (int debug_flag );
639 
641 
642 void zvr_set_extra (YY_EXTRA_TYPE user_defined );
643 
644 FILE *zvr_get_in (void );
645 
646 void zvr_set_in (FILE * in_str );
647 
648 FILE *zvr_get_out (void );
649 
650 void zvr_set_out (FILE * out_str );
651 
652 int zvr_get_leng (void );
653 
654 char *zvr_get_text (void );
655 
656 int zvr_get_lineno (void );
657 
658 void zvr_set_lineno (int line_number );
659 
660 /* Macros after this point can all be overridden by user definitions in
661  * section 1.
662  */
663 
664 #ifndef YY_SKIP_YYWRAP
665 #ifdef __cplusplus
666 extern "C" int zvr_wrap (void );
667 #else
668 extern int zvr_wrap (void );
669 #endif
670 #endif
671 
672 #ifndef yytext_ptr
673 static void yy_flex_strncpy (char *,yyconst char *,int );
674 #endif
675 
676 #ifdef YY_NEED_STRLEN
677 static int yy_flex_strlen (yyconst char * );
678 #endif
679 
680 #ifndef YY_NO_INPUT
681 
682 #ifdef __cplusplus
683 static int yyinput (void );
684 #else
685 static int input (void );
686 #endif
687 
688 #endif
689 
690 /* Amount of stuff to slurp up with each read. */
691 #ifndef YY_READ_BUF_SIZE
692 #ifdef __ia64__
693 /* On IA-64, the buffer size is 16k, not 8k */
694 #define YY_READ_BUF_SIZE 16384
695 #else
696 #define YY_READ_BUF_SIZE 8192
697 #endif /* __ia64__ */
698 #endif
699 
700 /* Copy whatever the last rule matched to the standard output. */
701 #ifndef ECHO
702 /* This used to be an fputs(), but since the string might contain NUL's,
703  * we now use fwrite().
704  */
705 #define ECHO do { if (fwrite( zvr_text, zvr_leng, 1, zvr_out )) {} } while (0)
706 #endif
707 
708 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
709  * is returned in "result".
710  */
711 #ifndef YY_INPUT
712 #define YY_INPUT(buf,result,max_size) \
713  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
714  { \
715  int c = '*'; \
716  size_t n; \
717  for ( n = 0; n < max_size && \
718  (c = getc( zvr_in )) != EOF && c != '\n'; ++n ) \
719  buf[n] = (char) c; \
720  if ( c == '\n' ) \
721  buf[n++] = (char) c; \
722  if ( c == EOF && ferror( zvr_in ) ) \
723  YY_FATAL_ERROR( "input in flex scanner failed" ); \
724  result = n; \
725  } \
726  else \
727  { \
728  errno=0; \
729  while ( (result = fread(buf, 1, max_size, zvr_in))==0 && ferror(zvr_in)) \
730  { \
731  if( errno != EINTR) \
732  { \
733  YY_FATAL_ERROR( "input in flex scanner failed" ); \
734  break; \
735  } \
736  errno=0; \
737  clearerr(zvr_in); \
738  } \
739  }\
740 \
741 
742 #endif
743 
744 /* No semi-colon after return; correct usage is to write "yyterminate();" -
745  * we don't want an extra ';' after the "return" because that will cause
746  * some compilers to complain about unreachable statements.
747  */
748 #ifndef yyterminate
749 #define yyterminate() return YY_NULL
750 #endif
751 
752 /* Number of entries by which start-condition stack grows. */
753 #ifndef YY_START_STACK_INCR
754 #define YY_START_STACK_INCR 25
755 #endif
756 
757 /* Report a fatal error. */
758 #ifndef YY_FATAL_ERROR
759 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
760 #endif
761 
762 /* end tables serialization structures and prototypes */
763 
764 /* Default declaration of generated scanner - a define so the user can
765  * easily add parameters.
766  */
767 #ifndef YY_DECL
768 #define YY_DECL_IS_OURS 1
769 
770 extern int zvr_lex (void);
771 
772 #define YY_DECL int zvr_lex (void)
773 #endif /* !YY_DECL */
774 
775 /* Code executed at the beginning of each rule, after zvr_text and zvr_leng
776  * have been set up.
777  */
778 #ifndef YY_USER_ACTION
779 #define YY_USER_ACTION
780 #endif
781 
782 /* Code executed at the end of each rule. */
783 #ifndef YY_BREAK
784 #define YY_BREAK break;
785 #endif
786 
787 #define YY_RULE_SETUP \
788  YY_USER_ACTION
789 
792 YY_DECL
793 {
794  register yy_state_type yy_current_state;
795  register char *yy_cp, *yy_bp;
796  register int yy_act;
797 
798 #line 69 "scan_zvr.l"
799 
800 
801 #line 802 "scan_zvr.cpp"
802 
803  if ( !(yy_init) )
804  {
805  (yy_init) = 1;
806 
807 #ifdef YY_USER_INIT
808  YY_USER_INIT;
809 #endif
810 
811  if ( ! (yy_start) )
812  (yy_start) = 1; /* first start state */
813 
814  if ( ! zvr_in )
815  zvr_in = stdin;
816 
817  if ( ! zvr_out )
818  zvr_out = stdout;
819 
820  if ( ! YY_CURRENT_BUFFER ) {
821  zvr_ensure_buffer_stack ();
824  }
825 
826  zvr__load_buffer_state( );
827  }
828 
829  while ( 1 ) /* loops until end-of-file is reached */
830  {
831  yy_cp = (yy_c_buf_p);
832 
833  /* Support of zvr_text. */
834  *yy_cp = (yy_hold_char);
835 
836  /* yy_bp points to the position in yy_ch_buf of the start of
837  * the current run.
838  */
839  yy_bp = yy_cp;
840 
841  yy_current_state = (yy_start);
842 yy_match:
843  do
844  {
845  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
846  if ( yy_accept[yy_current_state] )
847  {
848  (yy_last_accepting_state) = yy_current_state;
849  (yy_last_accepting_cpos) = yy_cp;
850  }
851  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
852  {
853  yy_current_state = (int) yy_def[yy_current_state];
854  if ( yy_current_state >= 71 )
855  yy_c = yy_meta[(unsigned int) yy_c];
856  }
857  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
858  ++yy_cp;
859  }
860  while ( yy_base[yy_current_state] != 174 );
861 
862 yy_find_action:
863  yy_act = yy_accept[yy_current_state];
864  if ( yy_act == 0 )
865  { /* have to back up */
866  yy_cp = (yy_last_accepting_cpos);
867  yy_current_state = (yy_last_accepting_state);
868  yy_act = yy_accept[yy_current_state];
869  }
870 
872 
873  if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
874  {
875  int yyl;
876  for ( yyl = 0; yyl < zvr_leng; ++yyl )
877  if ( zvr_text[yyl] == '\n' )
878 
879  zvr_lineno++;
880 ;
881  }
882 
883 do_action: /* This label is used only to access EOF actions. */
884 
885  switch ( yy_act )
886  { /* beginning of action switch */
887  case 0: /* must back up */
888  /* undo the effects of YY_DO_BEFORE_ACTION */
889  *yy_cp = (yy_hold_char);
890  yy_cp = (yy_last_accepting_cpos);
891  yy_current_state = (yy_last_accepting_state);
892  goto yy_find_action;
893 
894 case 1:
896 #line 71 "scan_zvr.l"
897 {
898  BEGIN(VERSION);
899  return ZVR;
900 }
901  YY_BREAK
902 case 2:
904 #line 76 "scan_zvr.l"
905 {
906  BEGIN(INITIAL);
907  return Version;
908 }
909  YY_BREAK
910 case 3:
912 #line 81 "scan_zvr.l"
913 {
914  zvr_lval.f = strtod (zvr_text, NULL);
915  return Real;
916 }
917  YY_BREAK
918 case 4:
920 #line 86 "scan_zvr.l"
921 {
922  zvr_lval.ident = strdup (zvr_text);
923  return Unit;
924 }
925  YY_BREAK
926 case 5:
928 #line 91 "scan_zvr.l"
929 {
930  zvr_lval.ident = strdup (zvr_text);
931  return DataFMT;
932 }
933  YY_BREAK
934 case 6:
936 #line 96 "scan_zvr.l"
937 {
938  zvr_lval.ident = strdup (zvr_text);
939  return DataTYP;
940 }
941  YY_BREAK
942 case 7:
944 #line 101 "scan_zvr.l"
945 {
946  zvr_lval.ident = strdup (zvr_text);
947  return Identifier;
948 }
949  YY_BREAK
950 case 8:
952 #line 106 "scan_zvr.l"
953 {
954  zvr_lval.ident = strdup (zvr_text);
955  return DataIDN;
956 }
957  YY_BREAK
958 case 9:
960 #line 111 "scan_zvr.l"
961 { /* pass the ';' to the parser */ return ';'; }
962  YY_BREAK
963 case 10:
964 /* rule 10 can match eol */
966 #line 113 "scan_zvr.l"
967 { /* skip end of line and spaces */ }
968  YY_BREAK
969 case 11:
971 #line 115 "scan_zvr.l"
972 { /* any other character is invalid */
973  fprintf (stderr,
974  "line %d: syntax error, unrecognized character: `%s'\n",
975  zvr_lineno, zvr_text);
976  return InvalidCharacter;
977 }
978  YY_BREAK
979 case 12:
981 #line 122 "scan_zvr.l"
982 ECHO;
983  YY_BREAK
984 #line 985 "scan_zvr.cpp"
985 case YY_STATE_EOF(INITIAL):
986 case YY_STATE_EOF(VERSION):
987  yyterminate();
988 
989  case YY_END_OF_BUFFER:
990  {
991  /* Amount of text matched not including the EOB char. */
992  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
993 
994  /* Undo the effects of YY_DO_BEFORE_ACTION. */
995  *yy_cp = (yy_hold_char);
997 
998  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
999  {
1000  /* We're scanning a new file or input source. It's
1001  * possible that this happened because the user
1002  * just pointed zvr_in at a new source and called
1003  * zvr_lex(). If so, then we have to assure
1004  * consistency between YY_CURRENT_BUFFER and our
1005  * globals. Here is the right place to do so, because
1006  * this is the first action (other than possibly a
1007  * back-up) that will match for the new input source.
1008  */
1009  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1010  YY_CURRENT_BUFFER_LVALUE->yy_input_file = zvr_in;
1011  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1012  }
1013 
1014  /* Note that here we test for yy_c_buf_p "<=" to the position
1015  * of the first EOB in the buffer, since yy_c_buf_p will
1016  * already have been incremented past the NUL character
1017  * (since all states make transitions on EOB to the
1018  * end-of-buffer state). Contrast this with the test
1019  * in input().
1020  */
1021  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1022  { /* This was really a NUL. */
1023  yy_state_type yy_next_state;
1024 
1025  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1026 
1027  yy_current_state = yy_get_previous_state( );
1028 
1029  /* Okay, we're now positioned to make the NUL
1030  * transition. We couldn't have
1031  * yy_get_previous_state() go ahead and do it
1032  * for us because it doesn't know how to deal
1033  * with the possibility of jamming (and we don't
1034  * want to build jamming into it because then it
1035  * will run more slowly).
1036  */
1037 
1038  yy_next_state = yy_try_NUL_trans( yy_current_state );
1039 
1040  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1041 
1042  if ( yy_next_state )
1043  {
1044  /* Consume the NUL. */
1045  yy_cp = ++(yy_c_buf_p);
1046  yy_current_state = yy_next_state;
1047  goto yy_match;
1048  }
1049 
1050  else
1051  {
1052  yy_cp = (yy_c_buf_p);
1053  goto yy_find_action;
1054  }
1055  }
1056 
1057  else switch ( yy_get_next_buffer( ) )
1058  {
1059  case EOB_ACT_END_OF_FILE:
1060  {
1061  (yy_did_buffer_switch_on_eof) = 0;
1062 
1063  if ( zvr_wrap( ) )
1064  {
1065  /* Note: because we've taken care in
1066  * yy_get_next_buffer() to have set up
1067  * zvr_text, we can now set up
1068  * yy_c_buf_p so that if some total
1069  * hoser (like flex itself) wants to
1070  * call the scanner after we return the
1071  * YY_NULL, it'll still work - another
1072  * YY_NULL will get returned.
1073  */
1074  (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1075 
1076  yy_act = YY_STATE_EOF(YY_START);
1077  goto do_action;
1078  }
1079 
1080  else
1081  {
1082  if ( ! (yy_did_buffer_switch_on_eof) )
1083  YY_NEW_FILE;
1084  }
1085  break;
1086  }
1087 
1088  case EOB_ACT_CONTINUE_SCAN:
1089  (yy_c_buf_p) =
1090  (yytext_ptr) + yy_amount_of_matched_text;
1091 
1092  yy_current_state = yy_get_previous_state( );
1093 
1094  yy_cp = (yy_c_buf_p);
1095  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1096  goto yy_match;
1097 
1098  case EOB_ACT_LAST_MATCH:
1099  (yy_c_buf_p) =
1100  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1101 
1102  yy_current_state = yy_get_previous_state( );
1103 
1104  yy_cp = (yy_c_buf_p);
1105  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1106  goto yy_find_action;
1107  }
1108  break;
1109  }
1110 
1111  default:
1113  "fatal flex scanner internal error--no action found" );
1114  } /* end of action switch */
1115  } /* end of scanning one token */
1116 } /* end of zvr_lex */
1117 
1118 /* yy_get_next_buffer - try to read in a new buffer
1119  *
1120  * Returns a code representing an action:
1121  * EOB_ACT_LAST_MATCH -
1122  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1123  * EOB_ACT_END_OF_FILE - end of file
1124  */
1125 static int yy_get_next_buffer (void)
1126 {
1127  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1128  register char *source = (yytext_ptr);
1129  register int number_to_move, i;
1130  int ret_val;
1131 
1132  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1134  "fatal flex scanner internal error--end of buffer missed" );
1135 
1136  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1137  { /* Don't try to fill the buffer, so this is an EOF. */
1138  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1139  {
1140  /* We matched a single character, the EOB, so
1141  * treat this as a final EOF.
1142  */
1143  return EOB_ACT_END_OF_FILE;
1144  }
1145 
1146  else
1147  {
1148  /* We matched some text prior to the EOB, first
1149  * process it.
1150  */
1151  return EOB_ACT_LAST_MATCH;
1152  }
1153  }
1154 
1155  /* Try to read more data. */
1156 
1157  /* First move last chars to start of buffer. */
1158  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1159 
1160  for ( i = 0; i < number_to_move; ++i )
1161  *(dest++) = *(source++);
1162 
1163  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1164  /* don't do the read, it's not guaranteed to return an EOF,
1165  * just force an EOF
1166  */
1167  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1168 
1169  else
1170  {
1171  int num_to_read =
1172  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1173 
1174  while ( num_to_read <= 0 )
1175  { /* Not enough room in the buffer - grow it. */
1176 
1177  /* just a shorter name for the current buffer */
1178  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1179 
1180  int yy_c_buf_p_offset =
1181  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1182 
1183  if ( b->yy_is_our_buffer )
1184  {
1185  int new_size = b->yy_buf_size * 2;
1186 
1187  if ( new_size <= 0 )
1188  b->yy_buf_size += b->yy_buf_size / 8;
1189  else
1190  b->yy_buf_size *= 2;
1191 
1192  b->yy_ch_buf = (char *)
1193  /* Include room in for 2 EOB chars. */
1194  zvr_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1195  }
1196  else
1197  /* Can't grow it, we don't own it. */
1198  b->yy_ch_buf = 0;
1199 
1200  if ( ! b->yy_ch_buf )
1202  "fatal error - scanner input buffer overflow" );
1203 
1204  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1205 
1206  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1207  number_to_move - 1;
1208 
1209  }
1210 
1211  if ( num_to_read > YY_READ_BUF_SIZE )
1212  num_to_read = YY_READ_BUF_SIZE;
1213 
1214  /* Read in more data. */
1215  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1216  (yy_n_chars), (size_t) num_to_read );
1217 
1218  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1219  }
1220 
1221  if ( (yy_n_chars) == 0 )
1222  {
1223  if ( number_to_move == YY_MORE_ADJ )
1224  {
1225  ret_val = EOB_ACT_END_OF_FILE;
1226  zvr_restart(zvr_in );
1227  }
1228 
1229  else
1230  {
1231  ret_val = EOB_ACT_LAST_MATCH;
1232  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1234  }
1235  }
1236 
1237  else
1238  ret_val = EOB_ACT_CONTINUE_SCAN;
1239 
1240  if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1241  /* Extend the array by 50%, plus the number we really need. */
1242  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1243  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) zvr_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1244  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1245  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1246  }
1247 
1248  (yy_n_chars) += number_to_move;
1249  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1250  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1251 
1252  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1253 
1254  return ret_val;
1255 }
1256 
1257 /* yy_get_previous_state - get the state just before the EOB char was reached */
1258 
1259  static yy_state_type yy_get_previous_state (void)
1260 {
1261  register yy_state_type yy_current_state;
1262  register char *yy_cp;
1263 
1264  yy_current_state = (yy_start);
1265 
1266  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1267  {
1268  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1269  if ( yy_accept[yy_current_state] )
1270  {
1271  (yy_last_accepting_state) = yy_current_state;
1272  (yy_last_accepting_cpos) = yy_cp;
1273  }
1274  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1275  {
1276  yy_current_state = (int) yy_def[yy_current_state];
1277  if ( yy_current_state >= 71 )
1278  yy_c = yy_meta[(unsigned int) yy_c];
1279  }
1280  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1281  }
1282 
1283  return yy_current_state;
1284 }
1285 
1286 /* yy_try_NUL_trans - try to make a transition on the NUL character
1287  *
1288  * synopsis
1289  * next_state = yy_try_NUL_trans( current_state );
1290  */
1291  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1292 {
1293  register int yy_is_jam;
1294  register char *yy_cp = (yy_c_buf_p);
1295 
1296  register YY_CHAR yy_c = 1;
1297  if ( yy_accept[yy_current_state] )
1298  {
1299  (yy_last_accepting_state) = yy_current_state;
1300  (yy_last_accepting_cpos) = yy_cp;
1301  }
1302  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1303  {
1304  yy_current_state = (int) yy_def[yy_current_state];
1305  if ( yy_current_state >= 71 )
1306  yy_c = yy_meta[(unsigned int) yy_c];
1307  }
1308  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1309  yy_is_jam = (yy_current_state == 70);
1310 
1311  return yy_is_jam ? 0 : yy_current_state;
1312 }
1313 
1314 #ifndef YY_NO_INPUT
1315 #ifdef __cplusplus
1316  static int yyinput (void)
1317 #else
1318  static int input (void)
1319 #endif
1320 
1321 {
1322  int c;
1323 
1324  *(yy_c_buf_p) = (yy_hold_char);
1325 
1326  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1327  {
1328  /* yy_c_buf_p now points to the character we want to return.
1329  * If this occurs *before* the EOB characters, then it's a
1330  * valid NUL; if not, then we've hit the end of the buffer.
1331  */
1332  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1333  /* This was really a NUL. */
1334  *(yy_c_buf_p) = '\0';
1335 
1336  else
1337  { /* need more input */
1338  int offset = (yy_c_buf_p) - (yytext_ptr);
1339  ++(yy_c_buf_p);
1340 
1341  switch ( yy_get_next_buffer( ) )
1342  {
1343  case EOB_ACT_LAST_MATCH:
1344  /* This happens because yy_g_n_b()
1345  * sees that we've accumulated a
1346  * token and flags that we need to
1347  * try matching the token before
1348  * proceeding. But for input(),
1349  * there's no matching to consider.
1350  * So convert the EOB_ACT_LAST_MATCH
1351  * to EOB_ACT_END_OF_FILE.
1352  */
1353 
1354  /* Reset buffer status. */
1355  zvr_restart(zvr_in );
1356 
1357  /*FALLTHROUGH*/
1358 
1359  case EOB_ACT_END_OF_FILE:
1360  {
1361  if ( zvr_wrap( ) )
1362  return EOF;
1363 
1364  if ( ! (yy_did_buffer_switch_on_eof) )
1365  YY_NEW_FILE;
1366 #ifdef __cplusplus
1367  return yyinput();
1368 #else
1369  return input();
1370 #endif
1371  }
1372 
1373  case EOB_ACT_CONTINUE_SCAN:
1374  (yy_c_buf_p) = (yytext_ptr) + offset;
1375  break;
1376  }
1377  }
1378  }
1379 
1380  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1381  *(yy_c_buf_p) = '\0'; /* preserve zvr_text */
1382  (yy_hold_char) = *++(yy_c_buf_p);
1383 
1384  if ( c == '\n' )
1385 
1386  zvr_lineno++;
1387 ;
1388 
1389  return c;
1390 }
1391 #endif /* ifndef YY_NO_INPUT */
1392 
1398  void zvr_restart (FILE * input_file )
1399 {
1400 
1401  if ( ! YY_CURRENT_BUFFER ){
1402  zvr_ensure_buffer_stack ();
1405  }
1406 
1407  zvr__init_buffer(YY_CURRENT_BUFFER,input_file );
1408  zvr__load_buffer_state( );
1409 }
1410 
1415  void zvr__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1416 {
1417 
1418  /* TODO. We should be able to replace this entire function body
1419  * with
1420  * zvr_pop_buffer_state();
1421  * zvr_push_buffer_state(new_buffer);
1422  */
1423  zvr_ensure_buffer_stack ();
1424  if ( YY_CURRENT_BUFFER == new_buffer )
1425  return;
1426 
1427  if ( YY_CURRENT_BUFFER )
1428  {
1429  /* Flush out information for old buffer. */
1430  *(yy_c_buf_p) = (yy_hold_char);
1431  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1432  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1433  }
1434 
1435  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1436  zvr__load_buffer_state( );
1437 
1438  /* We don't actually know whether we did this switch during
1439  * EOF (zvr_wrap()) processing, but the only time this flag
1440  * is looked at is after zvr_wrap() is called, so it's safe
1441  * to go ahead and always set it.
1442  */
1443  (yy_did_buffer_switch_on_eof) = 1;
1444 }
1445 
1446 static void zvr__load_buffer_state (void)
1447 {
1448  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1449  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1450  zvr_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1451  (yy_hold_char) = *(yy_c_buf_p);
1452 }
1453 
1460  YY_BUFFER_STATE zvr__create_buffer (FILE * file, int size )
1461 {
1462  YY_BUFFER_STATE b;
1463 
1464  b = (YY_BUFFER_STATE) zvr_alloc(sizeof( struct yy_buffer_state ) );
1465  if ( ! b )
1466  YY_FATAL_ERROR( "out of dynamic memory in zvr__create_buffer()" );
1467 
1468  b->yy_buf_size = size;
1469 
1470  /* yy_ch_buf has to be 2 characters longer than the size given because
1471  * we need to put in 2 end-of-buffer characters.
1472  */
1473  b->yy_ch_buf = (char *) zvr_alloc(b->yy_buf_size + 2 );
1474  if ( ! b->yy_ch_buf )
1475  YY_FATAL_ERROR( "out of dynamic memory in zvr__create_buffer()" );
1476 
1477  b->yy_is_our_buffer = 1;
1478 
1479  zvr__init_buffer(b,file );
1480 
1481  return b;
1482 }
1483 
1488  void zvr__delete_buffer (YY_BUFFER_STATE b )
1489 {
1490 
1491  if ( ! b )
1492  return;
1493 
1494  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1496 
1497  if ( b->yy_is_our_buffer )
1498  zvr_free((void *) b->yy_ch_buf );
1499 
1500  zvr_free((void *) b );
1501 }
1502 
1503 #ifndef __cplusplus
1504 extern int isatty (int );
1505 #endif /* __cplusplus */
1506 
1507 /* Initializes or reinitializes a buffer.
1508  * This function is sometimes called more than once on the same buffer,
1509  * such as during a zvr_restart() or at EOF.
1510  */
1511  static void zvr__init_buffer (YY_BUFFER_STATE b, FILE * file )
1512 
1513 {
1514  int oerrno = errno;
1515 
1516  zvr__flush_buffer(b );
1517 
1518  b->yy_input_file = file;
1519  b->yy_fill_buffer = 1;
1520 
1521  /* If b is the current buffer, then zvr__init_buffer was _probably_
1522  * called from zvr_restart() or through yy_get_next_buffer.
1523  * In that case, we don't want to reset the lineno or column.
1524  */
1525  if (b != YY_CURRENT_BUFFER){
1526  b->yy_bs_lineno = 1;
1527  b->yy_bs_column = 0;
1528  }
1529 
1530  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1531 
1532  errno = oerrno;
1533 }
1534 
1539  void zvr__flush_buffer (YY_BUFFER_STATE b )
1540 {
1541  if ( ! b )
1542  return;
1543 
1544  b->yy_n_chars = 0;
1545 
1546  /* We always need two end-of-buffer characters. The first causes
1547  * a transition to the end-of-buffer state. The second causes
1548  * a jam in that state.
1549  */
1552 
1553  b->yy_buf_pos = &b->yy_ch_buf[0];
1554 
1555  b->yy_at_bol = 1;
1557 
1558  if ( b == YY_CURRENT_BUFFER )
1559  zvr__load_buffer_state( );
1560 }
1561 
1568 void zvr_push_buffer_state (YY_BUFFER_STATE new_buffer )
1569 {
1570  if (new_buffer == NULL)
1571  return;
1572 
1573  zvr_ensure_buffer_stack();
1574 
1575  /* This block is copied from zvr__switch_to_buffer. */
1576  if ( YY_CURRENT_BUFFER )
1577  {
1578  /* Flush out information for old buffer. */
1579  *(yy_c_buf_p) = (yy_hold_char);
1580  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1581  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1582  }
1583 
1584  /* Only push if top exists. Otherwise, replace top. */
1585  if (YY_CURRENT_BUFFER)
1586  (yy_buffer_stack_top)++;
1587  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1588 
1589  /* copied from zvr__switch_to_buffer. */
1590  zvr__load_buffer_state( );
1591  (yy_did_buffer_switch_on_eof) = 1;
1592 }
1593 
1599 {
1600  if (!YY_CURRENT_BUFFER)
1601  return;
1602 
1604  YY_CURRENT_BUFFER_LVALUE = NULL;
1605  if ((yy_buffer_stack_top) > 0)
1606  --(yy_buffer_stack_top);
1607 
1608  if (YY_CURRENT_BUFFER) {
1609  zvr__load_buffer_state( );
1610  (yy_did_buffer_switch_on_eof) = 1;
1611  }
1612 }
1613 
1614 /* Allocates the stack if it does not exist.
1615  * Guarantees space for at least one push.
1616  */
1617 static void zvr_ensure_buffer_stack (void)
1618 {
1619  int num_to_alloc;
1620 
1621  if (!(yy_buffer_stack)) {
1622 
1623  /* First allocation is just for 2 elements, since we don't know if this
1624  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1625  * immediate realloc on the next call.
1626  */
1627  num_to_alloc = 1;
1628  (yy_buffer_stack) = (struct yy_buffer_state**)zvr_alloc
1629  (num_to_alloc * sizeof(struct yy_buffer_state*)
1630  );
1631  if ( ! (yy_buffer_stack) )
1632  YY_FATAL_ERROR( "out of dynamic memory in zvr_ensure_buffer_stack()" );
1633 
1634  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1635 
1636  (yy_buffer_stack_max) = num_to_alloc;
1637  (yy_buffer_stack_top) = 0;
1638  return;
1639  }
1640 
1641  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1642 
1643  /* Increase the buffer to prepare for a possible push. */
1644  int grow_size = 8 /* arbitrary grow size */;
1645 
1646  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1647  (yy_buffer_stack) = (struct yy_buffer_state**)zvr_realloc
1648  ((yy_buffer_stack),
1649  num_to_alloc * sizeof(struct yy_buffer_state*)
1650  );
1651  if ( ! (yy_buffer_stack) )
1652  YY_FATAL_ERROR( "out of dynamic memory in zvr_ensure_buffer_stack()" );
1653 
1654  /* zero only the new slots.*/
1655  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1656  (yy_buffer_stack_max) = num_to_alloc;
1657  }
1658 }
1659 
1666 YY_BUFFER_STATE zvr__scan_buffer (char * base, yy_size_t size )
1667 {
1668  YY_BUFFER_STATE b;
1669 
1670  if ( size < 2 ||
1671  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1672  base[size-1] != YY_END_OF_BUFFER_CHAR )
1673  /* They forgot to leave room for the EOB's. */
1674  return 0;
1675 
1676  b = (YY_BUFFER_STATE) zvr_alloc(sizeof( struct yy_buffer_state ) );
1677  if ( ! b )
1678  YY_FATAL_ERROR( "out of dynamic memory in zvr__scan_buffer()" );
1679 
1680  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1681  b->yy_buf_pos = b->yy_ch_buf = base;
1682  b->yy_is_our_buffer = 0;
1683  b->yy_input_file = 0;
1684  b->yy_n_chars = b->yy_buf_size;
1685  b->yy_is_interactive = 0;
1686  b->yy_at_bol = 1;
1687  b->yy_fill_buffer = 0;
1689 
1691 
1692  return b;
1693 }
1694 
1703 YY_BUFFER_STATE zvr__scan_string (yyconst char * yystr )
1704 {
1705 
1706  return zvr__scan_bytes(yystr,strlen(yystr) );
1707 }
1708 
1716 YY_BUFFER_STATE zvr__scan_bytes (yyconst char * yybytes, int _yybytes_len )
1717 {
1718  YY_BUFFER_STATE b;
1719  char *buf;
1720  yy_size_t n;
1721  int i;
1722 
1723  /* Get memory for full buffer, including space for trailing EOB's. */
1724  n = _yybytes_len + 2;
1725  buf = (char *) zvr_alloc(n );
1726  if ( ! buf )
1727  YY_FATAL_ERROR( "out of dynamic memory in zvr__scan_bytes()" );
1728 
1729  for ( i = 0; i < _yybytes_len; ++i )
1730  buf[i] = yybytes[i];
1731 
1732  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1733 
1734  b = zvr__scan_buffer(buf,n );
1735  if ( ! b )
1736  YY_FATAL_ERROR( "bad buffer in zvr__scan_bytes()" );
1737 
1738  /* It's okay to grow etc. this buffer, and we should throw it
1739  * away when we're done.
1740  */
1741  b->yy_is_our_buffer = 1;
1742 
1743  return b;
1744 }
1745 
1746 #ifndef YY_EXIT_FAILURE
1747 #define YY_EXIT_FAILURE 2
1748 #endif
1749 
1750 static void yy_fatal_error (yyconst char* msg )
1751 {
1752  (void) fprintf( stderr, "%s\n", msg );
1753  exit( YY_EXIT_FAILURE );
1754 }
1755 
1756 /* Redefine yyless() so it works in section 3 code. */
1757 
1758 #undef yyless
1759 #define yyless(n) \
1760  do \
1761  { \
1762  /* Undo effects of setting up zvr_text. */ \
1763  int yyless_macro_arg = (n); \
1764  YY_LESS_LINENO(yyless_macro_arg);\
1765  zvr_text[zvr_leng] = (yy_hold_char); \
1766  (yy_c_buf_p) = zvr_text + yyless_macro_arg; \
1767  (yy_hold_char) = *(yy_c_buf_p); \
1768  *(yy_c_buf_p) = '\0'; \
1769  zvr_leng = yyless_macro_arg; \
1770  } \
1771  while ( 0 )
1772 
1773 /* Accessor methods (get/set functions) to struct members. */
1774 
1778 int zvr_get_lineno (void)
1779 {
1780 
1781  return zvr_lineno;
1782 }
1783 
1787 FILE *zvr_get_in (void)
1788 {
1789  return zvr_in;
1790 }
1791 
1795 FILE *zvr_get_out (void)
1796 {
1797  return zvr_out;
1798 }
1799 
1803 int zvr_get_leng (void)
1804 {
1805  return zvr_leng;
1806 }
1807 
1812 char *zvr_get_text (void)
1813 {
1814  return zvr_text;
1815 }
1816 
1821 void zvr_set_lineno (int line_number )
1822 {
1823 
1824  zvr_lineno = line_number;
1825 }
1826 
1833 void zvr_set_in (FILE * in_str )
1834 {
1835  zvr_in = in_str ;
1836 }
1837 
1838 void zvr_set_out (FILE * out_str )
1839 {
1840  zvr_out = out_str ;
1841 }
1842 
1843 int zvr_get_debug (void)
1844 {
1845  return zvr__flex_debug;
1846 }
1847 
1848 void zvr_set_debug (int bdebug )
1849 {
1850  zvr__flex_debug = bdebug ;
1851 }
1852 
1853 static int yy_init_globals (void)
1854 {
1855  /* Initialization is the same as for the non-reentrant scanner.
1856  * This function is called from zvr_lex_destroy(), so don't allocate here.
1857  */
1858 
1859  /* We do not touch zvr_lineno unless the option is enabled. */
1860  zvr_lineno = 1;
1861 
1862  (yy_buffer_stack) = 0;
1863  (yy_buffer_stack_top) = 0;
1864  (yy_buffer_stack_max) = 0;
1865  (yy_c_buf_p) = (char *) 0;
1866  (yy_init) = 0;
1867  (yy_start) = 0;
1868 
1869 /* Defined in main.c */
1870 #ifdef YY_STDINIT
1871  zvr_in = stdin;
1872  zvr_out = stdout;
1873 #else
1874  zvr_in = (FILE *) 0;
1875  zvr_out = (FILE *) 0;
1876 #endif
1877 
1878  /* For future reference: Set errno on error, since we are called by
1879  * zvr_lex_init()
1880  */
1881  return 0;
1882 }
1883 
1884 /* zvr_lex_destroy is for both reentrant and non-reentrant scanners. */
1886 {
1887 
1888  /* Pop the buffer stack, destroying each element. */
1889  while(YY_CURRENT_BUFFER){
1891  YY_CURRENT_BUFFER_LVALUE = NULL;
1893  }
1894 
1895  /* Destroy the stack itself. */
1896  zvr_free((yy_buffer_stack) );
1897  (yy_buffer_stack) = NULL;
1898 
1899  /* Reset the globals. This is important in a non-reentrant scanner so the next time
1900  * zvr_lex() is called, initialization will occur. */
1901  yy_init_globals( );
1902 
1903  return 0;
1904 }
1905 
1906 /*
1907  * Internal utility routines.
1908  */
1909 
1910 #ifndef yytext_ptr
1911 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1912 {
1913  register int i;
1914  for ( i = 0; i < n; ++i )
1915  s1[i] = s2[i];
1916 }
1917 #endif
1918 
1919 #ifdef YY_NEED_STRLEN
1920 static int yy_flex_strlen (yyconst char * s )
1921 {
1922  register int n;
1923  for ( n = 0; s[n]; ++n )
1924  ;
1925 
1926  return n;
1927 }
1928 #endif
1929 
1930 void *zvr_alloc (yy_size_t size )
1931 {
1932  return (void *) malloc( size );
1933 }
1934 
1935 void *zvr_realloc (void * ptr, yy_size_t size )
1936 {
1937  /* The cast to (char *) in the following accommodates both
1938  * implementations that use char* generic pointers, and those
1939  * that use void* generic pointers. It works with the latter
1940  * because both ANSI C and C++ allow castless assignment from
1941  * any pointer type to void*, and deal with argument conversions
1942  * as though doing an assignment.
1943  */
1944  return (void *) realloc( (char *) ptr, size );
1945 }
1946 
1947 void zvr_free (void * ptr )
1948 {
1949  free( (char *) ptr ); /* see zvr_realloc() for (char *) cast */
1950 }
1951 
1952 #define YYTABLES_NAME "yytables"
1953 
1954 #line 122 "scan_zvr.l"
1955 
1956 
1957