libqasm
library for handling cQASM files
cqasm-version-lexer.cpp
Go to the documentation of this file.
1 #line 2 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/cbuild/src/cqasm/cqasm-version-lexer.cpp"
2 
3 #line 4 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/cbuild/src/cqasm/cqasm-version-lexer.cpp"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define FLEX_SCANNER
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 6
12 #define YY_FLEX_SUBMINOR_VERSION 1
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
16 
17 /* First, we deal with platform-specific or compiler-specific issues. */
18 
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
24 
25 /* end standard C headers. */
26 
27 /* flex integer type definitions */
28 
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
31 
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37  * if you want the limit (max/min) macros for int types.
38  */
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
41 #endif
42 
43 #include <inttypes.h>
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
50 #else
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
57 
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX (4294967295U)
85 #endif
86 
87 #endif /* ! C99 */
88 
89 #endif /* ! FLEXINT_H */
90 
91 /* TODO: this is always defined, so inline it */
92 #define yyconst const
93 
94 #if defined(__GNUC__) && __GNUC__ >= 3
95 #define yynoreturn __attribute__((__noreturn__))
96 #else
97 #define yynoreturn
98 #endif
99 
100 /* Returned upon end-of-file. */
101 #define YY_NULL 0
102 
103 /* Promotes a possibly negative, possibly signed char to an unsigned
104  * integer for use as an array index. If the signed char is negative,
105  * we want to instead treat it as an 8-bit unsigned char, hence the
106  * double cast.
107  */
108 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
109 
110 /* An opaque pointer. */
111 #ifndef YY_TYPEDEF_YY_SCANNER_T
112 #define YY_TYPEDEF_YY_SCANNER_T
113 typedef void* yyscan_t;
114 #endif
115 
116 /* For convenience, these vars (plus the bison vars far below)
117  are macros in the reentrant scanner. */
118 #define yyin yyg->yyin_r
119 #define yyout yyg->yyout_r
120 #define yyextra yyg->yyextra_r
121 #define yyleng yyg->yyleng_r
122 #define yytext yyg->yytext_r
123 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
124 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
125 #define yy_flex_debug yyg->yy_flex_debug_r
126 
127 /* Enter a start condition. This macro really ought to take a parameter,
128  * but we do it the disgusting crufty way forced on us by the ()-less
129  * definition of BEGIN.
130  */
131 #define BEGIN yyg->yy_start = 1 + 2 *
132 
133 /* Translate the current start state into a value that can be later handed
134  * to BEGIN to return to the state. The YYSTATE alias is for lex
135  * compatibility.
136  */
137 #define YY_START ((yyg->yy_start - 1) / 2)
138 #define YYSTATE YY_START
139 
140 /* Action number for EOF rule of a given start state. */
141 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
142 
143 /* Special action meaning "start processing a new file". */
144 #define YY_NEW_FILE cqasm_versionrestart(yyin ,yyscanner )
145 
146 #define YY_END_OF_BUFFER_CHAR 0
147 
148 /* Size of default input buffer. */
149 #ifndef YY_BUF_SIZE
150 #ifdef __ia64__
151 /* On IA-64, the buffer size is 16k, not 8k.
152  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
153  * Ditto for the __ia64__ case accordingly.
154  */
155 #define YY_BUF_SIZE 32768
156 #else
157 #define YY_BUF_SIZE 16384
158 #endif /* __ia64__ */
159 #endif
160 
161 /* The state buf must be large enough to hold one state per character in the main buffer.
162  */
163 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
164 
165 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
166 #define YY_TYPEDEF_YY_BUFFER_STATE
168 #endif
169 
170 #ifndef YY_TYPEDEF_YY_SIZE_T
171 #define YY_TYPEDEF_YY_SIZE_T
172 typedef size_t yy_size_t;
173 #endif
174 
175 #define EOB_ACT_CONTINUE_SCAN 0
176 #define EOB_ACT_END_OF_FILE 1
177 #define EOB_ACT_LAST_MATCH 2
178 
179  /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
180  * access to the local variable yy_act. Since yyless() is a macro, it would break
181  * existing scanners that call yyless() from OUTSIDE cqasm_versionlex.
182  * One obvious solution it to make yy_act a global. I tried that, and saw
183  * a 5% performance hit in a non-yylineno scanner, because yy_act is
184  * normally declared as a register variable-- so it is not worth it.
185  */
186  #define YY_LESS_LINENO(n) \
187  do { \
188  int yyl;\
189  for ( yyl = n; yyl < yyleng; ++yyl )\
190  if ( yytext[yyl] == '\n' )\
191  --yylineno;\
192  }while(0)
193  #define YY_LINENO_REWIND_TO(dst) \
194  do {\
195  const char *p;\
196  for ( p = yy_cp-1; p >= (dst); --p)\
197  if ( *p == '\n' )\
198  --yylineno;\
199  }while(0)
200 
201 /* Return all but the first "n" matched characters back to the input stream. */
202 #define yyless(n) \
203  do \
204  { \
205  /* Undo effects of setting up yytext. */ \
206  int yyless_macro_arg = (n); \
207  YY_LESS_LINENO(yyless_macro_arg);\
208  *yy_cp = yyg->yy_hold_char; \
209  YY_RESTORE_YY_MORE_OFFSET \
210  yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
211  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
212  } \
213  while ( 0 )
214 
215 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
216 
217 #ifndef YY_STRUCT_YY_BUFFER_STATE
218 #define YY_STRUCT_YY_BUFFER_STATE
219 struct yy_buffer_state
220  {
221  FILE *yy_input_file;
222 
223  char *yy_ch_buf; /* input buffer */
224  char *yy_buf_pos; /* current position in input buffer */
225 
226  /* Size of input buffer in bytes, not including room for EOB
227  * characters.
228  */
229  int yy_buf_size;
230 
231  /* Number of characters read into yy_ch_buf, not including EOB
232  * characters.
233  */
234  int yy_n_chars;
235 
236  /* Whether we "own" the buffer - i.e., we know we created it,
237  * and can realloc() it to grow it, and should free() it to
238  * delete it.
239  */
240  int yy_is_our_buffer;
241 
242  /* Whether this is an "interactive" input source; if so, and
243  * if we're using stdio for input, then we want to use getc()
244  * instead of fread(), to make sure we stop fetching input after
245  * each newline.
246  */
247  int yy_is_interactive;
248 
249  /* Whether we're considered to be at the beginning of a line.
250  * If so, '^' rules will be active on the next match, otherwise
251  * not.
252  */
253  int yy_at_bol;
254 
255  int yy_bs_lineno;
256  int yy_bs_column;
258  /* Whether to try to fill the input buffer when we reach the
259  * end of it.
260  */
261  int yy_fill_buffer;
262 
263  int yy_buffer_status;
264 
265 #define YY_BUFFER_NEW 0
266 #define YY_BUFFER_NORMAL 1
267  /* When an EOF's been seen but there's still some text to process
268  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
269  * shouldn't try reading from the input source any more. We might
270  * still have a bunch of tokens to match, though, because of
271  * possible backing-up.
272  *
273  * When we actually see the EOF, we change the status to "new"
274  * (via cqasm_versionrestart()), so that the user can continue scanning by
275  * just pointing yyin at a new input file.
276  */
277 #define YY_BUFFER_EOF_PENDING 2
278 
279  };
280 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
281 
282 /* We provide macros for accessing buffer states in case in the
283  * future we want to put the buffer states in a more general
284  * "scanner state".
285  *
286  * Returns the top of the stack, or NULL.
287  */
288 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
289  ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
290  : NULL)
291 
292 /* Same as previous macro, but useful when we know that the buffer stack is not
293  * NULL or when we need an lvalue. For internal use only.
294  */
295 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
296 
297 void cqasm_versionrestart (FILE *input_file ,yyscan_t yyscanner );
298 void cqasm_version_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
299 YY_BUFFER_STATE cqasm_version_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
300 void cqasm_version_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
301 void cqasm_version_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
302 void cqasm_versionpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
303 void cqasm_versionpop_buffer_state (yyscan_t yyscanner );
304 
305 static void cqasm_versionensure_buffer_stack (yyscan_t yyscanner );
306 static void cqasm_version_load_buffer_state (yyscan_t yyscanner );
307 static void cqasm_version_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
308 
309 #define YY_FLUSH_BUFFER cqasm_version_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
310 
311 YY_BUFFER_STATE cqasm_version_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
312 YY_BUFFER_STATE cqasm_version_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
313 YY_BUFFER_STATE cqasm_version_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
314 
315 void *cqasm_versionalloc (yy_size_t ,yyscan_t yyscanner );
316 void *cqasm_versionrealloc (void *,yy_size_t ,yyscan_t yyscanner );
317 void cqasm_versionfree (void * ,yyscan_t yyscanner );
318 
319 #define yy_new_buffer cqasm_version_create_buffer
320 
321 #define yy_set_interactive(is_interactive) \
322  { \
323  if ( ! YY_CURRENT_BUFFER ){ \
324  cqasm_versionensure_buffer_stack (yyscanner); \
325  YY_CURRENT_BUFFER_LVALUE = \
326  cqasm_version_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
327  } \
328  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
329  }
330 
331 #define yy_set_bol(at_bol) \
332  { \
333  if ( ! YY_CURRENT_BUFFER ){\
334  cqasm_versionensure_buffer_stack (yyscanner); \
335  YY_CURRENT_BUFFER_LVALUE = \
336  cqasm_version_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
337  } \
338  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
339  }
340 
341 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
342 
343 #define cqasm_versionwrap(yyscanner) (/*CONSTCOND*/1)
344 #define YY_SKIP_YYWRAP
345 
346 typedef unsigned char YY_CHAR;
347 
348 typedef int yy_state_type;
349 
350 #define yytext_ptr yytext_r
351 
352 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
353 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
354 static int yy_get_next_buffer (yyscan_t yyscanner );
355 static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
356 
357 /* Done after the current pattern has been matched and before the
358  * corresponding action - sets up yytext.
359  */
360 #define YY_DO_BEFORE_ACTION \
361  yyg->yytext_ptr = yy_bp; \
362  yyleng = (int) (yy_cp - yy_bp); \
363  yyg->yy_hold_char = *yy_cp; \
364  *yy_cp = '\0'; \
365  yyg->yy_c_buf_p = yy_cp;
366 
367 #define YY_NUM_RULES 19
368 #define YY_END_OF_BUFFER 20
369 /* This struct is not used in this scanner,
370  but its presence is necessary. */
371 struct yy_trans_info
372  {
373  flex_int32_t yy_verify;
374  flex_int32_t yy_nxt;
375  };
376 static yyconst flex_int16_t yy_accept[53] =
377  { 0,
378  0, 0, 0, 0, 0, 0, 0, 0, 20, 7,
379  4, 1, 1, 2, 7, 7, 7, 10, 8, 8,
380  10, 16, 13, 11, 11, 15, 14, 12, 18, 17,
381  17, 4, 1, 2, 3, 0, 0, 8, 9, 13,
382  11, 14, 17, 0, 0, 0, 0, 0, 6, 0,
383  5, 0
384  } ;
385 
386 static yyconst YY_CHAR yy_ec[256] =
387  { 0,
388  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
389  1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
390  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391  1, 2, 1, 1, 5, 1, 1, 1, 1, 1,
392  1, 6, 1, 1, 1, 7, 8, 9, 9, 9,
393  9, 9, 9, 9, 9, 9, 9, 1, 10, 1,
394  1, 1, 1, 1, 11, 1, 1, 1, 12, 1,
395  1, 1, 13, 1, 1, 1, 14, 15, 16, 1,
396  17, 18, 19, 1, 1, 20, 1, 1, 1, 1,
397  1, 1, 1, 1, 1, 1, 1, 1, 21, 1,
398 
399  22, 1, 1, 1, 23, 1, 1, 1, 1, 24,
400  25, 1, 1, 26, 27, 1, 1, 28, 1, 1,
401  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 
410  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415  1, 1, 1, 1, 1
416  } ;
417 
418 static yyconst YY_CHAR yy_meta[29] =
419  { 0,
420  1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
421  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422  1, 1, 1, 1, 1, 1, 1, 1
423  } ;
424 
425 static yyconst flex_uint16_t yy_base[58] =
426  { 0,
427  0, 27, 3, 7, 54, 63, 11, 13, 59, 82,
428  52, 82, 50, 0, 46, 0, 34, 82, 82, 47,
429  41, 82, 44, 82, 41, 82, 34, 82, 82, 82,
430  39, 39, 82, 0, 82, 0, 29, 82, 82, 37,
431  82, 29, 82, 0, 18, 10, 10, 9, 82, 21,
432  82, 82, 73, 75, 77, 79, 0
433  } ;
434 
435 static yyconst flex_int16_t yy_def[58] =
436  { 0,
437  53, 53, 54, 54, 55, 55, 56, 56, 52, 52,
438  52, 52, 52, 57, 52, 52, 52, 52, 52, 52,
439  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
440  52, 52, 52, 57, 52, 52, 52, 52, 52, 52,
441  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
442  52, 0, 52, 52, 52, 52, 52
443  } ;
444 
445 static yyconst flex_uint16_t yy_nxt[111] =
446  { 0,
447  34, 11, 12, 13, 14, 19, 20, 15, 21, 19,
448  20, 36, 21, 30, 31, 30, 31, 44, 46, 16,
449  17, 36, 48, 49, 50, 44, 46, 16, 11, 12,
450  13, 14, 48, 50, 15, 51, 47, 42, 40, 45,
451  32, 43, 42, 41, 51, 40, 16, 17, 39, 38,
452  37, 35, 33, 32, 16, 23, 24, 25, 52, 52,
453  26, 52, 27, 28, 23, 24, 25, 52, 52, 26,
454  52, 27, 28, 10, 10, 18, 18, 22, 22, 29,
455  29, 9, 52, 52, 52, 52, 52, 52, 52, 52,
456  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
457 
458  52, 52, 52, 52, 52, 52, 52, 52, 52, 52
459  } ;
460 
461 static yyconst flex_int16_t yy_chk[111] =
462  { 0,
463  57, 1, 1, 1, 1, 3, 3, 1, 3, 4,
464  4, 16, 4, 7, 7, 8, 8, 36, 44, 1,
465  1, 16, 46, 47, 48, 36, 44, 1, 2, 2,
466  2, 2, 46, 48, 2, 50, 45, 42, 40, 37,
467  32, 31, 27, 25, 50, 23, 2, 2, 21, 20,
468  17, 15, 13, 11, 2, 5, 5, 5, 9, 0,
469  5, 0, 5, 5, 6, 6, 6, 0, 0, 6,
470  0, 6, 6, 53, 53, 54, 54, 55, 55, 56,
471  56, 52, 52, 52, 52, 52, 52, 52, 52, 52,
472  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
473 
474  52, 52, 52, 52, 52, 52, 52, 52, 52, 52
475  } ;
476 
477 /* Table of booleans, true if rule could match eol. */
478 static yyconst flex_int32_t yy_rule_can_match_eol[20] =
479  { 0,
480 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0,
481  };
482 
483 /* The intent behind this definition is that it'll catch
484  * any uses of REJECT which flex missed.
485  */
486 #define REJECT reject_used_but_not_detected
487 #define yymore() yymore_used_but_not_detected
488 #define YY_MORE_ADJ 0
489 #define YY_RESTORE_YY_MORE_OFFSET
490 #line 1 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
491 #define YY_NO_INPUT 1
492 #line 7 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
493 
497  #include "cqasm-version-parser.hpp"
498 
499  //#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
500  #define DEBUG(...)
501 
502  #define YY_USER_ACTION yylloc->last_column += yyleng;
503  #define LOCATION_RESET \
504  yylloc->first_column = 1; yylloc->first_line = 1; \
505  yylloc->last_column = 1; yylloc->last_line = 1;
506  #define LOCATION_LINE \
507  yylloc->last_column = 1; yylloc->last_line += 1;
508  #define LOCATION_STEP \
509  yylloc->first_column = yylloc->last_column; \
510  yylloc->first_line = yylloc->last_line;
511  #define WITH_STR(TOKNAME) \
512  DEBUG("Pushing %s token (%s) starting at %d:%d\n", #TOKNAME, yytext, yylloc->first_line, yylloc->first_column); \
513  yylval->str = strdup(yytext); return TOKNAME
514  #define WITHOUT_STR(TOKNAME) \
515  DEBUG("Pushing %s token starting at %d:%d\n", #TOKNAME, yylloc->first_line, yylloc->first_column); \
516  return TOKNAME
517  #define OPERATOR \
518  DEBUG("Pushing '%c' token starting at %d:%d\n", yytext[0], yylloc->first_line, yylloc->first_column); \
519  return yytext[0]
520  #define DELETE LOCATION_STEP
521 
522 
523 
524 
525 #line 526 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/cbuild/src/cqasm/cqasm-version-lexer.cpp"
526 
527 #define INITIAL 0
528 #define MODE_MULTILINE_COMMENT 1
529 #define MODE_VERSION 2
530 #define MODE_IGNORE_THE_REST 3
531 
532 #ifndef YY_NO_UNISTD_H
533 /* Special case for "unistd.h", since it is non-ANSI. We include it way
534  * down here because we want the user's section 1 to have been scanned first.
535  * The user has a chance to override it with an option.
536  */
537 #include <unistd.h>
538 #endif
539 
540 #ifndef YY_EXTRA_TYPE
541 #define YY_EXTRA_TYPE void *
542 #endif
543 
544 /* Holds the entire state of the reentrant scanner. */
545 struct yyguts_t
546  {
547 
548  /* User-defined. Not touched by flex. */
549  YY_EXTRA_TYPE yyextra_r;
550 
551  /* The rest are the same as the globals declared in the non-reentrant scanner. */
552  FILE *yyin_r, *yyout_r;
553  size_t yy_buffer_stack_top;
554  size_t yy_buffer_stack_max;
555  YY_BUFFER_STATE * yy_buffer_stack;
556  char yy_hold_char;
557  int yy_n_chars;
558  int yyleng_r;
559  char *yy_c_buf_p;
560  int yy_init;
561  int yy_start;
562  int yy_did_buffer_switch_on_eof;
563  int yy_start_stack_ptr;
564  int yy_start_stack_depth;
565  int *yy_start_stack;
566  yy_state_type yy_last_accepting_state;
567  char* yy_last_accepting_cpos;
568 
569  int yylineno_r;
570  int yy_flex_debug_r;
571 
572  char *yytext_r;
573  int yy_more_flag;
574  int yy_more_len;
575 
576  YYSTYPE * yylval_r;
577 
578  YYLTYPE * yylloc_r;
579 
580  }; /* end struct yyguts_t */
581 
582 static int yy_init_globals (yyscan_t yyscanner );
583 
584  /* This must go here because YYSTYPE and YYLTYPE are included
585  * from bison output in section 1.*/
586  # define yylval yyg->yylval_r
587 
588  # define yylloc yyg->yylloc_r
589 
590 int cqasm_versionlex_init (yyscan_t* scanner);
591 
592 int cqasm_versionlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
593 
594 /* Accessor methods to globals.
595  These are made visible to non-reentrant scanners for convenience. */
596 
597 int cqasm_versionlex_destroy (yyscan_t yyscanner );
598 
599 int cqasm_versionget_debug (yyscan_t yyscanner );
600 
601 void cqasm_versionset_debug (int debug_flag ,yyscan_t yyscanner );
602 
604 
605 void cqasm_versionset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
606 
607 FILE *cqasm_versionget_in (yyscan_t yyscanner );
608 
609 void cqasm_versionset_in (FILE * _in_str ,yyscan_t yyscanner );
610 
611 FILE *cqasm_versionget_out (yyscan_t yyscanner );
612 
613 void cqasm_versionset_out (FILE * _out_str ,yyscan_t yyscanner );
614 
615  int cqasm_versionget_leng (yyscan_t yyscanner );
616 
617 char *cqasm_versionget_text (yyscan_t yyscanner );
618 
619 int cqasm_versionget_lineno (yyscan_t yyscanner );
620 
621 void cqasm_versionset_lineno (int _line_number ,yyscan_t yyscanner );
622 
623 int cqasm_versionget_column (yyscan_t yyscanner );
624 
625 void cqasm_versionset_column (int _column_no ,yyscan_t yyscanner );
626 
627 YYSTYPE * cqasm_versionget_lval (yyscan_t yyscanner );
628 
629 void cqasm_versionset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
630 
631  YYLTYPE *cqasm_versionget_lloc (yyscan_t yyscanner );
632 
633  void cqasm_versionset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
634 
635 /* Macros after this point can all be overridden by user definitions in
636  * section 1.
637  */
638 
639 #ifndef YY_SKIP_YYWRAP
640 #ifdef __cplusplus
641 extern "C" int cqasm_versionwrap (yyscan_t yyscanner );
642 #else
643 extern int cqasm_versionwrap (yyscan_t yyscanner );
644 #endif
645 #endif
646 
647 #ifndef YY_NO_UNPUT
648 
649 #endif
650 
651 #ifndef yytext_ptr
652 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
653 #endif
654 
655 #ifdef YY_NEED_STRLEN
656 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
657 #endif
658 
659 #ifndef YY_NO_INPUT
660 
661 #ifdef __cplusplus
662 static int yyinput (yyscan_t yyscanner );
663 #else
664 static int input (yyscan_t yyscanner );
665 #endif
666 
667 #endif
668 
669 /* Amount of stuff to slurp up with each read. */
670 #ifndef YY_READ_BUF_SIZE
671 #ifdef __ia64__
672 /* On IA-64, the buffer size is 16k, not 8k */
673 #define YY_READ_BUF_SIZE 16384
674 #else
675 #define YY_READ_BUF_SIZE 8192
676 #endif /* __ia64__ */
677 #endif
678 
679 /* Copy whatever the last rule matched to the standard output. */
680 #ifndef ECHO
681 /* This used to be an fputs(), but since the string might contain NUL's,
682  * we now use fwrite().
683  */
684 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
685 #endif
686 
687 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
688  * is returned in "result".
689  */
690 #ifndef YY_INPUT
691 #define YY_INPUT(buf,result,max_size) \
692  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
693  { \
694  int c = '*'; \
695  size_t n; \
696  for ( n = 0; n < max_size && \
697  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
698  buf[n] = (char) c; \
699  if ( c == '\n' ) \
700  buf[n++] = (char) c; \
701  if ( c == EOF && ferror( yyin ) ) \
702  YY_FATAL_ERROR( "input in flex scanner failed" ); \
703  result = n; \
704  } \
705  else \
706  { \
707  errno=0; \
708  while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
709  { \
710  if( errno != EINTR) \
711  { \
712  YY_FATAL_ERROR( "input in flex scanner failed" ); \
713  break; \
714  } \
715  errno=0; \
716  clearerr(yyin); \
717  } \
718  }\
719 \
720 
721 #endif
722 
723 /* No semi-colon after return; correct usage is to write "yyterminate();" -
724  * we don't want an extra ';' after the "return" because that will cause
725  * some compilers to complain about unreachable statements.
726  */
727 #ifndef yyterminate
728 #define yyterminate() return YY_NULL
729 #endif
730 
731 /* Number of entries by which start-condition stack grows. */
732 #ifndef YY_START_STACK_INCR
733 #define YY_START_STACK_INCR 25
734 #endif
735 
736 /* Report a fatal error. */
737 #ifndef YY_FATAL_ERROR
738 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
739 #endif
740 
741 /* end tables serialization structures and prototypes */
742 
743 /* Default declaration of generated scanner - a define so the user can
744  * easily add parameters.
745  */
746 #ifndef YY_DECL
747 #define YY_DECL_IS_OURS 1
748 
749 extern int cqasm_versionlex \
750  (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
751 
752 #define YY_DECL int cqasm_versionlex \
753  (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
754 #endif /* !YY_DECL */
755 
756 /* Code executed at the beginning of each rule, after yytext and yyleng
757  * have been set up.
758  */
759 #ifndef YY_USER_ACTION
760 #define YY_USER_ACTION
761 #endif
762 
763 /* Code executed at the end of each rule. */
764 #ifndef YY_BREAK
765 #define YY_BREAK /*LINTED*/break;
766 #endif
767 
768 #define YY_RULE_SETUP \
769  YY_USER_ACTION
770 
773 YY_DECL
774 {
775  yy_state_type yy_current_state;
776  char *yy_cp, *yy_bp;
777  int yy_act;
778  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
779 
780  yylval = yylval_param;
781 
782  yylloc = yylloc_param;
783 
784  if ( !yyg->yy_init )
785  {
786  yyg->yy_init = 1;
787 
788 #ifdef YY_USER_INIT
789  YY_USER_INIT;
790 #endif
791 
792  if ( ! yyg->yy_start )
793  yyg->yy_start = 1; /* first start state */
794 
795  if ( ! yyin )
796  yyin = stdin;
797 
798  if ( ! yyout )
799  yyout = stdout;
800 
801  if ( ! YY_CURRENT_BUFFER ) {
802  cqasm_versionensure_buffer_stack (yyscanner);
805  }
806 
807  cqasm_version_load_buffer_state(yyscanner );
808  }
809 
810  {
811 #line 42 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
812 
813 
814 
816 
817 
818 #line 819 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/cbuild/src/cqasm/cqasm-version-lexer.cpp"
819 
820  while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
821  {
822  yy_cp = yyg->yy_c_buf_p;
823 
824  /* Support of yytext. */
825  *yy_cp = yyg->yy_hold_char;
826 
827  /* yy_bp points to the position in yy_ch_buf of the start of
828  * the current run.
829  */
830  yy_bp = yy_cp;
831 
832  yy_current_state = yyg->yy_start;
833 yy_match:
834  do
835  {
836  YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
837  if ( yy_accept[yy_current_state] )
838  {
839  yyg->yy_last_accepting_state = yy_current_state;
841  }
842  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
843  {
844  yy_current_state = (int) yy_def[yy_current_state];
845  if ( yy_current_state >= 53 )
846  yy_c = yy_meta[(unsigned int) yy_c];
847  }
848  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
849  ++yy_cp;
850  }
851  while ( yy_base[yy_current_state] != 82 );
852 
853 yy_find_action:
854  yy_act = yy_accept[yy_current_state];
855  if ( yy_act == 0 )
856  { /* have to back up */
857  yy_cp = yyg->yy_last_accepting_cpos;
858  yy_current_state = yyg->yy_last_accepting_state;
859  yy_act = yy_accept[yy_current_state];
860  }
861 
863 
864  if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
865  {
866  yy_size_t yyl;
867  for ( yyl = 0; yyl < yyleng; ++yyl )
868  if ( yytext[yyl] == '\n' )
869 
870  do{ yylineno++;
871  yycolumn=0;
872  }while(0)
873 ;
874  }
875 
876 do_action: /* This label is used only to access EOF actions. */
877 
878  switch ( yy_act )
879  { /* beginning of action switch */
880  case 0: /* must back up */
881  /* undo the effects of YY_DO_BEFORE_ACTION */
882  *yy_cp = yyg->yy_hold_char;
883  yy_cp = yyg->yy_last_accepting_cpos;
884  yy_current_state = yyg->yy_last_accepting_state;
885  goto yy_find_action;
886 
887 case 1:
888 /* rule 1 can match eol */
890 #line 49 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
892  YY_BREAK
893 case 2:
895 #line 50 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
896 DELETE;
897  YY_BREAK
898 case 3:
900 #line 51 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
902  YY_BREAK
903 case 4:
905 #line 52 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
906 DELETE;
907  YY_BREAK
908 case 5:
910 #line 53 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
912  YY_BREAK
913 case 6:
915 #line 54 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
917  YY_BREAK
918 case 7:
920 #line 55 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
922  YY_BREAK
923 
924 
925 case 8:
926 /* rule 8 can match eol */
928 #line 59 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
930  YY_BREAK
931 case 9:
933 #line 60 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
935  YY_BREAK
936 case 10:
938 #line 61 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
939 DELETE;
940  YY_BREAK
942 #line 62 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
944  YY_BREAK
945 
946 
947 case 11:
948 /* rule 11 can match eol */
950 #line 66 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
952  YY_BREAK
953 case 12:
955 #line 67 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
957  YY_BREAK
958 case 13:
960 #line 68 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
961 DELETE;
962  YY_BREAK
963 case 14:
965 #line 69 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
967  YY_BREAK
968 case 15:
970 #line 70 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
971 OPERATOR;
972  YY_BREAK
973 case 16:
975 #line 71 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
977  YY_BREAK
978 
979 
980 case 17:
981 /* rule 17 can match eol */
983 #line 75 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
985  YY_BREAK
986 case 18:
988 #line 76 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
989 DELETE;
990  YY_BREAK
991 
992 case 19:
994 #line 78 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
995 YY_FATAL_ERROR( "flex scanner jammed" );
996  YY_BREAK
997 #line 998 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/cbuild/src/cqasm/cqasm-version-lexer.cpp"
998 case YY_STATE_EOF(INITIAL):
1001  yyterminate();
1002 
1003  case YY_END_OF_BUFFER:
1004  {
1005  /* Amount of text matched not including the EOB char. */
1006  int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1007 
1008  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1009  *yy_cp = yyg->yy_hold_char;
1011 
1012  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1013  {
1014  /* We're scanning a new file or input source. It's
1015  * possible that this happened because the user
1016  * just pointed yyin at a new source and called
1017  * cqasm_versionlex(). If so, then we have to assure
1018  * consistency between YY_CURRENT_BUFFER and our
1019  * globals. Here is the right place to do so, because
1020  * this is the first action (other than possibly a
1021  * back-up) that will match for the new input source.
1022  */
1023  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1024  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1025  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1026  }
1027 
1028  /* Note that here we test for yy_c_buf_p "<=" to the position
1029  * of the first EOB in the buffer, since yy_c_buf_p will
1030  * already have been incremented past the NUL character
1031  * (since all states make transitions on EOB to the
1032  * end-of-buffer state). Contrast this with the test
1033  * in input().
1034  */
1035  if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1036  { /* This was really a NUL. */
1037  yy_state_type yy_next_state;
1038 
1039  yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1040 
1041  yy_current_state = yy_get_previous_state( yyscanner );
1042 
1043  /* Okay, we're now positioned to make the NUL
1044  * transition. We couldn't have
1045  * yy_get_previous_state() go ahead and do it
1046  * for us because it doesn't know how to deal
1047  * with the possibility of jamming (and we don't
1048  * want to build jamming into it because then it
1049  * will run more slowly).
1050  */
1051 
1052  yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1053 
1054  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1055 
1056  if ( yy_next_state )
1057  {
1058  /* Consume the NUL. */
1059  yy_cp = ++yyg->yy_c_buf_p;
1060  yy_current_state = yy_next_state;
1061  goto yy_match;
1062  }
1063 
1064  else
1065  {
1066  yy_cp = yyg->yy_c_buf_p;
1067  goto yy_find_action;
1068  }
1069  }
1070 
1071  else switch ( yy_get_next_buffer( yyscanner ) )
1072  {
1073  case EOB_ACT_END_OF_FILE:
1074  {
1075  yyg->yy_did_buffer_switch_on_eof = 0;
1076 
1077  if ( cqasm_versionwrap(yyscanner ) )
1078  {
1079  /* Note: because we've taken care in
1080  * yy_get_next_buffer() to have set up
1081  * yytext, we can now set up
1082  * yy_c_buf_p so that if some total
1083  * hoser (like flex itself) wants to
1084  * call the scanner after we return the
1085  * YY_NULL, it'll still work - another
1086  * YY_NULL will get returned.
1087  */
1088  yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1089 
1090  yy_act = YY_STATE_EOF(YY_START);
1091  goto do_action;
1092  }
1093 
1094  else
1095  {
1096  if ( ! yyg->yy_did_buffer_switch_on_eof )
1097  YY_NEW_FILE;
1098  }
1099  break;
1100  }
1101 
1102  case EOB_ACT_CONTINUE_SCAN:
1103  yyg->yy_c_buf_p =
1104  yyg->yytext_ptr + yy_amount_of_matched_text;
1105 
1106  yy_current_state = yy_get_previous_state( yyscanner );
1107 
1108  yy_cp = yyg->yy_c_buf_p;
1109  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1110  goto yy_match;
1111 
1112  case EOB_ACT_LAST_MATCH:
1113  yyg->yy_c_buf_p =
1114  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1115 
1116  yy_current_state = yy_get_previous_state( yyscanner );
1117 
1118  yy_cp = yyg->yy_c_buf_p;
1119  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1120  goto yy_find_action;
1121  }
1122  break;
1123  }
1124 
1125  default:
1127  "fatal flex scanner internal error--no action found" );
1128  } /* end of action switch */
1129  } /* end of scanning one token */
1130  } /* end of user's declarations */
1131 } /* end of cqasm_versionlex */
1132 
1133 /* yy_get_next_buffer - try to read in a new buffer
1134  *
1135  * Returns a code representing an action:
1136  * EOB_ACT_LAST_MATCH -
1137  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1138  * EOB_ACT_END_OF_FILE - end of file
1139  */
1140 static int yy_get_next_buffer (yyscan_t yyscanner)
1141 {
1142  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1143  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1144  char *source = yyg->yytext_ptr;
1145  yy_size_t number_to_move, i;
1146  int ret_val;
1147 
1148  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1150  "fatal flex scanner internal error--end of buffer missed" );
1151 
1152  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1153  { /* Don't try to fill the buffer, so this is an EOF. */
1154  if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1155  {
1156  /* We matched a single character, the EOB, so
1157  * treat this as a final EOF.
1158  */
1159  return EOB_ACT_END_OF_FILE;
1160  }
1161 
1162  else
1163  {
1164  /* We matched some text prior to the EOB, first
1165  * process it.
1166  */
1167  return EOB_ACT_LAST_MATCH;
1168  }
1169  }
1170 
1171  /* Try to read more data. */
1172 
1173  /* First move last chars to start of buffer. */
1174  number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1175 
1176  for ( i = 0; i < number_to_move; ++i )
1177  *(dest++) = *(source++);
1178 
1179  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1180  /* don't do the read, it's not guaranteed to return an EOF,
1181  * just force an EOF
1182  */
1183  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1184 
1185  else
1186  {
1187  int num_to_read =
1188  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1189 
1190  while ( num_to_read <= 0 )
1191  { /* Not enough room in the buffer - grow it. */
1192 
1193  /* just a shorter name for the current buffer */
1194  YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1195 
1196  int yy_c_buf_p_offset =
1197  (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1198 
1199  if ( b->yy_is_our_buffer )
1200  {
1201  int new_size = b->yy_buf_size * 2;
1202 
1203  if ( new_size <= 0 )
1204  b->yy_buf_size += b->yy_buf_size / 8;
1205  else
1206  b->yy_buf_size *= 2;
1207 
1208  b->yy_ch_buf = (char *)
1209  /* Include room in for 2 EOB chars. */
1210  cqasm_versionrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1211  }
1212  else
1213  /* Can't grow it, we don't own it. */
1214  b->yy_ch_buf = NULL;
1215 
1216  if ( ! b->yy_ch_buf )
1218  "fatal error - scanner input buffer overflow" );
1219 
1220  yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1221 
1222  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1223  number_to_move - 1;
1224 
1225  }
1226 
1227  if ( num_to_read > YY_READ_BUF_SIZE )
1228  num_to_read = YY_READ_BUF_SIZE;
1229 
1230  /* Read in more data. */
1231  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1232  yyg->yy_n_chars, num_to_read );
1233 
1234  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1235  }
1236 
1237  if ( yyg->yy_n_chars == 0 )
1238  {
1239  if ( number_to_move == YY_MORE_ADJ )
1240  {
1241  ret_val = EOB_ACT_END_OF_FILE;
1242  cqasm_versionrestart(yyin ,yyscanner);
1243  }
1244 
1245  else
1246  {
1247  ret_val = EOB_ACT_LAST_MATCH;
1248  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1250  }
1251  }
1252 
1253  else
1254  ret_val = EOB_ACT_CONTINUE_SCAN;
1255 
1256  if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1257  /* Extend the array by 50%, plus the number we really need. */
1258  int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1259  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cqasm_versionrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1260  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1261  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1262  }
1263 
1264  yyg->yy_n_chars += number_to_move;
1267 
1268  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1269 
1270  return ret_val;
1271 }
1272 
1273 /* yy_get_previous_state - get the state just before the EOB char was reached */
1274 
1275  static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1276 {
1277  yy_state_type yy_current_state;
1278  char *yy_cp;
1279  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1280 
1281  yy_current_state = yyg->yy_start;
1282 
1283  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1284  {
1285  YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1286  if ( yy_accept[yy_current_state] )
1287  {
1288  yyg->yy_last_accepting_state = yy_current_state;
1290  }
1291  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1292  {
1293  yy_current_state = (int) yy_def[yy_current_state];
1294  if ( yy_current_state >= 53 )
1295  yy_c = yy_meta[(unsigned int) yy_c];
1296  }
1297  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1298  }
1299 
1300  return yy_current_state;
1301 }
1302 
1303 /* yy_try_NUL_trans - try to make a transition on the NUL character
1304  *
1305  * synopsis
1306  * next_state = yy_try_NUL_trans( current_state );
1307  */
1308  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1309 {
1310  int yy_is_jam;
1311  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1312  char *yy_cp = yyg->yy_c_buf_p;
1313 
1314  YY_CHAR yy_c = 1;
1315  if ( yy_accept[yy_current_state] )
1316  {
1317  yyg->yy_last_accepting_state = yy_current_state;
1319  }
1320  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1321  {
1322  yy_current_state = (int) yy_def[yy_current_state];
1323  if ( yy_current_state >= 53 )
1324  yy_c = yy_meta[(unsigned int) yy_c];
1325  }
1326  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1327  yy_is_jam = (yy_current_state == 52);
1328 
1329  (void)yyg;
1330  return yy_is_jam ? 0 : yy_current_state;
1331 }
1332 
1333 #ifndef YY_NO_UNPUT
1334 
1335 #endif
1336 
1337 #ifndef YY_NO_INPUT
1338 #ifdef __cplusplus
1339  static int yyinput (yyscan_t yyscanner)
1340 #else
1341  static int input (yyscan_t yyscanner)
1342 #endif
1343 
1344 {
1345  int c;
1346  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1347 
1348  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1349 
1350  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1351  {
1352  /* yy_c_buf_p now points to the character we want to return.
1353  * If this occurs *before* the EOB characters, then it's a
1354  * valid NUL; if not, then we've hit the end of the buffer.
1355  */
1356  if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1357  /* This was really a NUL. */
1358  *yyg->yy_c_buf_p = '\0';
1359 
1360  else
1361  { /* need more input */
1362  int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1363  ++yyg->yy_c_buf_p;
1364 
1365  switch ( yy_get_next_buffer( yyscanner ) )
1366  {
1367  case EOB_ACT_LAST_MATCH:
1368  /* This happens because yy_g_n_b()
1369  * sees that we've accumulated a
1370  * token and flags that we need to
1371  * try matching the token before
1372  * proceeding. But for input(),
1373  * there's no matching to consider.
1374  * So convert the EOB_ACT_LAST_MATCH
1375  * to EOB_ACT_END_OF_FILE.
1376  */
1377 
1378  /* Reset buffer status. */
1379  cqasm_versionrestart(yyin ,yyscanner);
1380 
1381  /*FALLTHROUGH*/
1382 
1383  case EOB_ACT_END_OF_FILE:
1384  {
1385  if ( cqasm_versionwrap(yyscanner ) )
1386  return 0;
1387 
1388  if ( ! yyg->yy_did_buffer_switch_on_eof )
1389  YY_NEW_FILE;
1390 #ifdef __cplusplus
1391  return yyinput(yyscanner);
1392 #else
1393  return input(yyscanner);
1394 #endif
1395  }
1396 
1397  case EOB_ACT_CONTINUE_SCAN:
1398  yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1399  break;
1400  }
1401  }
1402  }
1403 
1404  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1405  *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1406  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1407 
1408  if ( c == '\n' )
1409 
1410  do{ yylineno++;
1411  yycolumn=0;
1412  }while(0)
1413 ;
1414 
1415  return c;
1416 }
1417 #endif /* ifndef YY_NO_INPUT */
1418 
1424  void cqasm_versionrestart (FILE * input_file , yyscan_t yyscanner)
1425 {
1426  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1427 
1428  if ( ! YY_CURRENT_BUFFER ){
1429  cqasm_versionensure_buffer_stack (yyscanner);
1432  }
1433 
1434  cqasm_version_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1435  cqasm_version_load_buffer_state(yyscanner );
1436 }
1437 
1442  void cqasm_version_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1443 {
1444  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1445 
1446  /* TODO. We should be able to replace this entire function body
1447  * with
1448  * cqasm_versionpop_buffer_state();
1449  * cqasm_versionpush_buffer_state(new_buffer);
1450  */
1451  cqasm_versionensure_buffer_stack (yyscanner);
1452  if ( YY_CURRENT_BUFFER == new_buffer )
1453  return;
1454 
1455  if ( YY_CURRENT_BUFFER )
1456  {
1457  /* Flush out information for old buffer. */
1458  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1459  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1460  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1461  }
1462 
1463  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1464  cqasm_version_load_buffer_state(yyscanner );
1465 
1466  /* We don't actually know whether we did this switch during
1467  * EOF (cqasm_versionwrap()) processing, but the only time this flag
1468  * is looked at is after cqasm_versionwrap() is called, so it's safe
1469  * to go ahead and always set it.
1470  */
1471  yyg->yy_did_buffer_switch_on_eof = 1;
1472 }
1473 
1474 static void cqasm_version_load_buffer_state (yyscan_t yyscanner)
1475 {
1476  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1477  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1478  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1479  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1480  yyg->yy_hold_char = *yyg->yy_c_buf_p;
1481 }
1482 
1489  YY_BUFFER_STATE cqasm_version_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1490 {
1491  YY_BUFFER_STATE b;
1492 
1493  b = (YY_BUFFER_STATE) cqasm_versionalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1494  if ( ! b )
1495  YY_FATAL_ERROR( "out of dynamic memory in cqasm_version_create_buffer()" );
1496 
1497  b->yy_buf_size = (yy_size_t)size;
1498 
1499  /* yy_ch_buf has to be 2 characters longer than the size given because
1500  * we need to put in 2 end-of-buffer characters.
1501  */
1502  b->yy_ch_buf = (char *) cqasm_versionalloc(b->yy_buf_size + 2 ,yyscanner );
1503  if ( ! b->yy_ch_buf )
1504  YY_FATAL_ERROR( "out of dynamic memory in cqasm_version_create_buffer()" );
1505 
1506  b->yy_is_our_buffer = 1;
1507 
1508  cqasm_version_init_buffer(b,file ,yyscanner);
1509 
1510  return b;
1511 }
1512 
1517  void cqasm_version_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1518 {
1519  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1520 
1521  if ( ! b )
1522  return;
1523 
1524  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1526 
1527  if ( b->yy_is_our_buffer )
1528  cqasm_versionfree((void *) b->yy_ch_buf ,yyscanner );
1529 
1530  cqasm_versionfree((void *) b ,yyscanner );
1531 }
1532 
1533 /* Initializes or reinitializes a buffer.
1534  * This function is sometimes called more than once on the same buffer,
1535  * such as during a cqasm_versionrestart() or at EOF.
1536  */
1537  static void cqasm_version_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1538 
1539 {
1540  int oerrno = errno;
1541  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1542 
1543  cqasm_version_flush_buffer(b ,yyscanner);
1544 
1545  b->yy_input_file = file;
1546  b->yy_fill_buffer = 1;
1547 
1548  /* If b is the current buffer, then cqasm_version_init_buffer was _probably_
1549  * called from cqasm_versionrestart() or through yy_get_next_buffer.
1550  * In that case, we don't want to reset the lineno or column.
1551  */
1552  if (b != YY_CURRENT_BUFFER){
1553  b->yy_bs_lineno = 1;
1554  b->yy_bs_column = 0;
1555  }
1556 
1557  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1558 
1559  errno = oerrno;
1560 }
1561 
1566  void cqasm_version_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1567 {
1568  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1569  if ( ! b )
1570  return;
1571 
1572  b->yy_n_chars = 0;
1573 
1574  /* We always need two end-of-buffer characters. The first causes
1575  * a transition to the end-of-buffer state. The second causes
1576  * a jam in that state.
1577  */
1580 
1581  b->yy_buf_pos = &b->yy_ch_buf[0];
1582 
1583  b->yy_at_bol = 1;
1585 
1586  if ( b == YY_CURRENT_BUFFER )
1587  cqasm_version_load_buffer_state(yyscanner );
1588 }
1589 
1596 void cqasm_versionpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1597 {
1598  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1599  if (new_buffer == NULL)
1600  return;
1601 
1602  cqasm_versionensure_buffer_stack(yyscanner);
1603 
1604  /* This block is copied from cqasm_version_switch_to_buffer. */
1605  if ( YY_CURRENT_BUFFER )
1606  {
1607  /* Flush out information for old buffer. */
1608  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1609  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1610  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1611  }
1612 
1613  /* Only push if top exists. Otherwise, replace top. */
1614  if (YY_CURRENT_BUFFER)
1615  yyg->yy_buffer_stack_top++;
1616  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1617 
1618  /* copied from cqasm_version_switch_to_buffer. */
1619  cqasm_version_load_buffer_state(yyscanner );
1620  yyg->yy_did_buffer_switch_on_eof = 1;
1621 }
1622 
1628 {
1629  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1630  if (!YY_CURRENT_BUFFER)
1631  return;
1632 
1634  YY_CURRENT_BUFFER_LVALUE = NULL;
1635  if (yyg->yy_buffer_stack_top > 0)
1636  --yyg->yy_buffer_stack_top;
1637 
1638  if (YY_CURRENT_BUFFER) {
1639  cqasm_version_load_buffer_state(yyscanner );
1640  yyg->yy_did_buffer_switch_on_eof = 1;
1641  }
1642 }
1643 
1644 /* Allocates the stack if it does not exist.
1645  * Guarantees space for at least one push.
1646  */
1647 static void cqasm_versionensure_buffer_stack (yyscan_t yyscanner)
1648 {
1649  int num_to_alloc;
1650  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1651 
1652  if (!yyg->yy_buffer_stack) {
1653 
1654  /* First allocation is just for 2 elements, since we don't know if this
1655  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1656  * immediate realloc on the next call.
1657  */
1658  num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1660  (num_to_alloc * sizeof(struct yy_buffer_state*)
1661  , yyscanner);
1662  if ( ! yyg->yy_buffer_stack )
1663  YY_FATAL_ERROR( "out of dynamic memory in cqasm_versionensure_buffer_stack()" );
1664 
1665  memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1666 
1667  yyg->yy_buffer_stack_max = num_to_alloc;
1668  yyg->yy_buffer_stack_top = 0;
1669  return;
1670  }
1671 
1672  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1673 
1674  /* Increase the buffer to prepare for a possible push. */
1675  yy_size_t grow_size = 8 /* arbitrary grow size */;
1676 
1677  num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1679  (yyg->yy_buffer_stack,
1680  num_to_alloc * sizeof(struct yy_buffer_state*)
1681  , yyscanner);
1682  if ( ! yyg->yy_buffer_stack )
1683  YY_FATAL_ERROR( "out of dynamic memory in cqasm_versionensure_buffer_stack()" );
1684 
1685  /* zero only the new slots.*/
1686  memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1687  yyg->yy_buffer_stack_max = num_to_alloc;
1688  }
1689 }
1690 
1697 YY_BUFFER_STATE cqasm_version_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1698 {
1699  YY_BUFFER_STATE b;
1700 
1701  if ( size < 2 ||
1702  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1703  base[size-1] != YY_END_OF_BUFFER_CHAR )
1704  /* They forgot to leave room for the EOB's. */
1705  return NULL;
1706 
1707  b = (YY_BUFFER_STATE) cqasm_versionalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1708  if ( ! b )
1709  YY_FATAL_ERROR( "out of dynamic memory in cqasm_version_scan_buffer()" );
1710 
1711  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1712  b->yy_buf_pos = b->yy_ch_buf = base;
1713  b->yy_is_our_buffer = 0;
1714  b->yy_input_file = NULL;
1715  b->yy_n_chars = b->yy_buf_size;
1716  b->yy_is_interactive = 0;
1717  b->yy_at_bol = 1;
1718  b->yy_fill_buffer = 0;
1720 
1721  cqasm_version_switch_to_buffer(b ,yyscanner );
1722 
1723  return b;
1724 }
1725 
1734 YY_BUFFER_STATE cqasm_version_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1735 {
1736 
1737  return cqasm_version_scan_bytes(yystr,(int) strlen(yystr) ,yyscanner);
1738 }
1739 
1747 YY_BUFFER_STATE cqasm_version_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1748 {
1749  YY_BUFFER_STATE b;
1750  char *buf;
1751  yy_size_t n;
1752  yy_size_t i;
1753 
1754  /* Get memory for full buffer, including space for trailing EOB's. */
1755  n = (yy_size_t) _yybytes_len + 2;
1756  buf = (char *) cqasm_versionalloc(n ,yyscanner );
1757  if ( ! buf )
1758  YY_FATAL_ERROR( "out of dynamic memory in cqasm_version_scan_bytes()" );
1759 
1760  for ( i = 0; i < _yybytes_len; ++i )
1761  buf[i] = yybytes[i];
1762 
1763  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1764 
1765  b = cqasm_version_scan_buffer(buf,n ,yyscanner);
1766  if ( ! b )
1767  YY_FATAL_ERROR( "bad buffer in cqasm_version_scan_bytes()" );
1768 
1769  /* It's okay to grow etc. this buffer, and we should throw it
1770  * away when we're done.
1771  */
1772  b->yy_is_our_buffer = 1;
1773 
1774  return b;
1775 }
1776 
1777 #ifndef YY_EXIT_FAILURE
1778 #define YY_EXIT_FAILURE 2
1779 #endif
1780 
1781 static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1782 {
1783  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1784  (void)yyg;
1785  (void) fprintf( stderr, "%s\n", msg );
1786  exit( YY_EXIT_FAILURE );
1787 }
1788 
1789 /* Redefine yyless() so it works in section 3 code. */
1790 
1791 #undef yyless
1792 #define yyless(n) \
1793  do \
1794  { \
1795  /* Undo effects of setting up yytext. */ \
1796  int yyless_macro_arg = (n); \
1797  YY_LESS_LINENO(yyless_macro_arg);\
1798  yytext[yyleng] = yyg->yy_hold_char; \
1799  yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1800  yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1801  *yyg->yy_c_buf_p = '\0'; \
1802  yyleng = yyless_macro_arg; \
1803  } \
1804  while ( 0 )
1805 
1806 /* Accessor methods (get/set functions) to struct members. */
1807 
1812 {
1813  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1814  return yyextra;
1815 }
1816 
1821 {
1822  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1823 
1824  if (! YY_CURRENT_BUFFER)
1825  return 0;
1826 
1827  return yylineno;
1828 }
1829 
1834 {
1835  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1836 
1837  if (! YY_CURRENT_BUFFER)
1838  return 0;
1839 
1840  return yycolumn;
1841 }
1842 
1847 {
1848  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1849  return yyin;
1850 }
1851 
1856 {
1857  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1858  return yyout;
1859 }
1860 
1865 {
1866  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1867  return yyleng;
1868 }
1869 
1875 {
1876  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1877  return yytext;
1878 }
1879 
1884 void cqasm_versionset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1885 {
1886  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1887  yyextra = user_defined ;
1888 }
1889 
1894 void cqasm_versionset_lineno (int _line_number , yyscan_t yyscanner)
1895 {
1896  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1897 
1898  /* lineno is only valid if an input buffer exists. */
1899  if (! YY_CURRENT_BUFFER )
1900  YY_FATAL_ERROR( "cqasm_versionset_lineno called with no buffer" );
1901 
1902  yylineno = _line_number;
1903 }
1904 
1909 void cqasm_versionset_column (int _column_no , yyscan_t yyscanner)
1910 {
1911  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1912 
1913  /* column is only valid if an input buffer exists. */
1914  if (! YY_CURRENT_BUFFER )
1915  YY_FATAL_ERROR( "cqasm_versionset_column called with no buffer" );
1916 
1917  yycolumn = _column_no;
1918 }
1919 
1926 void cqasm_versionset_in (FILE * _in_str , yyscan_t yyscanner)
1927 {
1928  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1929  yyin = _in_str ;
1930 }
1931 
1932 void cqasm_versionset_out (FILE * _out_str , yyscan_t yyscanner)
1933 {
1934  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1935  yyout = _out_str ;
1936 }
1937 
1939 {
1940  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1941  return yy_flex_debug;
1942 }
1943 
1944 void cqasm_versionset_debug (int _bdebug , yyscan_t yyscanner)
1945 {
1946  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1947  yy_flex_debug = _bdebug ;
1948 }
1949 
1950 /* Accessor methods for yylval and yylloc */
1951 
1953 {
1954  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1955  return yylval;
1956 }
1957 
1958 void cqasm_versionset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
1959 {
1960  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1961  yylval = yylval_param;
1962 }
1963 
1965 {
1966  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1967  return yylloc;
1968 }
1969 
1970 void cqasm_versionset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
1971 {
1972  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1973  yylloc = yylloc_param;
1974 }
1975 
1976 /* User-visible API */
1977 
1978 /* cqasm_versionlex_init is special because it creates the scanner itself, so it is
1979  * the ONLY reentrant function that doesn't take the scanner as the last argument.
1980  * That's why we explicitly handle the declaration, instead of using our macros.
1981  */
1982 
1983 int cqasm_versionlex_init(yyscan_t* ptr_yy_globals)
1984 
1985 {
1986  if (ptr_yy_globals == NULL){
1987  errno = EINVAL;
1988  return 1;
1989  }
1990 
1991  *ptr_yy_globals = (yyscan_t) cqasm_versionalloc ( sizeof( struct yyguts_t ), NULL );
1992 
1993  if (*ptr_yy_globals == NULL){
1994  errno = ENOMEM;
1995  return 1;
1996  }
1997 
1998  /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
1999  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2000 
2001  return yy_init_globals ( *ptr_yy_globals );
2002 }
2003 
2004 /* cqasm_versionlex_init_extra has the same functionality as cqasm_versionlex_init, but follows the
2005  * convention of taking the scanner as the last argument. Note however, that
2006  * this is a *pointer* to a scanner, as it will be allocated by this call (and
2007  * is the reason, too, why this function also must handle its own declaration).
2008  * The user defined value in the first argument will be available to cqasm_versionalloc in
2009  * the yyextra field.
2010  */
2011 
2012 int cqasm_versionlex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2013 
2014 {
2015  struct yyguts_t dummy_yyguts;
2016 
2017  cqasm_versionset_extra (yy_user_defined, &dummy_yyguts);
2018 
2019  if (ptr_yy_globals == NULL){
2020  errno = EINVAL;
2021  return 1;
2022  }
2023 
2024  *ptr_yy_globals = (yyscan_t) cqasm_versionalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2025 
2026  if (*ptr_yy_globals == NULL){
2027  errno = ENOMEM;
2028  return 1;
2029  }
2030 
2031  /* By setting to 0xAA, we expose bugs in
2032  yy_init_globals. Leave at 0x00 for releases. */
2033  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2034 
2035  cqasm_versionset_extra (yy_user_defined, *ptr_yy_globals);
2036 
2037  return yy_init_globals ( *ptr_yy_globals );
2038 }
2039 
2040 static int yy_init_globals (yyscan_t yyscanner)
2041 {
2042  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2043  /* Initialization is the same as for the non-reentrant scanner.
2044  * This function is called from cqasm_versionlex_destroy(), so don't allocate here.
2045  */
2046 
2047  yyg->yy_buffer_stack = NULL;
2048  yyg->yy_buffer_stack_top = 0;
2049  yyg->yy_buffer_stack_max = 0;
2050  yyg->yy_c_buf_p = NULL;
2051  yyg->yy_init = 0;
2052  yyg->yy_start = 0;
2053 
2054  yyg->yy_start_stack_ptr = 0;
2055  yyg->yy_start_stack_depth = 0;
2056  yyg->yy_start_stack = NULL;
2057 
2058 /* Defined in main.c */
2059 #ifdef YY_STDINIT
2060  yyin = stdin;
2061  yyout = stdout;
2062 #else
2063  yyin = NULL;
2064  yyout = NULL;
2065 #endif
2066 
2067  /* For future reference: Set errno on error, since we are called by
2068  * cqasm_versionlex_init()
2069  */
2070  return 0;
2071 }
2072 
2073 /* cqasm_versionlex_destroy is for both reentrant and non-reentrant scanners. */
2075 {
2076  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2077 
2078  /* Pop the buffer stack, destroying each element. */
2079  while(YY_CURRENT_BUFFER){
2081  YY_CURRENT_BUFFER_LVALUE = NULL;
2082  cqasm_versionpop_buffer_state(yyscanner);
2083  }
2084 
2085  /* Destroy the stack itself. */
2086  cqasm_versionfree(yyg->yy_buffer_stack ,yyscanner);
2087  yyg->yy_buffer_stack = NULL;
2088 
2089  /* Destroy the start condition stack. */
2090  cqasm_versionfree(yyg->yy_start_stack ,yyscanner );
2091  yyg->yy_start_stack = NULL;
2092 
2093  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2094  * cqasm_versionlex() is called, initialization will occur. */
2095  yy_init_globals( yyscanner);
2096 
2097  /* Destroy the main struct (reentrant only). */
2098  cqasm_versionfree ( yyscanner , yyscanner );
2099  yyscanner = NULL;
2100  return 0;
2101 }
2102 
2103 /*
2104  * Internal utility routines.
2105  */
2106 
2107 #ifndef yytext_ptr
2108 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2109 {
2110  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2111  (void)yyg;
2112 
2113  int i;
2114  for ( i = 0; i < n; ++i )
2115  s1[i] = s2[i];
2116 }
2117 #endif
2118 
2119 #ifdef YY_NEED_STRLEN
2120 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2121 {
2122  int n;
2123  for ( n = 0; s[n]; ++n )
2124  ;
2125 
2126  return n;
2127 }
2128 #endif
2129 
2130 void *cqasm_versionalloc (yy_size_t size , yyscan_t yyscanner)
2131 {
2132  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2133  (void)yyg;
2134  return malloc(size);
2135 }
2136 
2137 void *cqasm_versionrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2138 {
2139  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2140  (void)yyg;
2141 
2142  /* The cast to (char *) in the following accommodates both
2143  * implementations that use char* generic pointers, and those
2144  * that use void* generic pointers. It works with the latter
2145  * because both ANSI C and C++ allow castless assignment from
2146  * any pointer type to void*, and deal with argument conversions
2147  * as though doing an assignment.
2148  */
2149  return realloc(ptr, size);
2150 }
2151 
2152 void cqasm_versionfree (void * ptr , yyscan_t yyscanner)
2153 {
2154  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2155  (void)yyg;
2156  free( (char *) ptr ); /* see cqasm_versionrealloc() for (char *) cast */
2157 }
2158 
2159 #define YYTABLES_NAME "yytables"
2160 
2161 #line 78 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/latest/src/cqasm/src/cqasm-version-lexer.l"
#define yynoreturn
int flex_int32_t
void cqasm_versionfree(void *, yyscan_t yyscanner)
int cqasm_versionget_debug(yyscan_t yyscanner)
size_t yy_buffer_stack_top
index of top of stack.
void cqasm_versionset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner)
unsigned char flex_uint8_t
int yy_start_stack_depth
void cqasm_versionset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner)
#define WITHOUT_STR(TOKNAME)
void cqasm_versionpop_buffer_state(yyscan_t yyscanner)
Removes and deletes the top of the stack, if present.
int yy_act
#define MODE_IGNORE_THE_REST
void cqasm_version_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Switch to a different input buffer.
#define yy_flex_debug
struct yyguts_t * yyg
unsigned int flex_uint32_t
#define yylloc
#define YY_RULE_SETUP
YYSTYPE * cqasm_versionget_lval(yyscan_t yyscanner)
#define MODE_VERSION
#define YY_DO_BEFORE_ACTION
void cqasm_versionset_column(int _column_no, yyscan_t yyscanner)
Set the current column.
void cqasm_versionpush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Pushes the new state onto the stack.
FILE * cqasm_versionget_in(yyscan_t yyscanner)
Get the input stream.
void cqasm_version_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Destroy the buffer.
#define YY_BUFFER_NORMAL
#define yylval
YY_BUFFER_STATE cqasm_version_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
Setup the input buffer state to scan directly from a user-specified character buffer.
int yy_bs_lineno
The line count.
void cqasm_versionset_in(FILE *_in_str, yyscan_t yyscanner)
Set the input stream.
#define yylineno
YY_EXTRA_TYPE cqasm_versionget_extra(yyscan_t yyscanner)
Get the user-defined data for this scanner.
#define YY_EXTRA_TYPE
#define DELETE
#define YY_STATE_EOF(state)
YY_BUFFER_STATE cqasm_version_scan_bytes(yyconst char *bytes, int len, yyscan_t yyscanner)
Setup the input buffer state to scan the given bytes.
size_t yy_size_t
YY_BUFFER_STATE cqasm_version_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Setup the input buffer state to scan a string.
size_t yy_buffer_stack_max
capacity of stack.
if(!yyg->yy_init)
#define YYLTYPE
unsigned short int flex_uint16_t
#define BEGIN
#define EOB_ACT_END_OF_FILE
void * cqasm_versionrealloc(void *, yy_size_t, yyscan_t yyscanner)
unsigned char YY_CHAR
#define YY_END_OF_BUFFER
unsigned short int flex_uint16_t
void cqasm_versionset_debug(int debug_flag, yyscan_t yyscanner)
#define EOB_ACT_CONTINUE_SCAN
#define YY_MORE_ADJ
int yy_state_type
#define yyextra
char * yy_c_buf_p
#define YY_START
#define yyout
#define YY_END_OF_BUFFER_CHAR
void * yyscan_t
#define yyin
int yy_did_buffer_switch_on_eof
void cqasm_versionset_lineno(int _line_number, yyscan_t yyscanner)
Set the current line number.
#define INITIAL
int yy_bs_column
The column count.
signed char flex_int8_t
char * yy_cp
#define YY_BREAK
#define YYSTYPE
#define MODE_MULTILINE_COMMENT
int cqasm_versionget_column(yyscan_t yyscanner)
Get the current column number.
#define yyconst
#define YY_SC_TO_UI(c)
#define YY_RESTORE_YY_MORE_OFFSET
void cqasm_versionset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
Set the user-defined data.
unsigned char YY_CHAR
#define EOB_ACT_LAST_MATCH
int yy_start_stack_ptr
int * yy_start_stack
char * yy_bp
struct yy_buffer_state * YY_BUFFER_STATE
int cqasm_versionlex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner)
void free(void *)
int cqasm_versionlex_destroy(yyscan_t yyscanner)
#define YY_EXIT_FAILURE
#define yytext
#define LOCATION_LINE
#define YY_FATAL_ERROR(msg)
yy_state_type yy_last_accepting_state
short int flex_int16_t
int cqasm_versionget_lineno(yyscan_t yyscanner)
Get the current line number.
int cqasm_versionlex_init(yyscan_t *scanner)
#define WITH_STR(TOKNAME)
#define LOCATION_STEP
#define YY_BUFFER_NEW
short int flex_int16_t
void cqasm_versionset_out(FILE *_out_str, yyscan_t yyscanner)
#define YY_READ_BUF_SIZE
int cqasm_versionlex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
#define YY_CURRENT_BUFFER_LVALUE
size_t yy_size_t
#define YY_CURRENT_BUFFER
#define YY_BUF_SIZE
#define yyleng
int yy_state_type
#define YY_NEW_FILE
#define cqasm_versionwrap(yyscanner)
char * cqasm_versionget_text(yyscan_t yyscanner)
Get the current token.
#define OPERATOR
YY_BUFFER_STATE cqasm_version_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Allocate and initialize an input buffer state.
FILE * cqasm_versionget_out(yyscan_t yyscanner)
Get the output stream.
void cqasm_versionrestart(FILE *input_file, yyscan_t yyscanner)
Immediately switch to a different input stream.
#define YY_DECL
void * cqasm_versionalloc(yy_size_t, yyscan_t yyscanner)
#define yyterminate()
int flex_int32_t
void * malloc(YYSIZE_T)
void * yyscan_t
YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
char * yy_last_accepting_cpos
void cqasm_version_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Discard all buffered characters.
YYLTYPE * cqasm_versionget_lloc(yyscan_t yyscanner)
#define YY_BUFFER_EOF_PENDING
#define yycolumn
int cqasm_versionget_leng(yyscan_t yyscanner)
Get the length of the current token.
#define YY_INPUT(buf, result, max_size)
Parser, generated by Bison.