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