1 /* A Bison parser, made by GNU Bison 3.8.2. */
2
3 /* Bison interface for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
35 especially those whose name start with YY_ or yy_. They are
36 private implementation details that can be changed or removed. */
37
38 #ifndef YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
39 # define YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED
40 /* Debug traces. */
41 #ifndef GRAM_DEBUG
42 # if defined YYDEBUG
43 #if YYDEBUG
44 # define GRAM_DEBUG 1
45 # else
46 # define GRAM_DEBUG 0
47 # endif
48 # else /* ! defined YYDEBUG */
49 # define GRAM_DEBUG 1
50 # endif /* ! defined YYDEBUG */
51 #endif /* ! defined GRAM_DEBUG */
52 #if GRAM_DEBUG
53 extern int gram_debug;
54 #endif
55 /* "%code requires" blocks. */
56 #line 21 "src/parse-gram.y"
57
58 #include "symlist.h"
59 #include "symtab.h"
60 #line 268 "src/parse-gram.y"
61
62 typedef enum
63 {
64 param_none = 0,
65 param_lex = 1 << 0,
66 param_parse = 1 << 1,
67 param_both = param_lex | param_parse
68 } param_type;
69 #line 737 "src/parse-gram.y"
70
71 #include "muscle-tab.h"
72 typedef struct
73 {
74 char const *chars;
75 muscle_kind kind;
76 } value_type;
77
78 #line 79 "src/parse-gram.h"
79
80 /* Token kinds. */
81 #ifndef GRAM_TOKENTYPE
82 # define GRAM_TOKENTYPE
83 enum gram_tokentype
84 {
85 GRAM_EMPTY = -2,
86 GRAM_EOF = 0, /* "end of file" */
87 GRAM_error = 1, /* error */
88 GRAM_UNDEF = 2, /* "invalid token" */
89 STRING = 3, /* "string" */
90 TSTRING = 4, /* "translatable string" */
91 PERCENT_TOKEN = 5, /* "%token" */
92 PERCENT_NTERM = 6, /* "%nterm" */
93 PERCENT_TYPE = 7, /* "%type" */
94 PERCENT_DESTRUCTOR = 8, /* "%destructor" */
95 PERCENT_PRINTER = 9, /* "%printer" */
96 PERCENT_LEFT = 10, /* "%left" */
97 PERCENT_RIGHT = 11, /* "%right" */
98 PERCENT_NONASSOC = 12, /* "%nonassoc" */
99 PERCENT_PRECEDENCE = 13, /* "%precedence" */
100 PERCENT_PREC = 14, /* "%prec" */
101 PERCENT_DPREC = 15, /* "%dprec" */
102 PERCENT_MERGE = 16, /* "%merge" */
103 PERCENT_CODE = 17, /* "%code" */
104 PERCENT_DEFAULT_PREC = 18, /* "%default-prec" */
105 PERCENT_DEFINE = 19, /* "%define" */
106 PERCENT_ERROR_VERBOSE = 20, /* "%error-verbose" */
107 PERCENT_EXPECT = 21, /* "%expect" */
108 PERCENT_EXPECT_RR = 22, /* "%expect-rr" */
109 PERCENT_FILE_PREFIX = 23, /* "%file-prefix" */
110 PERCENT_FLAG = 24, /* "%<flag>" */
111 PERCENT_GLR_PARSER = 25, /* "%glr-parser" */
112 PERCENT_HEADER = 26, /* "%header" */
113 PERCENT_INITIAL_ACTION = 27, /* "%initial-action" */
114 PERCENT_LANGUAGE = 28, /* "%language" */
115 PERCENT_NAME_PREFIX = 29, /* "%name-prefix" */
116 PERCENT_NO_DEFAULT_PREC = 30, /* "%no-default-prec" */
117 PERCENT_NO_LINES = 31, /* "%no-lines" */
118 PERCENT_NONDETERMINISTIC_PARSER = 32, /* "%nondeterministic-parser" */
119 PERCENT_OUTPUT = 33, /* "%output" */
120 PERCENT_PURE_PARSER = 34, /* "%pure-parser" */
121 PERCENT_REQUIRE = 35, /* "%require" */
122 PERCENT_SKELETON = 36, /* "%skeleton" */
123 PERCENT_START = 37, /* "%start" */
124 PERCENT_TOKEN_TABLE = 38, /* "%token-table" */
125 PERCENT_VERBOSE = 39, /* "%verbose" */
126 PERCENT_YACC = 40, /* "%yacc" */
127 BRACED_CODE = 41, /* "{...}" */
128 BRACED_PREDICATE = 42, /* "%?{...}" */
129 BRACKETED_ID = 43, /* "[identifier]" */
130 CHAR_LITERAL = 44, /* "character literal" */
131 COLON = 45, /* ":" */
132 EPILOGUE = 46, /* "epilogue" */
133 EQUAL = 47, /* "=" */
134 ID = 48, /* "identifier" */
135 ID_COLON = 49, /* "identifier:" */
136 PERCENT_PERCENT = 50, /* "%%" */
137 PIPE = 51, /* "|" */
138 PROLOGUE = 52, /* "%{...%}" */
139 SEMICOLON = 53, /* ";" */
140 TAG = 54, /* "<tag>" */
141 TAG_ANY = 55, /* "<*>" */
142 TAG_NONE = 56, /* "<>" */
143 INT_LITERAL = 57, /* "integer literal" */
144 PERCENT_PARAM = 58, /* "%param" */
145 PERCENT_UNION = 59, /* "%union" */
146 PERCENT_EMPTY = 60 /* "%empty" */
147 };
148 typedef enum gram_tokentype gram_token_kind_t;
149 #endif
150
151 /* Value type. */
152 #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
153 union GRAM_STYPE
154 {
155 assoc precedence_declarator; /* precedence_declarator */
156 char* STRING; /* "string" */
157 char* TSTRING; /* "translatable string" */
158 char* BRACED_CODE; /* "{...}" */
159 char* BRACED_PREDICATE; /* "%?{...}" */
160 char* EPILOGUE; /* "epilogue" */
161 char* PROLOGUE; /* "%{...%}" */
162 char* yykind_75; /* string.opt */
163 code_props_type code_props_type; /* code_props_type */
164 int INT_LITERAL; /* "integer literal" */
165 int yykind_84; /* int.opt */
166 named_ref* yykind_97; /* named_ref.opt */
167 param_type PERCENT_PARAM; /* "%param" */
168 symbol* token_decl; /* token_decl */
169 symbol* alias; /* alias */
170 symbol* token_decl_for_prec; /* token_decl_for_prec */
171 symbol* id; /* id */
172 symbol* id_colon; /* id_colon */
173 symbol* symbol; /* symbol */
174 symbol* string_as_id; /* string_as_id */
175 symbol_list* generic_symlist; /* generic_symlist */
176 symbol_list* generic_symlist_item; /* generic_symlist_item */
177 symbol_list* nterm_decls; /* nterm_decls */
178 symbol_list* token_decls; /* token_decls */
179 symbol_list* yykind_82; /* token_decl.1 */
180 symbol_list* token_decls_for_prec; /* token_decls_for_prec */
181 symbol_list* yykind_87; /* token_decl_for_prec.1 */
182 symbol_list* symbol_decls; /* symbol_decls */
183 symbol_list* yykind_90; /* symbols.1 */
184 uniqstr PERCENT_ERROR_VERBOSE; /* "%error-verbose" */
185 uniqstr PERCENT_FILE_PREFIX; /* "%file-prefix" */
186 uniqstr PERCENT_FLAG; /* "%<flag>" */
187 uniqstr PERCENT_NAME_PREFIX; /* "%name-prefix" */
188 uniqstr PERCENT_PURE_PARSER; /* "%pure-parser" */
189 uniqstr BRACKETED_ID; /* "[identifier]" */
190 uniqstr ID; /* "identifier" */
191 uniqstr ID_COLON; /* "identifier:" */
192 uniqstr TAG; /* "<tag>" */
193 uniqstr yykind_76; /* tag.opt */
194 uniqstr tag; /* tag */
195 uniqstr variable; /* variable */
196 unsigned char CHAR_LITERAL; /* "character literal" */
197 value_type value; /* value */
198
199 #line 200 "src/parse-gram.h"
200
201 };
202 typedef union GRAM_STYPE GRAM_STYPE;
203 # define GRAM_STYPE_IS_TRIVIAL 1
204 # define GRAM_STYPE_IS_DECLARED 1
205 #endif
206
207 /* Location type. */
208 #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
209 typedef struct GRAM_LTYPE GRAM_LTYPE;
210 struct GRAM_LTYPE
211 {
212 int first_line;
213 int first_column;
214 int last_line;
215 int last_column;
216 };
217 # define GRAM_LTYPE_IS_DECLARED 1
218 # define GRAM_LTYPE_IS_TRIVIAL 1
219 #endif
220
221
222
223
224 int gram_parse (void);
225
226 /* "%code provides" blocks. */
227 #line 27 "src/parse-gram.y"
228
229 /* Initialize unquote. */
230 void parser_init (void);
231 /* Deallocate storage for unquote. */
232 void parser_free (void);
233
234 #line 235 "src/parse-gram.h"
235
236 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */