libqasm
library for handling cQASM files
cqasm-version-parser.hpp
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0. */
2 
3 /* Bison interface for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 #ifndef YY_CQASM_VERSION_HOME_DOCS_CHECKOUTS_READTHEDOCS_ORG_USER_BUILDS_LIBQASM_CHECKOUTS_STABLE_CBUILD_SRC_CQASM_CQASM_VERSION_PARSER_HPP_INCLUDED
34 # define YY_CQASM_VERSION_HOME_DOCS_CHECKOUTS_READTHEDOCS_ORG_USER_BUILDS_LIBQASM_CHECKOUTS_STABLE_CBUILD_SRC_CQASM_CQASM_VERSION_PARSER_HPP_INCLUDED
35 /* Debug traces. */
36 #ifndef CQASM_VERSIONDEBUG
37 # if defined YYDEBUG
38 #if YYDEBUG
39 # define CQASM_VERSIONDEBUG 1
40 # else
41 # define CQASM_VERSIONDEBUG 0
42 # endif
43 # else /* ! defined YYDEBUG */
44 # define CQASM_VERSIONDEBUG 0
45 # endif /* ! defined YYDEBUG */
46 #endif /* ! defined CQASM_VERSIONDEBUG */
47 #if CQASM_VERSIONDEBUG
48 extern int cqasm_versiondebug;
49 #endif
50 /* "%code requires" blocks. */
51 #line 5 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/stable/src/cqasm/src/cqasm-version-parser.y" /* yacc.c:1915 */
52 
57  #include <memory>
58  #include <cstdio>
59  #include <cstdint>
60  #include "cqasm-error.hpp"
61  #include "cqasm-version.hpp"
62  using namespace cqasm::version;
63  typedef void* yyscan_t;
64 
65  #define YYSTYPE CQASM_VERSIONSTYPE
66  #define YYLTYPE CQASM_VERSIONLTYPE
67 
68 
69 #line 70 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/stable/cbuild/src/cqasm/cqasm-version-parser.hpp" /* yacc.c:1915 */
70 
71 /* Token type. */
72 #ifndef CQASM_VERSIONTOKENTYPE
73 # define CQASM_VERSIONTOKENTYPE
75  {
76  VERSION = 258,
77  INT_LITERAL = 259,
78  UNKNOWN = 260,
80  };
81 #endif
82 
83 /* Value type. */
84 #if ! defined CQASM_VERSIONSTYPE && ! defined CQASM_VERSIONSTYPE_IS_DECLARED
87 {
88 #line 32 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/stable/src/cqasm/src/cqasm-version-parser.y" /* yacc.c:1915 */
89 
90  char *str;
91  Version *vers;
92 
93 #line 94 "/home/docs/checkouts/readthedocs.org/user_builds/libqasm/checkouts/stable/cbuild/src/cqasm/cqasm-version-parser.hpp" /* yacc.c:1915 */
94 };
95 # define CQASM_VERSIONSTYPE_IS_TRIVIAL 1
96 # define CQASM_VERSIONSTYPE_IS_DECLARED 1
97 #endif
98 
99 /* Location type. */
100 #if ! defined CQASM_VERSIONLTYPE && ! defined CQASM_VERSIONLTYPE_IS_DECLARED
102 struct CQASM_VERSIONLTYPE
103 {
104  int first_line;
105  int first_column;
106  int last_line;
107  int last_column;
108 };
109 # define CQASM_VERSIONLTYPE_IS_DECLARED 1
110 # define CQASM_VERSIONLTYPE_IS_TRIVIAL 1
111 #endif
112 
113 
114 
116 
117 #endif /* !YY_CQASM_VERSION_HOME_DOCS_CHECKOUTS_READTHEDOCS_ORG_USER_BUILDS_LIBQASM_CHECKOUTS_STABLE_CBUILD_SRC_CQASM_CQASM_VERSION_PARSER_HPP_INCLUDED */
cqasm_versiontokentype
Defines utilities for detecting and dealing with cQASM language versions.
void * yyscan_t
Version number primitive used within the AST and semantic trees.
void * yyscan_t
Internal helper class for parsing cQASM file versions.
Contains custom exception objects used by libqasm.
int cqasm_versionparse(yyscan_t scanner, cqasm::version::ParseHelper &helper)
Namespace for detecting and dealing with cQASM language versions.