1 /* A Bison parser, made by GNU Bison 3.5.  */
2 
3 /* Bison interface for Yacc-like parsers in C
4 
5    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 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 <http://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 /* Undocumented macros, especially those whose name start with YY_,
35    are private implementation details.  Do not rely on them.  */
36 
37 #ifndef YY__MESA_GLSL_SRC_COMPILER_GLSL_GLSL_PARSER_H_INCLUDED
38 # define YY__MESA_GLSL_SRC_COMPILER_GLSL_GLSL_PARSER_H_INCLUDED
39 /* Debug traces.  */
40 #ifndef YYDEBUG
41 # define YYDEBUG 0
42 #endif
43 #if YYDEBUG
44 extern int _mesa_glsl_debug;
45 #endif
46 
47 /* Token type.  */
48 #ifndef YYTOKENTYPE
49 # define YYTOKENTYPE
50   enum yytokentype
51   {
52     ATTRIBUTE = 258,
53     CONST_TOK = 259,
54     BASIC_TYPE_TOK = 260,
55     BREAK = 261,
56     BUFFER = 262,
57     CONTINUE = 263,
58     DO = 264,
59     ELSE = 265,
60     FOR = 266,
61     IF = 267,
62     DEMOTE = 268,
63     DISCARD = 269,
64     RETURN = 270,
65     SWITCH = 271,
66     CASE = 272,
67     DEFAULT = 273,
68     CENTROID = 274,
69     IN_TOK = 275,
70     OUT_TOK = 276,
71     INOUT_TOK = 277,
72     UNIFORM = 278,
73     VARYING = 279,
74     SAMPLE = 280,
75     NOPERSPECTIVE = 281,
76     FLAT = 282,
77     SMOOTH = 283,
78     IMAGE1DSHADOW = 284,
79     IMAGE2DSHADOW = 285,
80     IMAGE1DARRAYSHADOW = 286,
81     IMAGE2DARRAYSHADOW = 287,
82     COHERENT = 288,
83     VOLATILE = 289,
84     RESTRICT = 290,
85     READONLY = 291,
86     WRITEONLY = 292,
87     SHARED = 293,
88     STRUCT = 294,
89     VOID_TOK = 295,
90     WHILE = 296,
91     IDENTIFIER = 297,
92     TYPE_IDENTIFIER = 298,
93     NEW_IDENTIFIER = 299,
94     FLOATCONSTANT = 300,
95     DOUBLECONSTANT = 301,
96     INTCONSTANT = 302,
97     UINTCONSTANT = 303,
98     BOOLCONSTANT = 304,
99     INT64CONSTANT = 305,
100     UINT64CONSTANT = 306,
101     FIELD_SELECTION = 307,
102     LEFT_OP = 308,
103     RIGHT_OP = 309,
104     INC_OP = 310,
105     DEC_OP = 311,
106     LE_OP = 312,
107     GE_OP = 313,
108     EQ_OP = 314,
109     NE_OP = 315,
110     AND_OP = 316,
111     OR_OP = 317,
112     XOR_OP = 318,
113     MUL_ASSIGN = 319,
114     DIV_ASSIGN = 320,
115     ADD_ASSIGN = 321,
116     MOD_ASSIGN = 322,
117     LEFT_ASSIGN = 323,
118     RIGHT_ASSIGN = 324,
119     AND_ASSIGN = 325,
120     XOR_ASSIGN = 326,
121     OR_ASSIGN = 327,
122     SUB_ASSIGN = 328,
123     INVARIANT = 329,
124     PRECISE = 330,
125     LOWP = 331,
126     MEDIUMP = 332,
127     HIGHP = 333,
128     SUPERP = 334,
129     PRECISION = 335,
130     VERSION_TOK = 336,
131     EXTENSION = 337,
132     LINE = 338,
133     COLON = 339,
134     EOL = 340,
135     INTERFACE = 341,
136     OUTPUT = 342,
137     PRAGMA_DEBUG_ON = 343,
138     PRAGMA_DEBUG_OFF = 344,
139     PRAGMA_OPTIMIZE_ON = 345,
140     PRAGMA_OPTIMIZE_OFF = 346,
141     PRAGMA_WARNING_ON = 347,
142     PRAGMA_WARNING_OFF = 348,
143     PRAGMA_INVARIANT_ALL = 349,
144     LAYOUT_TOK = 350,
145     DOT_TOK = 351,
146     ASM = 352,
147     CLASS = 353,
148     UNION = 354,
149     ENUM = 355,
150     TYPEDEF = 356,
151     TEMPLATE = 357,
152     THIS = 358,
153     PACKED_TOK = 359,
154     GOTO = 360,
155     INLINE_TOK = 361,
156     NOINLINE = 362,
157     PUBLIC_TOK = 363,
158     STATIC = 364,
159     EXTERN = 365,
160     EXTERNAL = 366,
161     LONG_TOK = 367,
162     SHORT_TOK = 368,
163     HALF = 369,
164     FIXED_TOK = 370,
165     UNSIGNED = 371,
166     INPUT_TOK = 372,
167     HVEC2 = 373,
168     HVEC3 = 374,
169     HVEC4 = 375,
170     FVEC2 = 376,
171     FVEC3 = 377,
172     FVEC4 = 378,
173     SAMPLER3DRECT = 379,
174     SIZEOF = 380,
175     CAST = 381,
176     NAMESPACE = 382,
177     USING = 383,
178     RESOURCE = 384,
179     PATCH = 385,
180     SUBROUTINE = 386,
181     ERROR_TOK = 387,
182     COMMON = 388,
183     PARTITION = 389,
184     ACTIVE = 390,
185     FILTER = 391,
186     ROW_MAJOR = 392,
187     THEN = 393
188   };
189 #endif
190 
191 /* Value type.  */
192 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
193 union YYSTYPE
194 {
195 #line 101 "src/compiler/glsl/glsl_parser.yy"
196 
197    int n;
198    int64_t n64;
199    float real;
200    double dreal;
201    const char *identifier;
202 
203    struct ast_type_qualifier type_qualifier;
204 
205    ast_node *node;
206    ast_type_specifier *type_specifier;
207    ast_array_specifier *array_specifier;
208    ast_fully_specified_type *fully_specified_type;
209    ast_function *function;
210    ast_parameter_declarator *parameter_declarator;
211    ast_function_definition *function_definition;
212    ast_compound_statement *compound_statement;
213    ast_expression *expression;
214    ast_declarator_list *declarator_list;
215    ast_struct_specifier *struct_specifier;
216    ast_declaration *declaration;
217    ast_switch_body *switch_body;
218    ast_case_label *case_label;
219    ast_case_label_list *case_label_list;
220    ast_case_statement *case_statement;
221    ast_case_statement_list *case_statement_list;
222    ast_interface_block *interface_block;
223    ast_subroutine_list *subroutine_list;
224    struct {
225       ast_node *cond;
226       ast_expression *rest;
227    } for_rest_statement;
228 
229    struct {
230       ast_node *then_statement;
231       ast_node *else_statement;
232    } selection_rest_statement;
233 
234    const glsl_type *type;
235 
236 #line 237 "src/compiler/glsl/glsl_parser.h"
237 
238 };
239 typedef union YYSTYPE YYSTYPE;
240 # define YYSTYPE_IS_TRIVIAL 1
241 # define YYSTYPE_IS_DECLARED 1
242 #endif
243 
244 /* Location type.  */
245 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
246 typedef struct YYLTYPE YYLTYPE;
247 struct YYLTYPE
248 {
249   int first_line;
250   int first_column;
251   int last_line;
252   int last_column;
253 };
254 # define YYLTYPE_IS_DECLARED 1
255 # define YYLTYPE_IS_TRIVIAL 1
256 #endif
257 
258 
259 
260 int _mesa_glsl_parse (struct _mesa_glsl_parse_state *state);
261 
262 #endif /* !YY__MESA_GLSL_SRC_COMPILER_GLSL_GLSL_PARSER_H_INCLUDED  */
263