libqasm
library for handling cQASM files
cqasm-v1-lexer.hpp
Go to the documentation of this file.
1 #ifndef cqasm_v1HEADER_H
2 #define cqasm_v1HEADER_H 1
3 #define cqasm_v1IN_HEADER 1
4 
5 #line 6 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/stable/cbuild/src/cqasm/cqasm-v1-lexer.hpp"
6 
7 #line 8 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/stable/cbuild/src/cqasm/cqasm-v1-lexer.hpp"
8 
9 #define YY_INT_ALIGNED short int
10 
11 /* A lexical scanner generated by flex */
12 
13 #define FLEX_SCANNER
14 #define YY_FLEX_MAJOR_VERSION 2
15 #define YY_FLEX_MINOR_VERSION 6
16 #define YY_FLEX_SUBMINOR_VERSION 1
17 #if YY_FLEX_SUBMINOR_VERSION > 0
18 #define FLEX_BETA
19 #endif
20 
21 /* First, we deal with platform-specific or compiler-specific issues. */
22 
23 /* begin standard C headers. */
24 #include <stdio.h>
25 #include <string.h>
26 #include <errno.h>
27 #include <stdlib.h>
28 
29 /* end standard C headers. */
30 
31 /* flex integer type definitions */
32 
33 #ifndef FLEXINT_H
34 #define FLEXINT_H
35 
36 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
37 
38 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
39 
40 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
41  * if you want the limit (max/min) macros for int types.
42  */
43 #ifndef __STDC_LIMIT_MACROS
44 #define __STDC_LIMIT_MACROS 1
45 #endif
46 
47 #include <inttypes.h>
48 typedef int8_t flex_int8_t;
49 typedef uint8_t flex_uint8_t;
50 typedef int16_t flex_int16_t;
51 typedef uint16_t flex_uint16_t;
52 typedef int32_t flex_int32_t;
53 typedef uint32_t flex_uint32_t;
54 #else
55 typedef signed char flex_int8_t;
56 typedef short int flex_int16_t;
57 typedef int flex_int32_t;
58 typedef unsigned char flex_uint8_t;
59 typedef unsigned short int flex_uint16_t;
60 typedef unsigned int flex_uint32_t;
61 
62 /* Limits of integral types. */
63 #ifndef INT8_MIN
64 #define INT8_MIN (-128)
65 #endif
66 #ifndef INT16_MIN
67 #define INT16_MIN (-32767-1)
68 #endif
69 #ifndef INT32_MIN
70 #define INT32_MIN (-2147483647-1)
71 #endif
72 #ifndef INT8_MAX
73 #define INT8_MAX (127)
74 #endif
75 #ifndef INT16_MAX
76 #define INT16_MAX (32767)
77 #endif
78 #ifndef INT32_MAX
79 #define INT32_MAX (2147483647)
80 #endif
81 #ifndef UINT8_MAX
82 #define UINT8_MAX (255U)
83 #endif
84 #ifndef UINT16_MAX
85 #define UINT16_MAX (65535U)
86 #endif
87 #ifndef UINT32_MAX
88 #define UINT32_MAX (4294967295U)
89 #endif
90 
91 #endif /* ! C99 */
92 
93 #endif /* ! FLEXINT_H */
94 
95 /* TODO: this is always defined, so inline it */
96 #define yyconst const
97 
98 #if defined(__GNUC__) && __GNUC__ >= 3
99 #define yynoreturn __attribute__((__noreturn__))
100 #else
101 #define yynoreturn
102 #endif
103 
104 /* An opaque pointer. */
105 #ifndef YY_TYPEDEF_YY_SCANNER_T
106 #define YY_TYPEDEF_YY_SCANNER_T
107 typedef void* yyscan_t;
108 #endif
109 
110 /* For convenience, these vars (plus the bison vars far below)
111  are macros in the reentrant scanner. */
112 #define yyin yyg->yyin_r
113 #define yyout yyg->yyout_r
114 #define yyextra yyg->yyextra_r
115 #define yyleng yyg->yyleng_r
116 #define yytext yyg->yytext_r
117 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
118 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
119 #define yy_flex_debug yyg->yy_flex_debug_r
120 
121 /* Size of default input buffer. */
122 #ifndef YY_BUF_SIZE
123 #ifdef __ia64__
124 /* On IA-64, the buffer size is 16k, not 8k.
125  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
126  * Ditto for the __ia64__ case accordingly.
127  */
128 #define YY_BUF_SIZE 32768
129 #else
130 #define YY_BUF_SIZE 16384
131 #endif /* __ia64__ */
132 #endif
133 
134 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
135 #define YY_TYPEDEF_YY_BUFFER_STATE
137 #endif
138 
139 #ifndef YY_TYPEDEF_YY_SIZE_T
140 #define YY_TYPEDEF_YY_SIZE_T
141 typedef size_t yy_size_t;
142 #endif
143 
144 #ifndef YY_STRUCT_YY_BUFFER_STATE
145 #define YY_STRUCT_YY_BUFFER_STATE
146 struct yy_buffer_state
147  {
148  FILE *yy_input_file;
149 
150  char *yy_ch_buf; /* input buffer */
151  char *yy_buf_pos; /* current position in input buffer */
152 
153  /* Size of input buffer in bytes, not including room for EOB
154  * characters.
155  */
156  int yy_buf_size;
157 
158  /* Number of characters read into yy_ch_buf, not including EOB
159  * characters.
160  */
161  int yy_n_chars;
162 
163  /* Whether we "own" the buffer - i.e., we know we created it,
164  * and can realloc() it to grow it, and should free() it to
165  * delete it.
166  */
167  int yy_is_our_buffer;
168 
169  /* Whether this is an "interactive" input source; if so, and
170  * if we're using stdio for input, then we want to use getc()
171  * instead of fread(), to make sure we stop fetching input after
172  * each newline.
173  */
174  int yy_is_interactive;
175 
176  /* Whether we're considered to be at the beginning of a line.
177  * If so, '^' rules will be active on the next match, otherwise
178  * not.
179  */
180  int yy_at_bol;
181 
182  int yy_bs_lineno;
183  int yy_bs_column;
185  /* Whether to try to fill the input buffer when we reach the
186  * end of it.
187  */
188  int yy_fill_buffer;
189 
190  int yy_buffer_status;
191 
192  };
193 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
194 
195 void cqasm_v1restart (FILE *input_file ,yyscan_t yyscanner );
196 void cqasm_v1_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
197 YY_BUFFER_STATE cqasm_v1_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
198 void cqasm_v1_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
199 void cqasm_v1_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
200 void cqasm_v1push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
201 void cqasm_v1pop_buffer_state (yyscan_t yyscanner );
202 
203 YY_BUFFER_STATE cqasm_v1_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
204 YY_BUFFER_STATE cqasm_v1_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
205 YY_BUFFER_STATE cqasm_v1_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
206 
207 void *cqasm_v1alloc (yy_size_t ,yyscan_t yyscanner );
208 void *cqasm_v1realloc (void *,yy_size_t ,yyscan_t yyscanner );
209 void cqasm_v1free (void * ,yyscan_t yyscanner );
210 
211 #define cqasm_v1wrap(yyscanner) (/*CONSTCOND*/1)
212 #define YY_SKIP_YYWRAP
213 
214 #define yytext_ptr yytext_r
215 
216 #ifdef YY_HEADER_EXPORT_START_CONDITIONS
217 #define INITIAL 0
218 #define MODE_MULTILINE_COMMENT 1
219 #define MODE_VERSION 2
220 #define MODE_STRING 3
221 #define MODE_JSON 4
222 #define MODE_JSON_STRING 5
223 #define MODE_UNEXPECTED_EOF 6
224 
225 #endif
226 
227 #ifndef YY_NO_UNISTD_H
228 /* Special case for "unistd.h", since it is non-ANSI. We include it way
229  * down here because we want the user's section 1 to have been scanned first.
230  * The user has a chance to override it with an option.
231  */
232 #include <unistd.h>
233 #endif
234 
235 #ifndef YY_EXTRA_TYPE
236 #define YY_EXTRA_TYPE void *
237 #endif
238 
239 int cqasm_v1lex_init (yyscan_t* scanner);
240 
241 int cqasm_v1lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
242 
243 /* Accessor methods to globals.
244  These are made visible to non-reentrant scanners for convenience. */
245 
246 int cqasm_v1lex_destroy (yyscan_t yyscanner );
247 
248 int cqasm_v1get_debug (yyscan_t yyscanner );
249 
250 void cqasm_v1set_debug (int debug_flag ,yyscan_t yyscanner );
251 
253 
254 void cqasm_v1set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
255 
256 FILE *cqasm_v1get_in (yyscan_t yyscanner );
257 
258 void cqasm_v1set_in (FILE * _in_str ,yyscan_t yyscanner );
259 
260 FILE *cqasm_v1get_out (yyscan_t yyscanner );
261 
262 void cqasm_v1set_out (FILE * _out_str ,yyscan_t yyscanner );
263 
264  int cqasm_v1get_leng (yyscan_t yyscanner );
265 
266 char *cqasm_v1get_text (yyscan_t yyscanner );
267 
268 int cqasm_v1get_lineno (yyscan_t yyscanner );
269 
270 void cqasm_v1set_lineno (int _line_number ,yyscan_t yyscanner );
271 
272 int cqasm_v1get_column (yyscan_t yyscanner );
273 
274 void cqasm_v1set_column (int _column_no ,yyscan_t yyscanner );
275 
276 YYSTYPE * cqasm_v1get_lval (yyscan_t yyscanner );
277 
278 void cqasm_v1set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
279 
280  YYLTYPE *cqasm_v1get_lloc (yyscan_t yyscanner );
281 
282  void cqasm_v1set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
283 
284 /* Macros after this point can all be overridden by user definitions in
285  * section 1.
286  */
287 
288 #ifndef YY_SKIP_YYWRAP
289 #ifdef __cplusplus
290 extern "C" int cqasm_v1wrap (yyscan_t yyscanner );
291 #else
292 extern int cqasm_v1wrap (yyscan_t yyscanner );
293 #endif
294 #endif
295 
296 #ifndef yytext_ptr
297 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
298 #endif
299 
300 #ifdef YY_NEED_STRLEN
301 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
302 #endif
303 
304 #ifndef YY_NO_INPUT
305 
306 #endif
307 
308 /* Amount of stuff to slurp up with each read. */
309 #ifndef YY_READ_BUF_SIZE
310 #ifdef __ia64__
311 /* On IA-64, the buffer size is 16k, not 8k */
312 #define YY_READ_BUF_SIZE 16384
313 #else
314 #define YY_READ_BUF_SIZE 8192
315 #endif /* __ia64__ */
316 #endif
317 
318 /* Number of entries by which start-condition stack grows. */
319 #ifndef YY_START_STACK_INCR
320 #define YY_START_STACK_INCR 25
321 #endif
322 
323 /* Default declaration of generated scanner - a define so the user can
324  * easily add parameters.
325  */
326 #ifndef YY_DECL
327 #define YY_DECL_IS_OURS 1
328 
329 extern int cqasm_v1lex \
330  (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
331 
332 #define YY_DECL int cqasm_v1lex \
333  (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
334 #endif /* !YY_DECL */
335 
336 /* yy_get_previous_state - get the state just before the EOB char was reached */
337 
338 #undef YY_NEW_FILE
339 #undef YY_FLUSH_BUFFER
340 #undef yy_set_bol
341 #undef yy_new_buffer
342 #undef yy_set_interactive
343 #undef YY_DO_BEFORE_ACTION
344 
345 #ifdef YY_DECL_IS_OURS
346 #undef YY_DECL_IS_OURS
347 #undef YY_DECL
348 #endif
349 
350 #line 233 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/stable/src/cqasm/src/cqasm-v1-lexer.l"
351 
352 #line 353 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/stable/cbuild/src/cqasm/cqasm-v1-lexer.hpp"
353 #undef cqasm_v1IN_HEADER
354 #endif /* cqasm_v1HEADER_H */
void cqasm_v1push_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Pushes the new state onto the stack.
char * cqasm_v1get_text(yyscan_t yyscanner)
Get the current token.
unsigned int flex_uint32_t
void cqasm_v1_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Discard all buffered characters.
void * cqasm_v1alloc(yy_size_t, yyscan_t yyscanner)
int flex_int32_t
YY_BUFFER_STATE cqasm_v1_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Setup the input buffer state to scan a string.
YY_BUFFER_STATE cqasm_v1_scan_bytes(yyconst char *bytes, int len, yyscan_t yyscanner)
Setup the input buffer state to scan the given bytes.
short int flex_int16_t
struct yy_buffer_state * YY_BUFFER_STATE
#define yyconst
int yy_bs_lineno
The line count.
YYSTYPE * cqasm_v1get_lval(yyscan_t yyscanner)
signed char flex_int8_t
#define YYLTYPE
void * yyscan_t
FILE * cqasm_v1get_out(yyscan_t yyscanner)
Get the output stream.
void cqasm_v1set_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
Set the user-defined data.
void * yyscan_t
int cqasm_v1lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
void cqasm_v1set_in(FILE *_in_str, yyscan_t yyscanner)
Set the input stream.
int yy_bs_column
The column count.
#define YYSTYPE
void cqasm_v1pop_buffer_state(yyscan_t yyscanner)
Removes and deletes the top of the stack, if present.
void * cqasm_v1realloc(void *, yy_size_t, yyscan_t yyscanner)
size_t yy_size_t
void cqasm_v1set_lval(YYSTYPE *yylval_param, yyscan_t yyscanner)
YY_BUFFER_STATE cqasm_v1_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Allocate and initialize an input buffer state.
int cqasm_v1get_column(yyscan_t yyscanner)
Get the current column number.
int cqasm_v1lex_destroy(yyscan_t yyscanner)
FILE * cqasm_v1get_in(yyscan_t yyscanner)
Get the input stream.
YY_EXTRA_TYPE cqasm_v1get_extra(yyscan_t yyscanner)
Get the user-defined data for this scanner.
void cqasm_v1set_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner)
void cqasm_v1restart(FILE *input_file, yyscan_t yyscanner)
Immediately switch to a different input stream.
int cqasm_v1get_lineno(yyscan_t yyscanner)
Get the current line number.
YY_BUFFER_STATE cqasm_v1_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.
size_t yy_size_t
void cqasm_v1free(void *, yyscan_t yyscanner)
unsigned char flex_uint8_t
YYLTYPE * cqasm_v1get_lloc(yyscan_t yyscanner)
void cqasm_v1_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Destroy the buffer.
void cqasm_v1_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Switch to a different input buffer.
unsigned short int flex_uint16_t
void cqasm_v1set_column(int _column_no, yyscan_t yyscanner)
Set the current column.
#define YY_EXTRA_TYPE
int cqasm_v1get_leng(yyscan_t yyscanner)
Get the length of the current token.
void cqasm_v1set_debug(int debug_flag, yyscan_t yyscanner)
int cqasm_v1lex_init(yyscan_t *scanner)
void cqasm_v1set_lineno(int _line_number, yyscan_t yyscanner)
Set the current line number.
void cqasm_v1set_out(FILE *_out_str, yyscan_t yyscanner)
int cqasm_v1get_debug(yyscan_t yyscanner)
int cqasm_v1lex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner)
#define cqasm_v1wrap(yyscanner)