libqasm
library for handling cQASM files
|
Go to the source code of this file.
Classes | |
struct | yy_buffer_state |
Macros | |
#define | cqasm_v1IN_HEADER 1 |
#define | YY_INT_ALIGNED short int |
#define | FLEX_SCANNER |
#define | YY_FLEX_MAJOR_VERSION 2 |
#define | YY_FLEX_MINOR_VERSION 6 |
#define | YY_FLEX_SUBMINOR_VERSION 1 |
#define | FLEX_BETA |
#define | FLEXINT_H |
#define | INT8_MIN (-128) |
#define | INT16_MIN (-32767-1) |
#define | INT32_MIN (-2147483647-1) |
#define | INT8_MAX (127) |
#define | INT16_MAX (32767) |
#define | INT32_MAX (2147483647) |
#define | UINT8_MAX (255U) |
#define | UINT16_MAX (65535U) |
#define | UINT32_MAX (4294967295U) |
#define | yyconst const |
#define | yynoreturn |
#define | YY_TYPEDEF_YY_SCANNER_T |
#define | yyin yyg->yyin_r |
#define | yyout yyg->yyout_r |
#define | yyextra yyg->yyextra_r |
#define | yyleng yyg->yyleng_r |
#define | yytext yyg->yytext_r |
#define | yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
#define | yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
#define | yy_flex_debug yyg->yy_flex_debug_r |
#define | YY_BUF_SIZE 16384 |
#define | YY_TYPEDEF_YY_BUFFER_STATE |
#define | YY_TYPEDEF_YY_SIZE_T |
#define | YY_STRUCT_YY_BUFFER_STATE |
#define | cqasm_v1wrap(yyscanner) (/*CONSTCOND*/1) |
#define | YY_SKIP_YYWRAP |
#define | yytext_ptr yytext_r |
#define | YY_EXTRA_TYPE void * |
#define | YY_READ_BUF_SIZE 8192 |
#define | YY_START_STACK_INCR 25 |
#define | YY_DECL_IS_OURS 1 |
#define | YY_DECL |
Typedefs | |
typedef signed char | flex_int8_t |
typedef short int | flex_int16_t |
typedef int | flex_int32_t |
typedef unsigned char | flex_uint8_t |
typedef unsigned short int | flex_uint16_t |
typedef unsigned int | flex_uint32_t |
typedef void * | yyscan_t |
typedef struct yy_buffer_state * | YY_BUFFER_STATE |
typedef size_t | yy_size_t |
Functions | |
void | cqasm_v1restart (FILE *input_file, yyscan_t yyscanner) |
Immediately switch to a different input stream. More... | |
void | cqasm_v1_switch_to_buffer (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) |
Switch to a different input buffer. More... | |
YY_BUFFER_STATE | cqasm_v1_create_buffer (FILE *file, int size, yyscan_t yyscanner) |
Allocate and initialize an input buffer state. More... | |
void | cqasm_v1_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner) |
Destroy the buffer. More... | |
void | cqasm_v1_flush_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner) |
Discard all buffered characters. More... | |
void | cqasm_v1push_buffer_state (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) |
Pushes the new state onto the stack. More... | |
void | cqasm_v1pop_buffer_state (yyscan_t yyscanner) |
Removes and deletes the top of the stack, if present. More... | |
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. More... | |
YY_BUFFER_STATE | cqasm_v1_scan_string (yyconst char *yy_str, yyscan_t yyscanner) |
Setup the input buffer state to scan a string. More... | |
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. More... | |
void * | cqasm_v1alloc (yy_size_t, yyscan_t yyscanner) |
void * | cqasm_v1realloc (void *, yy_size_t, yyscan_t yyscanner) |
void | cqasm_v1free (void *, yyscan_t yyscanner) |
int | cqasm_v1lex_init (yyscan_t *scanner) |
int | cqasm_v1lex_init_extra (YY_EXTRA_TYPE user_defined, yyscan_t *scanner) |
int | cqasm_v1lex_destroy (yyscan_t yyscanner) |
int | cqasm_v1get_debug (yyscan_t yyscanner) |
void | cqasm_v1set_debug (int debug_flag, yyscan_t yyscanner) |
YY_EXTRA_TYPE | cqasm_v1get_extra (yyscan_t yyscanner) |
Get the user-defined data for this scanner. More... | |
void | cqasm_v1set_extra (YY_EXTRA_TYPE user_defined, yyscan_t yyscanner) |
Set the user-defined data. More... | |
FILE * | cqasm_v1get_in (yyscan_t yyscanner) |
Get the input stream. More... | |
void | cqasm_v1set_in (FILE *_in_str, yyscan_t yyscanner) |
Set the input stream. More... | |
FILE * | cqasm_v1get_out (yyscan_t yyscanner) |
Get the output stream. More... | |
void | cqasm_v1set_out (FILE *_out_str, yyscan_t yyscanner) |
int | cqasm_v1get_leng (yyscan_t yyscanner) |
Get the length of the current token. More... | |
char * | cqasm_v1get_text (yyscan_t yyscanner) |
Get the current token. More... | |
int | cqasm_v1get_lineno (yyscan_t yyscanner) |
Get the current line number. More... | |
void | cqasm_v1set_lineno (int _line_number, yyscan_t yyscanner) |
Set the current line number. More... | |
int | cqasm_v1get_column (yyscan_t yyscanner) |
Get the current column number. More... | |
void | cqasm_v1set_column (int _column_no, yyscan_t yyscanner) |
Set the current column. More... | |
YYSTYPE * | cqasm_v1get_lval (yyscan_t yyscanner) |
void | cqasm_v1set_lval (YYSTYPE *yylval_param, yyscan_t yyscanner) |
YYLTYPE * | cqasm_v1get_lloc (yyscan_t yyscanner) |
void | cqasm_v1set_lloc (YYLTYPE *yylloc_param, yyscan_t yyscanner) |
int | cqasm_v1lex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner) |
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#define cqasm_v1IN_HEADER 1 |
Definition at line 3 of file cqasm-v1-lexer.hpp.
#define YY_INT_ALIGNED short int |
Definition at line 9 of file cqasm-v1-lexer.hpp.
#define FLEX_SCANNER |
Definition at line 13 of file cqasm-v1-lexer.hpp.
#define YY_FLEX_MAJOR_VERSION 2 |
Definition at line 14 of file cqasm-v1-lexer.hpp.
#define YY_FLEX_MINOR_VERSION 6 |
Definition at line 15 of file cqasm-v1-lexer.hpp.
#define YY_FLEX_SUBMINOR_VERSION 1 |
Definition at line 16 of file cqasm-v1-lexer.hpp.
#define FLEX_BETA |
Definition at line 18 of file cqasm-v1-lexer.hpp.
#define FLEXINT_H |
Definition at line 34 of file cqasm-v1-lexer.hpp.
#define INT8_MIN (-128) |
Definition at line 64 of file cqasm-v1-lexer.hpp.
#define INT16_MIN (-32767-1) |
Definition at line 67 of file cqasm-v1-lexer.hpp.
#define INT32_MIN (-2147483647-1) |
Definition at line 70 of file cqasm-v1-lexer.hpp.
#define INT8_MAX (127) |
Definition at line 73 of file cqasm-v1-lexer.hpp.
#define INT16_MAX (32767) |
Definition at line 76 of file cqasm-v1-lexer.hpp.
#define INT32_MAX (2147483647) |
Definition at line 79 of file cqasm-v1-lexer.hpp.
#define UINT8_MAX (255U) |
Definition at line 82 of file cqasm-v1-lexer.hpp.
#define UINT16_MAX (65535U) |
Definition at line 85 of file cqasm-v1-lexer.hpp.
#define UINT32_MAX (4294967295U) |
Definition at line 88 of file cqasm-v1-lexer.hpp.
#define yyconst const |
Definition at line 96 of file cqasm-v1-lexer.hpp.
#define yynoreturn |
Definition at line 101 of file cqasm-v1-lexer.hpp.
#define YY_TYPEDEF_YY_SCANNER_T |
Definition at line 106 of file cqasm-v1-lexer.hpp.
#define yyin yyg->yyin_r |
Definition at line 112 of file cqasm-v1-lexer.hpp.
#define yyout yyg->yyout_r |
Definition at line 113 of file cqasm-v1-lexer.hpp.
#define yyextra yyg->yyextra_r |
Definition at line 114 of file cqasm-v1-lexer.hpp.
#define yyleng yyg->yyleng_r |
Definition at line 115 of file cqasm-v1-lexer.hpp.
#define yytext yyg->yytext_r |
Definition at line 116 of file cqasm-v1-lexer.hpp.
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
Definition at line 117 of file cqasm-v1-lexer.hpp.
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
Definition at line 118 of file cqasm-v1-lexer.hpp.
#define yy_flex_debug yyg->yy_flex_debug_r |
Definition at line 119 of file cqasm-v1-lexer.hpp.
#define YY_BUF_SIZE 16384 |
Definition at line 130 of file cqasm-v1-lexer.hpp.
#define YY_TYPEDEF_YY_BUFFER_STATE |
Definition at line 135 of file cqasm-v1-lexer.hpp.
#define YY_TYPEDEF_YY_SIZE_T |
Definition at line 140 of file cqasm-v1-lexer.hpp.
#define YY_STRUCT_YY_BUFFER_STATE |
Definition at line 145 of file cqasm-v1-lexer.hpp.
#define cqasm_v1wrap | ( | yyscanner | ) | (/*CONSTCOND*/1) |
Definition at line 211 of file cqasm-v1-lexer.hpp.
#define YY_SKIP_YYWRAP |
Definition at line 212 of file cqasm-v1-lexer.hpp.
#define yytext_ptr yytext_r |
Definition at line 214 of file cqasm-v1-lexer.hpp.
#define YY_EXTRA_TYPE void * |
Definition at line 236 of file cqasm-v1-lexer.hpp.
#define YY_READ_BUF_SIZE 8192 |
Definition at line 314 of file cqasm-v1-lexer.hpp.
#define YY_START_STACK_INCR 25 |
Definition at line 320 of file cqasm-v1-lexer.hpp.
#define YY_DECL_IS_OURS 1 |
Definition at line 327 of file cqasm-v1-lexer.hpp.
#define YY_DECL |
Definition at line 332 of file cqasm-v1-lexer.hpp.
typedef signed char flex_int8_t |
Definition at line 55 of file cqasm-v1-lexer.hpp.
typedef short int flex_int16_t |
Definition at line 56 of file cqasm-v1-lexer.hpp.
typedef int flex_int32_t |
Definition at line 57 of file cqasm-v1-lexer.hpp.
typedef unsigned char flex_uint8_t |
Definition at line 58 of file cqasm-v1-lexer.hpp.
typedef unsigned short int flex_uint16_t |
Definition at line 59 of file cqasm-v1-lexer.hpp.
typedef unsigned int flex_uint32_t |
Definition at line 60 of file cqasm-v1-lexer.hpp.
typedef void* yyscan_t |
Definition at line 107 of file cqasm-v1-lexer.hpp.
typedef struct yy_buffer_state* YY_BUFFER_STATE |
Definition at line 136 of file cqasm-v1-lexer.hpp.
typedef size_t yy_size_t |
Definition at line 141 of file cqasm-v1-lexer.hpp.
void cqasm_v1restart | ( | FILE * | input_file, |
yyscan_t | yyscanner | ||
) |
Immediately switch to a different input stream.
input_file | A readable stream. |
yyscanner | The scanner object. |
INITIAL
. Definition at line 1880 of file cqasm-v1-lexer.cpp.
void cqasm_v1_switch_to_buffer | ( | YY_BUFFER_STATE | new_buffer, |
yyscan_t | yyscanner | ||
) |
Switch to a different input buffer.
new_buffer | The new input buffer. |
yyscanner | The scanner object. |
Definition at line 1898 of file cqasm-v1-lexer.cpp.
YY_BUFFER_STATE cqasm_v1_create_buffer | ( | FILE * | file, |
int | size, | ||
yyscan_t | yyscanner | ||
) |
Allocate and initialize an input buffer state.
file | A readable stream. |
size | The character buffer size in bytes. When in doubt, use YY_BUF_SIZE . |
yyscanner | The scanner object. |
Definition at line 1945 of file cqasm-v1-lexer.cpp.
void cqasm_v1_delete_buffer | ( | YY_BUFFER_STATE | b, |
yyscan_t | yyscanner | ||
) |
Destroy the buffer.
b | a buffer created with cqasm_v1_create_buffer() |
yyscanner | The scanner object. |
Definition at line 1973 of file cqasm-v1-lexer.cpp.
void cqasm_v1_flush_buffer | ( | YY_BUFFER_STATE | b, |
yyscan_t | yyscanner | ||
) |
Discard all buffered characters.
On the next scan, YY_INPUT will be called.
b | the buffer state to be flushed, usually YY_CURRENT_BUFFER . |
yyscanner | The scanner object. |
Definition at line 2022 of file cqasm-v1-lexer.cpp.
void cqasm_v1push_buffer_state | ( | YY_BUFFER_STATE | new_buffer, |
yyscan_t | yyscanner | ||
) |
Pushes the new state onto the stack.
The new state becomes the current state. This function will allocate the stack if necessary.
new_buffer | The new state. |
yyscanner | The scanner object. |
Definition at line 2052 of file cqasm-v1-lexer.cpp.
void cqasm_v1pop_buffer_state | ( | yyscan_t | yyscanner | ) |
Removes and deletes the top of the stack, if present.
The next element becomes the new top.
yyscanner | The scanner object. |
Definition at line 2083 of file cqasm-v1-lexer.cpp.
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.
base | the character buffer |
size | the size in bytes of the character buffer |
yyscanner | The scanner object. |
Definition at line 2153 of file cqasm-v1-lexer.cpp.
YY_BUFFER_STATE cqasm_v1_scan_string | ( | yyconst char * | yystr, |
yyscan_t | yyscanner | ||
) |
Setup the input buffer state to scan a string.
The next call to cqasm_v1lex() will scan from a copy of str.
yystr | a NUL-terminated string to scan |
yyscanner | The scanner object. |
Definition at line 2190 of file cqasm-v1-lexer.cpp.
YY_BUFFER_STATE cqasm_v1_scan_bytes | ( | yyconst char * | yybytes, |
int | _yybytes_len, | ||
yyscan_t | yyscanner | ||
) |
Setup the input buffer state to scan the given bytes.
The next call to cqasm_v1lex() will scan from a copy of bytes.
yybytes | the byte buffer to scan |
_yybytes_len | the number of bytes in the buffer pointed to by bytes. |
yyscanner | The scanner object. |
Definition at line 2203 of file cqasm-v1-lexer.cpp.
Definition at line 2586 of file cqasm-v1-lexer.cpp.
Definition at line 2593 of file cqasm-v1-lexer.cpp.
void cqasm_v1free | ( | void * | , |
yyscan_t | yyscanner | ||
) |
Definition at line 2608 of file cqasm-v1-lexer.cpp.
int cqasm_v1lex_init | ( | yyscan_t * | scanner | ) |
Definition at line 2439 of file cqasm-v1-lexer.cpp.
int cqasm_v1lex_init_extra | ( | YY_EXTRA_TYPE | user_defined, |
yyscan_t * | scanner | ||
) |
Definition at line 2468 of file cqasm-v1-lexer.cpp.
int cqasm_v1lex_destroy | ( | yyscan_t | yyscanner | ) |
Definition at line 2530 of file cqasm-v1-lexer.cpp.
int cqasm_v1get_debug | ( | yyscan_t | yyscanner | ) |
Definition at line 2394 of file cqasm-v1-lexer.cpp.
void cqasm_v1set_debug | ( | int | debug_flag, |
yyscan_t | yyscanner | ||
) |
Definition at line 2400 of file cqasm-v1-lexer.cpp.
YY_EXTRA_TYPE cqasm_v1get_extra | ( | yyscan_t | yyscanner | ) |
Get the user-defined data for this scanner.
yyscanner | The scanner object. |
Definition at line 2267 of file cqasm-v1-lexer.cpp.
void cqasm_v1set_extra | ( | YY_EXTRA_TYPE | user_defined, |
yyscan_t | yyscanner | ||
) |
Set the user-defined data.
This data is never touched by the scanner.
user_defined | The data to be associated with this scanner. |
yyscanner | The scanner object. |
Definition at line 2340 of file cqasm-v1-lexer.cpp.
FILE* cqasm_v1get_in | ( | yyscan_t | yyscanner | ) |
Get the input stream.
yyscanner | The scanner object. |
Definition at line 2302 of file cqasm-v1-lexer.cpp.
void cqasm_v1set_in | ( | FILE * | _in_str, |
yyscan_t | yyscanner | ||
) |
Set the input stream.
This does not discard the current input buffer.
_in_str | A readable stream. |
yyscanner | The scanner object. |
Definition at line 2382 of file cqasm-v1-lexer.cpp.
FILE* cqasm_v1get_out | ( | yyscan_t | yyscanner | ) |
Get the output stream.
yyscanner | The scanner object. |
Definition at line 2311 of file cqasm-v1-lexer.cpp.
void cqasm_v1set_out | ( | FILE * | _out_str, |
yyscan_t | yyscanner | ||
) |
Definition at line 2388 of file cqasm-v1-lexer.cpp.
int cqasm_v1get_leng | ( | yyscan_t | yyscanner | ) |
Get the length of the current token.
yyscanner | The scanner object. |
Definition at line 2320 of file cqasm-v1-lexer.cpp.
char* cqasm_v1get_text | ( | yyscan_t | yyscanner | ) |
Get the current token.
yyscanner | The scanner object. |
Definition at line 2330 of file cqasm-v1-lexer.cpp.
int cqasm_v1get_lineno | ( | yyscan_t | yyscanner | ) |
Get the current line number.
yyscanner | The scanner object. |
Definition at line 2276 of file cqasm-v1-lexer.cpp.
void cqasm_v1set_lineno | ( | int | _line_number, |
yyscan_t | yyscanner | ||
) |
Set the current line number.
_line_number | line number |
yyscanner | The scanner object. |
Definition at line 2350 of file cqasm-v1-lexer.cpp.
int cqasm_v1get_column | ( | yyscan_t | yyscanner | ) |
Get the current column number.
yyscanner | The scanner object. |
Definition at line 2289 of file cqasm-v1-lexer.cpp.
void cqasm_v1set_column | ( | int | _column_no, |
yyscan_t | yyscanner | ||
) |
Set the current column.
_column_no | column number |
yyscanner | The scanner object. |
Definition at line 2365 of file cqasm-v1-lexer.cpp.
Definition at line 2408 of file cqasm-v1-lexer.cpp.
Definition at line 2414 of file cqasm-v1-lexer.cpp.
Definition at line 2420 of file cqasm-v1-lexer.cpp.
Definition at line 2426 of file cqasm-v1-lexer.cpp.