package: bump copyrights to 2021
[bison.git] / src / parse-gram.h
blob1cd9c99cedd45ebec96fb7024a0d91329d90ba79
1 /* A Bison parser, made by GNU Bison 3.7.4.23-44a69. */
3 /* Bison interface for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
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.
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.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
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.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
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. */
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. */
57 #include "symlist.h"
58 #include "symtab.h"
60 typedef enum
62 param_none = 0,
63 param_lex = 1 << 0,
64 param_parse = 1 << 1,
65 param_both = param_lex | param_parse
66 } param_type;
68 #include "muscle-tab.h"
69 typedef struct
71 char const *chars;
72 muscle_kind kind;
73 } value_type;
76 /* Token kinds. */
77 #ifndef GRAM_TOKENTYPE
78 # define GRAM_TOKENTYPE
79 enum gram_tokentype
81 GRAM_EMPTY = -2,
82 GRAM_EOF = 0, /* "end of file" */
83 GRAM_error = 1, /* error */
84 GRAM_UNDEF = 2, /* "invalid token" */
85 STRING = 3, /* "string" */
86 TSTRING = 4, /* "translatable string" */
87 PERCENT_TOKEN = 5, /* "%token" */
88 PERCENT_NTERM = 6, /* "%nterm" */
89 PERCENT_TYPE = 7, /* "%type" */
90 PERCENT_DESTRUCTOR = 8, /* "%destructor" */
91 PERCENT_PRINTER = 9, /* "%printer" */
92 PERCENT_LEFT = 10, /* "%left" */
93 PERCENT_RIGHT = 11, /* "%right" */
94 PERCENT_NONASSOC = 12, /* "%nonassoc" */
95 PERCENT_PRECEDENCE = 13, /* "%precedence" */
96 PERCENT_PREC = 14, /* "%prec" */
97 PERCENT_DPREC = 15, /* "%dprec" */
98 PERCENT_MERGE = 16, /* "%merge" */
99 PERCENT_CODE = 17, /* "%code" */
100 PERCENT_DEFAULT_PREC = 18, /* "%default-prec" */
101 PERCENT_DEFINE = 19, /* "%define" */
102 PERCENT_DEFINES = 20, /* "%defines" */
103 PERCENT_ERROR_VERBOSE = 21, /* "%error-verbose" */
104 PERCENT_EXPECT = 22, /* "%expect" */
105 PERCENT_EXPECT_RR = 23, /* "%expect-rr" */
106 PERCENT_FLAG = 24, /* "%<flag>" */
107 PERCENT_FILE_PREFIX = 25, /* "%file-prefix" */
108 PERCENT_GLR_PARSER = 26, /* "%glr-parser" */
109 PERCENT_INITIAL_ACTION = 27, /* "%initial-action" */
110 PERCENT_LANGUAGE = 28, /* "%language" */
111 PERCENT_NAME_PREFIX = 29, /* "%name-prefix" */
112 PERCENT_NO_DEFAULT_PREC = 30, /* "%no-default-prec" */
113 PERCENT_NO_LINES = 31, /* "%no-lines" */
114 PERCENT_NONDETERMINISTIC_PARSER = 32, /* "%nondeterministic-parser" */
115 PERCENT_OUTPUT = 33, /* "%output" */
116 PERCENT_PURE_PARSER = 34, /* "%pure-parser" */
117 PERCENT_REQUIRE = 35, /* "%require" */
118 PERCENT_SKELETON = 36, /* "%skeleton" */
119 PERCENT_START = 37, /* "%start" */
120 PERCENT_TOKEN_TABLE = 38, /* "%token-table" */
121 PERCENT_VERBOSE = 39, /* "%verbose" */
122 PERCENT_YACC = 40, /* "%yacc" */
123 BRACED_CODE = 41, /* "{...}" */
124 BRACED_PREDICATE = 42, /* "%?{...}" */
125 BRACKETED_ID = 43, /* "[identifier]" */
126 CHAR_LITERAL = 44, /* "character literal" */
127 COLON = 45, /* ":" */
128 EPILOGUE = 46, /* "epilogue" */
129 EQUAL = 47, /* "=" */
130 ID = 48, /* "identifier" */
131 ID_COLON = 49, /* "identifier:" */
132 PERCENT_PERCENT = 50, /* "%%" */
133 PIPE = 51, /* "|" */
134 PROLOGUE = 52, /* "%{...%}" */
135 SEMICOLON = 53, /* ";" */
136 TAG = 54, /* "<tag>" */
137 TAG_ANY = 55, /* "<*>" */
138 TAG_NONE = 56, /* "<>" */
139 INT_LITERAL = 57, /* "integer literal" */
140 PERCENT_PARAM = 58, /* "%param" */
141 PERCENT_UNION = 59, /* "%union" */
142 PERCENT_EMPTY = 60 /* "%empty" */
144 typedef enum gram_tokentype gram_token_kind_t;
145 #endif
147 /* Value type. */
148 #if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
149 union GRAM_STYPE
151 assoc precedence_declarator; /* precedence_declarator */
152 char* STRING; /* "string" */
153 char* TSTRING; /* "translatable string" */
154 char* BRACED_CODE; /* "{...}" */
155 char* BRACED_PREDICATE; /* "%?{...}" */
156 char* EPILOGUE; /* "epilogue" */
157 char* PROLOGUE; /* "%{...%}" */
158 code_props_type code_props_type; /* code_props_type */
159 int INT_LITERAL; /* "integer literal" */
160 int yykind_82; /* int.opt */
161 named_ref* yykind_95; /* named_ref.opt */
162 param_type PERCENT_PARAM; /* "%param" */
163 symbol* token_decl; /* token_decl */
164 symbol* alias; /* alias */
165 symbol* token_decl_for_prec; /* token_decl_for_prec */
166 symbol* id; /* id */
167 symbol* id_colon; /* id_colon */
168 symbol* symbol; /* symbol */
169 symbol* string_as_id; /* string_as_id */
170 symbol_list* generic_symlist; /* generic_symlist */
171 symbol_list* generic_symlist_item; /* generic_symlist_item */
172 symbol_list* nterm_decls; /* nterm_decls */
173 symbol_list* token_decls; /* token_decls */
174 symbol_list* yykind_80; /* token_decl.1 */
175 symbol_list* token_decls_for_prec; /* token_decls_for_prec */
176 symbol_list* yykind_85; /* token_decl_for_prec.1 */
177 symbol_list* symbol_decls; /* symbol_decls */
178 symbol_list* yykind_88; /* symbol_decl.1 */
179 uniqstr PERCENT_ERROR_VERBOSE; /* "%error-verbose" */
180 uniqstr PERCENT_FLAG; /* "%<flag>" */
181 uniqstr PERCENT_FILE_PREFIX; /* "%file-prefix" */
182 uniqstr PERCENT_NAME_PREFIX; /* "%name-prefix" */
183 uniqstr PERCENT_PURE_PARSER; /* "%pure-parser" */
184 uniqstr BRACKETED_ID; /* "[identifier]" */
185 uniqstr ID; /* "identifier" */
186 uniqstr ID_COLON; /* "identifier:" */
187 uniqstr TAG; /* "<tag>" */
188 uniqstr yykind_74; /* tag.opt */
189 uniqstr tag; /* tag */
190 uniqstr variable; /* variable */
191 unsigned char CHAR_LITERAL; /* "character literal" */
192 value_type value; /* value */
196 typedef union GRAM_STYPE GRAM_STYPE;
197 # define GRAM_STYPE_IS_TRIVIAL 1
198 # define GRAM_STYPE_IS_DECLARED 1
199 #endif
201 /* Location type. */
202 #if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
203 typedef struct GRAM_LTYPE GRAM_LTYPE;
204 struct GRAM_LTYPE
206 int first_line;
207 int first_column;
208 int last_line;
209 int last_column;
211 # define GRAM_LTYPE_IS_DECLARED 1
212 # define GRAM_LTYPE_IS_TRIVIAL 1
213 #endif
217 int gram_parse (void);
218 /* "%code provides" blocks. */
220 /* Initialize unquote. */
221 void parser_init (void);
222 /* Deallocate storage for unquote. */
223 void parser_free (void);
226 #endif /* !YY_GRAM_SRC_PARSE_GRAM_H_INCLUDED */