libqasm
library for handling cQASM files
|
Parser, generated by Bison. More...
Go to the source code of this file.
Classes | |
union | CQASM_V1STYPE |
struct | CQASM_V1LTYPE |
union | yyalloc |
Macros | |
#define | YYBISON 1 |
#define | YYBISON_VERSION "3.0" |
#define | YYSKELETON_NAME "yacc.c" |
#define | YYPURE 2 |
#define | YYPUSH 0 |
#define | YYPULL 1 |
#define | ADD_SOURCE_LOCATION(v) |
Attaches a source location annotation object to the given node pointer. More... | |
#define | NEW(v, T) |
Constructs an empty, new node of type T and places it into v. More... | |
#define | FROM(t, s) |
Moves previously constructed node s into t, where s is almost always one of bison's input locations ($1, $2, etc) and t is almost always $$. More... | |
#define | YYSTYPE CQASM_V1STYPE |
#define | YYLTYPE CQASM_V1LTYPE |
#define | yyparse cqasm_v1parse |
#define | yylex cqasm_v1lex |
#define | yyerror cqasm_v1error |
#define | yydebug cqasm_v1debug |
#define | yynerrs cqasm_v1nerrs |
#define | YY_NULL 0 |
#define | YYERROR_VERBOSE 1 |
#define | YY_CQASM_V1_HOME_DOCS_CHECKOUTS_READTHEDOCS_ORG_USER_BUILDS_LIBQASM_CHECKOUTS_LATEST_CBUILD_SRC_CQASM_CQASM_V1_PARSER_HPP_INCLUDED |
#define | CQASM_V1DEBUG 0 |
#define | YYSTYPE CQASM_V1STYPE |
#define | YYLTYPE CQASM_V1LTYPE |
#define | CQASM_V1TOKENTYPE |
#define | CQASM_V1STYPE_IS_TRIVIAL 1 |
#define | CQASM_V1STYPE_IS_DECLARED 1 |
#define | CQASM_V1LTYPE_IS_DECLARED 1 |
#define | CQASM_V1LTYPE_IS_TRIVIAL 1 |
#define | YYSIZE_T size_t |
#define | YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
#define | YY_(Msgid) Msgid |
#define | __attribute__(Spec) /* empty */ |
#define | YYUSE(E) ((void) (E)) |
#define | YY_INITIAL_VALUE(Value) Value |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_END |
#define | YYSTACK_ALLOC YYMALLOC |
#define | YYSTACK_FREE YYFREE |
#define | YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define | YYMALLOC malloc |
#define | YYFREE free |
#define | YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
#define | YYSTACK_BYTES(N) |
#define | YYCOPY_NEEDED 1 |
#define | YYSTACK_RELOCATE(Stack_alloc, Stack) |
#define | YYCOPY(Dst, Src, Count) |
#define | YYFINAL 9 |
#define | YYLAST 2125 |
#define | YYNTOKENS 72 |
#define | YYNNTS 55 |
#define | YYNRULES 170 |
#define | YYNSTATES 328 |
#define | YYUNDEFTOK 2 |
#define | YYMAXUTOK 302 |
#define | YYTRANSLATE(YYX) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
#define | YYPACT_NINF -239 |
#define | yypact_value_is_default(Yystate) (!!((Yystate) == (-239))) |
#define | YYTABLE_NINF -137 |
#define | yytable_value_is_error(Yytable_value) 0 |
#define | yyerrok (yyerrstatus = 0) |
#define | yyclearin (yychar = YYEMPTY) |
#define | YYEMPTY (-2) |
#define | YYEOF 0 |
#define | YYACCEPT goto yyacceptlab |
#define | YYABORT goto yyabortlab |
#define | YYERROR goto yyerrorlab |
#define | YYRECOVERING() (!!yyerrstatus) |
#define | YYBACKUP(Token, Value) |
#define | YYTERROR 1 |
#define | YYERRCODE 256 |
#define | YYLLOC_DEFAULT(Current, Rhs, N) |
#define | YYRHSLOC(Rhs, K) ((Rhs)[K]) |
#define | YYDPRINTF(Args) |
#define | YY_SYMBOL_PRINT(Title, Type, Value, Location) |
#define | YY_STACK_PRINT(Bottom, Top) |
#define | YY_REDUCE_PRINT(Rule) |
#define | YYINITDEPTH 200 |
#define | YYMAXDEPTH 10000 |
#define | YYCASE_(N, S) |
#define | YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
#define | YYSYNTAX_ERROR |
Typedefs | |
typedef void * | yyscan_t |
typedef union CQASM_V1STYPE | CQASM_V1STYPE |
typedef struct CQASM_V1LTYPE | CQASM_V1LTYPE |
typedef unsigned char | yytype_uint8 |
typedef signed char | yytype_int8 |
typedef unsigned short int | yytype_uint16 |
typedef short int | yytype_int16 |
Enumerations | |
enum | cqasm_v1tokentype { NEWLINE = 258, VERSION = 259, QUBITS = 260, MAP = 261, VAR = 262, CDASH = 263, COND = 264, IF = 265, ELSE = 266, FOR = 267, FOREACH = 268, WHILE = 269, REPEAT = 270, UNTIL = 271, CONTINUE = 272, BREAK = 273, SET = 274, INT_LITERAL = 275, FLOAT_LITERAL = 276, BAD_NUMBER = 277, STRING_OPEN = 278, STRING_CLOSE = 279, JSON_OPEN = 280, JSON_CLOSE = 281, STRBUILD_APPEND = 282, STRBUILD_ESCAPE = 283, IDENTIFIER = 284, POWER = 285, INT_DIV = 286, LOGIC_OR = 287, LOGIC_AND = 288, LOGIC_XOR = 289, CMP_GE = 290, CMP_LE = 291, CMP_EQ = 292, CMP_NE = 293, SHL = 294, ARITH_SHR = 295, LOGIC_SHR = 296, ELLIPSIS = 297, BAD_CHARACTER = 298, END_OF_FILE = 299, UMINUS = 300, UCOMP = 301, UNOT = 302, NEWLINE = 258, VERSION = 259, QUBITS = 260, MAP = 261, VAR = 262, CDASH = 263, COND = 264, IF = 265, ELSE = 266, FOR = 267, FOREACH = 268, WHILE = 269, REPEAT = 270, UNTIL = 271, CONTINUE = 272, BREAK = 273, SET = 274, INT_LITERAL = 275, FLOAT_LITERAL = 276, BAD_NUMBER = 277, STRING_OPEN = 278, STRING_CLOSE = 279, JSON_OPEN = 280, JSON_CLOSE = 281, STRBUILD_APPEND = 282, STRBUILD_ESCAPE = 283, IDENTIFIER = 284, POWER = 285, INT_DIV = 286, LOGIC_OR = 287, LOGIC_AND = 288, LOGIC_XOR = 289, CMP_GE = 290, CMP_LE = 291, CMP_EQ = 292, CMP_NE = 293, SHL = 294, ARITH_SHR = 295, LOGIC_SHR = 296, ELLIPSIS = 297, BAD_CHARACTER = 298, END_OF_FILE = 299, UMINUS = 300, UCOMP = 301, UNOT = 302 } |
Functions | |
int | cqasm_v1parse (yyscan_t scanner, cqasm::v1::parser::ParseHelper &helper) |
int | yylex (YYSTYPE *yylvalp, YYLTYPE *yyllocp, yyscan_t scanner) |
void | yyerror (YYLTYPE *yyllocp, yyscan_t scanner, cqasm::v1::parser::ParseHelper &helper, const char *msg) |
void * | malloc (YYSIZE_T) |
void | free (void *) |
int | yyparse (yyscan_t scanner, cqasm::v1::parser::ParseHelper &helper) |
Parser, generated by Bison.
Definition in file cqasm-v1-parser.cpp.
#include <memory>
#include <cstdio>
#include <cstdint>
#include "cqasm-annotations.hpp"
#include "cqasm-v1-ast.hpp"
#include "cqasm-v1-parse-helper.hpp"
#include <stddef.h>
#define YYBISON 1 |
Definition at line 44 of file cqasm-v1-parser.cpp.
#define YYBISON_VERSION "3.0" |
Definition at line 47 of file cqasm-v1-parser.cpp.
#define YYSKELETON_NAME "yacc.c" |
Definition at line 50 of file cqasm-v1-parser.cpp.
#define YYPURE 2 |
Definition at line 53 of file cqasm-v1-parser.cpp.
#define YYPUSH 0 |
Definition at line 56 of file cqasm-v1-parser.cpp.
#define YYPULL 1 |
Definition at line 59 of file cqasm-v1-parser.cpp.
#define ADD_SOURCE_LOCATION | ( | v | ) |
Attaches a source location annotation object to the given node pointer.
Definition at line 68 of file cqasm-v1-parser.cpp.
#define NEW | ( | v, | |
T | |||
) |
Constructs an empty, new node of type T and places it into v.
v is almost always $$ (the result location), but it can't be made part of the definition because preprocessing happens after bison's substitution.
Definition at line 81 of file cqasm-v1-parser.cpp.
#define FROM | ( | t, | |
s | |||
) |
Moves previously constructed node s into t, where s is almost always one of bison's input locations ($1, $2, etc) and t is almost always $$.
The purpose of this over just assigning t = s is that it extends the source location annotation of the object to the extents of whatever rule is being matched.
Definition at line 92 of file cqasm-v1-parser.cpp.
#define YYSTYPE CQASM_V1STYPE |
Definition at line 172 of file cqasm-v1-parser.cpp.
#define YYLTYPE CQASM_V1LTYPE |
Definition at line 173 of file cqasm-v1-parser.cpp.
#define yyparse cqasm_v1parse |
Definition at line 110 of file cqasm-v1-parser.cpp.
#define yylex cqasm_v1lex |
Definition at line 111 of file cqasm-v1-parser.cpp.
#define yyerror cqasm_v1error |
Definition at line 112 of file cqasm-v1-parser.cpp.
#define yydebug cqasm_v1debug |
Definition at line 113 of file cqasm-v1-parser.cpp.
#define yynerrs cqasm_v1nerrs |
Definition at line 114 of file cqasm-v1-parser.cpp.
#define YY_NULL 0 |
Definition at line 125 of file cqasm-v1-parser.cpp.
#define YYERROR_VERBOSE 1 |
Definition at line 134 of file cqasm-v1-parser.cpp.
#define YY_CQASM_V1_HOME_DOCS_CHECKOUTS_READTHEDOCS_ORG_USER_BUILDS_LIBQASM_CHECKOUTS_LATEST_CBUILD_SRC_CQASM_CQASM_V1_PARSER_HPP_INCLUDED |
Definition at line 140 of file cqasm-v1-parser.cpp.
#define CQASM_V1DEBUG 0 |
Definition at line 150 of file cqasm-v1-parser.cpp.
#define YYSTYPE CQASM_V1STYPE |
Definition at line 172 of file cqasm-v1-parser.cpp.
#define YYLTYPE CQASM_V1LTYPE |
Definition at line 173 of file cqasm-v1-parser.cpp.
#define CQASM_V1TOKENTYPE |
Definition at line 180 of file cqasm-v1-parser.cpp.
#define CQASM_V1STYPE_IS_TRIVIAL 1 |
Definition at line 278 of file cqasm-v1-parser.cpp.
#define CQASM_V1STYPE_IS_DECLARED 1 |
Definition at line 279 of file cqasm-v1-parser.cpp.
#define CQASM_V1LTYPE_IS_DECLARED 1 |
Definition at line 292 of file cqasm-v1-parser.cpp.
#define CQASM_V1LTYPE_IS_TRIVIAL 1 |
Definition at line 293 of file cqasm-v1-parser.cpp.
#define YYSIZE_T size_t |
Definition at line 348 of file cqasm-v1-parser.cpp.
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
Definition at line 354 of file cqasm-v1-parser.cpp.
#define YY_ | ( | Msgid | ) | Msgid |
Definition at line 364 of file cqasm-v1-parser.cpp.
#define __attribute__ | ( | Spec | ) | /* empty */ |
Definition at line 372 of file cqasm-v1-parser.cpp.
#define YYUSE | ( | E | ) | ((void) (E)) |
Definition at line 378 of file cqasm-v1-parser.cpp.
#define YY_INITIAL_VALUE | ( | Value | ) | Value |
Definition at line 392 of file cqasm-v1-parser.cpp.
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
Definition at line 395 of file cqasm-v1-parser.cpp.
#define YY_IGNORE_MAYBE_UNINITIALIZED_END |
Definition at line 396 of file cqasm-v1-parser.cpp.
#define YYSTACK_ALLOC YYMALLOC |
Definition at line 442 of file cqasm-v1-parser.cpp.
#define YYSTACK_FREE YYFREE |
Definition at line 443 of file cqasm-v1-parser.cpp.
#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
Definition at line 445 of file cqasm-v1-parser.cpp.
#define YYMALLOC malloc |
Definition at line 456 of file cqasm-v1-parser.cpp.
#define YYFREE free |
Definition at line 462 of file cqasm-v1-parser.cpp.
#define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
Definition at line 485 of file cqasm-v1-parser.cpp.
#define YYSTACK_BYTES | ( | N | ) |
Definition at line 489 of file cqasm-v1-parser.cpp.
#define YYCOPY_NEEDED 1 |
Definition at line 493 of file cqasm-v1-parser.cpp.
#define YYSTACK_RELOCATE | ( | Stack_alloc, | |
Stack | |||
) |
Definition at line 500 of file cqasm-v1-parser.cpp.
#define YYCOPY | ( | Dst, | |
Src, | |||
Count | |||
) |
Definition at line 521 of file cqasm-v1-parser.cpp.
#define YYFINAL 9 |
Definition at line 534 of file cqasm-v1-parser.cpp.
#define YYLAST 2125 |
Definition at line 536 of file cqasm-v1-parser.cpp.
#define YYNTOKENS 72 |
Definition at line 539 of file cqasm-v1-parser.cpp.
#define YYNNTS 55 |
Definition at line 541 of file cqasm-v1-parser.cpp.
#define YYNRULES 170 |
Definition at line 543 of file cqasm-v1-parser.cpp.
#define YYNSTATES 328 |
Definition at line 545 of file cqasm-v1-parser.cpp.
#define YYUNDEFTOK 2 |
Definition at line 549 of file cqasm-v1-parser.cpp.
#define YYMAXUTOK 302 |
Definition at line 550 of file cqasm-v1-parser.cpp.
#define YYTRANSLATE | ( | YYX | ) | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
Definition at line 552 of file cqasm-v1-parser.cpp.
#define YYPACT_NINF -239 |
Definition at line 664 of file cqasm-v1-parser.cpp.
#define yypact_value_is_default | ( | Yystate | ) | (!!((Yystate) == (-239))) |
Definition at line 666 of file cqasm-v1-parser.cpp.
#define YYTABLE_NINF -137 |
Definition at line 669 of file cqasm-v1-parser.cpp.
#define yytable_value_is_error | ( | Yytable_value | ) | 0 |
Definition at line 671 of file cqasm-v1-parser.cpp.
#define yyerrok (yyerrstatus = 0) |
Definition at line 1298 of file cqasm-v1-parser.cpp.
#define yyclearin (yychar = YYEMPTY) |
Definition at line 1299 of file cqasm-v1-parser.cpp.
#define YYEMPTY (-2) |
Definition at line 1300 of file cqasm-v1-parser.cpp.
#define YYEOF 0 |
Definition at line 1301 of file cqasm-v1-parser.cpp.
#define YYACCEPT goto yyacceptlab |
Definition at line 1303 of file cqasm-v1-parser.cpp.
#define YYABORT goto yyabortlab |
Definition at line 1304 of file cqasm-v1-parser.cpp.
#define YYERROR goto yyerrorlab |
Definition at line 1305 of file cqasm-v1-parser.cpp.
#define YYRECOVERING | ( | ) | (!!yyerrstatus) |
Definition at line 1308 of file cqasm-v1-parser.cpp.
#define YYBACKUP | ( | Token, | |
Value | |||
) |
Definition at line 1310 of file cqasm-v1-parser.cpp.
#define YYTERROR 1 |
Definition at line 1328 of file cqasm-v1-parser.cpp.
#define YYERRCODE 256 |
Definition at line 1329 of file cqasm-v1-parser.cpp.
#define YYLLOC_DEFAULT | ( | Current, | |
Rhs, | |||
N | |||
) |
Definition at line 1337 of file cqasm-v1-parser.cpp.
#define YYRHSLOC | ( | Rhs, | |
K | |||
) | ((Rhs)[K]) |
Definition at line 1356 of file cqasm-v1-parser.cpp.
#define YYDPRINTF | ( | Args | ) |
Definition at line 1526 of file cqasm-v1-parser.cpp.
#define YY_SYMBOL_PRINT | ( | Title, | |
Type, | |||
Value, | |||
Location | |||
) |
Definition at line 1527 of file cqasm-v1-parser.cpp.
#define YY_STACK_PRINT | ( | Bottom, | |
Top | |||
) |
Definition at line 1528 of file cqasm-v1-parser.cpp.
#define YY_REDUCE_PRINT | ( | Rule | ) |
Definition at line 1529 of file cqasm-v1-parser.cpp.
#define YYINITDEPTH 200 |
Definition at line 1535 of file cqasm-v1-parser.cpp.
#define YYMAXDEPTH 10000 |
Definition at line 1546 of file cqasm-v1-parser.cpp.
#define YYCASE_ | ( | N, | |
S | |||
) |
#define YYPOPSTACK | ( | N | ) | (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
#define YYSYNTAX_ERROR |
typedef void* yyscan_t |
Definition at line 170 of file cqasm-v1-parser.cpp.
typedef union CQASM_V1STYPE CQASM_V1STYPE |
Definition at line 233 of file cqasm-v1-parser.cpp.
typedef struct CQASM_V1LTYPE CQASM_V1LTYPE |
Definition at line 284 of file cqasm-v1-parser.cpp.
typedef unsigned char yytype_uint8 |
Definition at line 320 of file cqasm-v1-parser.cpp.
typedef signed char yytype_int8 |
Definition at line 326 of file cqasm-v1-parser.cpp.
typedef unsigned short int yytype_uint16 |
Definition at line 332 of file cqasm-v1-parser.cpp.
typedef short int yytype_int16 |
Definition at line 338 of file cqasm-v1-parser.cpp.
enum cqasm_v1tokentype |
Definition at line 181 of file cqasm-v1-parser.cpp.
int cqasm_v1parse | ( | yyscan_t | scanner, |
cqasm::v1::parser::ParseHelper & | helper | ||
) |
void yyerror | ( | YYLTYPE * | yyllocp, |
yyscan_t | scanner, | ||
cqasm::v1::parser::ParseHelper & | helper, | ||
const char * | msg | ||
) |
Definition at line 3360 of file cqasm-v1-parser.cpp.
void* malloc | ( | YYSIZE_T | ) |
void free | ( | void * | ) |
int yyparse | ( | yyscan_t | scanner, |
cqasm::v1::parser::ParseHelper & | helper | ||
) |
Definition at line 1800 of file cqasm-v1-parser.cpp.