diff --git a/src/libs/glsl/glsl-lib.pri b/src/libs/glsl/glsl-lib.pri new file mode 100644 index 00000000000..cd39d5777b5 --- /dev/null +++ b/src/libs/glsl/glsl-lib.pri @@ -0,0 +1,6 @@ +HEADERS += $$PWD/glsllexer.h $$PWD/glslparser.h glslparsertable_p.h $$PWD/glslast.h +SOURCES += $$PWD/glslkeywords.cpp $$PWD/glslparser.cpp $$PWD/glslparsertable.cpp \ + $$PWD/glsllexer.cpp $$PWD/glslast.cpp $$PWD/glsldump.cpp $$PWD/glsldelete.cpp + +OTHER_FILES = $$PWD/specs/glsl.g.in \ + $$PWD/specs/grammar.txt diff --git a/src/libs/glsl/glsl.g b/src/libs/glsl/glsl.g new file mode 100644 index 00000000000..a7ddeec428f --- /dev/null +++ b/src/libs/glsl/glsl.g @@ -0,0 +1,668 @@ +-- todo: +-- spelling of XOR_OP and CARET + +%decl glslparser.h +%impl glslparser.cpp +%parser GLSLParserTable +%token_prefix T_ + +%token ADD_ASSIGN "+=" +%token AMPERSAND "&" +%token AND_ASSIGN "&=" +%token AND_OP "&&" +%token ATTRIBUTE "attribute" +%token BANG "!" +%token BOOL "bool" +%token BREAK "break" +%token BVEC2 "bvec2" +%token BVEC3 "bvec3" +%token BVEC4 "bvec4" +%token CARET "^" +%token CASE "case" +%token CENTROID "centroid" +%token COLON ":" +%token COMMA "," +%token CONST "const" +%token CONTINUE "continue" +%token DASH "-" +%token DEC_OP "--" +%token DEFAULT "default" +%token DISCARD "discard" +%token DIV_ASSIGN "/=" +%token DMAT2 "dmat2" +%token DMAT2X2 "dmat2x2" +%token DMAT2X3 "dmat2x3" +%token DMAT2X4 "dmat2x4" +%token DMAT3 "dmat3" +%token DMAT3X2 "dmat3x2" +%token DMAT3X3 "dmat3x3" +%token DMAT3X4 "dmat3x4" +%token DMAT4 "dmat4" +%token DMAT4X2 "dmat4x2" +%token DMAT4X3 "dmat4x3" +%token DMAT4X4 "dmat4x4" +%token DO "do" +%token DOT "." +%token DOUBLE "double" +%token DVEC2 "dvec2" +%token DVEC3 "dvec3" +%token DVEC4 "dvec4" +%token ELSE "else" +%token EQUAL "=" +%token EQ_OP "==" +%token FLAT "flat" +%token FLOAT "float" +%token FOR "for" +%token GE_OP ">=" +%token HIGHP "highp" +%token IDENTIFIER "identifier" +%token IF "if" +%token IN "in" +%token INC_OP "++" +%token INOUT "inout" +%token INT "int" +%token INVARIANT "invariant" +%token ISAMPLER1D "isampler1D" +%token ISAMPLER1DARRAY "isampler1DArray" +%token ISAMPLER2D "isampler2D" +%token ISAMPLER2DARRAY "isampler2DArray" +%token ISAMPLER2DMS "isampler2DMS" +%token ISAMPLER2DMSARRAY "isampler2DMSArray" +%token ISAMPLER2DRECT "isampler2DRect" +%token ISAMPLER3D "isampler3D" +%token ISAMPLERBUFFER "isamplerBuffer" +%token ISAMPLERCUBE "isamplerCube" +%token ISAMPLERCUBEARRAY "isamplerCubeArray" +%token IVEC2 "ivec2" +%token IVEC3 "ivec3" +%token IVEC4 "ivec4" +%token LAYOUT "layout" +%token LEFT_ANGLE "<" +%token LEFT_ASSIGN "<<=" +%token LEFT_BRACE "{" +%token LEFT_BRACKET "[" +%token LEFT_OP "<<" +%token LEFT_PAREN "(" +%token LE_OP "<=" +%token LOWP "lowp" +%token MAT2 "mat2" +%token MAT2X2 "mat2x2" +%token MAT2X3 "mat2x3" +%token MAT2X4 "mat2x4" +%token MAT3 "mat3" +%token MAT3X2 "mat3x2" +%token MAT3X3 "mat3x3" +%token MAT3X4 "mat3x4" +%token MAT4 "mat4" +%token MAT4X2 "mat4x2" +%token MAT4X3 "mat4x3" +%token MAT4X4 "mat4x4" +%token MEDIUMP "mediump" +%token MOD_ASSIGN "%=" +%token MUL_ASSIGN "*=" +%token NE_OP "!=" +%token NOPERSPECTIVE "noperspective" +%token NUMBER "number constant" +%token OR_ASSIGN "|=" +%token OR_OP "||" +%token OUT "out" +%token PATCH "patch" +%token PERCENT "%" +%token PLUS "plus" +%token PRECISION "precision" +%token QUESTION "?" +%token RETURN "return" +%token RIGHT_ANGLE ">" +%token RIGHT_ASSIGN ">>=" +%token RIGHT_BRACE "}" +%token RIGHT_BRACKET "]" +%token RIGHT_OP ">>" +%token RIGHT_PAREN ")" +%token SAMPLE "sample" +%token SAMPLER1D "sampler1D" +%token SAMPLER1DARRAY "sampler1DArray" +%token SAMPLER1DARRAYSHADOW "sampler1DArrayShadow" +%token SAMPLER1DSHADOW "sampler1DShadow" +%token SAMPLER2D "sampler2D" +%token SAMPLER2DARRAY "sampler2DArray" +%token SAMPLER2DARRAYSHADOW "sampler2DArrayShadow" +%token SAMPLER2DMS "sampler2DMS" +%token SAMPLER2DMSARRAY "sampler2DMSArray" +%token SAMPLER2DRECT "sampler2DRect" +%token SAMPLER2DRECTSHADOW "sampler2DRectShadow" +%token SAMPLER2DSHADOW "sampler2DShadow" +%token SAMPLER3D "sampler3D" +%token SAMPLERBUFFER "samplerBuffer" +%token SAMPLERCUBE "samplerCube" +%token SAMPLERCUBEARRAY "samplerCubeArray" +%token SAMPLERCUBEARRAYSHADOW "samplerCubeArrayShadow" +%token SAMPLERCUBESHADOW "samplerCubeShadow" +%token SEMICOLON ";" +%token SLASH "/" +%token SMOOTH "smooth" +%token STAR "*" +%token STRUCT "struct" +%token SUBROUTINE "subroutine" +%token SUB_ASSIGN "-=" +%token SWITCH "switch" +%token TILDE "~" +%token TYPE_NAME "type_name" +%token UINT "uint" +%token UNIFORM "uniform" +%token USAMPLER1D "usampler1D" +%token USAMPLER1DARRAY "usampler1DArray" +%token USAMPLER2D "usampler2D" +%token USAMPLER2DARRAY "usampler2DArray" +%token USAMPLER2DMS "usampler2DMS" +%token USAMPLER2DMSARRAY "usampler2DMSarray" +%token USAMPLER2DRECT "usampler2DRect" +%token USAMPLER3D "usampler3D" +%token USAMPLERBUFFER "usamplerBuffer" +%token USAMPLERCUBE "usamplerCube" +%token USAMPLERCUBEARRAY "usamplerCubeArray" +%token UVEC2 "uvec2" +%token UVEC3 "uvec3" +%token UVEC4 "uvec4" +%token VARYING "varying" +%token VEC2 "vec2" +%token VEC3 "vec3" +%token VEC4 "vec4" +%token VERTICAL_BAR "|" +%token VOID "void" +%token WHILE "while" +%token XOR_ASSIGN "^=" +%token XOR_OP "^" +%token TRUE "true" +%token FALSE "false" +%token ERROR "error" + +%start translation_unit + +/: +#include "$header" +#include "glsllexer.h" +#include "glslast.h" +#include +#include + +namespace GLSL { + +class Parser: public $table +{ +public: + Parser(const char *source, unsigned size, int variant); + ~Parser(); + + bool parse(); + +private: + inline int consumeToken() { return _index++; } + inline const Token &tokenAt(int index) const { return _tokens.at(index); } + inline int tokenKind(int index) const { return _tokens.at(index).kind; } + void dump(AST *ast); + +private: + int _tos; + int _index; + std::vector _stateStack; + std::vector _locationStack; + std::vector _astStack; + std::vector _tokens; +}; + +} // end of namespace GLSL +:/ + +/. +#include "glslparser.h" +#include + +using namespace GLSL; + +namespace GLSL { +void dumpAST(AST *); +void deleteAST(AST *ast); +} + +Parser::Parser(const char *source, unsigned size, int variant) + : _tos(-1), _index(0) +{ + _tokens.reserve(1024); + + _stateStack.resize(128); + _locationStack.resize(128); + _astStack.resize(128); + + _tokens.push_back(Token()); // invalid token + + std::stack parenStack; + std::stack bracketStack; + std::stack braceStack; + + Lexer lexer(source, size); + lexer.setVariant(variant); + Token tk; + do { + lexer.yylex(&tk); + + switch (tk.kind) { + case T_LEFT_PAREN: + parenStack.push(_tokens.size()); + break; + case T_LEFT_BRACKET: + bracketStack.push(_tokens.size()); + break; + case T_LEFT_BRACE: + braceStack.push(_tokens.size()); + break; + + case T_RIGHT_PAREN: + if (! parenStack.empty()) { + _tokens[parenStack.top()].matchingBrace = _tokens.size(); + parenStack.pop(); + } + break; + case T_RIGHT_BRACKET: + if (! bracketStack.empty()) { + _tokens[bracketStack.top()].matchingBrace = _tokens.size(); + bracketStack.pop(); + } + break; + case T_RIGHT_BRACE: + if (! braceStack.empty()) { + _tokens[braceStack.top()].matchingBrace = _tokens.size(); + braceStack.pop(); + } + break; + default: + break; + } + + _tokens.push_back(tk); + } while (tk.isNot(EOF_SYMBOL)); + + _index = 1; +} + +Parser::~Parser() +{ +} + +void Parser::dump(AST *ast) +{ + dumpAST(ast); +} + +bool Parser::parse() +{ + int action = 0; + int yytoken = -1; + int yyloc = -1; + Operand *opd = 0; + + _tos = -1; + + do { + if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) { + yyloc = consumeToken(); + yytoken = tokenKind(yyloc); + if (yytoken == T_IDENTIFIER && t_action(action, T_TYPE_NAME) != 0) { + const Token &la = tokenAt(_index); + + if (la.is(T_IDENTIFIER)) { + yytoken = T_TYPE_NAME; + } else if (la.is(T_LEFT_BRACKET) && la.matchingBrace != 0 && + tokenAt(la.matchingBrace + 1).is(T_IDENTIFIER)) { + yytoken = T_TYPE_NAME; + } + } + opd = new Operand(yyloc); + } + + if (unsigned(++_tos) == _stateStack.size()) { + _stateStack.resize(_tos * 2); + _locationStack.resize(_tos * 2); + _astStack.resize(_tos * 2); + } + + _stateStack[_tos] = action; + action = t_action(action, yytoken); + if (action > 0) { + if (action == ACCEPT_STATE) { + --_tos; + dump(_astStack[0]); + deleteAST(_astStack[0]); + return true; + } + _astStack[_tos] = opd; + _locationStack[_tos] = yyloc; + yytoken = -1; + } else if (action < 0) { + const int ruleno = -action - 1; + const int N = rhs[ruleno]; + _tos -= N; + if (N == 0) + _astStack[_tos] = 0; + else + _astStack[_tos] = new Operator(ruleno, &_astStack[_tos], &_astStack[_tos + N]); + action = nt_action(_stateStack[_tos], lhs[ruleno] - TERMINAL_COUNT); + } + } while (action); + + fprintf(stderr, "unexpected token `%s' at line %d\n", yytoken != -1 ? spell[yytoken] : "", + _tokens[yyloc].line + 1); + + return false; +} +./ +variable_identifier ::= IDENTIFIER ; +primary_expression ::= NUMBER ; +primary_expression ::= TRUE ; +primary_expression ::= FALSE ; +primary_expression ::= variable_identifier ; +primary_expression ::= LEFT_PAREN expression RIGHT_PAREN ; +postfix_expression ::= primary_expression ; +postfix_expression ::= postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET ; +postfix_expression ::= function_call ; +postfix_expression ::= postfix_expression DOT IDENTIFIER ; +postfix_expression ::= postfix_expression INC_OP ; +postfix_expression ::= postfix_expression DEC_OP ; +integer_expression ::= expression ; +function_call ::= function_call_or_method ; +function_call_or_method ::= function_call_generic ; +function_call_or_method ::= postfix_expression DOT function_call_generic ; +function_call_generic ::= function_call_header_with_parameters RIGHT_PAREN ; +function_call_generic ::= function_call_header_no_parameters RIGHT_PAREN ; +function_call_header_no_parameters ::= function_call_header VOID ; +function_call_header_no_parameters ::= function_call_header ; +function_call_header_with_parameters ::= function_call_header assignment_expression ; +function_call_header_with_parameters ::= function_call_header_with_parameters COMMA assignment_expression ; +function_call_header ::= function_identifier LEFT_PAREN ; +function_identifier ::= type_specifier ; +function_identifier ::= IDENTIFIER ; +unary_expression ::= postfix_expression ; +unary_expression ::= INC_OP unary_expression ; +unary_expression ::= DEC_OP unary_expression ; +unary_expression ::= unary_operator unary_expression ; +unary_operator ::= PLUS ; +unary_operator ::= DASH ; +unary_operator ::= BANG ; +unary_operator ::= TILDE ; +multiplicative_expression ::= unary_expression ; +multiplicative_expression ::= multiplicative_expression STAR unary_expression ; +multiplicative_expression ::= multiplicative_expression SLASH unary_expression ; +multiplicative_expression ::= multiplicative_expression PERCENT unary_expression ; +additive_expression ::= multiplicative_expression ; +additive_expression ::= additive_expression PLUS multiplicative_expression ; +additive_expression ::= additive_expression DASH multiplicative_expression ; +shift_expression ::= additive_expression ; +shift_expression ::= shift_expression LEFT_OP additive_expression ; +shift_expression ::= shift_expression RIGHT_OP additive_expression ; +relational_expression ::= shift_expression ; +relational_expression ::= relational_expression LEFT_ANGLE shift_expression ; +relational_expression ::= relational_expression RIGHT_ANGLE shift_expression ; +relational_expression ::= relational_expression LE_OP shift_expression ; +relational_expression ::= relational_expression GE_OP shift_expression ; +equality_expression ::= relational_expression ; +equality_expression ::= equality_expression EQ_OP relational_expression ; +equality_expression ::= equality_expression NE_OP relational_expression ; +and_expression ::= equality_expression ; +and_expression ::= and_expression AMPERSAND equality_expression ; +exclusive_or_expression ::= and_expression ; +exclusive_or_expression ::= exclusive_or_expression CARET and_expression ; +inclusive_or_expression ::= exclusive_or_expression ; +inclusive_or_expression ::= inclusive_or_expression VERTICAL_BAR exclusive_or_expression ; +logical_and_expression ::= inclusive_or_expression ; +logical_and_expression ::= logical_and_expression AND_OP inclusive_or_expression ; +logical_xor_expression ::= logical_and_expression ; +logical_xor_expression ::= logical_xor_expression XOR_OP logical_and_expression ; +logical_or_expression ::= logical_xor_expression ; +logical_or_expression ::= logical_or_expression OR_OP logical_xor_expression ; +conditional_expression ::= logical_or_expression ; +conditional_expression ::= logical_or_expression QUESTION expression COLON assignment_expression ; +assignment_expression ::= conditional_expression ; +assignment_expression ::= unary_expression assignment_operator assignment_expression ; +assignment_operator ::= EQUAL ; +assignment_operator ::= MUL_ASSIGN ; +assignment_operator ::= DIV_ASSIGN ; +assignment_operator ::= MOD_ASSIGN ; +assignment_operator ::= ADD_ASSIGN ; +assignment_operator ::= SUB_ASSIGN ; +assignment_operator ::= LEFT_ASSIGN ; +assignment_operator ::= RIGHT_ASSIGN ; +assignment_operator ::= AND_ASSIGN ; +assignment_operator ::= XOR_ASSIGN ; +assignment_operator ::= OR_ASSIGN ; +expression ::= assignment_expression ; +expression ::= expression COMMA assignment_expression ; +constant_expression ::= conditional_expression ; +declaration ::= function_prototype SEMICOLON ; +declaration ::= init_declarator_list SEMICOLON ; +declaration ::= PRECISION precision_qualifier type_specifier_no_prec SEMICOLON ; +declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE SEMICOLON ; +declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER SEMICOLON ; +declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET RIGHT_BRACKET SEMICOLON ; +declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET SEMICOLON ; +declaration ::= type_qualifier SEMICOLON ; +function_prototype ::= function_declarator RIGHT_PAREN ; +function_declarator ::= function_header ; +function_declarator ::= function_header_with_parameters ; +function_header_with_parameters ::= function_header parameter_declaration ; +function_header_with_parameters ::= function_header_with_parameters COMMA parameter_declaration ; +function_header ::= fully_specified_type IDENTIFIER LEFT_PAREN ; +parameter_declarator ::= type_specifier IDENTIFIER ; +parameter_declarator ::= type_specifier IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_declarator ; +parameter_declaration ::= parameter_qualifier parameter_declarator ; +parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_type_specifier ; +parameter_declaration ::= parameter_qualifier parameter_type_specifier ; +parameter_qualifier ::= ; +parameter_qualifier ::= IN ; +parameter_qualifier ::= OUT ; +parameter_qualifier ::= INOUT ; +parameter_type_specifier ::= type_specifier ; +init_declarator_list ::= single_declaration ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER EQUAL initializer ; +single_declaration ::= fully_specified_type ; +single_declaration ::= fully_specified_type IDENTIFIER ; +single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer ; +single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer ; +single_declaration ::= fully_specified_type IDENTIFIER EQUAL initializer ; +single_declaration ::= INVARIANT IDENTIFIER ; +fully_specified_type ::= type_specifier ; +fully_specified_type ::= type_qualifier type_specifier ; +invariant_qualifier ::= INVARIANT ; +interpolation_qualifier ::= SMOOTH ; +interpolation_qualifier ::= FLAT ; +interpolation_qualifier ::= NOPERSPECTIVE ; +layout_qualifier ::= LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN ; +layout_qualifier_id_list ::= layout_qualifier_id ; +layout_qualifier_id_list ::= layout_qualifier_id_list COMMA layout_qualifier_id ; +layout_qualifier_id ::= IDENTIFIER ; +layout_qualifier_id ::= IDENTIFIER EQUAL NUMBER ; +parameter_type_qualifier ::= CONST ; +type_qualifier ::= storage_qualifier ; +type_qualifier ::= layout_qualifier ; +type_qualifier ::= layout_qualifier storage_qualifier ; +type_qualifier ::= interpolation_qualifier storage_qualifier ; +type_qualifier ::= interpolation_qualifier ; +type_qualifier ::= invariant_qualifier storage_qualifier ; +type_qualifier ::= invariant_qualifier interpolation_qualifier storage_qualifier ; +type_qualifier ::= INVARIANT ; +storage_qualifier ::= CONST ; +storage_qualifier ::= ATTRIBUTE ; +storage_qualifier ::= VARYING ; +storage_qualifier ::= CENTROID VARYING ; +storage_qualifier ::= IN ; +storage_qualifier ::= OUT ; +storage_qualifier ::= CENTROID IN ; +storage_qualifier ::= CENTROID OUT ; +storage_qualifier ::= PATCH IN ; +storage_qualifier ::= PATCH OUT ; +storage_qualifier ::= SAMPLE IN ; +storage_qualifier ::= SAMPLE OUT ; +storage_qualifier ::= UNIFORM ; +type_specifier ::= type_specifier_no_prec ; +type_specifier ::= precision_qualifier type_specifier_no_prec ; +type_specifier_no_prec ::= type_specifier_nonarray ; +type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET RIGHT_BRACKET ; +type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET constant_expression RIGHT_BRACKET ; +type_specifier_nonarray ::= VOID ; +type_specifier_nonarray ::= FLOAT ; +type_specifier_nonarray ::= DOUBLE ; +type_specifier_nonarray ::= INT ; +type_specifier_nonarray ::= UINT ; +type_specifier_nonarray ::= BOOL ; +type_specifier_nonarray ::= VEC2 ; +type_specifier_nonarray ::= VEC3 ; +type_specifier_nonarray ::= VEC4 ; +type_specifier_nonarray ::= DVEC2 ; +type_specifier_nonarray ::= DVEC3 ; +type_specifier_nonarray ::= DVEC4 ; +type_specifier_nonarray ::= BVEC2 ; +type_specifier_nonarray ::= BVEC3 ; +type_specifier_nonarray ::= BVEC4 ; +type_specifier_nonarray ::= IVEC2 ; +type_specifier_nonarray ::= IVEC3 ; +type_specifier_nonarray ::= IVEC4 ; +type_specifier_nonarray ::= UVEC2 ; +type_specifier_nonarray ::= UVEC3 ; +type_specifier_nonarray ::= UVEC4 ; +type_specifier_nonarray ::= MAT2 ; +type_specifier_nonarray ::= MAT3 ; +type_specifier_nonarray ::= MAT4 ; +type_specifier_nonarray ::= MAT2X2 ; +type_specifier_nonarray ::= MAT2X3 ; +type_specifier_nonarray ::= MAT2X4 ; +type_specifier_nonarray ::= MAT3X2 ; +type_specifier_nonarray ::= MAT3X3 ; +type_specifier_nonarray ::= MAT3X4 ; +type_specifier_nonarray ::= MAT4X2 ; +type_specifier_nonarray ::= MAT4X3 ; +type_specifier_nonarray ::= MAT4X4 ; +type_specifier_nonarray ::= DMAT2 ; +type_specifier_nonarray ::= DMAT3 ; +type_specifier_nonarray ::= DMAT4 ; +type_specifier_nonarray ::= DMAT2X2 ; +type_specifier_nonarray ::= DMAT2X3 ; +type_specifier_nonarray ::= DMAT2X4 ; +type_specifier_nonarray ::= DMAT3X2 ; +type_specifier_nonarray ::= DMAT3X3 ; +type_specifier_nonarray ::= DMAT3X4 ; +type_specifier_nonarray ::= DMAT4X2 ; +type_specifier_nonarray ::= DMAT4X3 ; +type_specifier_nonarray ::= DMAT4X4 ; +type_specifier_nonarray ::= SAMPLER1D ; +type_specifier_nonarray ::= SAMPLER2D ; +type_specifier_nonarray ::= SAMPLER3D ; +type_specifier_nonarray ::= SAMPLERCUBE ; +type_specifier_nonarray ::= SAMPLER1DSHADOW ; +type_specifier_nonarray ::= SAMPLER2DSHADOW ; +type_specifier_nonarray ::= SAMPLERCUBESHADOW ; +type_specifier_nonarray ::= SAMPLER1DARRAY ; +type_specifier_nonarray ::= SAMPLER2DARRAY ; +type_specifier_nonarray ::= SAMPLER1DARRAYSHADOW ; +type_specifier_nonarray ::= SAMPLER2DARRAYSHADOW ; +type_specifier_nonarray ::= SAMPLERCUBEARRAY ; +type_specifier_nonarray ::= SAMPLERCUBEARRAYSHADOW ; +type_specifier_nonarray ::= ISAMPLER1D ; +type_specifier_nonarray ::= ISAMPLER2D ; +type_specifier_nonarray ::= ISAMPLER3D ; +type_specifier_nonarray ::= ISAMPLERCUBE ; +type_specifier_nonarray ::= ISAMPLER1DARRAY ; +type_specifier_nonarray ::= ISAMPLER2DARRAY ; +type_specifier_nonarray ::= ISAMPLERCUBEARRAY ; +type_specifier_nonarray ::= USAMPLER1D ; +type_specifier_nonarray ::= USAMPLER2D ; +type_specifier_nonarray ::= USAMPLER3D ; +type_specifier_nonarray ::= USAMPLERCUBE ; +type_specifier_nonarray ::= USAMPLER1DARRAY ; +type_specifier_nonarray ::= USAMPLER2DARRAY ; +type_specifier_nonarray ::= USAMPLERCUBEARRAY ; +type_specifier_nonarray ::= SAMPLER2DRECT ; +type_specifier_nonarray ::= SAMPLER2DRECTSHADOW ; +type_specifier_nonarray ::= ISAMPLER2DRECT ; +type_specifier_nonarray ::= USAMPLER2DRECT ; +type_specifier_nonarray ::= SAMPLERBUFFER ; +type_specifier_nonarray ::= ISAMPLERBUFFER ; +type_specifier_nonarray ::= USAMPLERBUFFER ; +type_specifier_nonarray ::= SAMPLER2DMS ; +type_specifier_nonarray ::= ISAMPLER2DMS ; +type_specifier_nonarray ::= USAMPLER2DMS ; +type_specifier_nonarray ::= SAMPLER2DMSARRAY ; +type_specifier_nonarray ::= ISAMPLER2DMSARRAY ; +type_specifier_nonarray ::= USAMPLER2DMSARRAY ; +type_specifier_nonarray ::= struct_specifier ; +type_specifier_nonarray ::= TYPE_NAME ; +precision_qualifier ::= HIGHP ; +precision_qualifier ::= MEDIUMP ; +precision_qualifier ::= LOWP ; +struct_specifier ::= STRUCT IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE ; +struct_specifier ::= STRUCT LEFT_BRACE struct_declaration_list RIGHT_BRACE ; +struct_declaration_list ::= struct_declaration ; +struct_declaration_list ::= struct_declaration_list struct_declaration ; +struct_declaration ::= type_specifier struct_declarator_list SEMICOLON ; +struct_declaration ::= type_qualifier type_specifier struct_declarator_list SEMICOLON ; +struct_declarator_list ::= struct_declarator ; +struct_declarator_list ::= struct_declarator_list COMMA struct_declarator ; +struct_declarator ::= IDENTIFIER ; +struct_declarator ::= IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +struct_declarator ::= IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +initializer ::= assignment_expression ; +declaration_statement ::= declaration ; +statement ::= compound_statement ; +statement ::= simple_statement ; +simple_statement ::= declaration_statement ; +simple_statement ::= expression_statement ; +simple_statement ::= selection_statement ; +simple_statement ::= switch_statement ; +simple_statement ::= case_label ; +simple_statement ::= iteration_statement ; +simple_statement ::= jump_statement ; +compound_statement ::= LEFT_BRACE RIGHT_BRACE ; +compound_statement ::= LEFT_BRACE statement_list RIGHT_BRACE ; +statement_no_new_scope ::= compound_statement_no_new_scope ; +statement_no_new_scope ::= simple_statement ; +compound_statement_no_new_scope ::= LEFT_BRACE RIGHT_BRACE ; +compound_statement_no_new_scope ::= LEFT_BRACE statement_list RIGHT_BRACE ; +statement_list ::= statement ; +statement_list ::= statement_list statement ; +expression_statement ::= SEMICOLON ; +expression_statement ::= expression SEMICOLON ; +selection_statement ::= IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement ; +selection_rest_statement ::= statement ELSE statement ; +selection_rest_statement ::= statement ; +condition ::= expression ; +condition ::= fully_specified_type IDENTIFIER EQUAL initializer ; +switch_statement ::= SWITCH LEFT_PAREN expression RIGHT_PAREN LEFT_BRACE switch_statement_list RIGHT_BRACE ; +switch_statement_list ::= ; +switch_statement_list ::= statement_list ; +case_label ::= CASE expression COLON ; +case_label ::= DEFAULT COLON ; +iteration_statement ::= WHILE LEFT_PAREN condition RIGHT_PAREN statement_no_new_scope ; +iteration_statement ::= DO statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON ; +iteration_statement ::= FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope ; +for_init_statement ::= expression_statement ; +for_init_statement ::= declaration_statement ; +conditionopt ::= ; +conditionopt ::= condition ; +for_rest_statement ::= conditionopt SEMICOLON ; +for_rest_statement ::= conditionopt SEMICOLON expression ; +jump_statement ::= CONTINUE SEMICOLON ; +jump_statement ::= BREAK SEMICOLON ; +jump_statement ::= RETURN SEMICOLON ; +jump_statement ::= RETURN expression SEMICOLON ; +jump_statement ::= DISCARD SEMICOLON ; +translation_unit ::= external_declaration ; +translation_unit ::= translation_unit external_declaration ; +external_declaration ::= function_definition ; +external_declaration ::= declaration ; +external_declaration ::= SEMICOLON ; +function_definition ::= function_prototype compound_statement_no_new_scope ; diff --git a/src/libs/glsl/glsl.pro b/src/libs/glsl/glsl.pro new file mode 100644 index 00000000000..758e2d613e4 --- /dev/null +++ b/src/libs/glsl/glsl.pro @@ -0,0 +1,9 @@ +TEMPLATE = lib +CONFIG += dll +TARGET = GLSL +DEFINES += GLSL_BUILD_DIR QT_CREATOR + +include(../../qtcreatorlibrary.pri) +include(glsl-lib.pri) +include(../utils/utils.pri) + diff --git a/src/libs/glsl/glslast.cpp b/src/libs/glsl/glslast.cpp new file mode 100644 index 00000000000..c4914f39538 --- /dev/null +++ b/src/libs/glsl/glslast.cpp @@ -0,0 +1,12 @@ +#include "glslast.h" + +using namespace GLSL; + +AST::AST() +{ +} + +AST::~AST() +{ +} + diff --git a/src/libs/glsl/glslast.h b/src/libs/glsl/glslast.h new file mode 100644 index 00000000000..0ceb56be337 --- /dev/null +++ b/src/libs/glsl/glslast.h @@ -0,0 +1,51 @@ +#ifndef GLSLAST_H +#define GLSLAST_H + +#include + +namespace GLSL { + +class AST; +class Operand; +class Operator; + +class AST +{ +public: + AST(); + virtual ~AST(); + + virtual Operand *asOperand() { return 0; } + virtual Operator *asOperator() { return 0; } +}; + +class Operand: public AST +{ +public: + Operand(int location) + : location(location) {} + + virtual Operand *asOperand() { return this; } + +public: // attributes + int location; +}; + +class Operator: public AST, public std::vector +{ + typedef std::vector _Base; + +public: + template + Operator(int ruleno, It begin, It end) + : _Base(begin, end), ruleno(ruleno) {} + + virtual Operator *asOperator() { return this; } + +public: // attributes + int ruleno; +}; + +} // namespace GLSL + +#endif // GLSLAST_H diff --git a/src/libs/glsl/glsldelete.cpp b/src/libs/glsl/glsldelete.cpp new file mode 100644 index 00000000000..93288cb7e61 --- /dev/null +++ b/src/libs/glsl/glsldelete.cpp @@ -0,0 +1,3471 @@ + +#include "glslast.h" + +namespace GLSL { + +class Delete +{ + typedef void (Delete::*dispatch_func)(AST *); + static dispatch_func dispatch[]; + +public: + void accept(AST *ast) + { + if (! ast) + return; + else if (Operator *op = ast->asOperator()) + (this->*dispatch[op->ruleno])(ast); + delete ast; + } + + template + void accept(It first, It last) + { + for (; first != last; ++first) + accept(*first); + } + +private: + void on_variable_identifier_1(AST *); + void on_primary_expression_2(AST *); + void on_primary_expression_3(AST *); + void on_primary_expression_4(AST *); + void on_primary_expression_5(AST *); + void on_primary_expression_6(AST *); + void on_postfix_expression_7(AST *); + void on_postfix_expression_8(AST *); + void on_postfix_expression_9(AST *); + void on_postfix_expression_10(AST *); + void on_postfix_expression_11(AST *); + void on_postfix_expression_12(AST *); + void on_integer_expression_13(AST *); + void on_function_call_14(AST *); + void on_function_call_or_method_15(AST *); + void on_function_call_or_method_16(AST *); + void on_function_call_generic_17(AST *); + void on_function_call_generic_18(AST *); + void on_function_call_header_no_parameters_19(AST *); + void on_function_call_header_no_parameters_20(AST *); + void on_function_call_header_with_parameters_21(AST *); + void on_function_call_header_with_parameters_22(AST *); + void on_function_call_header_23(AST *); + void on_function_identifier_24(AST *); + void on_function_identifier_25(AST *); + void on_unary_expression_26(AST *); + void on_unary_expression_27(AST *); + void on_unary_expression_28(AST *); + void on_unary_expression_29(AST *); + void on_unary_operator_30(AST *); + void on_unary_operator_31(AST *); + void on_unary_operator_32(AST *); + void on_unary_operator_33(AST *); + void on_multiplicative_expression_34(AST *); + void on_multiplicative_expression_35(AST *); + void on_multiplicative_expression_36(AST *); + void on_multiplicative_expression_37(AST *); + void on_additive_expression_38(AST *); + void on_additive_expression_39(AST *); + void on_additive_expression_40(AST *); + void on_shift_expression_41(AST *); + void on_shift_expression_42(AST *); + void on_shift_expression_43(AST *); + void on_relational_expression_44(AST *); + void on_relational_expression_45(AST *); + void on_relational_expression_46(AST *); + void on_relational_expression_47(AST *); + void on_relational_expression_48(AST *); + void on_equality_expression_49(AST *); + void on_equality_expression_50(AST *); + void on_equality_expression_51(AST *); + void on_and_expression_52(AST *); + void on_and_expression_53(AST *); + void on_exclusive_or_expression_54(AST *); + void on_exclusive_or_expression_55(AST *); + void on_inclusive_or_expression_56(AST *); + void on_inclusive_or_expression_57(AST *); + void on_logical_and_expression_58(AST *); + void on_logical_and_expression_59(AST *); + void on_logical_xor_expression_60(AST *); + void on_logical_xor_expression_61(AST *); + void on_logical_or_expression_62(AST *); + void on_logical_or_expression_63(AST *); + void on_conditional_expression_64(AST *); + void on_conditional_expression_65(AST *); + void on_assignment_expression_66(AST *); + void on_assignment_expression_67(AST *); + void on_assignment_operator_68(AST *); + void on_assignment_operator_69(AST *); + void on_assignment_operator_70(AST *); + void on_assignment_operator_71(AST *); + void on_assignment_operator_72(AST *); + void on_assignment_operator_73(AST *); + void on_assignment_operator_74(AST *); + void on_assignment_operator_75(AST *); + void on_assignment_operator_76(AST *); + void on_assignment_operator_77(AST *); + void on_assignment_operator_78(AST *); + void on_expression_79(AST *); + void on_expression_80(AST *); + void on_constant_expression_81(AST *); + void on_declaration_82(AST *); + void on_declaration_83(AST *); + void on_declaration_84(AST *); + void on_declaration_85(AST *); + void on_declaration_86(AST *); + void on_declaration_87(AST *); + void on_declaration_88(AST *); + void on_declaration_89(AST *); + void on_function_prototype_90(AST *); + void on_function_declarator_91(AST *); + void on_function_declarator_92(AST *); + void on_function_header_with_parameters_93(AST *); + void on_function_header_with_parameters_94(AST *); + void on_function_header_95(AST *); + void on_parameter_declarator_96(AST *); + void on_parameter_declarator_97(AST *); + void on_parameter_declaration_98(AST *); + void on_parameter_declaration_99(AST *); + void on_parameter_declaration_100(AST *); + void on_parameter_declaration_101(AST *); + void on_parameter_qualifier_102(AST *); + void on_parameter_qualifier_103(AST *); + void on_parameter_qualifier_104(AST *); + void on_parameter_qualifier_105(AST *); + void on_parameter_type_specifier_106(AST *); + void on_init_declarator_list_107(AST *); + void on_init_declarator_list_108(AST *); + void on_init_declarator_list_109(AST *); + void on_init_declarator_list_110(AST *); + void on_init_declarator_list_111(AST *); + void on_init_declarator_list_112(AST *); + void on_init_declarator_list_113(AST *); + void on_single_declaration_114(AST *); + void on_single_declaration_115(AST *); + void on_single_declaration_116(AST *); + void on_single_declaration_117(AST *); + void on_single_declaration_118(AST *); + void on_single_declaration_119(AST *); + void on_single_declaration_120(AST *); + void on_single_declaration_121(AST *); + void on_fully_specified_type_122(AST *); + void on_fully_specified_type_123(AST *); + void on_invariant_qualifier_124(AST *); + void on_interpolation_qualifier_125(AST *); + void on_interpolation_qualifier_126(AST *); + void on_interpolation_qualifier_127(AST *); + void on_layout_qualifier_128(AST *); + void on_layout_qualifier_id_list_129(AST *); + void on_layout_qualifier_id_list_130(AST *); + void on_layout_qualifier_id_131(AST *); + void on_layout_qualifier_id_132(AST *); + void on_parameter_type_qualifier_133(AST *); + void on_type_qualifier_134(AST *); + void on_type_qualifier_135(AST *); + void on_type_qualifier_136(AST *); + void on_type_qualifier_137(AST *); + void on_type_qualifier_138(AST *); + void on_type_qualifier_139(AST *); + void on_type_qualifier_140(AST *); + void on_type_qualifier_141(AST *); + void on_storage_qualifier_142(AST *); + void on_storage_qualifier_143(AST *); + void on_storage_qualifier_144(AST *); + void on_storage_qualifier_145(AST *); + void on_storage_qualifier_146(AST *); + void on_storage_qualifier_147(AST *); + void on_storage_qualifier_148(AST *); + void on_storage_qualifier_149(AST *); + void on_storage_qualifier_150(AST *); + void on_storage_qualifier_151(AST *); + void on_storage_qualifier_152(AST *); + void on_storage_qualifier_153(AST *); + void on_storage_qualifier_154(AST *); + void on_type_specifier_155(AST *); + void on_type_specifier_156(AST *); + void on_type_specifier_no_prec_157(AST *); + void on_type_specifier_no_prec_158(AST *); + void on_type_specifier_no_prec_159(AST *); + void on_type_specifier_nonarray_160(AST *); + void on_type_specifier_nonarray_161(AST *); + void on_type_specifier_nonarray_162(AST *); + void on_type_specifier_nonarray_163(AST *); + void on_type_specifier_nonarray_164(AST *); + void on_type_specifier_nonarray_165(AST *); + void on_type_specifier_nonarray_166(AST *); + void on_type_specifier_nonarray_167(AST *); + void on_type_specifier_nonarray_168(AST *); + void on_type_specifier_nonarray_169(AST *); + void on_type_specifier_nonarray_170(AST *); + void on_type_specifier_nonarray_171(AST *); + void on_type_specifier_nonarray_172(AST *); + void on_type_specifier_nonarray_173(AST *); + void on_type_specifier_nonarray_174(AST *); + void on_type_specifier_nonarray_175(AST *); + void on_type_specifier_nonarray_176(AST *); + void on_type_specifier_nonarray_177(AST *); + void on_type_specifier_nonarray_178(AST *); + void on_type_specifier_nonarray_179(AST *); + void on_type_specifier_nonarray_180(AST *); + void on_type_specifier_nonarray_181(AST *); + void on_type_specifier_nonarray_182(AST *); + void on_type_specifier_nonarray_183(AST *); + void on_type_specifier_nonarray_184(AST *); + void on_type_specifier_nonarray_185(AST *); + void on_type_specifier_nonarray_186(AST *); + void on_type_specifier_nonarray_187(AST *); + void on_type_specifier_nonarray_188(AST *); + void on_type_specifier_nonarray_189(AST *); + void on_type_specifier_nonarray_190(AST *); + void on_type_specifier_nonarray_191(AST *); + void on_type_specifier_nonarray_192(AST *); + void on_type_specifier_nonarray_193(AST *); + void on_type_specifier_nonarray_194(AST *); + void on_type_specifier_nonarray_195(AST *); + void on_type_specifier_nonarray_196(AST *); + void on_type_specifier_nonarray_197(AST *); + void on_type_specifier_nonarray_198(AST *); + void on_type_specifier_nonarray_199(AST *); + void on_type_specifier_nonarray_200(AST *); + void on_type_specifier_nonarray_201(AST *); + void on_type_specifier_nonarray_202(AST *); + void on_type_specifier_nonarray_203(AST *); + void on_type_specifier_nonarray_204(AST *); + void on_type_specifier_nonarray_205(AST *); + void on_type_specifier_nonarray_206(AST *); + void on_type_specifier_nonarray_207(AST *); + void on_type_specifier_nonarray_208(AST *); + void on_type_specifier_nonarray_209(AST *); + void on_type_specifier_nonarray_210(AST *); + void on_type_specifier_nonarray_211(AST *); + void on_type_specifier_nonarray_212(AST *); + void on_type_specifier_nonarray_213(AST *); + void on_type_specifier_nonarray_214(AST *); + void on_type_specifier_nonarray_215(AST *); + void on_type_specifier_nonarray_216(AST *); + void on_type_specifier_nonarray_217(AST *); + void on_type_specifier_nonarray_218(AST *); + void on_type_specifier_nonarray_219(AST *); + void on_type_specifier_nonarray_220(AST *); + void on_type_specifier_nonarray_221(AST *); + void on_type_specifier_nonarray_222(AST *); + void on_type_specifier_nonarray_223(AST *); + void on_type_specifier_nonarray_224(AST *); + void on_type_specifier_nonarray_225(AST *); + void on_type_specifier_nonarray_226(AST *); + void on_type_specifier_nonarray_227(AST *); + void on_type_specifier_nonarray_228(AST *); + void on_type_specifier_nonarray_229(AST *); + void on_type_specifier_nonarray_230(AST *); + void on_type_specifier_nonarray_231(AST *); + void on_type_specifier_nonarray_232(AST *); + void on_type_specifier_nonarray_233(AST *); + void on_type_specifier_nonarray_234(AST *); + void on_type_specifier_nonarray_235(AST *); + void on_type_specifier_nonarray_236(AST *); + void on_type_specifier_nonarray_237(AST *); + void on_type_specifier_nonarray_238(AST *); + void on_type_specifier_nonarray_239(AST *); + void on_type_specifier_nonarray_240(AST *); + void on_type_specifier_nonarray_241(AST *); + void on_type_specifier_nonarray_242(AST *); + void on_type_specifier_nonarray_243(AST *); + void on_type_specifier_nonarray_244(AST *); + void on_type_specifier_nonarray_245(AST *); + void on_type_specifier_nonarray_246(AST *); + void on_precision_qualifier_247(AST *); + void on_precision_qualifier_248(AST *); + void on_precision_qualifier_249(AST *); + void on_struct_specifier_250(AST *); + void on_struct_specifier_251(AST *); + void on_struct_declaration_list_252(AST *); + void on_struct_declaration_list_253(AST *); + void on_struct_declaration_254(AST *); + void on_struct_declaration_255(AST *); + void on_struct_declarator_list_256(AST *); + void on_struct_declarator_list_257(AST *); + void on_struct_declarator_258(AST *); + void on_struct_declarator_259(AST *); + void on_struct_declarator_260(AST *); + void on_initializer_261(AST *); + void on_declaration_statement_262(AST *); + void on_statement_263(AST *); + void on_statement_264(AST *); + void on_simple_statement_265(AST *); + void on_simple_statement_266(AST *); + void on_simple_statement_267(AST *); + void on_simple_statement_268(AST *); + void on_simple_statement_269(AST *); + void on_simple_statement_270(AST *); + void on_simple_statement_271(AST *); + void on_compound_statement_272(AST *); + void on_compound_statement_273(AST *); + void on_statement_no_new_scope_274(AST *); + void on_statement_no_new_scope_275(AST *); + void on_compound_statement_no_new_scope_276(AST *); + void on_compound_statement_no_new_scope_277(AST *); + void on_statement_list_278(AST *); + void on_statement_list_279(AST *); + void on_expression_statement_280(AST *); + void on_expression_statement_281(AST *); + void on_selection_statement_282(AST *); + void on_selection_rest_statement_283(AST *); + void on_selection_rest_statement_284(AST *); + void on_condition_285(AST *); + void on_condition_286(AST *); + void on_switch_statement_287(AST *); + void on_switch_statement_list_288(AST *); + void on_switch_statement_list_289(AST *); + void on_case_label_290(AST *); + void on_case_label_291(AST *); + void on_iteration_statement_292(AST *); + void on_iteration_statement_293(AST *); + void on_iteration_statement_294(AST *); + void on_for_init_statement_295(AST *); + void on_for_init_statement_296(AST *); + void on_conditionopt_297(AST *); + void on_conditionopt_298(AST *); + void on_for_rest_statement_299(AST *); + void on_for_rest_statement_300(AST *); + void on_jump_statement_301(AST *); + void on_jump_statement_302(AST *); + void on_jump_statement_303(AST *); + void on_jump_statement_304(AST *); + void on_jump_statement_305(AST *); + void on_translation_unit_306(AST *); + void on_translation_unit_307(AST *); + void on_external_declaration_308(AST *); + void on_external_declaration_309(AST *); + void on_external_declaration_310(AST *); + void on_function_definition_311(AST *); +}; + +void deleteAST(AST *ast) +{ + Delete del; + del.accept(ast); +} + +} // end of namespace GLSL + +#include + +using namespace GLSL; + +namespace { +bool debug = false; +} + + +Delete::dispatch_func Delete::dispatch[] = { + &Delete::on_variable_identifier_1, + &Delete::on_primary_expression_2, + &Delete::on_primary_expression_3, + &Delete::on_primary_expression_4, + &Delete::on_primary_expression_5, + &Delete::on_primary_expression_6, + &Delete::on_postfix_expression_7, + &Delete::on_postfix_expression_8, + &Delete::on_postfix_expression_9, + &Delete::on_postfix_expression_10, + &Delete::on_postfix_expression_11, + &Delete::on_postfix_expression_12, + &Delete::on_integer_expression_13, + &Delete::on_function_call_14, + &Delete::on_function_call_or_method_15, + &Delete::on_function_call_or_method_16, + &Delete::on_function_call_generic_17, + &Delete::on_function_call_generic_18, + &Delete::on_function_call_header_no_parameters_19, + &Delete::on_function_call_header_no_parameters_20, + &Delete::on_function_call_header_with_parameters_21, + &Delete::on_function_call_header_with_parameters_22, + &Delete::on_function_call_header_23, + &Delete::on_function_identifier_24, + &Delete::on_function_identifier_25, + &Delete::on_unary_expression_26, + &Delete::on_unary_expression_27, + &Delete::on_unary_expression_28, + &Delete::on_unary_expression_29, + &Delete::on_unary_operator_30, + &Delete::on_unary_operator_31, + &Delete::on_unary_operator_32, + &Delete::on_unary_operator_33, + &Delete::on_multiplicative_expression_34, + &Delete::on_multiplicative_expression_35, + &Delete::on_multiplicative_expression_36, + &Delete::on_multiplicative_expression_37, + &Delete::on_additive_expression_38, + &Delete::on_additive_expression_39, + &Delete::on_additive_expression_40, + &Delete::on_shift_expression_41, + &Delete::on_shift_expression_42, + &Delete::on_shift_expression_43, + &Delete::on_relational_expression_44, + &Delete::on_relational_expression_45, + &Delete::on_relational_expression_46, + &Delete::on_relational_expression_47, + &Delete::on_relational_expression_48, + &Delete::on_equality_expression_49, + &Delete::on_equality_expression_50, + &Delete::on_equality_expression_51, + &Delete::on_and_expression_52, + &Delete::on_and_expression_53, + &Delete::on_exclusive_or_expression_54, + &Delete::on_exclusive_or_expression_55, + &Delete::on_inclusive_or_expression_56, + &Delete::on_inclusive_or_expression_57, + &Delete::on_logical_and_expression_58, + &Delete::on_logical_and_expression_59, + &Delete::on_logical_xor_expression_60, + &Delete::on_logical_xor_expression_61, + &Delete::on_logical_or_expression_62, + &Delete::on_logical_or_expression_63, + &Delete::on_conditional_expression_64, + &Delete::on_conditional_expression_65, + &Delete::on_assignment_expression_66, + &Delete::on_assignment_expression_67, + &Delete::on_assignment_operator_68, + &Delete::on_assignment_operator_69, + &Delete::on_assignment_operator_70, + &Delete::on_assignment_operator_71, + &Delete::on_assignment_operator_72, + &Delete::on_assignment_operator_73, + &Delete::on_assignment_operator_74, + &Delete::on_assignment_operator_75, + &Delete::on_assignment_operator_76, + &Delete::on_assignment_operator_77, + &Delete::on_assignment_operator_78, + &Delete::on_expression_79, + &Delete::on_expression_80, + &Delete::on_constant_expression_81, + &Delete::on_declaration_82, + &Delete::on_declaration_83, + &Delete::on_declaration_84, + &Delete::on_declaration_85, + &Delete::on_declaration_86, + &Delete::on_declaration_87, + &Delete::on_declaration_88, + &Delete::on_declaration_89, + &Delete::on_function_prototype_90, + &Delete::on_function_declarator_91, + &Delete::on_function_declarator_92, + &Delete::on_function_header_with_parameters_93, + &Delete::on_function_header_with_parameters_94, + &Delete::on_function_header_95, + &Delete::on_parameter_declarator_96, + &Delete::on_parameter_declarator_97, + &Delete::on_parameter_declaration_98, + &Delete::on_parameter_declaration_99, + &Delete::on_parameter_declaration_100, + &Delete::on_parameter_declaration_101, + &Delete::on_parameter_qualifier_102, + &Delete::on_parameter_qualifier_103, + &Delete::on_parameter_qualifier_104, + &Delete::on_parameter_qualifier_105, + &Delete::on_parameter_type_specifier_106, + &Delete::on_init_declarator_list_107, + &Delete::on_init_declarator_list_108, + &Delete::on_init_declarator_list_109, + &Delete::on_init_declarator_list_110, + &Delete::on_init_declarator_list_111, + &Delete::on_init_declarator_list_112, + &Delete::on_init_declarator_list_113, + &Delete::on_single_declaration_114, + &Delete::on_single_declaration_115, + &Delete::on_single_declaration_116, + &Delete::on_single_declaration_117, + &Delete::on_single_declaration_118, + &Delete::on_single_declaration_119, + &Delete::on_single_declaration_120, + &Delete::on_single_declaration_121, + &Delete::on_fully_specified_type_122, + &Delete::on_fully_specified_type_123, + &Delete::on_invariant_qualifier_124, + &Delete::on_interpolation_qualifier_125, + &Delete::on_interpolation_qualifier_126, + &Delete::on_interpolation_qualifier_127, + &Delete::on_layout_qualifier_128, + &Delete::on_layout_qualifier_id_list_129, + &Delete::on_layout_qualifier_id_list_130, + &Delete::on_layout_qualifier_id_131, + &Delete::on_layout_qualifier_id_132, + &Delete::on_parameter_type_qualifier_133, + &Delete::on_type_qualifier_134, + &Delete::on_type_qualifier_135, + &Delete::on_type_qualifier_136, + &Delete::on_type_qualifier_137, + &Delete::on_type_qualifier_138, + &Delete::on_type_qualifier_139, + &Delete::on_type_qualifier_140, + &Delete::on_type_qualifier_141, + &Delete::on_storage_qualifier_142, + &Delete::on_storage_qualifier_143, + &Delete::on_storage_qualifier_144, + &Delete::on_storage_qualifier_145, + &Delete::on_storage_qualifier_146, + &Delete::on_storage_qualifier_147, + &Delete::on_storage_qualifier_148, + &Delete::on_storage_qualifier_149, + &Delete::on_storage_qualifier_150, + &Delete::on_storage_qualifier_151, + &Delete::on_storage_qualifier_152, + &Delete::on_storage_qualifier_153, + &Delete::on_storage_qualifier_154, + &Delete::on_type_specifier_155, + &Delete::on_type_specifier_156, + &Delete::on_type_specifier_no_prec_157, + &Delete::on_type_specifier_no_prec_158, + &Delete::on_type_specifier_no_prec_159, + &Delete::on_type_specifier_nonarray_160, + &Delete::on_type_specifier_nonarray_161, + &Delete::on_type_specifier_nonarray_162, + &Delete::on_type_specifier_nonarray_163, + &Delete::on_type_specifier_nonarray_164, + &Delete::on_type_specifier_nonarray_165, + &Delete::on_type_specifier_nonarray_166, + &Delete::on_type_specifier_nonarray_167, + &Delete::on_type_specifier_nonarray_168, + &Delete::on_type_specifier_nonarray_169, + &Delete::on_type_specifier_nonarray_170, + &Delete::on_type_specifier_nonarray_171, + &Delete::on_type_specifier_nonarray_172, + &Delete::on_type_specifier_nonarray_173, + &Delete::on_type_specifier_nonarray_174, + &Delete::on_type_specifier_nonarray_175, + &Delete::on_type_specifier_nonarray_176, + &Delete::on_type_specifier_nonarray_177, + &Delete::on_type_specifier_nonarray_178, + &Delete::on_type_specifier_nonarray_179, + &Delete::on_type_specifier_nonarray_180, + &Delete::on_type_specifier_nonarray_181, + &Delete::on_type_specifier_nonarray_182, + &Delete::on_type_specifier_nonarray_183, + &Delete::on_type_specifier_nonarray_184, + &Delete::on_type_specifier_nonarray_185, + &Delete::on_type_specifier_nonarray_186, + &Delete::on_type_specifier_nonarray_187, + &Delete::on_type_specifier_nonarray_188, + &Delete::on_type_specifier_nonarray_189, + &Delete::on_type_specifier_nonarray_190, + &Delete::on_type_specifier_nonarray_191, + &Delete::on_type_specifier_nonarray_192, + &Delete::on_type_specifier_nonarray_193, + &Delete::on_type_specifier_nonarray_194, + &Delete::on_type_specifier_nonarray_195, + &Delete::on_type_specifier_nonarray_196, + &Delete::on_type_specifier_nonarray_197, + &Delete::on_type_specifier_nonarray_198, + &Delete::on_type_specifier_nonarray_199, + &Delete::on_type_specifier_nonarray_200, + &Delete::on_type_specifier_nonarray_201, + &Delete::on_type_specifier_nonarray_202, + &Delete::on_type_specifier_nonarray_203, + &Delete::on_type_specifier_nonarray_204, + &Delete::on_type_specifier_nonarray_205, + &Delete::on_type_specifier_nonarray_206, + &Delete::on_type_specifier_nonarray_207, + &Delete::on_type_specifier_nonarray_208, + &Delete::on_type_specifier_nonarray_209, + &Delete::on_type_specifier_nonarray_210, + &Delete::on_type_specifier_nonarray_211, + &Delete::on_type_specifier_nonarray_212, + &Delete::on_type_specifier_nonarray_213, + &Delete::on_type_specifier_nonarray_214, + &Delete::on_type_specifier_nonarray_215, + &Delete::on_type_specifier_nonarray_216, + &Delete::on_type_specifier_nonarray_217, + &Delete::on_type_specifier_nonarray_218, + &Delete::on_type_specifier_nonarray_219, + &Delete::on_type_specifier_nonarray_220, + &Delete::on_type_specifier_nonarray_221, + &Delete::on_type_specifier_nonarray_222, + &Delete::on_type_specifier_nonarray_223, + &Delete::on_type_specifier_nonarray_224, + &Delete::on_type_specifier_nonarray_225, + &Delete::on_type_specifier_nonarray_226, + &Delete::on_type_specifier_nonarray_227, + &Delete::on_type_specifier_nonarray_228, + &Delete::on_type_specifier_nonarray_229, + &Delete::on_type_specifier_nonarray_230, + &Delete::on_type_specifier_nonarray_231, + &Delete::on_type_specifier_nonarray_232, + &Delete::on_type_specifier_nonarray_233, + &Delete::on_type_specifier_nonarray_234, + &Delete::on_type_specifier_nonarray_235, + &Delete::on_type_specifier_nonarray_236, + &Delete::on_type_specifier_nonarray_237, + &Delete::on_type_specifier_nonarray_238, + &Delete::on_type_specifier_nonarray_239, + &Delete::on_type_specifier_nonarray_240, + &Delete::on_type_specifier_nonarray_241, + &Delete::on_type_specifier_nonarray_242, + &Delete::on_type_specifier_nonarray_243, + &Delete::on_type_specifier_nonarray_244, + &Delete::on_type_specifier_nonarray_245, + &Delete::on_type_specifier_nonarray_246, + &Delete::on_precision_qualifier_247, + &Delete::on_precision_qualifier_248, + &Delete::on_precision_qualifier_249, + &Delete::on_struct_specifier_250, + &Delete::on_struct_specifier_251, + &Delete::on_struct_declaration_list_252, + &Delete::on_struct_declaration_list_253, + &Delete::on_struct_declaration_254, + &Delete::on_struct_declaration_255, + &Delete::on_struct_declarator_list_256, + &Delete::on_struct_declarator_list_257, + &Delete::on_struct_declarator_258, + &Delete::on_struct_declarator_259, + &Delete::on_struct_declarator_260, + &Delete::on_initializer_261, + &Delete::on_declaration_statement_262, + &Delete::on_statement_263, + &Delete::on_statement_264, + &Delete::on_simple_statement_265, + &Delete::on_simple_statement_266, + &Delete::on_simple_statement_267, + &Delete::on_simple_statement_268, + &Delete::on_simple_statement_269, + &Delete::on_simple_statement_270, + &Delete::on_simple_statement_271, + &Delete::on_compound_statement_272, + &Delete::on_compound_statement_273, + &Delete::on_statement_no_new_scope_274, + &Delete::on_statement_no_new_scope_275, + &Delete::on_compound_statement_no_new_scope_276, + &Delete::on_compound_statement_no_new_scope_277, + &Delete::on_statement_list_278, + &Delete::on_statement_list_279, + &Delete::on_expression_statement_280, + &Delete::on_expression_statement_281, + &Delete::on_selection_statement_282, + &Delete::on_selection_rest_statement_283, + &Delete::on_selection_rest_statement_284, + &Delete::on_condition_285, + &Delete::on_condition_286, + &Delete::on_switch_statement_287, + &Delete::on_switch_statement_list_288, + &Delete::on_switch_statement_list_289, + &Delete::on_case_label_290, + &Delete::on_case_label_291, + &Delete::on_iteration_statement_292, + &Delete::on_iteration_statement_293, + &Delete::on_iteration_statement_294, + &Delete::on_for_init_statement_295, + &Delete::on_for_init_statement_296, + &Delete::on_conditionopt_297, + &Delete::on_conditionopt_298, + &Delete::on_for_rest_statement_299, + &Delete::on_for_rest_statement_300, + &Delete::on_jump_statement_301, + &Delete::on_jump_statement_302, + &Delete::on_jump_statement_303, + &Delete::on_jump_statement_304, + &Delete::on_jump_statement_305, + &Delete::on_translation_unit_306, + &Delete::on_translation_unit_307, + &Delete::on_external_declaration_308, + &Delete::on_external_declaration_309, + &Delete::on_external_declaration_310, + &Delete::on_function_definition_311, +0, }; + +// variable_identifier ::= IDENTIFIER ; +void Delete::on_variable_identifier_1(AST *ast) +{ + if (debug) + std::cout << "variable_identifier ::= IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= NUMBER ; +void Delete::on_primary_expression_2(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= NUMBER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= TRUE ; +void Delete::on_primary_expression_3(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= TRUE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= FALSE ; +void Delete::on_primary_expression_4(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= FALSE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= variable_identifier ; +void Delete::on_primary_expression_5(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= variable_identifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= LEFT_PAREN expression RIGHT_PAREN ; +void Delete::on_primary_expression_6(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= LEFT_PAREN expression RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= primary_expression ; +void Delete::on_postfix_expression_7(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= primary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET ; +void Delete::on_postfix_expression_8(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= function_call ; +void Delete::on_postfix_expression_9(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= function_call" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= postfix_expression DOT IDENTIFIER ; +void Delete::on_postfix_expression_10(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= postfix_expression DOT IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= postfix_expression INC_OP ; +void Delete::on_postfix_expression_11(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= postfix_expression INC_OP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= postfix_expression DEC_OP ; +void Delete::on_postfix_expression_12(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= postfix_expression DEC_OP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// integer_expression ::= expression ; +void Delete::on_integer_expression_13(AST *ast) +{ + if (debug) + std::cout << "integer_expression ::= expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call ::= function_call_or_method ; +void Delete::on_function_call_14(AST *ast) +{ + if (debug) + std::cout << "function_call ::= function_call_or_method" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_or_method ::= function_call_generic ; +void Delete::on_function_call_or_method_15(AST *ast) +{ + if (debug) + std::cout << "function_call_or_method ::= function_call_generic" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_or_method ::= postfix_expression DOT function_call_generic ; +void Delete::on_function_call_or_method_16(AST *ast) +{ + if (debug) + std::cout << "function_call_or_method ::= postfix_expression DOT function_call_generic" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_generic ::= function_call_header_with_parameters RIGHT_PAREN ; +void Delete::on_function_call_generic_17(AST *ast) +{ + if (debug) + std::cout << "function_call_generic ::= function_call_header_with_parameters RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_generic ::= function_call_header_no_parameters RIGHT_PAREN ; +void Delete::on_function_call_generic_18(AST *ast) +{ + if (debug) + std::cout << "function_call_generic ::= function_call_header_no_parameters RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header_no_parameters ::= function_call_header VOID ; +void Delete::on_function_call_header_no_parameters_19(AST *ast) +{ + if (debug) + std::cout << "function_call_header_no_parameters ::= function_call_header VOID" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header_no_parameters ::= function_call_header ; +void Delete::on_function_call_header_no_parameters_20(AST *ast) +{ + if (debug) + std::cout << "function_call_header_no_parameters ::= function_call_header" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header_with_parameters ::= function_call_header assignment_expression ; +void Delete::on_function_call_header_with_parameters_21(AST *ast) +{ + if (debug) + std::cout << "function_call_header_with_parameters ::= function_call_header assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header_with_parameters ::= function_call_header_with_parameters COMMA assignment_expression ; +void Delete::on_function_call_header_with_parameters_22(AST *ast) +{ + if (debug) + std::cout << "function_call_header_with_parameters ::= function_call_header_with_parameters COMMA assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header ::= function_identifier LEFT_PAREN ; +void Delete::on_function_call_header_23(AST *ast) +{ + if (debug) + std::cout << "function_call_header ::= function_identifier LEFT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_identifier ::= type_specifier ; +void Delete::on_function_identifier_24(AST *ast) +{ + if (debug) + std::cout << "function_identifier ::= type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_identifier ::= IDENTIFIER ; +void Delete::on_function_identifier_25(AST *ast) +{ + if (debug) + std::cout << "function_identifier ::= IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_expression ::= postfix_expression ; +void Delete::on_unary_expression_26(AST *ast) +{ + if (debug) + std::cout << "unary_expression ::= postfix_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_expression ::= INC_OP unary_expression ; +void Delete::on_unary_expression_27(AST *ast) +{ + if (debug) + std::cout << "unary_expression ::= INC_OP unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_expression ::= DEC_OP unary_expression ; +void Delete::on_unary_expression_28(AST *ast) +{ + if (debug) + std::cout << "unary_expression ::= DEC_OP unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_expression ::= unary_operator unary_expression ; +void Delete::on_unary_expression_29(AST *ast) +{ + if (debug) + std::cout << "unary_expression ::= unary_operator unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_operator ::= PLUS ; +void Delete::on_unary_operator_30(AST *ast) +{ + if (debug) + std::cout << "unary_operator ::= PLUS" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_operator ::= DASH ; +void Delete::on_unary_operator_31(AST *ast) +{ + if (debug) + std::cout << "unary_operator ::= DASH" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_operator ::= BANG ; +void Delete::on_unary_operator_32(AST *ast) +{ + if (debug) + std::cout << "unary_operator ::= BANG" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_operator ::= TILDE ; +void Delete::on_unary_operator_33(AST *ast) +{ + if (debug) + std::cout << "unary_operator ::= TILDE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// multiplicative_expression ::= unary_expression ; +void Delete::on_multiplicative_expression_34(AST *ast) +{ + if (debug) + std::cout << "multiplicative_expression ::= unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// multiplicative_expression ::= multiplicative_expression STAR unary_expression ; +void Delete::on_multiplicative_expression_35(AST *ast) +{ + if (debug) + std::cout << "multiplicative_expression ::= multiplicative_expression STAR unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// multiplicative_expression ::= multiplicative_expression SLASH unary_expression ; +void Delete::on_multiplicative_expression_36(AST *ast) +{ + if (debug) + std::cout << "multiplicative_expression ::= multiplicative_expression SLASH unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// multiplicative_expression ::= multiplicative_expression PERCENT unary_expression ; +void Delete::on_multiplicative_expression_37(AST *ast) +{ + if (debug) + std::cout << "multiplicative_expression ::= multiplicative_expression PERCENT unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// additive_expression ::= multiplicative_expression ; +void Delete::on_additive_expression_38(AST *ast) +{ + if (debug) + std::cout << "additive_expression ::= multiplicative_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// additive_expression ::= additive_expression PLUS multiplicative_expression ; +void Delete::on_additive_expression_39(AST *ast) +{ + if (debug) + std::cout << "additive_expression ::= additive_expression PLUS multiplicative_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// additive_expression ::= additive_expression DASH multiplicative_expression ; +void Delete::on_additive_expression_40(AST *ast) +{ + if (debug) + std::cout << "additive_expression ::= additive_expression DASH multiplicative_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// shift_expression ::= additive_expression ; +void Delete::on_shift_expression_41(AST *ast) +{ + if (debug) + std::cout << "shift_expression ::= additive_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// shift_expression ::= shift_expression LEFT_OP additive_expression ; +void Delete::on_shift_expression_42(AST *ast) +{ + if (debug) + std::cout << "shift_expression ::= shift_expression LEFT_OP additive_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// shift_expression ::= shift_expression RIGHT_OP additive_expression ; +void Delete::on_shift_expression_43(AST *ast) +{ + if (debug) + std::cout << "shift_expression ::= shift_expression RIGHT_OP additive_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= shift_expression ; +void Delete::on_relational_expression_44(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= relational_expression LEFT_ANGLE shift_expression ; +void Delete::on_relational_expression_45(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= relational_expression LEFT_ANGLE shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= relational_expression RIGHT_ANGLE shift_expression ; +void Delete::on_relational_expression_46(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= relational_expression RIGHT_ANGLE shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= relational_expression LE_OP shift_expression ; +void Delete::on_relational_expression_47(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= relational_expression LE_OP shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= relational_expression GE_OP shift_expression ; +void Delete::on_relational_expression_48(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= relational_expression GE_OP shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// equality_expression ::= relational_expression ; +void Delete::on_equality_expression_49(AST *ast) +{ + if (debug) + std::cout << "equality_expression ::= relational_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// equality_expression ::= equality_expression EQ_OP relational_expression ; +void Delete::on_equality_expression_50(AST *ast) +{ + if (debug) + std::cout << "equality_expression ::= equality_expression EQ_OP relational_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// equality_expression ::= equality_expression NE_OP relational_expression ; +void Delete::on_equality_expression_51(AST *ast) +{ + if (debug) + std::cout << "equality_expression ::= equality_expression NE_OP relational_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// and_expression ::= equality_expression ; +void Delete::on_and_expression_52(AST *ast) +{ + if (debug) + std::cout << "and_expression ::= equality_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// and_expression ::= and_expression AMPERSAND equality_expression ; +void Delete::on_and_expression_53(AST *ast) +{ + if (debug) + std::cout << "and_expression ::= and_expression AMPERSAND equality_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// exclusive_or_expression ::= and_expression ; +void Delete::on_exclusive_or_expression_54(AST *ast) +{ + if (debug) + std::cout << "exclusive_or_expression ::= and_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// exclusive_or_expression ::= exclusive_or_expression CARET and_expression ; +void Delete::on_exclusive_or_expression_55(AST *ast) +{ + if (debug) + std::cout << "exclusive_or_expression ::= exclusive_or_expression CARET and_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// inclusive_or_expression ::= exclusive_or_expression ; +void Delete::on_inclusive_or_expression_56(AST *ast) +{ + if (debug) + std::cout << "inclusive_or_expression ::= exclusive_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// inclusive_or_expression ::= inclusive_or_expression VERTICAL_BAR exclusive_or_expression ; +void Delete::on_inclusive_or_expression_57(AST *ast) +{ + if (debug) + std::cout << "inclusive_or_expression ::= inclusive_or_expression VERTICAL_BAR exclusive_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_and_expression ::= inclusive_or_expression ; +void Delete::on_logical_and_expression_58(AST *ast) +{ + if (debug) + std::cout << "logical_and_expression ::= inclusive_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_and_expression ::= logical_and_expression AND_OP inclusive_or_expression ; +void Delete::on_logical_and_expression_59(AST *ast) +{ + if (debug) + std::cout << "logical_and_expression ::= logical_and_expression AND_OP inclusive_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_xor_expression ::= logical_and_expression ; +void Delete::on_logical_xor_expression_60(AST *ast) +{ + if (debug) + std::cout << "logical_xor_expression ::= logical_and_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_xor_expression ::= logical_xor_expression XOR_OP logical_and_expression ; +void Delete::on_logical_xor_expression_61(AST *ast) +{ + if (debug) + std::cout << "logical_xor_expression ::= logical_xor_expression XOR_OP logical_and_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_or_expression ::= logical_xor_expression ; +void Delete::on_logical_or_expression_62(AST *ast) +{ + if (debug) + std::cout << "logical_or_expression ::= logical_xor_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_or_expression ::= logical_or_expression OR_OP logical_xor_expression ; +void Delete::on_logical_or_expression_63(AST *ast) +{ + if (debug) + std::cout << "logical_or_expression ::= logical_or_expression OR_OP logical_xor_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// conditional_expression ::= logical_or_expression ; +void Delete::on_conditional_expression_64(AST *ast) +{ + if (debug) + std::cout << "conditional_expression ::= logical_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// conditional_expression ::= logical_or_expression QUESTION expression COLON assignment_expression ; +void Delete::on_conditional_expression_65(AST *ast) +{ + if (debug) + std::cout << "conditional_expression ::= logical_or_expression QUESTION expression COLON assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_expression ::= conditional_expression ; +void Delete::on_assignment_expression_66(AST *ast) +{ + if (debug) + std::cout << "assignment_expression ::= conditional_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_expression ::= unary_expression assignment_operator assignment_expression ; +void Delete::on_assignment_expression_67(AST *ast) +{ + if (debug) + std::cout << "assignment_expression ::= unary_expression assignment_operator assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= EQUAL ; +void Delete::on_assignment_operator_68(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= EQUAL" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= MUL_ASSIGN ; +void Delete::on_assignment_operator_69(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= MUL_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= DIV_ASSIGN ; +void Delete::on_assignment_operator_70(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= DIV_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= MOD_ASSIGN ; +void Delete::on_assignment_operator_71(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= MOD_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= ADD_ASSIGN ; +void Delete::on_assignment_operator_72(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= ADD_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= SUB_ASSIGN ; +void Delete::on_assignment_operator_73(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= SUB_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= LEFT_ASSIGN ; +void Delete::on_assignment_operator_74(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= LEFT_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= RIGHT_ASSIGN ; +void Delete::on_assignment_operator_75(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= RIGHT_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= AND_ASSIGN ; +void Delete::on_assignment_operator_76(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= AND_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= XOR_ASSIGN ; +void Delete::on_assignment_operator_77(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= XOR_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= OR_ASSIGN ; +void Delete::on_assignment_operator_78(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= OR_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// expression ::= assignment_expression ; +void Delete::on_expression_79(AST *ast) +{ + if (debug) + std::cout << "expression ::= assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// expression ::= expression COMMA assignment_expression ; +void Delete::on_expression_80(AST *ast) +{ + if (debug) + std::cout << "expression ::= expression COMMA assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// constant_expression ::= conditional_expression ; +void Delete::on_constant_expression_81(AST *ast) +{ + if (debug) + std::cout << "constant_expression ::= conditional_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= function_prototype SEMICOLON ; +void Delete::on_declaration_82(AST *ast) +{ + if (debug) + std::cout << "declaration ::= function_prototype SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= init_declarator_list SEMICOLON ; +void Delete::on_declaration_83(AST *ast) +{ + if (debug) + std::cout << "declaration ::= init_declarator_list SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= PRECISION precision_qualifier type_specifier_no_prec SEMICOLON ; +void Delete::on_declaration_84(AST *ast) +{ + if (debug) + std::cout << "declaration ::= PRECISION precision_qualifier type_specifier_no_prec SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE SEMICOLON ; +void Delete::on_declaration_85(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER SEMICOLON ; +void Delete::on_declaration_86(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET RIGHT_BRACKET SEMICOLON ; +void Delete::on_declaration_87(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET RIGHT_BRACKET SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET SEMICOLON ; +void Delete::on_declaration_88(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier SEMICOLON ; +void Delete::on_declaration_89(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_prototype ::= function_declarator RIGHT_PAREN ; +void Delete::on_function_prototype_90(AST *ast) +{ + if (debug) + std::cout << "function_prototype ::= function_declarator RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_declarator ::= function_header ; +void Delete::on_function_declarator_91(AST *ast) +{ + if (debug) + std::cout << "function_declarator ::= function_header" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_declarator ::= function_header_with_parameters ; +void Delete::on_function_declarator_92(AST *ast) +{ + if (debug) + std::cout << "function_declarator ::= function_header_with_parameters" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_header_with_parameters ::= function_header parameter_declaration ; +void Delete::on_function_header_with_parameters_93(AST *ast) +{ + if (debug) + std::cout << "function_header_with_parameters ::= function_header parameter_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_header_with_parameters ::= function_header_with_parameters COMMA parameter_declaration ; +void Delete::on_function_header_with_parameters_94(AST *ast) +{ + if (debug) + std::cout << "function_header_with_parameters ::= function_header_with_parameters COMMA parameter_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_header ::= fully_specified_type IDENTIFIER LEFT_PAREN ; +void Delete::on_function_header_95(AST *ast) +{ + if (debug) + std::cout << "function_header ::= fully_specified_type IDENTIFIER LEFT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declarator ::= type_specifier IDENTIFIER ; +void Delete::on_parameter_declarator_96(AST *ast) +{ + if (debug) + std::cout << "parameter_declarator ::= type_specifier IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declarator ::= type_specifier IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Delete::on_parameter_declarator_97(AST *ast) +{ + if (debug) + std::cout << "parameter_declarator ::= type_specifier IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_declarator ; +void Delete::on_parameter_declaration_98(AST *ast) +{ + if (debug) + std::cout << "parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_declarator" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declaration ::= parameter_qualifier parameter_declarator ; +void Delete::on_parameter_declaration_99(AST *ast) +{ + if (debug) + std::cout << "parameter_declaration ::= parameter_qualifier parameter_declarator" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_type_specifier ; +void Delete::on_parameter_declaration_100(AST *ast) +{ + if (debug) + std::cout << "parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declaration ::= parameter_qualifier parameter_type_specifier ; +void Delete::on_parameter_declaration_101(AST *ast) +{ + if (debug) + std::cout << "parameter_declaration ::= parameter_qualifier parameter_type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_qualifier ::= ; +void Delete::on_parameter_qualifier_102(AST *ast) +{ + if (debug) + std::cout << "parameter_qualifier ::=" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_qualifier ::= IN ; +void Delete::on_parameter_qualifier_103(AST *ast) +{ + if (debug) + std::cout << "parameter_qualifier ::= IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_qualifier ::= OUT ; +void Delete::on_parameter_qualifier_104(AST *ast) +{ + if (debug) + std::cout << "parameter_qualifier ::= OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_qualifier ::= INOUT ; +void Delete::on_parameter_qualifier_105(AST *ast) +{ + if (debug) + std::cout << "parameter_qualifier ::= INOUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_type_specifier ::= type_specifier ; +void Delete::on_parameter_type_specifier_106(AST *ast) +{ + if (debug) + std::cout << "parameter_type_specifier ::= type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= single_declaration ; +void Delete::on_init_declarator_list_107(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= single_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER ; +void Delete::on_init_declarator_list_108(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +void Delete::on_init_declarator_list_109(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Delete::on_init_declarator_list_110(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer ; +void Delete::on_init_declarator_list_111(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer ; +void Delete::on_init_declarator_list_112(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER EQUAL initializer ; +void Delete::on_init_declarator_list_113(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type ; +void Delete::on_single_declaration_114(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER ; +void Delete::on_single_declaration_115(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +void Delete::on_single_declaration_116(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Delete::on_single_declaration_117(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer ; +void Delete::on_single_declaration_118(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer ; +void Delete::on_single_declaration_119(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER EQUAL initializer ; +void Delete::on_single_declaration_120(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= INVARIANT IDENTIFIER ; +void Delete::on_single_declaration_121(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= INVARIANT IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// fully_specified_type ::= type_specifier ; +void Delete::on_fully_specified_type_122(AST *ast) +{ + if (debug) + std::cout << "fully_specified_type ::= type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// fully_specified_type ::= type_qualifier type_specifier ; +void Delete::on_fully_specified_type_123(AST *ast) +{ + if (debug) + std::cout << "fully_specified_type ::= type_qualifier type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// invariant_qualifier ::= INVARIANT ; +void Delete::on_invariant_qualifier_124(AST *ast) +{ + if (debug) + std::cout << "invariant_qualifier ::= INVARIANT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// interpolation_qualifier ::= SMOOTH ; +void Delete::on_interpolation_qualifier_125(AST *ast) +{ + if (debug) + std::cout << "interpolation_qualifier ::= SMOOTH" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// interpolation_qualifier ::= FLAT ; +void Delete::on_interpolation_qualifier_126(AST *ast) +{ + if (debug) + std::cout << "interpolation_qualifier ::= FLAT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// interpolation_qualifier ::= NOPERSPECTIVE ; +void Delete::on_interpolation_qualifier_127(AST *ast) +{ + if (debug) + std::cout << "interpolation_qualifier ::= NOPERSPECTIVE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier ::= LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN ; +void Delete::on_layout_qualifier_128(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier ::= LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier_id_list ::= layout_qualifier_id ; +void Delete::on_layout_qualifier_id_list_129(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier_id_list ::= layout_qualifier_id" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier_id_list ::= layout_qualifier_id_list COMMA layout_qualifier_id ; +void Delete::on_layout_qualifier_id_list_130(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier_id_list ::= layout_qualifier_id_list COMMA layout_qualifier_id" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier_id ::= IDENTIFIER ; +void Delete::on_layout_qualifier_id_131(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier_id ::= IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier_id ::= IDENTIFIER EQUAL NUMBER ; +void Delete::on_layout_qualifier_id_132(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier_id ::= IDENTIFIER EQUAL NUMBER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_type_qualifier ::= CONST ; +void Delete::on_parameter_type_qualifier_133(AST *ast) +{ + if (debug) + std::cout << "parameter_type_qualifier ::= CONST" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= storage_qualifier ; +void Delete::on_type_qualifier_134(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= layout_qualifier ; +void Delete::on_type_qualifier_135(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= layout_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= layout_qualifier storage_qualifier ; +void Delete::on_type_qualifier_136(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= layout_qualifier storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= interpolation_qualifier storage_qualifier ; +void Delete::on_type_qualifier_137(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= interpolation_qualifier storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= interpolation_qualifier ; +void Delete::on_type_qualifier_138(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= interpolation_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= invariant_qualifier storage_qualifier ; +void Delete::on_type_qualifier_139(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= invariant_qualifier storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= invariant_qualifier interpolation_qualifier storage_qualifier ; +void Delete::on_type_qualifier_140(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= invariant_qualifier interpolation_qualifier storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= INVARIANT ; +void Delete::on_type_qualifier_141(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= INVARIANT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= CONST ; +void Delete::on_storage_qualifier_142(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= CONST" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= ATTRIBUTE ; +void Delete::on_storage_qualifier_143(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= ATTRIBUTE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= VARYING ; +void Delete::on_storage_qualifier_144(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= VARYING" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= CENTROID VARYING ; +void Delete::on_storage_qualifier_145(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= CENTROID VARYING" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= IN ; +void Delete::on_storage_qualifier_146(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= OUT ; +void Delete::on_storage_qualifier_147(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= CENTROID IN ; +void Delete::on_storage_qualifier_148(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= CENTROID IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= CENTROID OUT ; +void Delete::on_storage_qualifier_149(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= CENTROID OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= PATCH IN ; +void Delete::on_storage_qualifier_150(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= PATCH IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= PATCH OUT ; +void Delete::on_storage_qualifier_151(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= PATCH OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= SAMPLE IN ; +void Delete::on_storage_qualifier_152(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= SAMPLE IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= SAMPLE OUT ; +void Delete::on_storage_qualifier_153(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= SAMPLE OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= UNIFORM ; +void Delete::on_storage_qualifier_154(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= UNIFORM" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier ::= type_specifier_no_prec ; +void Delete::on_type_specifier_155(AST *ast) +{ + if (debug) + std::cout << "type_specifier ::= type_specifier_no_prec" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier ::= precision_qualifier type_specifier_no_prec ; +void Delete::on_type_specifier_156(AST *ast) +{ + if (debug) + std::cout << "type_specifier ::= precision_qualifier type_specifier_no_prec" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_no_prec ::= type_specifier_nonarray ; +void Delete::on_type_specifier_no_prec_157(AST *ast) +{ + if (debug) + std::cout << "type_specifier_no_prec ::= type_specifier_nonarray" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET RIGHT_BRACKET ; +void Delete::on_type_specifier_no_prec_158(AST *ast) +{ + if (debug) + std::cout << "type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Delete::on_type_specifier_no_prec_159(AST *ast) +{ + if (debug) + std::cout << "type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= VOID ; +void Delete::on_type_specifier_nonarray_160(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= VOID" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= FLOAT ; +void Delete::on_type_specifier_nonarray_161(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= FLOAT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DOUBLE ; +void Delete::on_type_specifier_nonarray_162(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DOUBLE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= INT ; +void Delete::on_type_specifier_nonarray_163(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= INT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= UINT ; +void Delete::on_type_specifier_nonarray_164(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= UINT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= BOOL ; +void Delete::on_type_specifier_nonarray_165(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= BOOL" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= VEC2 ; +void Delete::on_type_specifier_nonarray_166(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= VEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= VEC3 ; +void Delete::on_type_specifier_nonarray_167(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= VEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= VEC4 ; +void Delete::on_type_specifier_nonarray_168(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= VEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DVEC2 ; +void Delete::on_type_specifier_nonarray_169(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DVEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DVEC3 ; +void Delete::on_type_specifier_nonarray_170(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DVEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DVEC4 ; +void Delete::on_type_specifier_nonarray_171(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DVEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= BVEC2 ; +void Delete::on_type_specifier_nonarray_172(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= BVEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= BVEC3 ; +void Delete::on_type_specifier_nonarray_173(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= BVEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= BVEC4 ; +void Delete::on_type_specifier_nonarray_174(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= BVEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= IVEC2 ; +void Delete::on_type_specifier_nonarray_175(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= IVEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= IVEC3 ; +void Delete::on_type_specifier_nonarray_176(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= IVEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= IVEC4 ; +void Delete::on_type_specifier_nonarray_177(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= IVEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= UVEC2 ; +void Delete::on_type_specifier_nonarray_178(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= UVEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= UVEC3 ; +void Delete::on_type_specifier_nonarray_179(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= UVEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= UVEC4 ; +void Delete::on_type_specifier_nonarray_180(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= UVEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT2 ; +void Delete::on_type_specifier_nonarray_181(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT3 ; +void Delete::on_type_specifier_nonarray_182(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT4 ; +void Delete::on_type_specifier_nonarray_183(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT2X2 ; +void Delete::on_type_specifier_nonarray_184(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT2X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT2X3 ; +void Delete::on_type_specifier_nonarray_185(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT2X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT2X4 ; +void Delete::on_type_specifier_nonarray_186(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT2X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT3X2 ; +void Delete::on_type_specifier_nonarray_187(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT3X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT3X3 ; +void Delete::on_type_specifier_nonarray_188(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT3X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT3X4 ; +void Delete::on_type_specifier_nonarray_189(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT3X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT4X2 ; +void Delete::on_type_specifier_nonarray_190(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT4X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT4X3 ; +void Delete::on_type_specifier_nonarray_191(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT4X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT4X4 ; +void Delete::on_type_specifier_nonarray_192(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT4X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT2 ; +void Delete::on_type_specifier_nonarray_193(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT3 ; +void Delete::on_type_specifier_nonarray_194(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT4 ; +void Delete::on_type_specifier_nonarray_195(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT2X2 ; +void Delete::on_type_specifier_nonarray_196(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT2X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT2X3 ; +void Delete::on_type_specifier_nonarray_197(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT2X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT2X4 ; +void Delete::on_type_specifier_nonarray_198(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT2X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT3X2 ; +void Delete::on_type_specifier_nonarray_199(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT3X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT3X3 ; +void Delete::on_type_specifier_nonarray_200(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT3X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT3X4 ; +void Delete::on_type_specifier_nonarray_201(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT3X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT4X2 ; +void Delete::on_type_specifier_nonarray_202(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT4X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT4X3 ; +void Delete::on_type_specifier_nonarray_203(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT4X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT4X4 ; +void Delete::on_type_specifier_nonarray_204(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT4X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER1D ; +void Delete::on_type_specifier_nonarray_205(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER1D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2D ; +void Delete::on_type_specifier_nonarray_206(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER3D ; +void Delete::on_type_specifier_nonarray_207(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER3D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERCUBE ; +void Delete::on_type_specifier_nonarray_208(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERCUBE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER1DSHADOW ; +void Delete::on_type_specifier_nonarray_209(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER1DSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DSHADOW ; +void Delete::on_type_specifier_nonarray_210(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERCUBESHADOW ; +void Delete::on_type_specifier_nonarray_211(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERCUBESHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER1DARRAY ; +void Delete::on_type_specifier_nonarray_212(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER1DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DARRAY ; +void Delete::on_type_specifier_nonarray_213(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER1DARRAYSHADOW ; +void Delete::on_type_specifier_nonarray_214(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER1DARRAYSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DARRAYSHADOW ; +void Delete::on_type_specifier_nonarray_215(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DARRAYSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERCUBEARRAY ; +void Delete::on_type_specifier_nonarray_216(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERCUBEARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERCUBEARRAYSHADOW ; +void Delete::on_type_specifier_nonarray_217(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERCUBEARRAYSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER1D ; +void Delete::on_type_specifier_nonarray_218(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER1D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2D ; +void Delete::on_type_specifier_nonarray_219(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER3D ; +void Delete::on_type_specifier_nonarray_220(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER3D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLERCUBE ; +void Delete::on_type_specifier_nonarray_221(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLERCUBE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER1DARRAY ; +void Delete::on_type_specifier_nonarray_222(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER1DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2DARRAY ; +void Delete::on_type_specifier_nonarray_223(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLERCUBEARRAY ; +void Delete::on_type_specifier_nonarray_224(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLERCUBEARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER1D ; +void Delete::on_type_specifier_nonarray_225(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER1D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2D ; +void Delete::on_type_specifier_nonarray_226(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER3D ; +void Delete::on_type_specifier_nonarray_227(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER3D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLERCUBE ; +void Delete::on_type_specifier_nonarray_228(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLERCUBE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER1DARRAY ; +void Delete::on_type_specifier_nonarray_229(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER1DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2DARRAY ; +void Delete::on_type_specifier_nonarray_230(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLERCUBEARRAY ; +void Delete::on_type_specifier_nonarray_231(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLERCUBEARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DRECT ; +void Delete::on_type_specifier_nonarray_232(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DRECT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DRECTSHADOW ; +void Delete::on_type_specifier_nonarray_233(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DRECTSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2DRECT ; +void Delete::on_type_specifier_nonarray_234(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2DRECT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2DRECT ; +void Delete::on_type_specifier_nonarray_235(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2DRECT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERBUFFER ; +void Delete::on_type_specifier_nonarray_236(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERBUFFER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLERBUFFER ; +void Delete::on_type_specifier_nonarray_237(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLERBUFFER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLERBUFFER ; +void Delete::on_type_specifier_nonarray_238(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLERBUFFER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DMS ; +void Delete::on_type_specifier_nonarray_239(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DMS" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2DMS ; +void Delete::on_type_specifier_nonarray_240(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2DMS" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2DMS ; +void Delete::on_type_specifier_nonarray_241(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2DMS" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DMSARRAY ; +void Delete::on_type_specifier_nonarray_242(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DMSARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2DMSARRAY ; +void Delete::on_type_specifier_nonarray_243(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2DMSARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2DMSARRAY ; +void Delete::on_type_specifier_nonarray_244(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2DMSARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= struct_specifier ; +void Delete::on_type_specifier_nonarray_245(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= struct_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= TYPE_NAME ; +void Delete::on_type_specifier_nonarray_246(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= TYPE_NAME" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// precision_qualifier ::= HIGHP ; +void Delete::on_precision_qualifier_247(AST *ast) +{ + if (debug) + std::cout << "precision_qualifier ::= HIGHP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// precision_qualifier ::= MEDIUMP ; +void Delete::on_precision_qualifier_248(AST *ast) +{ + if (debug) + std::cout << "precision_qualifier ::= MEDIUMP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// precision_qualifier ::= LOWP ; +void Delete::on_precision_qualifier_249(AST *ast) +{ + if (debug) + std::cout << "precision_qualifier ::= LOWP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_specifier ::= STRUCT IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE ; +void Delete::on_struct_specifier_250(AST *ast) +{ + if (debug) + std::cout << "struct_specifier ::= STRUCT IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_specifier ::= STRUCT LEFT_BRACE struct_declaration_list RIGHT_BRACE ; +void Delete::on_struct_specifier_251(AST *ast) +{ + if (debug) + std::cout << "struct_specifier ::= STRUCT LEFT_BRACE struct_declaration_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declaration_list ::= struct_declaration ; +void Delete::on_struct_declaration_list_252(AST *ast) +{ + if (debug) + std::cout << "struct_declaration_list ::= struct_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declaration_list ::= struct_declaration_list struct_declaration ; +void Delete::on_struct_declaration_list_253(AST *ast) +{ + if (debug) + std::cout << "struct_declaration_list ::= struct_declaration_list struct_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declaration ::= type_specifier struct_declarator_list SEMICOLON ; +void Delete::on_struct_declaration_254(AST *ast) +{ + if (debug) + std::cout << "struct_declaration ::= type_specifier struct_declarator_list SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declaration ::= type_qualifier type_specifier struct_declarator_list SEMICOLON ; +void Delete::on_struct_declaration_255(AST *ast) +{ + if (debug) + std::cout << "struct_declaration ::= type_qualifier type_specifier struct_declarator_list SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator_list ::= struct_declarator ; +void Delete::on_struct_declarator_list_256(AST *ast) +{ + if (debug) + std::cout << "struct_declarator_list ::= struct_declarator" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator_list ::= struct_declarator_list COMMA struct_declarator ; +void Delete::on_struct_declarator_list_257(AST *ast) +{ + if (debug) + std::cout << "struct_declarator_list ::= struct_declarator_list COMMA struct_declarator" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator ::= IDENTIFIER ; +void Delete::on_struct_declarator_258(AST *ast) +{ + if (debug) + std::cout << "struct_declarator ::= IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator ::= IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +void Delete::on_struct_declarator_259(AST *ast) +{ + if (debug) + std::cout << "struct_declarator ::= IDENTIFIER LEFT_BRACKET RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator ::= IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Delete::on_struct_declarator_260(AST *ast) +{ + if (debug) + std::cout << "struct_declarator ::= IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// initializer ::= assignment_expression ; +void Delete::on_initializer_261(AST *ast) +{ + if (debug) + std::cout << "initializer ::= assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration_statement ::= declaration ; +void Delete::on_declaration_statement_262(AST *ast) +{ + if (debug) + std::cout << "declaration_statement ::= declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement ::= compound_statement ; +void Delete::on_statement_263(AST *ast) +{ + if (debug) + std::cout << "statement ::= compound_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement ::= simple_statement ; +void Delete::on_statement_264(AST *ast) +{ + if (debug) + std::cout << "statement ::= simple_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= declaration_statement ; +void Delete::on_simple_statement_265(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= declaration_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= expression_statement ; +void Delete::on_simple_statement_266(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= expression_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= selection_statement ; +void Delete::on_simple_statement_267(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= selection_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= switch_statement ; +void Delete::on_simple_statement_268(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= switch_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= case_label ; +void Delete::on_simple_statement_269(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= case_label" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= iteration_statement ; +void Delete::on_simple_statement_270(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= iteration_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= jump_statement ; +void Delete::on_simple_statement_271(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= jump_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// compound_statement ::= LEFT_BRACE RIGHT_BRACE ; +void Delete::on_compound_statement_272(AST *ast) +{ + if (debug) + std::cout << "compound_statement ::= LEFT_BRACE RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// compound_statement ::= LEFT_BRACE statement_list RIGHT_BRACE ; +void Delete::on_compound_statement_273(AST *ast) +{ + if (debug) + std::cout << "compound_statement ::= LEFT_BRACE statement_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement_no_new_scope ::= compound_statement_no_new_scope ; +void Delete::on_statement_no_new_scope_274(AST *ast) +{ + if (debug) + std::cout << "statement_no_new_scope ::= compound_statement_no_new_scope" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement_no_new_scope ::= simple_statement ; +void Delete::on_statement_no_new_scope_275(AST *ast) +{ + if (debug) + std::cout << "statement_no_new_scope ::= simple_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// compound_statement_no_new_scope ::= LEFT_BRACE RIGHT_BRACE ; +void Delete::on_compound_statement_no_new_scope_276(AST *ast) +{ + if (debug) + std::cout << "compound_statement_no_new_scope ::= LEFT_BRACE RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// compound_statement_no_new_scope ::= LEFT_BRACE statement_list RIGHT_BRACE ; +void Delete::on_compound_statement_no_new_scope_277(AST *ast) +{ + if (debug) + std::cout << "compound_statement_no_new_scope ::= LEFT_BRACE statement_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement_list ::= statement ; +void Delete::on_statement_list_278(AST *ast) +{ + if (debug) + std::cout << "statement_list ::= statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement_list ::= statement_list statement ; +void Delete::on_statement_list_279(AST *ast) +{ + if (debug) + std::cout << "statement_list ::= statement_list statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// expression_statement ::= SEMICOLON ; +void Delete::on_expression_statement_280(AST *ast) +{ + if (debug) + std::cout << "expression_statement ::= SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// expression_statement ::= expression SEMICOLON ; +void Delete::on_expression_statement_281(AST *ast) +{ + if (debug) + std::cout << "expression_statement ::= expression SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// selection_statement ::= IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement ; +void Delete::on_selection_statement_282(AST *ast) +{ + if (debug) + std::cout << "selection_statement ::= IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// selection_rest_statement ::= statement ELSE statement ; +void Delete::on_selection_rest_statement_283(AST *ast) +{ + if (debug) + std::cout << "selection_rest_statement ::= statement ELSE statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// selection_rest_statement ::= statement ; +void Delete::on_selection_rest_statement_284(AST *ast) +{ + if (debug) + std::cout << "selection_rest_statement ::= statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// condition ::= expression ; +void Delete::on_condition_285(AST *ast) +{ + if (debug) + std::cout << "condition ::= expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// condition ::= fully_specified_type IDENTIFIER EQUAL initializer ; +void Delete::on_condition_286(AST *ast) +{ + if (debug) + std::cout << "condition ::= fully_specified_type IDENTIFIER EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// switch_statement ::= SWITCH LEFT_PAREN expression RIGHT_PAREN LEFT_BRACE switch_statement_list RIGHT_BRACE ; +void Delete::on_switch_statement_287(AST *ast) +{ + if (debug) + std::cout << "switch_statement ::= SWITCH LEFT_PAREN expression RIGHT_PAREN LEFT_BRACE switch_statement_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// switch_statement_list ::= ; +void Delete::on_switch_statement_list_288(AST *ast) +{ + if (debug) + std::cout << "switch_statement_list ::=" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// switch_statement_list ::= statement_list ; +void Delete::on_switch_statement_list_289(AST *ast) +{ + if (debug) + std::cout << "switch_statement_list ::= statement_list" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// case_label ::= CASE expression COLON ; +void Delete::on_case_label_290(AST *ast) +{ + if (debug) + std::cout << "case_label ::= CASE expression COLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// case_label ::= DEFAULT COLON ; +void Delete::on_case_label_291(AST *ast) +{ + if (debug) + std::cout << "case_label ::= DEFAULT COLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// iteration_statement ::= WHILE LEFT_PAREN condition RIGHT_PAREN statement_no_new_scope ; +void Delete::on_iteration_statement_292(AST *ast) +{ + if (debug) + std::cout << "iteration_statement ::= WHILE LEFT_PAREN condition RIGHT_PAREN statement_no_new_scope" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// iteration_statement ::= DO statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON ; +void Delete::on_iteration_statement_293(AST *ast) +{ + if (debug) + std::cout << "iteration_statement ::= DO statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// iteration_statement ::= FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope ; +void Delete::on_iteration_statement_294(AST *ast) +{ + if (debug) + std::cout << "iteration_statement ::= FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// for_init_statement ::= expression_statement ; +void Delete::on_for_init_statement_295(AST *ast) +{ + if (debug) + std::cout << "for_init_statement ::= expression_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// for_init_statement ::= declaration_statement ; +void Delete::on_for_init_statement_296(AST *ast) +{ + if (debug) + std::cout << "for_init_statement ::= declaration_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// conditionopt ::= ; +void Delete::on_conditionopt_297(AST *ast) +{ + if (debug) + std::cout << "conditionopt ::=" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// conditionopt ::= condition ; +void Delete::on_conditionopt_298(AST *ast) +{ + if (debug) + std::cout << "conditionopt ::= condition" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// for_rest_statement ::= conditionopt SEMICOLON ; +void Delete::on_for_rest_statement_299(AST *ast) +{ + if (debug) + std::cout << "for_rest_statement ::= conditionopt SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// for_rest_statement ::= conditionopt SEMICOLON expression ; +void Delete::on_for_rest_statement_300(AST *ast) +{ + if (debug) + std::cout << "for_rest_statement ::= conditionopt SEMICOLON expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= CONTINUE SEMICOLON ; +void Delete::on_jump_statement_301(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= CONTINUE SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= BREAK SEMICOLON ; +void Delete::on_jump_statement_302(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= BREAK SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= RETURN SEMICOLON ; +void Delete::on_jump_statement_303(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= RETURN SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= RETURN expression SEMICOLON ; +void Delete::on_jump_statement_304(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= RETURN expression SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= DISCARD SEMICOLON ; +void Delete::on_jump_statement_305(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= DISCARD SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// translation_unit ::= external_declaration ; +void Delete::on_translation_unit_306(AST *ast) +{ + if (debug) + std::cout << "translation_unit ::= external_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// translation_unit ::= translation_unit external_declaration ; +void Delete::on_translation_unit_307(AST *ast) +{ + if (debug) + std::cout << "translation_unit ::= translation_unit external_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// external_declaration ::= function_definition ; +void Delete::on_external_declaration_308(AST *ast) +{ + if (debug) + std::cout << "external_declaration ::= function_definition" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// external_declaration ::= declaration ; +void Delete::on_external_declaration_309(AST *ast) +{ + if (debug) + std::cout << "external_declaration ::= declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// external_declaration ::= SEMICOLON ; +void Delete::on_external_declaration_310(AST *ast) +{ + if (debug) + std::cout << "external_declaration ::= SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_definition ::= function_prototype compound_statement_no_new_scope ; +void Delete::on_function_definition_311(AST *ast) +{ + if (debug) + std::cout << "function_definition ::= function_prototype compound_statement_no_new_scope" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + diff --git a/src/libs/glsl/glsldump.cpp b/src/libs/glsl/glsldump.cpp new file mode 100644 index 00000000000..28c7b44bb4b --- /dev/null +++ b/src/libs/glsl/glsldump.cpp @@ -0,0 +1,3470 @@ + +#include "glslast.h" + +namespace GLSL { + +class Dump +{ + typedef void (Dump::*dispatch_func)(AST *); + static dispatch_func dispatch[]; + +public: + void accept(AST *ast) + { + if (! ast) + return; + else if (Operator *op = ast->asOperator()) + (this->*dispatch[op->ruleno])(ast); + } + + template + void accept(It first, It last) + { + for (; first != last; ++first) + accept(*first); + } + +private: + void on_variable_identifier_1(AST *); + void on_primary_expression_2(AST *); + void on_primary_expression_3(AST *); + void on_primary_expression_4(AST *); + void on_primary_expression_5(AST *); + void on_primary_expression_6(AST *); + void on_postfix_expression_7(AST *); + void on_postfix_expression_8(AST *); + void on_postfix_expression_9(AST *); + void on_postfix_expression_10(AST *); + void on_postfix_expression_11(AST *); + void on_postfix_expression_12(AST *); + void on_integer_expression_13(AST *); + void on_function_call_14(AST *); + void on_function_call_or_method_15(AST *); + void on_function_call_or_method_16(AST *); + void on_function_call_generic_17(AST *); + void on_function_call_generic_18(AST *); + void on_function_call_header_no_parameters_19(AST *); + void on_function_call_header_no_parameters_20(AST *); + void on_function_call_header_with_parameters_21(AST *); + void on_function_call_header_with_parameters_22(AST *); + void on_function_call_header_23(AST *); + void on_function_identifier_24(AST *); + void on_function_identifier_25(AST *); + void on_unary_expression_26(AST *); + void on_unary_expression_27(AST *); + void on_unary_expression_28(AST *); + void on_unary_expression_29(AST *); + void on_unary_operator_30(AST *); + void on_unary_operator_31(AST *); + void on_unary_operator_32(AST *); + void on_unary_operator_33(AST *); + void on_multiplicative_expression_34(AST *); + void on_multiplicative_expression_35(AST *); + void on_multiplicative_expression_36(AST *); + void on_multiplicative_expression_37(AST *); + void on_additive_expression_38(AST *); + void on_additive_expression_39(AST *); + void on_additive_expression_40(AST *); + void on_shift_expression_41(AST *); + void on_shift_expression_42(AST *); + void on_shift_expression_43(AST *); + void on_relational_expression_44(AST *); + void on_relational_expression_45(AST *); + void on_relational_expression_46(AST *); + void on_relational_expression_47(AST *); + void on_relational_expression_48(AST *); + void on_equality_expression_49(AST *); + void on_equality_expression_50(AST *); + void on_equality_expression_51(AST *); + void on_and_expression_52(AST *); + void on_and_expression_53(AST *); + void on_exclusive_or_expression_54(AST *); + void on_exclusive_or_expression_55(AST *); + void on_inclusive_or_expression_56(AST *); + void on_inclusive_or_expression_57(AST *); + void on_logical_and_expression_58(AST *); + void on_logical_and_expression_59(AST *); + void on_logical_xor_expression_60(AST *); + void on_logical_xor_expression_61(AST *); + void on_logical_or_expression_62(AST *); + void on_logical_or_expression_63(AST *); + void on_conditional_expression_64(AST *); + void on_conditional_expression_65(AST *); + void on_assignment_expression_66(AST *); + void on_assignment_expression_67(AST *); + void on_assignment_operator_68(AST *); + void on_assignment_operator_69(AST *); + void on_assignment_operator_70(AST *); + void on_assignment_operator_71(AST *); + void on_assignment_operator_72(AST *); + void on_assignment_operator_73(AST *); + void on_assignment_operator_74(AST *); + void on_assignment_operator_75(AST *); + void on_assignment_operator_76(AST *); + void on_assignment_operator_77(AST *); + void on_assignment_operator_78(AST *); + void on_expression_79(AST *); + void on_expression_80(AST *); + void on_constant_expression_81(AST *); + void on_declaration_82(AST *); + void on_declaration_83(AST *); + void on_declaration_84(AST *); + void on_declaration_85(AST *); + void on_declaration_86(AST *); + void on_declaration_87(AST *); + void on_declaration_88(AST *); + void on_declaration_89(AST *); + void on_function_prototype_90(AST *); + void on_function_declarator_91(AST *); + void on_function_declarator_92(AST *); + void on_function_header_with_parameters_93(AST *); + void on_function_header_with_parameters_94(AST *); + void on_function_header_95(AST *); + void on_parameter_declarator_96(AST *); + void on_parameter_declarator_97(AST *); + void on_parameter_declaration_98(AST *); + void on_parameter_declaration_99(AST *); + void on_parameter_declaration_100(AST *); + void on_parameter_declaration_101(AST *); + void on_parameter_qualifier_102(AST *); + void on_parameter_qualifier_103(AST *); + void on_parameter_qualifier_104(AST *); + void on_parameter_qualifier_105(AST *); + void on_parameter_type_specifier_106(AST *); + void on_init_declarator_list_107(AST *); + void on_init_declarator_list_108(AST *); + void on_init_declarator_list_109(AST *); + void on_init_declarator_list_110(AST *); + void on_init_declarator_list_111(AST *); + void on_init_declarator_list_112(AST *); + void on_init_declarator_list_113(AST *); + void on_single_declaration_114(AST *); + void on_single_declaration_115(AST *); + void on_single_declaration_116(AST *); + void on_single_declaration_117(AST *); + void on_single_declaration_118(AST *); + void on_single_declaration_119(AST *); + void on_single_declaration_120(AST *); + void on_single_declaration_121(AST *); + void on_fully_specified_type_122(AST *); + void on_fully_specified_type_123(AST *); + void on_invariant_qualifier_124(AST *); + void on_interpolation_qualifier_125(AST *); + void on_interpolation_qualifier_126(AST *); + void on_interpolation_qualifier_127(AST *); + void on_layout_qualifier_128(AST *); + void on_layout_qualifier_id_list_129(AST *); + void on_layout_qualifier_id_list_130(AST *); + void on_layout_qualifier_id_131(AST *); + void on_layout_qualifier_id_132(AST *); + void on_parameter_type_qualifier_133(AST *); + void on_type_qualifier_134(AST *); + void on_type_qualifier_135(AST *); + void on_type_qualifier_136(AST *); + void on_type_qualifier_137(AST *); + void on_type_qualifier_138(AST *); + void on_type_qualifier_139(AST *); + void on_type_qualifier_140(AST *); + void on_type_qualifier_141(AST *); + void on_storage_qualifier_142(AST *); + void on_storage_qualifier_143(AST *); + void on_storage_qualifier_144(AST *); + void on_storage_qualifier_145(AST *); + void on_storage_qualifier_146(AST *); + void on_storage_qualifier_147(AST *); + void on_storage_qualifier_148(AST *); + void on_storage_qualifier_149(AST *); + void on_storage_qualifier_150(AST *); + void on_storage_qualifier_151(AST *); + void on_storage_qualifier_152(AST *); + void on_storage_qualifier_153(AST *); + void on_storage_qualifier_154(AST *); + void on_type_specifier_155(AST *); + void on_type_specifier_156(AST *); + void on_type_specifier_no_prec_157(AST *); + void on_type_specifier_no_prec_158(AST *); + void on_type_specifier_no_prec_159(AST *); + void on_type_specifier_nonarray_160(AST *); + void on_type_specifier_nonarray_161(AST *); + void on_type_specifier_nonarray_162(AST *); + void on_type_specifier_nonarray_163(AST *); + void on_type_specifier_nonarray_164(AST *); + void on_type_specifier_nonarray_165(AST *); + void on_type_specifier_nonarray_166(AST *); + void on_type_specifier_nonarray_167(AST *); + void on_type_specifier_nonarray_168(AST *); + void on_type_specifier_nonarray_169(AST *); + void on_type_specifier_nonarray_170(AST *); + void on_type_specifier_nonarray_171(AST *); + void on_type_specifier_nonarray_172(AST *); + void on_type_specifier_nonarray_173(AST *); + void on_type_specifier_nonarray_174(AST *); + void on_type_specifier_nonarray_175(AST *); + void on_type_specifier_nonarray_176(AST *); + void on_type_specifier_nonarray_177(AST *); + void on_type_specifier_nonarray_178(AST *); + void on_type_specifier_nonarray_179(AST *); + void on_type_specifier_nonarray_180(AST *); + void on_type_specifier_nonarray_181(AST *); + void on_type_specifier_nonarray_182(AST *); + void on_type_specifier_nonarray_183(AST *); + void on_type_specifier_nonarray_184(AST *); + void on_type_specifier_nonarray_185(AST *); + void on_type_specifier_nonarray_186(AST *); + void on_type_specifier_nonarray_187(AST *); + void on_type_specifier_nonarray_188(AST *); + void on_type_specifier_nonarray_189(AST *); + void on_type_specifier_nonarray_190(AST *); + void on_type_specifier_nonarray_191(AST *); + void on_type_specifier_nonarray_192(AST *); + void on_type_specifier_nonarray_193(AST *); + void on_type_specifier_nonarray_194(AST *); + void on_type_specifier_nonarray_195(AST *); + void on_type_specifier_nonarray_196(AST *); + void on_type_specifier_nonarray_197(AST *); + void on_type_specifier_nonarray_198(AST *); + void on_type_specifier_nonarray_199(AST *); + void on_type_specifier_nonarray_200(AST *); + void on_type_specifier_nonarray_201(AST *); + void on_type_specifier_nonarray_202(AST *); + void on_type_specifier_nonarray_203(AST *); + void on_type_specifier_nonarray_204(AST *); + void on_type_specifier_nonarray_205(AST *); + void on_type_specifier_nonarray_206(AST *); + void on_type_specifier_nonarray_207(AST *); + void on_type_specifier_nonarray_208(AST *); + void on_type_specifier_nonarray_209(AST *); + void on_type_specifier_nonarray_210(AST *); + void on_type_specifier_nonarray_211(AST *); + void on_type_specifier_nonarray_212(AST *); + void on_type_specifier_nonarray_213(AST *); + void on_type_specifier_nonarray_214(AST *); + void on_type_specifier_nonarray_215(AST *); + void on_type_specifier_nonarray_216(AST *); + void on_type_specifier_nonarray_217(AST *); + void on_type_specifier_nonarray_218(AST *); + void on_type_specifier_nonarray_219(AST *); + void on_type_specifier_nonarray_220(AST *); + void on_type_specifier_nonarray_221(AST *); + void on_type_specifier_nonarray_222(AST *); + void on_type_specifier_nonarray_223(AST *); + void on_type_specifier_nonarray_224(AST *); + void on_type_specifier_nonarray_225(AST *); + void on_type_specifier_nonarray_226(AST *); + void on_type_specifier_nonarray_227(AST *); + void on_type_specifier_nonarray_228(AST *); + void on_type_specifier_nonarray_229(AST *); + void on_type_specifier_nonarray_230(AST *); + void on_type_specifier_nonarray_231(AST *); + void on_type_specifier_nonarray_232(AST *); + void on_type_specifier_nonarray_233(AST *); + void on_type_specifier_nonarray_234(AST *); + void on_type_specifier_nonarray_235(AST *); + void on_type_specifier_nonarray_236(AST *); + void on_type_specifier_nonarray_237(AST *); + void on_type_specifier_nonarray_238(AST *); + void on_type_specifier_nonarray_239(AST *); + void on_type_specifier_nonarray_240(AST *); + void on_type_specifier_nonarray_241(AST *); + void on_type_specifier_nonarray_242(AST *); + void on_type_specifier_nonarray_243(AST *); + void on_type_specifier_nonarray_244(AST *); + void on_type_specifier_nonarray_245(AST *); + void on_type_specifier_nonarray_246(AST *); + void on_precision_qualifier_247(AST *); + void on_precision_qualifier_248(AST *); + void on_precision_qualifier_249(AST *); + void on_struct_specifier_250(AST *); + void on_struct_specifier_251(AST *); + void on_struct_declaration_list_252(AST *); + void on_struct_declaration_list_253(AST *); + void on_struct_declaration_254(AST *); + void on_struct_declaration_255(AST *); + void on_struct_declarator_list_256(AST *); + void on_struct_declarator_list_257(AST *); + void on_struct_declarator_258(AST *); + void on_struct_declarator_259(AST *); + void on_struct_declarator_260(AST *); + void on_initializer_261(AST *); + void on_declaration_statement_262(AST *); + void on_statement_263(AST *); + void on_statement_264(AST *); + void on_simple_statement_265(AST *); + void on_simple_statement_266(AST *); + void on_simple_statement_267(AST *); + void on_simple_statement_268(AST *); + void on_simple_statement_269(AST *); + void on_simple_statement_270(AST *); + void on_simple_statement_271(AST *); + void on_compound_statement_272(AST *); + void on_compound_statement_273(AST *); + void on_statement_no_new_scope_274(AST *); + void on_statement_no_new_scope_275(AST *); + void on_compound_statement_no_new_scope_276(AST *); + void on_compound_statement_no_new_scope_277(AST *); + void on_statement_list_278(AST *); + void on_statement_list_279(AST *); + void on_expression_statement_280(AST *); + void on_expression_statement_281(AST *); + void on_selection_statement_282(AST *); + void on_selection_rest_statement_283(AST *); + void on_selection_rest_statement_284(AST *); + void on_condition_285(AST *); + void on_condition_286(AST *); + void on_switch_statement_287(AST *); + void on_switch_statement_list_288(AST *); + void on_switch_statement_list_289(AST *); + void on_case_label_290(AST *); + void on_case_label_291(AST *); + void on_iteration_statement_292(AST *); + void on_iteration_statement_293(AST *); + void on_iteration_statement_294(AST *); + void on_for_init_statement_295(AST *); + void on_for_init_statement_296(AST *); + void on_conditionopt_297(AST *); + void on_conditionopt_298(AST *); + void on_for_rest_statement_299(AST *); + void on_for_rest_statement_300(AST *); + void on_jump_statement_301(AST *); + void on_jump_statement_302(AST *); + void on_jump_statement_303(AST *); + void on_jump_statement_304(AST *); + void on_jump_statement_305(AST *); + void on_translation_unit_306(AST *); + void on_translation_unit_307(AST *); + void on_external_declaration_308(AST *); + void on_external_declaration_309(AST *); + void on_external_declaration_310(AST *); + void on_function_definition_311(AST *); +}; + +void dumpAST(AST *ast) +{ + Dump dump; + dump.accept(ast); +} + +} // end of namespace GLSL + +#include + +using namespace GLSL; + +namespace { +bool debug = true; +} + + +Dump::dispatch_func Dump::dispatch[] = { + &Dump::on_variable_identifier_1, + &Dump::on_primary_expression_2, + &Dump::on_primary_expression_3, + &Dump::on_primary_expression_4, + &Dump::on_primary_expression_5, + &Dump::on_primary_expression_6, + &Dump::on_postfix_expression_7, + &Dump::on_postfix_expression_8, + &Dump::on_postfix_expression_9, + &Dump::on_postfix_expression_10, + &Dump::on_postfix_expression_11, + &Dump::on_postfix_expression_12, + &Dump::on_integer_expression_13, + &Dump::on_function_call_14, + &Dump::on_function_call_or_method_15, + &Dump::on_function_call_or_method_16, + &Dump::on_function_call_generic_17, + &Dump::on_function_call_generic_18, + &Dump::on_function_call_header_no_parameters_19, + &Dump::on_function_call_header_no_parameters_20, + &Dump::on_function_call_header_with_parameters_21, + &Dump::on_function_call_header_with_parameters_22, + &Dump::on_function_call_header_23, + &Dump::on_function_identifier_24, + &Dump::on_function_identifier_25, + &Dump::on_unary_expression_26, + &Dump::on_unary_expression_27, + &Dump::on_unary_expression_28, + &Dump::on_unary_expression_29, + &Dump::on_unary_operator_30, + &Dump::on_unary_operator_31, + &Dump::on_unary_operator_32, + &Dump::on_unary_operator_33, + &Dump::on_multiplicative_expression_34, + &Dump::on_multiplicative_expression_35, + &Dump::on_multiplicative_expression_36, + &Dump::on_multiplicative_expression_37, + &Dump::on_additive_expression_38, + &Dump::on_additive_expression_39, + &Dump::on_additive_expression_40, + &Dump::on_shift_expression_41, + &Dump::on_shift_expression_42, + &Dump::on_shift_expression_43, + &Dump::on_relational_expression_44, + &Dump::on_relational_expression_45, + &Dump::on_relational_expression_46, + &Dump::on_relational_expression_47, + &Dump::on_relational_expression_48, + &Dump::on_equality_expression_49, + &Dump::on_equality_expression_50, + &Dump::on_equality_expression_51, + &Dump::on_and_expression_52, + &Dump::on_and_expression_53, + &Dump::on_exclusive_or_expression_54, + &Dump::on_exclusive_or_expression_55, + &Dump::on_inclusive_or_expression_56, + &Dump::on_inclusive_or_expression_57, + &Dump::on_logical_and_expression_58, + &Dump::on_logical_and_expression_59, + &Dump::on_logical_xor_expression_60, + &Dump::on_logical_xor_expression_61, + &Dump::on_logical_or_expression_62, + &Dump::on_logical_or_expression_63, + &Dump::on_conditional_expression_64, + &Dump::on_conditional_expression_65, + &Dump::on_assignment_expression_66, + &Dump::on_assignment_expression_67, + &Dump::on_assignment_operator_68, + &Dump::on_assignment_operator_69, + &Dump::on_assignment_operator_70, + &Dump::on_assignment_operator_71, + &Dump::on_assignment_operator_72, + &Dump::on_assignment_operator_73, + &Dump::on_assignment_operator_74, + &Dump::on_assignment_operator_75, + &Dump::on_assignment_operator_76, + &Dump::on_assignment_operator_77, + &Dump::on_assignment_operator_78, + &Dump::on_expression_79, + &Dump::on_expression_80, + &Dump::on_constant_expression_81, + &Dump::on_declaration_82, + &Dump::on_declaration_83, + &Dump::on_declaration_84, + &Dump::on_declaration_85, + &Dump::on_declaration_86, + &Dump::on_declaration_87, + &Dump::on_declaration_88, + &Dump::on_declaration_89, + &Dump::on_function_prototype_90, + &Dump::on_function_declarator_91, + &Dump::on_function_declarator_92, + &Dump::on_function_header_with_parameters_93, + &Dump::on_function_header_with_parameters_94, + &Dump::on_function_header_95, + &Dump::on_parameter_declarator_96, + &Dump::on_parameter_declarator_97, + &Dump::on_parameter_declaration_98, + &Dump::on_parameter_declaration_99, + &Dump::on_parameter_declaration_100, + &Dump::on_parameter_declaration_101, + &Dump::on_parameter_qualifier_102, + &Dump::on_parameter_qualifier_103, + &Dump::on_parameter_qualifier_104, + &Dump::on_parameter_qualifier_105, + &Dump::on_parameter_type_specifier_106, + &Dump::on_init_declarator_list_107, + &Dump::on_init_declarator_list_108, + &Dump::on_init_declarator_list_109, + &Dump::on_init_declarator_list_110, + &Dump::on_init_declarator_list_111, + &Dump::on_init_declarator_list_112, + &Dump::on_init_declarator_list_113, + &Dump::on_single_declaration_114, + &Dump::on_single_declaration_115, + &Dump::on_single_declaration_116, + &Dump::on_single_declaration_117, + &Dump::on_single_declaration_118, + &Dump::on_single_declaration_119, + &Dump::on_single_declaration_120, + &Dump::on_single_declaration_121, + &Dump::on_fully_specified_type_122, + &Dump::on_fully_specified_type_123, + &Dump::on_invariant_qualifier_124, + &Dump::on_interpolation_qualifier_125, + &Dump::on_interpolation_qualifier_126, + &Dump::on_interpolation_qualifier_127, + &Dump::on_layout_qualifier_128, + &Dump::on_layout_qualifier_id_list_129, + &Dump::on_layout_qualifier_id_list_130, + &Dump::on_layout_qualifier_id_131, + &Dump::on_layout_qualifier_id_132, + &Dump::on_parameter_type_qualifier_133, + &Dump::on_type_qualifier_134, + &Dump::on_type_qualifier_135, + &Dump::on_type_qualifier_136, + &Dump::on_type_qualifier_137, + &Dump::on_type_qualifier_138, + &Dump::on_type_qualifier_139, + &Dump::on_type_qualifier_140, + &Dump::on_type_qualifier_141, + &Dump::on_storage_qualifier_142, + &Dump::on_storage_qualifier_143, + &Dump::on_storage_qualifier_144, + &Dump::on_storage_qualifier_145, + &Dump::on_storage_qualifier_146, + &Dump::on_storage_qualifier_147, + &Dump::on_storage_qualifier_148, + &Dump::on_storage_qualifier_149, + &Dump::on_storage_qualifier_150, + &Dump::on_storage_qualifier_151, + &Dump::on_storage_qualifier_152, + &Dump::on_storage_qualifier_153, + &Dump::on_storage_qualifier_154, + &Dump::on_type_specifier_155, + &Dump::on_type_specifier_156, + &Dump::on_type_specifier_no_prec_157, + &Dump::on_type_specifier_no_prec_158, + &Dump::on_type_specifier_no_prec_159, + &Dump::on_type_specifier_nonarray_160, + &Dump::on_type_specifier_nonarray_161, + &Dump::on_type_specifier_nonarray_162, + &Dump::on_type_specifier_nonarray_163, + &Dump::on_type_specifier_nonarray_164, + &Dump::on_type_specifier_nonarray_165, + &Dump::on_type_specifier_nonarray_166, + &Dump::on_type_specifier_nonarray_167, + &Dump::on_type_specifier_nonarray_168, + &Dump::on_type_specifier_nonarray_169, + &Dump::on_type_specifier_nonarray_170, + &Dump::on_type_specifier_nonarray_171, + &Dump::on_type_specifier_nonarray_172, + &Dump::on_type_specifier_nonarray_173, + &Dump::on_type_specifier_nonarray_174, + &Dump::on_type_specifier_nonarray_175, + &Dump::on_type_specifier_nonarray_176, + &Dump::on_type_specifier_nonarray_177, + &Dump::on_type_specifier_nonarray_178, + &Dump::on_type_specifier_nonarray_179, + &Dump::on_type_specifier_nonarray_180, + &Dump::on_type_specifier_nonarray_181, + &Dump::on_type_specifier_nonarray_182, + &Dump::on_type_specifier_nonarray_183, + &Dump::on_type_specifier_nonarray_184, + &Dump::on_type_specifier_nonarray_185, + &Dump::on_type_specifier_nonarray_186, + &Dump::on_type_specifier_nonarray_187, + &Dump::on_type_specifier_nonarray_188, + &Dump::on_type_specifier_nonarray_189, + &Dump::on_type_specifier_nonarray_190, + &Dump::on_type_specifier_nonarray_191, + &Dump::on_type_specifier_nonarray_192, + &Dump::on_type_specifier_nonarray_193, + &Dump::on_type_specifier_nonarray_194, + &Dump::on_type_specifier_nonarray_195, + &Dump::on_type_specifier_nonarray_196, + &Dump::on_type_specifier_nonarray_197, + &Dump::on_type_specifier_nonarray_198, + &Dump::on_type_specifier_nonarray_199, + &Dump::on_type_specifier_nonarray_200, + &Dump::on_type_specifier_nonarray_201, + &Dump::on_type_specifier_nonarray_202, + &Dump::on_type_specifier_nonarray_203, + &Dump::on_type_specifier_nonarray_204, + &Dump::on_type_specifier_nonarray_205, + &Dump::on_type_specifier_nonarray_206, + &Dump::on_type_specifier_nonarray_207, + &Dump::on_type_specifier_nonarray_208, + &Dump::on_type_specifier_nonarray_209, + &Dump::on_type_specifier_nonarray_210, + &Dump::on_type_specifier_nonarray_211, + &Dump::on_type_specifier_nonarray_212, + &Dump::on_type_specifier_nonarray_213, + &Dump::on_type_specifier_nonarray_214, + &Dump::on_type_specifier_nonarray_215, + &Dump::on_type_specifier_nonarray_216, + &Dump::on_type_specifier_nonarray_217, + &Dump::on_type_specifier_nonarray_218, + &Dump::on_type_specifier_nonarray_219, + &Dump::on_type_specifier_nonarray_220, + &Dump::on_type_specifier_nonarray_221, + &Dump::on_type_specifier_nonarray_222, + &Dump::on_type_specifier_nonarray_223, + &Dump::on_type_specifier_nonarray_224, + &Dump::on_type_specifier_nonarray_225, + &Dump::on_type_specifier_nonarray_226, + &Dump::on_type_specifier_nonarray_227, + &Dump::on_type_specifier_nonarray_228, + &Dump::on_type_specifier_nonarray_229, + &Dump::on_type_specifier_nonarray_230, + &Dump::on_type_specifier_nonarray_231, + &Dump::on_type_specifier_nonarray_232, + &Dump::on_type_specifier_nonarray_233, + &Dump::on_type_specifier_nonarray_234, + &Dump::on_type_specifier_nonarray_235, + &Dump::on_type_specifier_nonarray_236, + &Dump::on_type_specifier_nonarray_237, + &Dump::on_type_specifier_nonarray_238, + &Dump::on_type_specifier_nonarray_239, + &Dump::on_type_specifier_nonarray_240, + &Dump::on_type_specifier_nonarray_241, + &Dump::on_type_specifier_nonarray_242, + &Dump::on_type_specifier_nonarray_243, + &Dump::on_type_specifier_nonarray_244, + &Dump::on_type_specifier_nonarray_245, + &Dump::on_type_specifier_nonarray_246, + &Dump::on_precision_qualifier_247, + &Dump::on_precision_qualifier_248, + &Dump::on_precision_qualifier_249, + &Dump::on_struct_specifier_250, + &Dump::on_struct_specifier_251, + &Dump::on_struct_declaration_list_252, + &Dump::on_struct_declaration_list_253, + &Dump::on_struct_declaration_254, + &Dump::on_struct_declaration_255, + &Dump::on_struct_declarator_list_256, + &Dump::on_struct_declarator_list_257, + &Dump::on_struct_declarator_258, + &Dump::on_struct_declarator_259, + &Dump::on_struct_declarator_260, + &Dump::on_initializer_261, + &Dump::on_declaration_statement_262, + &Dump::on_statement_263, + &Dump::on_statement_264, + &Dump::on_simple_statement_265, + &Dump::on_simple_statement_266, + &Dump::on_simple_statement_267, + &Dump::on_simple_statement_268, + &Dump::on_simple_statement_269, + &Dump::on_simple_statement_270, + &Dump::on_simple_statement_271, + &Dump::on_compound_statement_272, + &Dump::on_compound_statement_273, + &Dump::on_statement_no_new_scope_274, + &Dump::on_statement_no_new_scope_275, + &Dump::on_compound_statement_no_new_scope_276, + &Dump::on_compound_statement_no_new_scope_277, + &Dump::on_statement_list_278, + &Dump::on_statement_list_279, + &Dump::on_expression_statement_280, + &Dump::on_expression_statement_281, + &Dump::on_selection_statement_282, + &Dump::on_selection_rest_statement_283, + &Dump::on_selection_rest_statement_284, + &Dump::on_condition_285, + &Dump::on_condition_286, + &Dump::on_switch_statement_287, + &Dump::on_switch_statement_list_288, + &Dump::on_switch_statement_list_289, + &Dump::on_case_label_290, + &Dump::on_case_label_291, + &Dump::on_iteration_statement_292, + &Dump::on_iteration_statement_293, + &Dump::on_iteration_statement_294, + &Dump::on_for_init_statement_295, + &Dump::on_for_init_statement_296, + &Dump::on_conditionopt_297, + &Dump::on_conditionopt_298, + &Dump::on_for_rest_statement_299, + &Dump::on_for_rest_statement_300, + &Dump::on_jump_statement_301, + &Dump::on_jump_statement_302, + &Dump::on_jump_statement_303, + &Dump::on_jump_statement_304, + &Dump::on_jump_statement_305, + &Dump::on_translation_unit_306, + &Dump::on_translation_unit_307, + &Dump::on_external_declaration_308, + &Dump::on_external_declaration_309, + &Dump::on_external_declaration_310, + &Dump::on_function_definition_311, +0, }; + +// variable_identifier ::= IDENTIFIER ; +void Dump::on_variable_identifier_1(AST *ast) +{ + if (debug) + std::cout << "variable_identifier ::= IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= NUMBER ; +void Dump::on_primary_expression_2(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= NUMBER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= TRUE ; +void Dump::on_primary_expression_3(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= TRUE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= FALSE ; +void Dump::on_primary_expression_4(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= FALSE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= variable_identifier ; +void Dump::on_primary_expression_5(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= variable_identifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// primary_expression ::= LEFT_PAREN expression RIGHT_PAREN ; +void Dump::on_primary_expression_6(AST *ast) +{ + if (debug) + std::cout << "primary_expression ::= LEFT_PAREN expression RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= primary_expression ; +void Dump::on_postfix_expression_7(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= primary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET ; +void Dump::on_postfix_expression_8(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= function_call ; +void Dump::on_postfix_expression_9(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= function_call" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= postfix_expression DOT IDENTIFIER ; +void Dump::on_postfix_expression_10(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= postfix_expression DOT IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= postfix_expression INC_OP ; +void Dump::on_postfix_expression_11(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= postfix_expression INC_OP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// postfix_expression ::= postfix_expression DEC_OP ; +void Dump::on_postfix_expression_12(AST *ast) +{ + if (debug) + std::cout << "postfix_expression ::= postfix_expression DEC_OP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// integer_expression ::= expression ; +void Dump::on_integer_expression_13(AST *ast) +{ + if (debug) + std::cout << "integer_expression ::= expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call ::= function_call_or_method ; +void Dump::on_function_call_14(AST *ast) +{ + if (debug) + std::cout << "function_call ::= function_call_or_method" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_or_method ::= function_call_generic ; +void Dump::on_function_call_or_method_15(AST *ast) +{ + if (debug) + std::cout << "function_call_or_method ::= function_call_generic" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_or_method ::= postfix_expression DOT function_call_generic ; +void Dump::on_function_call_or_method_16(AST *ast) +{ + if (debug) + std::cout << "function_call_or_method ::= postfix_expression DOT function_call_generic" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_generic ::= function_call_header_with_parameters RIGHT_PAREN ; +void Dump::on_function_call_generic_17(AST *ast) +{ + if (debug) + std::cout << "function_call_generic ::= function_call_header_with_parameters RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_generic ::= function_call_header_no_parameters RIGHT_PAREN ; +void Dump::on_function_call_generic_18(AST *ast) +{ + if (debug) + std::cout << "function_call_generic ::= function_call_header_no_parameters RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header_no_parameters ::= function_call_header VOID ; +void Dump::on_function_call_header_no_parameters_19(AST *ast) +{ + if (debug) + std::cout << "function_call_header_no_parameters ::= function_call_header VOID" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header_no_parameters ::= function_call_header ; +void Dump::on_function_call_header_no_parameters_20(AST *ast) +{ + if (debug) + std::cout << "function_call_header_no_parameters ::= function_call_header" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header_with_parameters ::= function_call_header assignment_expression ; +void Dump::on_function_call_header_with_parameters_21(AST *ast) +{ + if (debug) + std::cout << "function_call_header_with_parameters ::= function_call_header assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header_with_parameters ::= function_call_header_with_parameters COMMA assignment_expression ; +void Dump::on_function_call_header_with_parameters_22(AST *ast) +{ + if (debug) + std::cout << "function_call_header_with_parameters ::= function_call_header_with_parameters COMMA assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_call_header ::= function_identifier LEFT_PAREN ; +void Dump::on_function_call_header_23(AST *ast) +{ + if (debug) + std::cout << "function_call_header ::= function_identifier LEFT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_identifier ::= type_specifier ; +void Dump::on_function_identifier_24(AST *ast) +{ + if (debug) + std::cout << "function_identifier ::= type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_identifier ::= IDENTIFIER ; +void Dump::on_function_identifier_25(AST *ast) +{ + if (debug) + std::cout << "function_identifier ::= IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_expression ::= postfix_expression ; +void Dump::on_unary_expression_26(AST *ast) +{ + if (debug) + std::cout << "unary_expression ::= postfix_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_expression ::= INC_OP unary_expression ; +void Dump::on_unary_expression_27(AST *ast) +{ + if (debug) + std::cout << "unary_expression ::= INC_OP unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_expression ::= DEC_OP unary_expression ; +void Dump::on_unary_expression_28(AST *ast) +{ + if (debug) + std::cout << "unary_expression ::= DEC_OP unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_expression ::= unary_operator unary_expression ; +void Dump::on_unary_expression_29(AST *ast) +{ + if (debug) + std::cout << "unary_expression ::= unary_operator unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_operator ::= PLUS ; +void Dump::on_unary_operator_30(AST *ast) +{ + if (debug) + std::cout << "unary_operator ::= PLUS" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_operator ::= DASH ; +void Dump::on_unary_operator_31(AST *ast) +{ + if (debug) + std::cout << "unary_operator ::= DASH" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_operator ::= BANG ; +void Dump::on_unary_operator_32(AST *ast) +{ + if (debug) + std::cout << "unary_operator ::= BANG" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// unary_operator ::= TILDE ; +void Dump::on_unary_operator_33(AST *ast) +{ + if (debug) + std::cout << "unary_operator ::= TILDE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// multiplicative_expression ::= unary_expression ; +void Dump::on_multiplicative_expression_34(AST *ast) +{ + if (debug) + std::cout << "multiplicative_expression ::= unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// multiplicative_expression ::= multiplicative_expression STAR unary_expression ; +void Dump::on_multiplicative_expression_35(AST *ast) +{ + if (debug) + std::cout << "multiplicative_expression ::= multiplicative_expression STAR unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// multiplicative_expression ::= multiplicative_expression SLASH unary_expression ; +void Dump::on_multiplicative_expression_36(AST *ast) +{ + if (debug) + std::cout << "multiplicative_expression ::= multiplicative_expression SLASH unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// multiplicative_expression ::= multiplicative_expression PERCENT unary_expression ; +void Dump::on_multiplicative_expression_37(AST *ast) +{ + if (debug) + std::cout << "multiplicative_expression ::= multiplicative_expression PERCENT unary_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// additive_expression ::= multiplicative_expression ; +void Dump::on_additive_expression_38(AST *ast) +{ + if (debug) + std::cout << "additive_expression ::= multiplicative_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// additive_expression ::= additive_expression PLUS multiplicative_expression ; +void Dump::on_additive_expression_39(AST *ast) +{ + if (debug) + std::cout << "additive_expression ::= additive_expression PLUS multiplicative_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// additive_expression ::= additive_expression DASH multiplicative_expression ; +void Dump::on_additive_expression_40(AST *ast) +{ + if (debug) + std::cout << "additive_expression ::= additive_expression DASH multiplicative_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// shift_expression ::= additive_expression ; +void Dump::on_shift_expression_41(AST *ast) +{ + if (debug) + std::cout << "shift_expression ::= additive_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// shift_expression ::= shift_expression LEFT_OP additive_expression ; +void Dump::on_shift_expression_42(AST *ast) +{ + if (debug) + std::cout << "shift_expression ::= shift_expression LEFT_OP additive_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// shift_expression ::= shift_expression RIGHT_OP additive_expression ; +void Dump::on_shift_expression_43(AST *ast) +{ + if (debug) + std::cout << "shift_expression ::= shift_expression RIGHT_OP additive_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= shift_expression ; +void Dump::on_relational_expression_44(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= relational_expression LEFT_ANGLE shift_expression ; +void Dump::on_relational_expression_45(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= relational_expression LEFT_ANGLE shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= relational_expression RIGHT_ANGLE shift_expression ; +void Dump::on_relational_expression_46(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= relational_expression RIGHT_ANGLE shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= relational_expression LE_OP shift_expression ; +void Dump::on_relational_expression_47(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= relational_expression LE_OP shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// relational_expression ::= relational_expression GE_OP shift_expression ; +void Dump::on_relational_expression_48(AST *ast) +{ + if (debug) + std::cout << "relational_expression ::= relational_expression GE_OP shift_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// equality_expression ::= relational_expression ; +void Dump::on_equality_expression_49(AST *ast) +{ + if (debug) + std::cout << "equality_expression ::= relational_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// equality_expression ::= equality_expression EQ_OP relational_expression ; +void Dump::on_equality_expression_50(AST *ast) +{ + if (debug) + std::cout << "equality_expression ::= equality_expression EQ_OP relational_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// equality_expression ::= equality_expression NE_OP relational_expression ; +void Dump::on_equality_expression_51(AST *ast) +{ + if (debug) + std::cout << "equality_expression ::= equality_expression NE_OP relational_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// and_expression ::= equality_expression ; +void Dump::on_and_expression_52(AST *ast) +{ + if (debug) + std::cout << "and_expression ::= equality_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// and_expression ::= and_expression AMPERSAND equality_expression ; +void Dump::on_and_expression_53(AST *ast) +{ + if (debug) + std::cout << "and_expression ::= and_expression AMPERSAND equality_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// exclusive_or_expression ::= and_expression ; +void Dump::on_exclusive_or_expression_54(AST *ast) +{ + if (debug) + std::cout << "exclusive_or_expression ::= and_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// exclusive_or_expression ::= exclusive_or_expression CARET and_expression ; +void Dump::on_exclusive_or_expression_55(AST *ast) +{ + if (debug) + std::cout << "exclusive_or_expression ::= exclusive_or_expression CARET and_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// inclusive_or_expression ::= exclusive_or_expression ; +void Dump::on_inclusive_or_expression_56(AST *ast) +{ + if (debug) + std::cout << "inclusive_or_expression ::= exclusive_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// inclusive_or_expression ::= inclusive_or_expression VERTICAL_BAR exclusive_or_expression ; +void Dump::on_inclusive_or_expression_57(AST *ast) +{ + if (debug) + std::cout << "inclusive_or_expression ::= inclusive_or_expression VERTICAL_BAR exclusive_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_and_expression ::= inclusive_or_expression ; +void Dump::on_logical_and_expression_58(AST *ast) +{ + if (debug) + std::cout << "logical_and_expression ::= inclusive_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_and_expression ::= logical_and_expression AND_OP inclusive_or_expression ; +void Dump::on_logical_and_expression_59(AST *ast) +{ + if (debug) + std::cout << "logical_and_expression ::= logical_and_expression AND_OP inclusive_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_xor_expression ::= logical_and_expression ; +void Dump::on_logical_xor_expression_60(AST *ast) +{ + if (debug) + std::cout << "logical_xor_expression ::= logical_and_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_xor_expression ::= logical_xor_expression XOR_OP logical_and_expression ; +void Dump::on_logical_xor_expression_61(AST *ast) +{ + if (debug) + std::cout << "logical_xor_expression ::= logical_xor_expression XOR_OP logical_and_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_or_expression ::= logical_xor_expression ; +void Dump::on_logical_or_expression_62(AST *ast) +{ + if (debug) + std::cout << "logical_or_expression ::= logical_xor_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// logical_or_expression ::= logical_or_expression OR_OP logical_xor_expression ; +void Dump::on_logical_or_expression_63(AST *ast) +{ + if (debug) + std::cout << "logical_or_expression ::= logical_or_expression OR_OP logical_xor_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// conditional_expression ::= logical_or_expression ; +void Dump::on_conditional_expression_64(AST *ast) +{ + if (debug) + std::cout << "conditional_expression ::= logical_or_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// conditional_expression ::= logical_or_expression QUESTION expression COLON assignment_expression ; +void Dump::on_conditional_expression_65(AST *ast) +{ + if (debug) + std::cout << "conditional_expression ::= logical_or_expression QUESTION expression COLON assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_expression ::= conditional_expression ; +void Dump::on_assignment_expression_66(AST *ast) +{ + if (debug) + std::cout << "assignment_expression ::= conditional_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_expression ::= unary_expression assignment_operator assignment_expression ; +void Dump::on_assignment_expression_67(AST *ast) +{ + if (debug) + std::cout << "assignment_expression ::= unary_expression assignment_operator assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= EQUAL ; +void Dump::on_assignment_operator_68(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= EQUAL" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= MUL_ASSIGN ; +void Dump::on_assignment_operator_69(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= MUL_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= DIV_ASSIGN ; +void Dump::on_assignment_operator_70(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= DIV_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= MOD_ASSIGN ; +void Dump::on_assignment_operator_71(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= MOD_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= ADD_ASSIGN ; +void Dump::on_assignment_operator_72(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= ADD_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= SUB_ASSIGN ; +void Dump::on_assignment_operator_73(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= SUB_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= LEFT_ASSIGN ; +void Dump::on_assignment_operator_74(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= LEFT_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= RIGHT_ASSIGN ; +void Dump::on_assignment_operator_75(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= RIGHT_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= AND_ASSIGN ; +void Dump::on_assignment_operator_76(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= AND_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= XOR_ASSIGN ; +void Dump::on_assignment_operator_77(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= XOR_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// assignment_operator ::= OR_ASSIGN ; +void Dump::on_assignment_operator_78(AST *ast) +{ + if (debug) + std::cout << "assignment_operator ::= OR_ASSIGN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// expression ::= assignment_expression ; +void Dump::on_expression_79(AST *ast) +{ + if (debug) + std::cout << "expression ::= assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// expression ::= expression COMMA assignment_expression ; +void Dump::on_expression_80(AST *ast) +{ + if (debug) + std::cout << "expression ::= expression COMMA assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// constant_expression ::= conditional_expression ; +void Dump::on_constant_expression_81(AST *ast) +{ + if (debug) + std::cout << "constant_expression ::= conditional_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= function_prototype SEMICOLON ; +void Dump::on_declaration_82(AST *ast) +{ + if (debug) + std::cout << "declaration ::= function_prototype SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= init_declarator_list SEMICOLON ; +void Dump::on_declaration_83(AST *ast) +{ + if (debug) + std::cout << "declaration ::= init_declarator_list SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= PRECISION precision_qualifier type_specifier_no_prec SEMICOLON ; +void Dump::on_declaration_84(AST *ast) +{ + if (debug) + std::cout << "declaration ::= PRECISION precision_qualifier type_specifier_no_prec SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE SEMICOLON ; +void Dump::on_declaration_85(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER SEMICOLON ; +void Dump::on_declaration_86(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET RIGHT_BRACKET SEMICOLON ; +void Dump::on_declaration_87(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET RIGHT_BRACKET SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET SEMICOLON ; +void Dump::on_declaration_88(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration ::= type_qualifier SEMICOLON ; +void Dump::on_declaration_89(AST *ast) +{ + if (debug) + std::cout << "declaration ::= type_qualifier SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_prototype ::= function_declarator RIGHT_PAREN ; +void Dump::on_function_prototype_90(AST *ast) +{ + if (debug) + std::cout << "function_prototype ::= function_declarator RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_declarator ::= function_header ; +void Dump::on_function_declarator_91(AST *ast) +{ + if (debug) + std::cout << "function_declarator ::= function_header" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_declarator ::= function_header_with_parameters ; +void Dump::on_function_declarator_92(AST *ast) +{ + if (debug) + std::cout << "function_declarator ::= function_header_with_parameters" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_header_with_parameters ::= function_header parameter_declaration ; +void Dump::on_function_header_with_parameters_93(AST *ast) +{ + if (debug) + std::cout << "function_header_with_parameters ::= function_header parameter_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_header_with_parameters ::= function_header_with_parameters COMMA parameter_declaration ; +void Dump::on_function_header_with_parameters_94(AST *ast) +{ + if (debug) + std::cout << "function_header_with_parameters ::= function_header_with_parameters COMMA parameter_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_header ::= fully_specified_type IDENTIFIER LEFT_PAREN ; +void Dump::on_function_header_95(AST *ast) +{ + if (debug) + std::cout << "function_header ::= fully_specified_type IDENTIFIER LEFT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declarator ::= type_specifier IDENTIFIER ; +void Dump::on_parameter_declarator_96(AST *ast) +{ + if (debug) + std::cout << "parameter_declarator ::= type_specifier IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declarator ::= type_specifier IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Dump::on_parameter_declarator_97(AST *ast) +{ + if (debug) + std::cout << "parameter_declarator ::= type_specifier IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_declarator ; +void Dump::on_parameter_declaration_98(AST *ast) +{ + if (debug) + std::cout << "parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_declarator" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declaration ::= parameter_qualifier parameter_declarator ; +void Dump::on_parameter_declaration_99(AST *ast) +{ + if (debug) + std::cout << "parameter_declaration ::= parameter_qualifier parameter_declarator" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_type_specifier ; +void Dump::on_parameter_declaration_100(AST *ast) +{ + if (debug) + std::cout << "parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_declaration ::= parameter_qualifier parameter_type_specifier ; +void Dump::on_parameter_declaration_101(AST *ast) +{ + if (debug) + std::cout << "parameter_declaration ::= parameter_qualifier parameter_type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_qualifier ::= ; +void Dump::on_parameter_qualifier_102(AST *ast) +{ + if (debug) + std::cout << "parameter_qualifier ::=" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_qualifier ::= IN ; +void Dump::on_parameter_qualifier_103(AST *ast) +{ + if (debug) + std::cout << "parameter_qualifier ::= IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_qualifier ::= OUT ; +void Dump::on_parameter_qualifier_104(AST *ast) +{ + if (debug) + std::cout << "parameter_qualifier ::= OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_qualifier ::= INOUT ; +void Dump::on_parameter_qualifier_105(AST *ast) +{ + if (debug) + std::cout << "parameter_qualifier ::= INOUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_type_specifier ::= type_specifier ; +void Dump::on_parameter_type_specifier_106(AST *ast) +{ + if (debug) + std::cout << "parameter_type_specifier ::= type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= single_declaration ; +void Dump::on_init_declarator_list_107(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= single_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER ; +void Dump::on_init_declarator_list_108(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +void Dump::on_init_declarator_list_109(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Dump::on_init_declarator_list_110(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer ; +void Dump::on_init_declarator_list_111(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer ; +void Dump::on_init_declarator_list_112(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// init_declarator_list ::= init_declarator_list COMMA IDENTIFIER EQUAL initializer ; +void Dump::on_init_declarator_list_113(AST *ast) +{ + if (debug) + std::cout << "init_declarator_list ::= init_declarator_list COMMA IDENTIFIER EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type ; +void Dump::on_single_declaration_114(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER ; +void Dump::on_single_declaration_115(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +void Dump::on_single_declaration_116(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Dump::on_single_declaration_117(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer ; +void Dump::on_single_declaration_118(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer ; +void Dump::on_single_declaration_119(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= fully_specified_type IDENTIFIER EQUAL initializer ; +void Dump::on_single_declaration_120(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= fully_specified_type IDENTIFIER EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// single_declaration ::= INVARIANT IDENTIFIER ; +void Dump::on_single_declaration_121(AST *ast) +{ + if (debug) + std::cout << "single_declaration ::= INVARIANT IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// fully_specified_type ::= type_specifier ; +void Dump::on_fully_specified_type_122(AST *ast) +{ + if (debug) + std::cout << "fully_specified_type ::= type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// fully_specified_type ::= type_qualifier type_specifier ; +void Dump::on_fully_specified_type_123(AST *ast) +{ + if (debug) + std::cout << "fully_specified_type ::= type_qualifier type_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// invariant_qualifier ::= INVARIANT ; +void Dump::on_invariant_qualifier_124(AST *ast) +{ + if (debug) + std::cout << "invariant_qualifier ::= INVARIANT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// interpolation_qualifier ::= SMOOTH ; +void Dump::on_interpolation_qualifier_125(AST *ast) +{ + if (debug) + std::cout << "interpolation_qualifier ::= SMOOTH" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// interpolation_qualifier ::= FLAT ; +void Dump::on_interpolation_qualifier_126(AST *ast) +{ + if (debug) + std::cout << "interpolation_qualifier ::= FLAT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// interpolation_qualifier ::= NOPERSPECTIVE ; +void Dump::on_interpolation_qualifier_127(AST *ast) +{ + if (debug) + std::cout << "interpolation_qualifier ::= NOPERSPECTIVE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier ::= LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN ; +void Dump::on_layout_qualifier_128(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier ::= LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier_id_list ::= layout_qualifier_id ; +void Dump::on_layout_qualifier_id_list_129(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier_id_list ::= layout_qualifier_id" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier_id_list ::= layout_qualifier_id_list COMMA layout_qualifier_id ; +void Dump::on_layout_qualifier_id_list_130(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier_id_list ::= layout_qualifier_id_list COMMA layout_qualifier_id" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier_id ::= IDENTIFIER ; +void Dump::on_layout_qualifier_id_131(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier_id ::= IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// layout_qualifier_id ::= IDENTIFIER EQUAL NUMBER ; +void Dump::on_layout_qualifier_id_132(AST *ast) +{ + if (debug) + std::cout << "layout_qualifier_id ::= IDENTIFIER EQUAL NUMBER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// parameter_type_qualifier ::= CONST ; +void Dump::on_parameter_type_qualifier_133(AST *ast) +{ + if (debug) + std::cout << "parameter_type_qualifier ::= CONST" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= storage_qualifier ; +void Dump::on_type_qualifier_134(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= layout_qualifier ; +void Dump::on_type_qualifier_135(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= layout_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= layout_qualifier storage_qualifier ; +void Dump::on_type_qualifier_136(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= layout_qualifier storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= interpolation_qualifier storage_qualifier ; +void Dump::on_type_qualifier_137(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= interpolation_qualifier storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= interpolation_qualifier ; +void Dump::on_type_qualifier_138(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= interpolation_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= invariant_qualifier storage_qualifier ; +void Dump::on_type_qualifier_139(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= invariant_qualifier storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= invariant_qualifier interpolation_qualifier storage_qualifier ; +void Dump::on_type_qualifier_140(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= invariant_qualifier interpolation_qualifier storage_qualifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_qualifier ::= INVARIANT ; +void Dump::on_type_qualifier_141(AST *ast) +{ + if (debug) + std::cout << "type_qualifier ::= INVARIANT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= CONST ; +void Dump::on_storage_qualifier_142(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= CONST" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= ATTRIBUTE ; +void Dump::on_storage_qualifier_143(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= ATTRIBUTE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= VARYING ; +void Dump::on_storage_qualifier_144(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= VARYING" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= CENTROID VARYING ; +void Dump::on_storage_qualifier_145(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= CENTROID VARYING" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= IN ; +void Dump::on_storage_qualifier_146(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= OUT ; +void Dump::on_storage_qualifier_147(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= CENTROID IN ; +void Dump::on_storage_qualifier_148(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= CENTROID IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= CENTROID OUT ; +void Dump::on_storage_qualifier_149(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= CENTROID OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= PATCH IN ; +void Dump::on_storage_qualifier_150(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= PATCH IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= PATCH OUT ; +void Dump::on_storage_qualifier_151(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= PATCH OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= SAMPLE IN ; +void Dump::on_storage_qualifier_152(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= SAMPLE IN" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= SAMPLE OUT ; +void Dump::on_storage_qualifier_153(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= SAMPLE OUT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// storage_qualifier ::= UNIFORM ; +void Dump::on_storage_qualifier_154(AST *ast) +{ + if (debug) + std::cout << "storage_qualifier ::= UNIFORM" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier ::= type_specifier_no_prec ; +void Dump::on_type_specifier_155(AST *ast) +{ + if (debug) + std::cout << "type_specifier ::= type_specifier_no_prec" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier ::= precision_qualifier type_specifier_no_prec ; +void Dump::on_type_specifier_156(AST *ast) +{ + if (debug) + std::cout << "type_specifier ::= precision_qualifier type_specifier_no_prec" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_no_prec ::= type_specifier_nonarray ; +void Dump::on_type_specifier_no_prec_157(AST *ast) +{ + if (debug) + std::cout << "type_specifier_no_prec ::= type_specifier_nonarray" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET RIGHT_BRACKET ; +void Dump::on_type_specifier_no_prec_158(AST *ast) +{ + if (debug) + std::cout << "type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Dump::on_type_specifier_no_prec_159(AST *ast) +{ + if (debug) + std::cout << "type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= VOID ; +void Dump::on_type_specifier_nonarray_160(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= VOID" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= FLOAT ; +void Dump::on_type_specifier_nonarray_161(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= FLOAT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DOUBLE ; +void Dump::on_type_specifier_nonarray_162(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DOUBLE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= INT ; +void Dump::on_type_specifier_nonarray_163(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= INT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= UINT ; +void Dump::on_type_specifier_nonarray_164(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= UINT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= BOOL ; +void Dump::on_type_specifier_nonarray_165(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= BOOL" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= VEC2 ; +void Dump::on_type_specifier_nonarray_166(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= VEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= VEC3 ; +void Dump::on_type_specifier_nonarray_167(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= VEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= VEC4 ; +void Dump::on_type_specifier_nonarray_168(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= VEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DVEC2 ; +void Dump::on_type_specifier_nonarray_169(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DVEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DVEC3 ; +void Dump::on_type_specifier_nonarray_170(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DVEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DVEC4 ; +void Dump::on_type_specifier_nonarray_171(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DVEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= BVEC2 ; +void Dump::on_type_specifier_nonarray_172(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= BVEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= BVEC3 ; +void Dump::on_type_specifier_nonarray_173(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= BVEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= BVEC4 ; +void Dump::on_type_specifier_nonarray_174(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= BVEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= IVEC2 ; +void Dump::on_type_specifier_nonarray_175(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= IVEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= IVEC3 ; +void Dump::on_type_specifier_nonarray_176(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= IVEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= IVEC4 ; +void Dump::on_type_specifier_nonarray_177(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= IVEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= UVEC2 ; +void Dump::on_type_specifier_nonarray_178(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= UVEC2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= UVEC3 ; +void Dump::on_type_specifier_nonarray_179(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= UVEC3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= UVEC4 ; +void Dump::on_type_specifier_nonarray_180(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= UVEC4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT2 ; +void Dump::on_type_specifier_nonarray_181(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT3 ; +void Dump::on_type_specifier_nonarray_182(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT4 ; +void Dump::on_type_specifier_nonarray_183(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT2X2 ; +void Dump::on_type_specifier_nonarray_184(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT2X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT2X3 ; +void Dump::on_type_specifier_nonarray_185(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT2X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT2X4 ; +void Dump::on_type_specifier_nonarray_186(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT2X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT3X2 ; +void Dump::on_type_specifier_nonarray_187(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT3X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT3X3 ; +void Dump::on_type_specifier_nonarray_188(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT3X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT3X4 ; +void Dump::on_type_specifier_nonarray_189(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT3X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT4X2 ; +void Dump::on_type_specifier_nonarray_190(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT4X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT4X3 ; +void Dump::on_type_specifier_nonarray_191(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT4X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= MAT4X4 ; +void Dump::on_type_specifier_nonarray_192(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= MAT4X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT2 ; +void Dump::on_type_specifier_nonarray_193(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT3 ; +void Dump::on_type_specifier_nonarray_194(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT4 ; +void Dump::on_type_specifier_nonarray_195(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT2X2 ; +void Dump::on_type_specifier_nonarray_196(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT2X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT2X3 ; +void Dump::on_type_specifier_nonarray_197(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT2X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT2X4 ; +void Dump::on_type_specifier_nonarray_198(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT2X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT3X2 ; +void Dump::on_type_specifier_nonarray_199(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT3X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT3X3 ; +void Dump::on_type_specifier_nonarray_200(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT3X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT3X4 ; +void Dump::on_type_specifier_nonarray_201(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT3X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT4X2 ; +void Dump::on_type_specifier_nonarray_202(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT4X2" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT4X3 ; +void Dump::on_type_specifier_nonarray_203(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT4X3" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= DMAT4X4 ; +void Dump::on_type_specifier_nonarray_204(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= DMAT4X4" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER1D ; +void Dump::on_type_specifier_nonarray_205(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER1D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2D ; +void Dump::on_type_specifier_nonarray_206(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER3D ; +void Dump::on_type_specifier_nonarray_207(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER3D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERCUBE ; +void Dump::on_type_specifier_nonarray_208(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERCUBE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER1DSHADOW ; +void Dump::on_type_specifier_nonarray_209(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER1DSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DSHADOW ; +void Dump::on_type_specifier_nonarray_210(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERCUBESHADOW ; +void Dump::on_type_specifier_nonarray_211(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERCUBESHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER1DARRAY ; +void Dump::on_type_specifier_nonarray_212(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER1DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DARRAY ; +void Dump::on_type_specifier_nonarray_213(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER1DARRAYSHADOW ; +void Dump::on_type_specifier_nonarray_214(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER1DARRAYSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DARRAYSHADOW ; +void Dump::on_type_specifier_nonarray_215(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DARRAYSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERCUBEARRAY ; +void Dump::on_type_specifier_nonarray_216(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERCUBEARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERCUBEARRAYSHADOW ; +void Dump::on_type_specifier_nonarray_217(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERCUBEARRAYSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER1D ; +void Dump::on_type_specifier_nonarray_218(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER1D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2D ; +void Dump::on_type_specifier_nonarray_219(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER3D ; +void Dump::on_type_specifier_nonarray_220(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER3D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLERCUBE ; +void Dump::on_type_specifier_nonarray_221(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLERCUBE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER1DARRAY ; +void Dump::on_type_specifier_nonarray_222(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER1DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2DARRAY ; +void Dump::on_type_specifier_nonarray_223(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLERCUBEARRAY ; +void Dump::on_type_specifier_nonarray_224(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLERCUBEARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER1D ; +void Dump::on_type_specifier_nonarray_225(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER1D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2D ; +void Dump::on_type_specifier_nonarray_226(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER3D ; +void Dump::on_type_specifier_nonarray_227(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER3D" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLERCUBE ; +void Dump::on_type_specifier_nonarray_228(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLERCUBE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER1DARRAY ; +void Dump::on_type_specifier_nonarray_229(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER1DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2DARRAY ; +void Dump::on_type_specifier_nonarray_230(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2DARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLERCUBEARRAY ; +void Dump::on_type_specifier_nonarray_231(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLERCUBEARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DRECT ; +void Dump::on_type_specifier_nonarray_232(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DRECT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DRECTSHADOW ; +void Dump::on_type_specifier_nonarray_233(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DRECTSHADOW" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2DRECT ; +void Dump::on_type_specifier_nonarray_234(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2DRECT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2DRECT ; +void Dump::on_type_specifier_nonarray_235(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2DRECT" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLERBUFFER ; +void Dump::on_type_specifier_nonarray_236(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLERBUFFER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLERBUFFER ; +void Dump::on_type_specifier_nonarray_237(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLERBUFFER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLERBUFFER ; +void Dump::on_type_specifier_nonarray_238(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLERBUFFER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DMS ; +void Dump::on_type_specifier_nonarray_239(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DMS" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2DMS ; +void Dump::on_type_specifier_nonarray_240(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2DMS" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2DMS ; +void Dump::on_type_specifier_nonarray_241(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2DMS" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= SAMPLER2DMSARRAY ; +void Dump::on_type_specifier_nonarray_242(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= SAMPLER2DMSARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= ISAMPLER2DMSARRAY ; +void Dump::on_type_specifier_nonarray_243(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= ISAMPLER2DMSARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= USAMPLER2DMSARRAY ; +void Dump::on_type_specifier_nonarray_244(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= USAMPLER2DMSARRAY" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= struct_specifier ; +void Dump::on_type_specifier_nonarray_245(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= struct_specifier" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// type_specifier_nonarray ::= TYPE_NAME ; +void Dump::on_type_specifier_nonarray_246(AST *ast) +{ + if (debug) + std::cout << "type_specifier_nonarray ::= TYPE_NAME" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// precision_qualifier ::= HIGHP ; +void Dump::on_precision_qualifier_247(AST *ast) +{ + if (debug) + std::cout << "precision_qualifier ::= HIGHP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// precision_qualifier ::= MEDIUMP ; +void Dump::on_precision_qualifier_248(AST *ast) +{ + if (debug) + std::cout << "precision_qualifier ::= MEDIUMP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// precision_qualifier ::= LOWP ; +void Dump::on_precision_qualifier_249(AST *ast) +{ + if (debug) + std::cout << "precision_qualifier ::= LOWP" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_specifier ::= STRUCT IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE ; +void Dump::on_struct_specifier_250(AST *ast) +{ + if (debug) + std::cout << "struct_specifier ::= STRUCT IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_specifier ::= STRUCT LEFT_BRACE struct_declaration_list RIGHT_BRACE ; +void Dump::on_struct_specifier_251(AST *ast) +{ + if (debug) + std::cout << "struct_specifier ::= STRUCT LEFT_BRACE struct_declaration_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declaration_list ::= struct_declaration ; +void Dump::on_struct_declaration_list_252(AST *ast) +{ + if (debug) + std::cout << "struct_declaration_list ::= struct_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declaration_list ::= struct_declaration_list struct_declaration ; +void Dump::on_struct_declaration_list_253(AST *ast) +{ + if (debug) + std::cout << "struct_declaration_list ::= struct_declaration_list struct_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declaration ::= type_specifier struct_declarator_list SEMICOLON ; +void Dump::on_struct_declaration_254(AST *ast) +{ + if (debug) + std::cout << "struct_declaration ::= type_specifier struct_declarator_list SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declaration ::= type_qualifier type_specifier struct_declarator_list SEMICOLON ; +void Dump::on_struct_declaration_255(AST *ast) +{ + if (debug) + std::cout << "struct_declaration ::= type_qualifier type_specifier struct_declarator_list SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator_list ::= struct_declarator ; +void Dump::on_struct_declarator_list_256(AST *ast) +{ + if (debug) + std::cout << "struct_declarator_list ::= struct_declarator" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator_list ::= struct_declarator_list COMMA struct_declarator ; +void Dump::on_struct_declarator_list_257(AST *ast) +{ + if (debug) + std::cout << "struct_declarator_list ::= struct_declarator_list COMMA struct_declarator" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator ::= IDENTIFIER ; +void Dump::on_struct_declarator_258(AST *ast) +{ + if (debug) + std::cout << "struct_declarator ::= IDENTIFIER" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator ::= IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +void Dump::on_struct_declarator_259(AST *ast) +{ + if (debug) + std::cout << "struct_declarator ::= IDENTIFIER LEFT_BRACKET RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// struct_declarator ::= IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +void Dump::on_struct_declarator_260(AST *ast) +{ + if (debug) + std::cout << "struct_declarator ::= IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// initializer ::= assignment_expression ; +void Dump::on_initializer_261(AST *ast) +{ + if (debug) + std::cout << "initializer ::= assignment_expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// declaration_statement ::= declaration ; +void Dump::on_declaration_statement_262(AST *ast) +{ + if (debug) + std::cout << "declaration_statement ::= declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement ::= compound_statement ; +void Dump::on_statement_263(AST *ast) +{ + if (debug) + std::cout << "statement ::= compound_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement ::= simple_statement ; +void Dump::on_statement_264(AST *ast) +{ + if (debug) + std::cout << "statement ::= simple_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= declaration_statement ; +void Dump::on_simple_statement_265(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= declaration_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= expression_statement ; +void Dump::on_simple_statement_266(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= expression_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= selection_statement ; +void Dump::on_simple_statement_267(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= selection_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= switch_statement ; +void Dump::on_simple_statement_268(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= switch_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= case_label ; +void Dump::on_simple_statement_269(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= case_label" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= iteration_statement ; +void Dump::on_simple_statement_270(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= iteration_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// simple_statement ::= jump_statement ; +void Dump::on_simple_statement_271(AST *ast) +{ + if (debug) + std::cout << "simple_statement ::= jump_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// compound_statement ::= LEFT_BRACE RIGHT_BRACE ; +void Dump::on_compound_statement_272(AST *ast) +{ + if (debug) + std::cout << "compound_statement ::= LEFT_BRACE RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// compound_statement ::= LEFT_BRACE statement_list RIGHT_BRACE ; +void Dump::on_compound_statement_273(AST *ast) +{ + if (debug) + std::cout << "compound_statement ::= LEFT_BRACE statement_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement_no_new_scope ::= compound_statement_no_new_scope ; +void Dump::on_statement_no_new_scope_274(AST *ast) +{ + if (debug) + std::cout << "statement_no_new_scope ::= compound_statement_no_new_scope" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement_no_new_scope ::= simple_statement ; +void Dump::on_statement_no_new_scope_275(AST *ast) +{ + if (debug) + std::cout << "statement_no_new_scope ::= simple_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// compound_statement_no_new_scope ::= LEFT_BRACE RIGHT_BRACE ; +void Dump::on_compound_statement_no_new_scope_276(AST *ast) +{ + if (debug) + std::cout << "compound_statement_no_new_scope ::= LEFT_BRACE RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// compound_statement_no_new_scope ::= LEFT_BRACE statement_list RIGHT_BRACE ; +void Dump::on_compound_statement_no_new_scope_277(AST *ast) +{ + if (debug) + std::cout << "compound_statement_no_new_scope ::= LEFT_BRACE statement_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement_list ::= statement ; +void Dump::on_statement_list_278(AST *ast) +{ + if (debug) + std::cout << "statement_list ::= statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// statement_list ::= statement_list statement ; +void Dump::on_statement_list_279(AST *ast) +{ + if (debug) + std::cout << "statement_list ::= statement_list statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// expression_statement ::= SEMICOLON ; +void Dump::on_expression_statement_280(AST *ast) +{ + if (debug) + std::cout << "expression_statement ::= SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// expression_statement ::= expression SEMICOLON ; +void Dump::on_expression_statement_281(AST *ast) +{ + if (debug) + std::cout << "expression_statement ::= expression SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// selection_statement ::= IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement ; +void Dump::on_selection_statement_282(AST *ast) +{ + if (debug) + std::cout << "selection_statement ::= IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// selection_rest_statement ::= statement ELSE statement ; +void Dump::on_selection_rest_statement_283(AST *ast) +{ + if (debug) + std::cout << "selection_rest_statement ::= statement ELSE statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// selection_rest_statement ::= statement ; +void Dump::on_selection_rest_statement_284(AST *ast) +{ + if (debug) + std::cout << "selection_rest_statement ::= statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// condition ::= expression ; +void Dump::on_condition_285(AST *ast) +{ + if (debug) + std::cout << "condition ::= expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// condition ::= fully_specified_type IDENTIFIER EQUAL initializer ; +void Dump::on_condition_286(AST *ast) +{ + if (debug) + std::cout << "condition ::= fully_specified_type IDENTIFIER EQUAL initializer" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// switch_statement ::= SWITCH LEFT_PAREN expression RIGHT_PAREN LEFT_BRACE switch_statement_list RIGHT_BRACE ; +void Dump::on_switch_statement_287(AST *ast) +{ + if (debug) + std::cout << "switch_statement ::= SWITCH LEFT_PAREN expression RIGHT_PAREN LEFT_BRACE switch_statement_list RIGHT_BRACE" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// switch_statement_list ::= ; +void Dump::on_switch_statement_list_288(AST *ast) +{ + if (debug) + std::cout << "switch_statement_list ::=" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// switch_statement_list ::= statement_list ; +void Dump::on_switch_statement_list_289(AST *ast) +{ + if (debug) + std::cout << "switch_statement_list ::= statement_list" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// case_label ::= CASE expression COLON ; +void Dump::on_case_label_290(AST *ast) +{ + if (debug) + std::cout << "case_label ::= CASE expression COLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// case_label ::= DEFAULT COLON ; +void Dump::on_case_label_291(AST *ast) +{ + if (debug) + std::cout << "case_label ::= DEFAULT COLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// iteration_statement ::= WHILE LEFT_PAREN condition RIGHT_PAREN statement_no_new_scope ; +void Dump::on_iteration_statement_292(AST *ast) +{ + if (debug) + std::cout << "iteration_statement ::= WHILE LEFT_PAREN condition RIGHT_PAREN statement_no_new_scope" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// iteration_statement ::= DO statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON ; +void Dump::on_iteration_statement_293(AST *ast) +{ + if (debug) + std::cout << "iteration_statement ::= DO statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// iteration_statement ::= FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope ; +void Dump::on_iteration_statement_294(AST *ast) +{ + if (debug) + std::cout << "iteration_statement ::= FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// for_init_statement ::= expression_statement ; +void Dump::on_for_init_statement_295(AST *ast) +{ + if (debug) + std::cout << "for_init_statement ::= expression_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// for_init_statement ::= declaration_statement ; +void Dump::on_for_init_statement_296(AST *ast) +{ + if (debug) + std::cout << "for_init_statement ::= declaration_statement" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// conditionopt ::= ; +void Dump::on_conditionopt_297(AST *ast) +{ + if (debug) + std::cout << "conditionopt ::=" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// conditionopt ::= condition ; +void Dump::on_conditionopt_298(AST *ast) +{ + if (debug) + std::cout << "conditionopt ::= condition" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// for_rest_statement ::= conditionopt SEMICOLON ; +void Dump::on_for_rest_statement_299(AST *ast) +{ + if (debug) + std::cout << "for_rest_statement ::= conditionopt SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// for_rest_statement ::= conditionopt SEMICOLON expression ; +void Dump::on_for_rest_statement_300(AST *ast) +{ + if (debug) + std::cout << "for_rest_statement ::= conditionopt SEMICOLON expression" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= CONTINUE SEMICOLON ; +void Dump::on_jump_statement_301(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= CONTINUE SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= BREAK SEMICOLON ; +void Dump::on_jump_statement_302(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= BREAK SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= RETURN SEMICOLON ; +void Dump::on_jump_statement_303(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= RETURN SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= RETURN expression SEMICOLON ; +void Dump::on_jump_statement_304(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= RETURN expression SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// jump_statement ::= DISCARD SEMICOLON ; +void Dump::on_jump_statement_305(AST *ast) +{ + if (debug) + std::cout << "jump_statement ::= DISCARD SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// translation_unit ::= external_declaration ; +void Dump::on_translation_unit_306(AST *ast) +{ + if (debug) + std::cout << "translation_unit ::= external_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// translation_unit ::= translation_unit external_declaration ; +void Dump::on_translation_unit_307(AST *ast) +{ + if (debug) + std::cout << "translation_unit ::= translation_unit external_declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// external_declaration ::= function_definition ; +void Dump::on_external_declaration_308(AST *ast) +{ + if (debug) + std::cout << "external_declaration ::= function_definition" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// external_declaration ::= declaration ; +void Dump::on_external_declaration_309(AST *ast) +{ + if (debug) + std::cout << "external_declaration ::= declaration" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// external_declaration ::= SEMICOLON ; +void Dump::on_external_declaration_310(AST *ast) +{ + if (debug) + std::cout << "external_declaration ::= SEMICOLON" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + +// function_definition ::= function_prototype compound_statement_no_new_scope ; +void Dump::on_function_definition_311(AST *ast) +{ + if (debug) + std::cout << "function_definition ::= function_prototype compound_statement_no_new_scope" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} + diff --git a/src/libs/glsl/glslkeywords.cpp b/src/libs/glsl/glslkeywords.cpp new file mode 100644 index 00000000000..a992c9508e6 --- /dev/null +++ b/src/libs/glsl/glslkeywords.cpp @@ -0,0 +1,1637 @@ +#include "glsllexer.h" +#include "glslparser.h" + + +using namespace GLSL; + +static inline int classify2(const char *s) { + if (s[0] == 'd') { + if (s[1] == 'o') { + return Parser::T_DO; + } + } + else if (s[0] == 'i') { + if (s[1] == 'f') { + return Parser::T_IF; + } + else if (s[1] == 'n') { + return Parser::T_IN; + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify3(const char *s) { + if (s[0] == 'f') { + if (s[1] == 'o') { + if (s[2] == 'r') { + return Parser::T_FOR; + } + } + } + else if (s[0] == 'i') { + if (s[1] == 'n') { + if (s[2] == 't') { + return Parser::T_INT; + } + } + } + else if (s[0] == 'o') { + if (s[1] == 'u') { + if (s[2] == 't') { + return Parser::T_OUT; + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify4(const char *s) { + if (s[0] == 'b') { + if (s[1] == 'o') { + if (s[2] == 'o') { + if (s[3] == 'l') { + return Parser::T_BOOL; + } + } + } + } + else if (s[0] == 'c') { + if (s[1] == 'a') { + if (s[2] == 's') { + if (s[3] == 'e') { + return Parser::T_CASE | Lexer::Variant_GLSL_150; + } + } + } + } + else if (s[0] == 'e') { + if (s[1] == 'l') { + if (s[2] == 's') { + if (s[3] == 'e') { + return Parser::T_ELSE; + } + } + } + } + else if (s[0] == 'f') { + if (s[1] == 'l') { + if (s[2] == 'a') { + if (s[3] == 't') { + return Parser::T_FLAT | Lexer::Variant_GLSL_150; + } + } + } + } + else if (s[0] == 'l') { + if (s[1] == 'o') { + if (s[2] == 'w') { + if (s[3] == 'p') { + return Parser::T_LOWP | Lexer::Variant_GLSL_Qt | Lexer::Variant_GLSL_ES_100 | Lexer::Variant_GLSL_400; + } + } + } + } + else if (s[0] == 'm') { + if (s[1] == 'a') { + if (s[2] == 't') { + if (s[3] == '2') { + return Parser::T_MAT2; + } + else if (s[3] == '3') { + return Parser::T_MAT3; + } + else if (s[3] == '4') { + return Parser::T_MAT4; + } + } + } + } + else if (s[0] == 't') { + if (s[1] == 'r') { + if (s[2] == 'u') { + if (s[3] == 'e') { + return Parser::T_TRUE; + } + } + } + } + else if (s[0] == 'u') { + if (s[1] == 'i') { + if (s[2] == 'n') { + if (s[3] == 't') { + return Parser::T_UINT | Lexer::Variant_GLSL_150; + } + } + } + } + else if (s[0] == 'v') { + if (s[1] == 'e') { + if (s[2] == 'c') { + if (s[3] == '2') { + return Parser::T_VEC2; + } + else if (s[3] == '3') { + return Parser::T_VEC3; + } + else if (s[3] == '4') { + return Parser::T_VEC4; + } + } + } + else if (s[1] == 'o') { + if (s[2] == 'i') { + if (s[3] == 'd') { + return Parser::T_VOID; + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify5(const char *s) { + if (s[0] == 'b') { + if (s[1] == 'r') { + if (s[2] == 'e') { + if (s[3] == 'a') { + if (s[4] == 'k') { + return Parser::T_BREAK; + } + } + } + } + else if (s[1] == 'v') { + if (s[2] == 'e') { + if (s[3] == 'c') { + if (s[4] == '2') { + return Parser::T_BVEC2; + } + else if (s[4] == '3') { + return Parser::T_BVEC3; + } + else if (s[4] == '4') { + return Parser::T_BVEC4; + } + } + } + } + } + else if (s[0] == 'c') { + if (s[1] == 'o') { + if (s[2] == 'n') { + if (s[3] == 's') { + if (s[4] == 't') { + return Parser::T_CONST; + } + } + } + } + } + else if (s[0] == 'd') { + if (s[1] == 'm') { + if (s[2] == 'a') { + if (s[3] == 't') { + if (s[4] == '2') { + return Parser::T_DMAT2 | Lexer::Variant_GLSL_400; + } + else if (s[4] == '3') { + return Parser::T_DMAT3 | Lexer::Variant_GLSL_400; + } + else if (s[4] == '4') { + return Parser::T_DMAT4 | Lexer::Variant_GLSL_400; + } + } + } + } + else if (s[1] == 'v') { + if (s[2] == 'e') { + if (s[3] == 'c') { + if (s[4] == '2') { + return Parser::T_DVEC2 | Lexer::Variant_GLSL_400; + } + else if (s[4] == '3') { + return Parser::T_DVEC3 | Lexer::Variant_GLSL_400; + } + else if (s[4] == '4') { + return Parser::T_DVEC4 | Lexer::Variant_GLSL_400; + } + } + } + } + } + else if (s[0] == 'f') { + if (s[1] == 'a') { + if (s[2] == 'l') { + if (s[3] == 's') { + if (s[4] == 'e') { + return Parser::T_FALSE; + } + } + } + } + else if (s[1] == 'l') { + if (s[2] == 'o') { + if (s[3] == 'a') { + if (s[4] == 't') { + return Parser::T_FLOAT; + } + } + } + } + } + else if (s[0] == 'h') { + if (s[1] == 'i') { + if (s[2] == 'g') { + if (s[3] == 'h') { + if (s[4] == 'p') { + return Parser::T_HIGHP | Lexer::Variant_GLSL_Qt | Lexer::Variant_GLSL_ES_100 | Lexer::Variant_GLSL_400; + } + } + } + } + } + else if (s[0] == 'i') { + if (s[1] == 'n') { + if (s[2] == 'o') { + if (s[3] == 'u') { + if (s[4] == 't') { + return Parser::T_INOUT; + } + } + } + } + else if (s[1] == 'v') { + if (s[2] == 'e') { + if (s[3] == 'c') { + if (s[4] == '2') { + return Parser::T_IVEC2; + } + else if (s[4] == '3') { + return Parser::T_IVEC3; + } + else if (s[4] == '4') { + return Parser::T_IVEC4; + } + } + } + } + } + else if (s[0] == 'p') { + if (s[1] == 'a') { + if (s[2] == 't') { + if (s[3] == 'c') { + if (s[4] == 'h') { + return Parser::T_PATCH | Lexer::Variant_GLSL_400; + } + } + } + } + } + else if (s[0] == 'u') { + if (s[1] == 'v') { + if (s[2] == 'e') { + if (s[3] == 'c') { + if (s[4] == '2') { + return Parser::T_UVEC2 | Lexer::Variant_GLSL_150; + } + else if (s[4] == '3') { + return Parser::T_UVEC3 | Lexer::Variant_GLSL_150; + } + else if (s[4] == '4') { + return Parser::T_UVEC4 | Lexer::Variant_GLSL_150; + } + } + } + } + } + else if (s[0] == 'w') { + if (s[1] == 'h') { + if (s[2] == 'i') { + if (s[3] == 'l') { + if (s[4] == 'e') { + return Parser::T_WHILE; + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify6(const char *s) { + if (s[0] == 'd') { + if (s[1] == 'o') { + if (s[2] == 'u') { + if (s[3] == 'b') { + if (s[4] == 'l') { + if (s[5] == 'e') { + return Parser::T_DOUBLE | Lexer::Variant_GLSL_400; + } + } + } + } + } + } + else if (s[0] == 'l') { + if (s[1] == 'a') { + if (s[2] == 'y') { + if (s[3] == 'o') { + if (s[4] == 'u') { + if (s[5] == 't') { + return Parser::T_LAYOUT | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + else if (s[0] == 'm') { + if (s[1] == 'a') { + if (s[2] == 't') { + if (s[3] == '2') { + if (s[4] == 'x') { + if (s[5] == '2') { + return Parser::T_MAT2X2 | Lexer::Variant_GLSL_120; + } + else if (s[5] == '3') { + return Parser::T_MAT2X3 | Lexer::Variant_GLSL_120; + } + else if (s[5] == '4') { + return Parser::T_MAT2X4 | Lexer::Variant_GLSL_120; + } + } + } + else if (s[3] == '3') { + if (s[4] == 'x') { + if (s[5] == '2') { + return Parser::T_MAT3X2 | Lexer::Variant_GLSL_120; + } + else if (s[5] == '3') { + return Parser::T_MAT3X3 | Lexer::Variant_GLSL_120; + } + else if (s[5] == '4') { + return Parser::T_MAT3X4 | Lexer::Variant_GLSL_120; + } + } + } + else if (s[3] == '4') { + if (s[4] == 'x') { + if (s[5] == '2') { + return Parser::T_MAT4X2 | Lexer::Variant_GLSL_120; + } + else if (s[5] == '3') { + return Parser::T_MAT4X3 | Lexer::Variant_GLSL_120; + } + else if (s[5] == '4') { + return Parser::T_MAT4X4 | Lexer::Variant_GLSL_120; + } + } + } + } + } + } + else if (s[0] == 'r') { + if (s[1] == 'e') { + if (s[2] == 't') { + if (s[3] == 'u') { + if (s[4] == 'r') { + if (s[5] == 'n') { + return Parser::T_RETURN; + } + } + } + } + } + } + else if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + return Parser::T_SAMPLE | Lexer::Variant_Reserved; + } + } + } + } + } + else if (s[1] == 'm') { + if (s[2] == 'o') { + if (s[3] == 'o') { + if (s[4] == 't') { + if (s[5] == 'h') { + return Parser::T_SMOOTH | Lexer::Variant_GLSL_150; + } + } + } + } + } + else if (s[1] == 't') { + if (s[2] == 'r') { + if (s[3] == 'u') { + if (s[4] == 'c') { + if (s[5] == 't') { + return Parser::T_STRUCT; + } + } + } + } + } + else if (s[1] == 'w') { + if (s[2] == 'i') { + if (s[3] == 't') { + if (s[4] == 'c') { + if (s[5] == 'h') { + return Parser::T_SWITCH | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify7(const char *s) { + if (s[0] == 'd') { + if (s[1] == 'e') { + if (s[2] == 'f') { + if (s[3] == 'a') { + if (s[4] == 'u') { + if (s[5] == 'l') { + if (s[6] == 't') { + return Parser::T_DEFAULT | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + else if (s[1] == 'i') { + if (s[2] == 's') { + if (s[3] == 'c') { + if (s[4] == 'a') { + if (s[5] == 'r') { + if (s[6] == 'd') { + return Parser::T_DISCARD | Lexer::Variant_FragmentShader; + } + } + } + } + } + } + else if (s[1] == 'm') { + if (s[2] == 'a') { + if (s[3] == 't') { + if (s[4] == '2') { + if (s[5] == 'x') { + if (s[6] == '2') { + return Parser::T_DMAT2X2 | Lexer::Variant_GLSL_400; + } + else if (s[6] == '3') { + return Parser::T_DMAT2X3 | Lexer::Variant_GLSL_400; + } + else if (s[6] == '4') { + return Parser::T_DMAT2X4 | Lexer::Variant_GLSL_400; + } + } + } + else if (s[4] == '3') { + if (s[5] == 'x') { + if (s[6] == '2') { + return Parser::T_DMAT3X2 | Lexer::Variant_GLSL_400; + } + else if (s[6] == '3') { + return Parser::T_DMAT3X3 | Lexer::Variant_GLSL_400; + } + else if (s[6] == '4') { + return Parser::T_DMAT3X4 | Lexer::Variant_GLSL_400; + } + } + } + else if (s[4] == '4') { + if (s[5] == 'x') { + if (s[6] == '2') { + return Parser::T_DMAT4X2 | Lexer::Variant_GLSL_400; + } + else if (s[6] == '3') { + return Parser::T_DMAT4X3 | Lexer::Variant_GLSL_400; + } + else if (s[6] == '4') { + return Parser::T_DMAT4X4 | Lexer::Variant_GLSL_400; + } + } + } + } + } + } + } + else if (s[0] == 'm') { + if (s[1] == 'e') { + if (s[2] == 'd') { + if (s[3] == 'i') { + if (s[4] == 'u') { + if (s[5] == 'm') { + if (s[6] == 'p') { + return Parser::T_MEDIUMP | Lexer::Variant_GLSL_Qt | Lexer::Variant_GLSL_ES_100 | Lexer::Variant_GLSL_400; + } + } + } + } + } + } + } + else if (s[0] == 'u') { + if (s[1] == 'n') { + if (s[2] == 'i') { + if (s[3] == 'f') { + if (s[4] == 'o') { + if (s[5] == 'r') { + if (s[6] == 'm') { + return Parser::T_UNIFORM; + } + } + } + } + } + } + } + else if (s[0] == 'v') { + if (s[1] == 'a') { + if (s[2] == 'r') { + if (s[3] == 'y') { + if (s[4] == 'i') { + if (s[5] == 'n') { + if (s[6] == 'g') { + return Parser::T_VARYING; + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify8(const char *s) { + if (s[0] == 'c') { + if (s[1] == 'e') { + if (s[2] == 'n') { + if (s[3] == 't') { + if (s[4] == 'r') { + if (s[5] == 'o') { + if (s[6] == 'i') { + if (s[7] == 'd') { + return Parser::T_CENTROID | Lexer::Variant_GLSL_120; + } + } + } + } + } + } + } + else if (s[1] == 'o') { + if (s[2] == 'n') { + if (s[3] == 't') { + if (s[4] == 'i') { + if (s[5] == 'n') { + if (s[6] == 'u') { + if (s[7] == 'e') { + return Parser::T_CONTINUE; + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify9(const char *s) { + if (s[0] == 'a') { + if (s[1] == 't') { + if (s[2] == 't') { + if (s[3] == 'r') { + if (s[4] == 'i') { + if (s[5] == 'b') { + if (s[6] == 'u') { + if (s[7] == 't') { + if (s[8] == 'e') { + return Parser::T_ATTRIBUTE | Lexer::Variant_VertexShader; + } + } + } + } + } + } + } + } + } + else if (s[0] == 'i') { + if (s[1] == 'n') { + if (s[2] == 'v') { + if (s[3] == 'a') { + if (s[4] == 'r') { + if (s[5] == 'i') { + if (s[6] == 'a') { + if (s[7] == 'n') { + if (s[8] == 't') { + return Parser::T_INVARIANT; + } + } + } + } + } + } + } + } + } + else if (s[0] == 'p') { + if (s[1] == 'r') { + if (s[2] == 'e') { + if (s[3] == 'c') { + if (s[4] == 'i') { + if (s[5] == 's') { + if (s[6] == 'i') { + if (s[7] == 'o') { + if (s[8] == 'n') { + return Parser::T_PRECISION | Lexer::Variant_GLSL_ES_100; + } + } + } + } + } + } + } + } + } + else if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == '1') { + if (s[8] == 'D') { + return Parser::T_SAMPLER1D | Lexer::Variant_GLSL_120; + } + } + else if (s[7] == '2') { + if (s[8] == 'D') { + return Parser::T_SAMPLER2D; + } + } + else if (s[7] == '3') { + if (s[8] == 'D') { + return Parser::T_SAMPLER3D | Lexer::Variant_GLSL_120; + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify10(const char *s) { + if (s[0] == 'i') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '1') { + if (s[9] == 'D') { + return Parser::T_ISAMPLER1D | Lexer::Variant_GLSL_150; + } + } + else if (s[8] == '2') { + if (s[9] == 'D') { + return Parser::T_ISAMPLER2D | Lexer::Variant_GLSL_150; + } + } + else if (s[8] == '3') { + if (s[9] == 'D') { + return Parser::T_ISAMPLER3D | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 's') { + if (s[1] == 'u') { + if (s[2] == 'b') { + if (s[3] == 'r') { + if (s[4] == 'o') { + if (s[5] == 'u') { + if (s[6] == 't') { + if (s[7] == 'i') { + if (s[8] == 'n') { + if (s[9] == 'e') { + return Parser::T_SUBROUTINE | Lexer::Variant_GLSL_400; + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 'u') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '1') { + if (s[9] == 'D') { + return Parser::T_USAMPLER1D | Lexer::Variant_GLSL_150; + } + } + else if (s[8] == '2') { + if (s[9] == 'D') { + return Parser::T_USAMPLER2D | Lexer::Variant_GLSL_150; + } + } + else if (s[8] == '3') { + if (s[9] == 'D') { + return Parser::T_USAMPLER3D | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify11(const char *s) { + if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == '2') { + if (s[8] == 'D') { + if (s[9] == 'M') { + if (s[10] == 'S') { + return Parser::T_SAMPLER2DMS | Lexer::Variant_GLSL_150; + } + } + } + } + else if (s[7] == 'C') { + if (s[8] == 'u') { + if (s[9] == 'b') { + if (s[10] == 'e') { + return Parser::T_SAMPLERCUBE; + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify12(const char *s) { + if (s[0] == 'i') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '2') { + if (s[9] == 'D') { + if (s[10] == 'M') { + if (s[11] == 'S') { + return Parser::T_ISAMPLER2DMS | Lexer::Variant_GLSL_150; + } + } + } + } + else if (s[8] == 'C') { + if (s[9] == 'u') { + if (s[10] == 'b') { + if (s[11] == 'e') { + return Parser::T_ISAMPLERCUBE | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 'u') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '2') { + if (s[9] == 'D') { + if (s[10] == 'M') { + if (s[11] == 'S') { + return Parser::T_USAMPLER2DMS | Lexer::Variant_GLSL_150; + } + } + } + } + else if (s[8] == 'C') { + if (s[9] == 'u') { + if (s[10] == 'b') { + if (s[11] == 'e') { + return Parser::T_USAMPLERCUBE | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify13(const char *s) { + if (s[0] == 'n') { + if (s[1] == 'o') { + if (s[2] == 'p') { + if (s[3] == 'e') { + if (s[4] == 'r') { + if (s[5] == 's') { + if (s[6] == 'p') { + if (s[7] == 'e') { + if (s[8] == 'c') { + if (s[9] == 't') { + if (s[10] == 'i') { + if (s[11] == 'v') { + if (s[12] == 'e') { + return Parser::T_NOPERSPECTIVE | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == '2') { + if (s[8] == 'D') { + if (s[9] == 'R') { + if (s[10] == 'e') { + if (s[11] == 'c') { + if (s[12] == 't') { + return Parser::T_SAMPLER2DRECT; + } + } + } + } + } + } + else if (s[7] == 'B') { + if (s[8] == 'u') { + if (s[9] == 'f') { + if (s[10] == 'f') { + if (s[11] == 'e') { + if (s[12] == 'r') { + return Parser::T_SAMPLERBUFFER | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify14(const char *s) { + if (s[0] == 'i') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '2') { + if (s[9] == 'D') { + if (s[10] == 'R') { + if (s[11] == 'e') { + if (s[12] == 'c') { + if (s[13] == 't') { + return Parser::T_ISAMPLER2DRECT | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + else if (s[8] == 'B') { + if (s[9] == 'u') { + if (s[10] == 'f') { + if (s[11] == 'f') { + if (s[12] == 'e') { + if (s[13] == 'r') { + return Parser::T_ISAMPLERBUFFER | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == '1') { + if (s[8] == 'D') { + if (s[9] == 'A') { + if (s[10] == 'r') { + if (s[11] == 'r') { + if (s[12] == 'a') { + if (s[13] == 'y') { + return Parser::T_SAMPLER1DARRAY | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + else if (s[7] == '2') { + if (s[8] == 'D') { + if (s[9] == 'A') { + if (s[10] == 'r') { + if (s[11] == 'r') { + if (s[12] == 'a') { + if (s[13] == 'y') { + return Parser::T_SAMPLER2DARRAY | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 'u') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '2') { + if (s[9] == 'D') { + if (s[10] == 'R') { + if (s[11] == 'e') { + if (s[12] == 'c') { + if (s[13] == 't') { + return Parser::T_USAMPLER2DRECT | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + else if (s[8] == 'B') { + if (s[9] == 'u') { + if (s[10] == 'f') { + if (s[11] == 'f') { + if (s[12] == 'e') { + if (s[13] == 'r') { + return Parser::T_USAMPLERBUFFER | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify15(const char *s) { + if (s[0] == 'i') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '1') { + if (s[9] == 'D') { + if (s[10] == 'A') { + if (s[11] == 'r') { + if (s[12] == 'r') { + if (s[13] == 'a') { + if (s[14] == 'y') { + return Parser::T_ISAMPLER1DARRAY | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + else if (s[8] == '2') { + if (s[9] == 'D') { + if (s[10] == 'A') { + if (s[11] == 'r') { + if (s[12] == 'r') { + if (s[13] == 'a') { + if (s[14] == 'y') { + return Parser::T_ISAMPLER2DARRAY | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == '1') { + if (s[8] == 'D') { + if (s[9] == 'S') { + if (s[10] == 'h') { + if (s[11] == 'a') { + if (s[12] == 'd') { + if (s[13] == 'o') { + if (s[14] == 'w') { + return Parser::T_SAMPLER1DSHADOW | Lexer::Variant_GLSL_120; + } + } + } + } + } + } + } + } + else if (s[7] == '2') { + if (s[8] == 'D') { + if (s[9] == 'S') { + if (s[10] == 'h') { + if (s[11] == 'a') { + if (s[12] == 'd') { + if (s[13] == 'o') { + if (s[14] == 'w') { + return Parser::T_SAMPLER2DSHADOW | Lexer::Variant_GLSL_120; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 'u') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '1') { + if (s[9] == 'D') { + if (s[10] == 'A') { + if (s[11] == 'r') { + if (s[12] == 'r') { + if (s[13] == 'a') { + if (s[14] == 'y') { + return Parser::T_USAMPLER1DARRAY | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + else if (s[8] == '2') { + if (s[9] == 'D') { + if (s[10] == 'A') { + if (s[11] == 'r') { + if (s[12] == 'r') { + if (s[13] == 'a') { + if (s[14] == 'y') { + return Parser::T_USAMPLER2DARRAY | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify16(const char *s) { + if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == '2') { + if (s[8] == 'D') { + if (s[9] == 'M') { + if (s[10] == 'S') { + if (s[11] == 'A') { + if (s[12] == 'r') { + if (s[13] == 'r') { + if (s[14] == 'a') { + if (s[15] == 'y') { + return Parser::T_SAMPLER2DMSARRAY | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + else if (s[7] == 'C') { + if (s[8] == 'u') { + if (s[9] == 'b') { + if (s[10] == 'e') { + if (s[11] == 'A') { + if (s[12] == 'r') { + if (s[13] == 'r') { + if (s[14] == 'a') { + if (s[15] == 'y') { + return Parser::T_SAMPLERCUBEARRAY | Lexer::Variant_GLSL_400; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify17(const char *s) { + if (s[0] == 'i') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '2') { + if (s[9] == 'D') { + if (s[10] == 'M') { + if (s[11] == 'S') { + if (s[12] == 'A') { + if (s[13] == 'r') { + if (s[14] == 'r') { + if (s[15] == 'a') { + if (s[16] == 'y') { + return Parser::T_ISAMPLER2DMSARRAY | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + else if (s[8] == 'C') { + if (s[9] == 'u') { + if (s[10] == 'b') { + if (s[11] == 'e') { + if (s[12] == 'A') { + if (s[13] == 'r') { + if (s[14] == 'r') { + if (s[15] == 'a') { + if (s[16] == 'y') { + return Parser::T_ISAMPLERCUBEARRAY | Lexer::Variant_GLSL_400; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == 'C') { + if (s[8] == 'u') { + if (s[9] == 'b') { + if (s[10] == 'e') { + if (s[11] == 'S') { + if (s[12] == 'h') { + if (s[13] == 'a') { + if (s[14] == 'd') { + if (s[15] == 'o') { + if (s[16] == 'w') { + return Parser::T_SAMPLERCUBESHADOW | Lexer::Variant_GLSL_400; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0] == 'u') { + if (s[1] == 's') { + if (s[2] == 'a') { + if (s[3] == 'm') { + if (s[4] == 'p') { + if (s[5] == 'l') { + if (s[6] == 'e') { + if (s[7] == 'r') { + if (s[8] == '2') { + if (s[9] == 'D') { + if (s[10] == 'M') { + if (s[11] == 'S') { + if (s[12] == 'a') { + if (s[13] == 'r') { + if (s[14] == 'r') { + if (s[15] == 'a') { + if (s[16] == 'y') { + return Parser::T_USAMPLER2DMSARRAY | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + else if (s[8] == 'C') { + if (s[9] == 'u') { + if (s[10] == 'b') { + if (s[11] == 'e') { + if (s[12] == 'A') { + if (s[13] == 'r') { + if (s[14] == 'r') { + if (s[15] == 'a') { + if (s[16] == 'y') { + return Parser::T_USAMPLERCUBEARRAY | Lexer::Variant_GLSL_400; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify19(const char *s) { + if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == '2') { + if (s[8] == 'D') { + if (s[9] == 'R') { + if (s[10] == 'e') { + if (s[11] == 'c') { + if (s[12] == 't') { + if (s[13] == 'S') { + if (s[14] == 'h') { + if (s[15] == 'a') { + if (s[16] == 'd') { + if (s[17] == 'o') { + if (s[18] == 'w') { + return Parser::T_SAMPLER2DRECTSHADOW; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify20(const char *s) { + if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == '1') { + if (s[8] == 'D') { + if (s[9] == 'A') { + if (s[10] == 'r') { + if (s[11] == 'r') { + if (s[12] == 'a') { + if (s[13] == 'y') { + if (s[14] == 'S') { + if (s[15] == 'h') { + if (s[16] == 'a') { + if (s[17] == 'd') { + if (s[18] == 'o') { + if (s[19] == 'w') { + return Parser::T_SAMPLER1DARRAYSHADOW | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[7] == '2') { + if (s[8] == 'D') { + if (s[9] == 'A') { + if (s[10] == 'r') { + if (s[11] == 'r') { + if (s[12] == 'a') { + if (s[13] == 'y') { + if (s[14] == 'S') { + if (s[15] == 'h') { + if (s[16] == 'a') { + if (s[17] == 'd') { + if (s[18] == 'o') { + if (s[19] == 'w') { + return Parser::T_SAMPLER2DARRAYSHADOW | Lexer::Variant_GLSL_150; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +static inline int classify22(const char *s) { + if (s[0] == 's') { + if (s[1] == 'a') { + if (s[2] == 'm') { + if (s[3] == 'p') { + if (s[4] == 'l') { + if (s[5] == 'e') { + if (s[6] == 'r') { + if (s[7] == 'C') { + if (s[8] == 'u') { + if (s[9] == 'b') { + if (s[10] == 'e') { + if (s[11] == 'A') { + if (s[12] == 'r') { + if (s[13] == 'r') { + if (s[14] == 'a') { + if (s[15] == 'y') { + if (s[16] == 'S') { + if (s[17] == 'h') { + if (s[18] == 'a') { + if (s[19] == 'd') { + if (s[20] == 'o') { + if (s[21] == 'w') { + return Parser::T_SAMPLERCUBEARRAYSHADOW | Lexer::Variant_GLSL_400; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return Parser::T_IDENTIFIER; +} + +int Lexer::classify(const char *s, int n) { + switch (n) { + case 2: return classify2(s); + case 3: return classify3(s); + case 4: return classify4(s); + case 5: return classify5(s); + case 6: return classify6(s); + case 7: return classify7(s); + case 8: return classify8(s); + case 9: return classify9(s); + case 10: return classify10(s); + case 11: return classify11(s); + case 12: return classify12(s); + case 13: return classify13(s); + case 14: return classify14(s); + case 15: return classify15(s); + case 16: return classify16(s); + case 17: return classify17(s); + case 19: return classify19(s); + case 20: return classify20(s); + case 22: return classify22(s); + default: return Parser::T_IDENTIFIER; + } // switch +} + diff --git a/src/libs/glsl/glsllexer.cpp b/src/libs/glsl/glsllexer.cpp new file mode 100644 index 00000000000..5490c10dfc8 --- /dev/null +++ b/src/libs/glsl/glsllexer.cpp @@ -0,0 +1,325 @@ + +#include "glsllexer.h" +#include "glslparser.h" +#include +#include + +using namespace GLSL; + +Lexer::Lexer(const char *source, unsigned size) + : _source(source), + _it(source), + _end(source + size), + _size(size), + _yychar('\n'), + _lineno(0), + _variant(Variant_Mask & ~Variant_Reserved) // everything except reserved +{ +} + +Lexer::~Lexer() +{ +} + +void Lexer::yyinp() +{ + if (_it != _end) { + _yychar = *_it++; + if (_yychar == '\n') + ++_lineno; + } else + _yychar = 0; +} + +int Lexer::yylex(Token *tk) +{ + const char *pos = 0; + int line = 0; + const int kind = yylex_helper(&pos, &line); + tk->kind = kind; + tk->position = pos - _source; + tk->length = _it - pos - 1; + tk->line = line; + tk->matchingBrace = 0; + return kind; +} + +int Lexer::yylex_helper(const char **position, int *line) +{ +again: + while (std::isspace(_yychar)) + yyinp(); + + *position = _it - 1; + *line = _lineno; + + if (_yychar == 0) + return Parser::EOF_SYMBOL; + + const int ch = _yychar; + yyinp(); + + switch (ch) { + case '#': + for (; _yychar; yyinp()) { + if (_yychar == '\n') + break; + } + goto again; + + // one of `!', `!=' + case '!': + if (_yychar == '=') { + yyinp(); + return Parser::T_NE_OP; + } + return Parser::T_BANG; + + // one of + // % + // %= + case '%': + if (_yychar == '=') { + yyinp(); + return Parser::T_MOD_ASSIGN; + } + return Parser::T_PERCENT; + + // one of + // & + // && + // &= + case '&': + if (_yychar == '=') { + yyinp(); + return Parser::T_AND_ASSIGN; + } else if (_yychar == '&') { + yyinp(); + return Parser::T_AND_OP; + } + return Parser::T_AMPERSAND; + + // ( + case '(': + return Parser::T_LEFT_PAREN; + + // ) + case ')': + return Parser::T_RIGHT_PAREN; + + // one of + // * + // *= + case '*': + if (_yychar == '=') { + yyinp(); + return Parser::T_MUL_ASSIGN; + } + return Parser::T_STAR; + + // one of + // ++ + // += + // + + case '+': + if (_yychar == '=') { + yyinp(); + return Parser::T_ADD_ASSIGN; + } else if (_yychar == '+') { + yyinp(); + return Parser::T_INC_OP; + } + return Parser::T_PLUS; + + // , + case ',': + return Parser::T_COMMA; + + // one of + // - + // -- + // -= + case '-': + if (_yychar == '=') { + yyinp(); + return Parser::T_SUB_ASSIGN; + } else if (_yychar == '-') { + yyinp(); + return Parser::T_DEC_OP; + } + return Parser::T_DASH; + + // one of + // . + // float constant + case '.': + if (std::isdigit(_yychar)) { + while (std::isalnum(_yychar)) { + yyinp(); + } + return Parser::T_NUMBER; + } + return Parser::T_DOT; + + // one of + // / + // /= + // comment + case '/': + if (_yychar == '/') { + for (; _yychar; yyinp()) { + if (_yychar == '\n') + break; + } + goto again; + } else if (_yychar == '*') { + yyinp(); + while (_yychar) { + if (_yychar == '*') { + yyinp(); + if (_yychar == '/') { + yyinp(); + goto again; + } + } else { + yyinp(); + } + } + goto again; + } else if (_yychar == '=') { + yyinp(); + return Parser::T_DIV_ASSIGN; + } + return Parser::T_SLASH; + + // : + case ':': + return Parser::T_COLON; + + // ; + case ';': + return Parser::T_SEMICOLON; + + // one of + // < + // <= + // << + // <<= + case '<': + if (_yychar == '=') { + yyinp(); + return Parser::T_LE_OP; + } else if (_yychar == '<') { + yyinp(); + if (_yychar == '=') { + yyinp(); + return Parser::T_LEFT_ASSIGN; + } + return Parser::T_LEFT_OP; + } + return Parser::T_LEFT_ANGLE; + + // one of + // = + // == + case '=': + if (_yychar == '=') { + yyinp(); + return Parser::T_EQ_OP; + } + return Parser::T_EQUAL; + + // one of + // > + // >= + // >>= + // >> + case '>': + if (_yychar == '=') { + yyinp(); + return Parser::T_GE_OP; + } else if (_yychar == '>') { + yyinp(); + if (_yychar == '=') { + yyinp(); + return Parser::T_RIGHT_ASSIGN; + } + return Parser::T_RIGHT_OP; + } + return Parser::T_RIGHT_ANGLE; + + // ? + case '?': + return Parser::T_QUESTION; + + // [ + case '[': + return Parser::T_LEFT_BRACKET; + + // ] + case ']': + return Parser::T_RIGHT_BRACKET; + + // one of + // ^ + // ^= + case '^': + if (_yychar == '=') { + yyinp(); + return Parser::T_XOR_ASSIGN; + } + return Parser::T_XOR_OP; + + // { + case '{': + return Parser::T_LEFT_BRACE; + + // one of + // | + // |= + // || + case '|': + if (_yychar == '=') { + yyinp(); + return Parser::T_OR_ASSIGN; + } else if (_yychar == '|') { + yyinp(); + return Parser::T_OR_OP; + } + return Parser::T_VERTICAL_BAR; + + // } + case '}': + return Parser::T_RIGHT_BRACE; + + // ~ + case '~': + return Parser::T_TILDE; + + default: + if (std::isalpha(ch) || ch == '_') { + const char *word = _it - 2; + while (std::isalnum(_yychar) || _yychar == '_') { + yyinp(); + } + int t = classify(word, _it - word -1); + if (!(t & Variant_Mask)) + return t; + if ((_variant & t & Variant_Mask) == 0) { + // TODO: issue a proper error for the unsupported keyword + std::string keyword(word, _it - word -1); + fprintf(stderr, "unsupported keyword `%s' at line %d\n", + keyword.c_str(), _lineno); + } + return t & ~Variant_Mask; + } else if (std::isdigit(ch)) { + while (std::isalnum(_yychar) || _yychar == '.') { + yyinp(); + } + return Parser::T_NUMBER; + } + + } // switch + + return Parser::T_ERROR; +} diff --git a/src/libs/glsl/glsllexer.h b/src/libs/glsl/glsllexer.h new file mode 100644 index 00000000000..fbb8217d62b --- /dev/null +++ b/src/libs/glsl/glsllexer.h @@ -0,0 +1,70 @@ +#ifndef GLSLLEXER_H +#define GLSLLEXER_H + +namespace GLSL { + +class Token +{ +public: + int kind; + int position; + int length; + int line; // ### remove + + union { + int matchingBrace; + void *ptr; + }; + + Token() + : kind(0), position(0), length(0), line(0), ptr(0) {} + + bool is(int k) const { return k == kind; } + bool isNot(int k) const { return k != kind; } +}; + +class Lexer +{ +public: + Lexer(const char *source, unsigned size); + ~Lexer(); + + enum + { + // Extra flag bits added to tokens by Lexer::classify() that + // indicate which variant of GLSL the keyword belongs to. + Variant_GLSL_120 = 0x00010000, // 1.20 and higher + Variant_GLSL_150 = 0x00020000, // 1.50 and higher + Variant_GLSL_400 = 0x00040000, // 4.00 and higher + Variant_GLSL_ES_100 = 0x00080000, // ES 1.00 and higher + Variant_GLSL_Qt = 0x00100000, + Variant_VertexShader = 0x00200000, + Variant_FragmentShader = 0x00400000, + Variant_Reserved = 0x80000000, + Variant_Mask = 0xFFFF0000 + }; + + int variant() const { return _variant; } + void setVariant(int flags) { _variant = flags; } + + int yylex(Token *tk); + +private: + static int classify(const char *s, int len); + + void yyinp(); + int yylex_helper(const char **position, int *line); + +private: + const char *_source; + const char *_it; + const char *_end; + int _size; + int _yychar; + int _lineno; + int _variant; +}; + +} // end of namespace GLSL + +#endif // GLSLLEXER_H diff --git a/src/libs/glsl/glslparser.cpp b/src/libs/glsl/glslparser.cpp new file mode 100644 index 00000000000..cb55b54ce9b --- /dev/null +++ b/src/libs/glsl/glslparser.cpp @@ -0,0 +1,141 @@ + +#include "glslparser.h" +#include + +using namespace GLSL; + +namespace GLSL { +void dumpAST(AST *); +void deleteAST(AST *ast); +} + +Parser::Parser(const char *source, unsigned size, int variant) + : _tos(-1), _index(0) +{ + _tokens.reserve(1024); + + _stateStack.resize(128); + _locationStack.resize(128); + _astStack.resize(128); + + _tokens.push_back(Token()); // invalid token + + std::stack parenStack; + std::stack bracketStack; + std::stack braceStack; + + Lexer lexer(source, size); + lexer.setVariant(variant); + Token tk; + do { + lexer.yylex(&tk); + + switch (tk.kind) { + case T_LEFT_PAREN: + parenStack.push(_tokens.size()); + break; + case T_LEFT_BRACKET: + bracketStack.push(_tokens.size()); + break; + case T_LEFT_BRACE: + braceStack.push(_tokens.size()); + break; + + case T_RIGHT_PAREN: + if (! parenStack.empty()) { + _tokens[parenStack.top()].matchingBrace = _tokens.size(); + parenStack.pop(); + } + break; + case T_RIGHT_BRACKET: + if (! bracketStack.empty()) { + _tokens[bracketStack.top()].matchingBrace = _tokens.size(); + bracketStack.pop(); + } + break; + case T_RIGHT_BRACE: + if (! braceStack.empty()) { + _tokens[braceStack.top()].matchingBrace = _tokens.size(); + braceStack.pop(); + } + break; + default: + break; + } + + _tokens.push_back(tk); + } while (tk.isNot(EOF_SYMBOL)); + + _index = 1; +} + +Parser::~Parser() +{ +} + +void Parser::dump(AST *ast) +{ + dumpAST(ast); +} + +bool Parser::parse() +{ + int action = 0; + int yytoken = -1; + int yyloc = -1; + Operand *opd = 0; + + _tos = -1; + + do { + if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) { + yyloc = consumeToken(); + yytoken = tokenKind(yyloc); + if (yytoken == T_IDENTIFIER && t_action(action, T_TYPE_NAME) != 0) { + const Token &la = tokenAt(_index); + + if (la.is(T_IDENTIFIER)) { + yytoken = T_TYPE_NAME; + } else if (la.is(T_LEFT_BRACKET) && la.matchingBrace != 0 && + tokenAt(la.matchingBrace + 1).is(T_IDENTIFIER)) { + yytoken = T_TYPE_NAME; + } + } + opd = new Operand(yyloc); + } + + if (unsigned(++_tos) == _stateStack.size()) { + _stateStack.resize(_tos * 2); + _locationStack.resize(_tos * 2); + _astStack.resize(_tos * 2); + } + + _stateStack[_tos] = action; + action = t_action(action, yytoken); + if (action > 0) { + if (action == ACCEPT_STATE) { + --_tos; + dump(_astStack[0]); + deleteAST(_astStack[0]); + return true; + } + _astStack[_tos] = opd; + _locationStack[_tos] = yyloc; + yytoken = -1; + } else if (action < 0) { + const int ruleno = -action - 1; + const int N = rhs[ruleno]; + _tos -= N; + if (N == 0) + _astStack[_tos] = 0; + else + _astStack[_tos] = new Operator(ruleno, &_astStack[_tos], &_astStack[_tos + N]); + action = nt_action(_stateStack[_tos], lhs[ruleno] - TERMINAL_COUNT); + } + } while (action); + + fprintf(stderr, "unexpected token `%s' at line %d\n", yytoken != -1 ? spell[yytoken] : "", + _tokens[yyloc].line + 1); + + return false; +} diff --git a/src/libs/glsl/glslparser.h b/src/libs/glsl/glslparser.h new file mode 100644 index 00000000000..b01eff4200a --- /dev/null +++ b/src/libs/glsl/glslparser.h @@ -0,0 +1,33 @@ + +#include "glslparsertable_p.h" +#include "glsllexer.h" +#include "glslast.h" +#include +#include + +namespace GLSL { + +class Parser: public GLSLParserTable +{ +public: + Parser(const char *source, unsigned size, int variant); + ~Parser(); + + bool parse(); + +private: + inline int consumeToken() { return _index++; } + inline const Token &tokenAt(int index) const { return _tokens.at(index); } + inline int tokenKind(int index) const { return _tokens.at(index).kind; } + void dump(AST *ast); + +private: + int _tos; + int _index; + std::vector _stateStack; + std::vector _locationStack; + std::vector _astStack; + std::vector _tokens; +}; + +} // end of namespace GLSL diff --git a/src/libs/glsl/glslparsertable.cpp b/src/libs/glsl/glslparsertable.cpp new file mode 100644 index 00000000000..35494fcdcd7 --- /dev/null +++ b/src/libs/glsl/glslparsertable.cpp @@ -0,0 +1,1264 @@ +// This file was generated by qlalr - DO NOT EDIT! +#include "glslparsertable_p.h" + +const char *const GLSLParserTable::spell [] = { + "end of file", "+=", "&", "&=", "&&", "attribute", "!", "bool", "break", "bvec2", + "bvec3", "bvec4", "^", "case", "centroid", ":", ",", "const", "continue", "-", + "--", "default", "discard", "/=", "dmat2", "dmat2x2", "dmat2x3", "dmat2x4", "dmat3", "dmat3x2", + "dmat3x3", "dmat3x4", "dmat4", "dmat4x2", "dmat4x3", "dmat4x4", "do", ".", "double", "dvec2", + "dvec3", "dvec4", "else", "=", "==", "flat", "float", "for", ">=", "highp", + "identifier", "if", "in", "++", "inout", "int", "invariant", "isampler1D", "isampler1DArray", "isampler2D", + "isampler2DArray", "isampler2DMS", "isampler2DMSArray", "isampler2DRect", "isampler3D", "isamplerBuffer", "isamplerCube", "isamplerCubeArray", "ivec2", "ivec3", + "ivec4", "layout", "<", "<<=", "{", "[", "<<", "(", "<=", "lowp", + "mat2", "mat2x2", "mat2x3", "mat2x4", "mat3", "mat3x2", "mat3x3", "mat3x4", "mat4", "mat4x2", + "mat4x3", "mat4x4", "mediump", "%=", "*=", "!=", "noperspective", "number constant", "|=", "||", + "out", "patch", "%", "plus", "precision", "?", "return", ">", ">>=", "}", + "]", ">>", ")", "sample", "sampler1D", "sampler1DArray", "sampler1DArrayShadow", "sampler1DShadow", "sampler2D", "sampler2DArray", + "sampler2DArrayShadow", "sampler2DMS", "sampler2DMSArray", "sampler2DRect", "sampler2DRectShadow", "sampler2DShadow", "sampler3D", "samplerBuffer", "samplerCube", "samplerCubeArray", + "samplerCubeArrayShadow", "samplerCubeShadow", ";", "/", "smooth", "*", "struct", "subroutine", "-=", "switch", + "~", "type_name", "uint", "uniform", "usampler1D", "usampler1DArray", "usampler2D", "usampler2DArray", "usampler2DMS", "usampler2DMSarray", + "usampler2DRect", "usampler3D", "usamplerBuffer", "usamplerCube", "usamplerCubeArray", "uvec2", "uvec3", "uvec4", "varying", "vec2", + "vec3", "vec4", "|", "void", "while", "^=", "^", "true", "false", "error"}; + +const short GLSLParserTable::lhs [] = { + 171, 172, 172, 172, 172, 172, 174, 174, 174, 174, + 174, 174, 175, 176, 177, 177, 178, 178, 180, 180, + 179, 179, 181, 183, 183, 185, 185, 185, 185, 186, + 186, 186, 186, 187, 187, 187, 187, 188, 188, 188, + 189, 189, 189, 190, 190, 190, 190, 190, 191, 191, + 191, 192, 192, 193, 193, 194, 194, 195, 195, 196, + 196, 197, 197, 198, 198, 182, 182, 199, 199, 199, + 199, 199, 199, 199, 199, 199, 199, 199, 173, 173, + 200, 201, 201, 201, 201, 201, 201, 201, 201, 202, + 208, 208, 210, 210, 209, 213, 213, 211, 211, 211, + 211, 215, 215, 215, 215, 216, 203, 203, 203, 203, + 203, 203, 203, 217, 217, 217, 217, 217, 217, 217, + 217, 212, 212, 219, 220, 220, 220, 221, 222, 222, + 223, 223, 214, 206, 206, 206, 206, 206, 206, 206, + 206, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 184, 184, 205, 205, 205, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 204, 204, 204, 226, + 226, 207, 207, 227, 227, 228, 228, 229, 229, 229, + 218, 230, 231, 231, 233, 233, 233, 233, 233, 233, + 233, 232, 232, 241, 241, 242, 242, 240, 240, 234, + 234, 235, 243, 243, 244, 244, 236, 245, 245, 237, + 237, 238, 238, 238, 246, 246, 248, 248, 247, 247, + 239, 239, 239, 239, 239, 170, 170, 249, 249, 249, + 250, 251}; + +const short GLSLParserTable::rhs [] = { + 1, 1, 1, 1, 1, 3, 1, 4, 1, 3, + 2, 2, 1, 1, 1, 3, 2, 2, 2, 1, + 2, 3, 2, 1, 1, 1, 2, 2, 2, 1, + 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, + 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 5, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 2, 2, 4, 6, 7, 9, 10, 2, 2, + 1, 1, 2, 3, 3, 2, 5, 3, 2, 3, + 2, 0, 1, 1, 1, 1, 1, 3, 5, 6, + 7, 8, 5, 1, 2, 4, 5, 6, 7, 4, + 2, 1, 2, 1, 1, 1, 1, 4, 1, 3, + 1, 3, 1, 1, 1, 2, 2, 1, 2, 3, + 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, + 2, 2, 2, 1, 1, 2, 1, 3, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, + 4, 1, 2, 3, 4, 1, 3, 1, 3, 4, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 3, 1, 1, 2, 3, 1, 2, 1, + 2, 5, 3, 1, 1, 4, 7, 0, 1, 3, + 2, 5, 7, 6, 1, 1, 0, 1, 2, 3, + 2, 2, 2, 3, 2, 1, 2, 1, 1, 1, + 2, 2}; + +const short GLSLParserTable::action_default [] = { + 0, 143, 165, 172, 173, 174, 0, 142, 193, 196, + 197, 198, 194, 199, 200, 201, 195, 202, 203, 204, + 162, 169, 170, 171, 126, 161, 247, 146, 163, 141, + 218, 222, 219, 223, 240, 243, 234, 220, 237, 221, + 224, 175, 176, 177, 0, 249, 181, 184, 185, 186, + 182, 187, 188, 189, 183, 190, 191, 192, 248, 127, + 147, 0, 0, 0, 205, 212, 214, 209, 206, 213, + 215, 239, 242, 232, 233, 210, 207, 236, 208, 216, + 217, 211, 310, 125, 0, 246, 164, 154, 225, 229, + 226, 230, 241, 244, 235, 227, 238, 228, 231, 178, + 179, 180, 144, 166, 167, 168, 160, 309, 306, 114, + 0, 308, 102, 92, 0, 0, 138, 0, 135, 0, + 107, 134, 245, 0, 0, 122, 155, 157, 148, 149, + 145, 121, 0, 131, 129, 0, 0, 132, 0, 128, + 130, 150, 151, 0, 0, 84, 152, 153, 0, 0, + 0, 141, 252, 0, 0, 0, 250, 253, 0, 258, + 256, 0, 0, 32, 31, 0, 4, 1, 0, 0, + 2, 30, 259, 33, 3, 41, 54, 81, 0, 52, + 56, 9, 15, 20, 0, 0, 14, 0, 58, 60, + 64, 62, 38, 26, 7, 49, 44, 24, 34, 0, + 5, 28, 27, 79, 66, 0, 34, 0, 6, 80, + 72, 76, 70, 68, 74, 71, 69, 78, 75, 73, + 77, 0, 67, 0, 0, 40, 0, 0, 0, 37, + 36, 35, 39, 0, 53, 0, 0, 50, 0, 0, + 0, 0, 48, 0, 0, 42, 43, 45, 47, 46, + 51, 260, 0, 55, 160, 21, 18, 0, 17, 22, + 23, 0, 57, 0, 59, 0, 0, 63, 0, 61, + 0, 0, 65, 12, 0, 11, 0, 10, 16, 13, + 0, 8, 29, 0, 255, 257, 0, 254, 0, 251, + 115, 0, 0, 95, 261, 120, 116, 0, 0, 118, + 117, 0, 119, 90, 133, 103, 105, 104, 93, 0, + 102, 99, 101, 106, 96, 0, 0, 97, 0, 98, + 100, 106, 102, 94, 0, 82, 311, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 276, 280, 0, + 0, 269, 263, 262, 265, 0, 266, 0, 270, 271, + 267, 264, 278, 0, 268, 122, 302, 0, 290, 301, + 291, 305, 0, 0, 0, 0, 0, 293, 0, 296, + 295, 297, 122, 298, 0, 285, 0, 0, 0, 299, + 300, 0, 274, 275, 294, 0, 0, 286, 123, 0, + 0, 0, 282, 284, 0, 283, 272, 0, 273, 279, + 303, 0, 304, 0, 0, 0, 288, 289, 0, 287, + 0, 0, 0, 292, 281, 277, 0, 83, 108, 0, + 0, 113, 109, 0, 0, 111, 110, 0, 112, 137, + 0, 139, 140, 136, 156, 312, 307, 0, 89, 0, + 0, 0, 0, 85, 0, 86, 0, 0, 87, 0, + 88, 0, 158, 0, 159}; + +const short GLSLParserTable::goto_default [] = { + 123, 200, 194, 345, 193, 280, 181, 186, 182, 185, + 184, 183, 203, 187, 197, 206, 199, 192, 175, 196, + 195, 179, 176, 180, 188, 189, 191, 190, 204, 221, + 178, 343, 347, 115, 119, 126, 124, 288, 110, 112, + 113, 308, 109, 311, 310, 309, 312, 120, 295, 117, + 116, 118, 135, 134, 121, 127, 122, 152, 286, 160, + 344, 352, 342, 351, 346, 350, 354, 341, 348, 349, + 353, 384, 382, 392, 373, 408, 371, 376, 374, 108, + 111, 0}; + +const short GLSLParserTable::action_index [] = { + 3093, -170, -170, -170, -170, -170, 48, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, 224, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -63, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, 24, 70, 30, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, 41, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -10, + -81, -170, 128, 18, 1, 67, 304, 155, 304, 467, + -170, -170, -170, 3263, 956, -170, -170, -24, -170, -170, + -170, -170, -3, 5, -170, 64, -47, -170, -20, -170, + -170, -170, -170, 467, -83, -170, -170, -170, -30, 2433, + 2433, 219, -170, 2763, 630, 7, -170, -170, 4, -17, + -170, 71, 1612, -170, -170, 1120, -170, -31, 1120, 1120, + -170, -170, -170, -170, -170, 53, 33, -170, -74, 45, + 21, -170, -170, 1284, -75, 54, -170, -35, -121, 39, + -1, -127, 44, 133, -170, 120, 16, -170, -170, 1120, + -170, -170, -170, -170, -170, 78, 209, 1120, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, 1120, -170, 1120, 1120, 6, 1120, 1120, 1120, -170, + -170, -170, 3, 1120, 49, 1120, 1120, 95, 1120, 1120, + 1120, 1120, 31, 1120, 1120, 82, 55, 26, 23, 10, + 116, -170, 1120, 66, -52, -170, -170, 1120, -170, -170, + -170, 1120, 52, 1120, -100, 1120, 1120, -103, 1120, 51, + 69, 1120, -170, -170, 793, -170, 1120, -8, -170, 139, + -44, -170, -170, 9, -170, -170, 65, -170, 2598, -170, + 75, 1120, 2268, -170, -170, -170, -39, -107, 1120, -170, + -18, 1120, -170, -170, -170, -170, -170, -170, -170, 630, + 59, -170, -170, -32, -56, 1120, -94, -170, 630, -170, + -170, -41, 109, -170, 4583, -170, -170, -104, 1120, -126, + -15, -130, 3758, -69, -72, 4088, 1448, -170, -170, -48, + -55, -170, -170, -170, -170, 57, -170, -117, -170, -170, + -170, -170, -170, 4418, -170, -70, -170, 62, -170, -170, + -170, -170, -151, -60, 1120, 72, -112, -170, 3593, -170, + -170, 3428, -50, -170, -106, 139, -88, -40, 630, 1120, + 139, 3923, -170, -170, -170, -42, 1120, -170, -170, 1120, + 63, 3758, -170, -21, 3758, -170, -170, 4253, -170, -170, + -170, 79, -170, 1120, 81, -51, 3758, 3758, -97, -170, + 3428, -101, 3923, -170, -170, -170, 11, -170, 28, 1120, + 1940, -170, 22, -43, 1120, -170, -11, 1120, -170, -170, + 304, -170, -170, -170, -170, -170, -170, -36, -170, 2433, + 2928, 46, 15, -170, 1776, -170, -87, -58, -170, -79, + -170, 2104, -170, -54, -170, + + 119, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, 2, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -40, -82, -45, 32, -41, -27, + -82, -82, -82, 141, 1, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -25, -82, + -82, -82, -82, -8, -82, -82, -82, -82, -82, 71, + 103, -82, -82, 99, 11, -82, -82, -82, -35, -82, + -82, -82, 40, -82, -82, 19, -82, -82, 18, 27, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -5, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -4, + -82, -82, -82, -82, -82, -82, -82, -7, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, 7, -82, 39, 36, -82, 6, -11, -1, -82, + -82, -82, -82, 31, -82, 24, 28, -82, 30, 51, + 44, 65, -82, 72, 42, -82, -82, -82, -82, -82, + -82, -82, 77, -82, -82, -82, -82, 8, -82, -82, + -82, 143, -82, 78, -82, 74, 13, -82, 63, -82, + -82, 5, -82, -82, 4, -82, 3, -82, -82, -82, + -82, -82, -82, -37, -82, -82, -82, -82, 84, -82, + -82, -2, 108, -82, -82, -82, -82, -82, 49, -82, + -82, 53, -82, -82, -82, -82, -82, -82, -82, 21, + -14, -82, -82, -82, -82, 115, -82, -82, 91, -82, + -82, -82, 9, -82, 10, -82, -82, -82, 15, -82, + -82, -82, 60, -82, -82, 57, 23, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, 58, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, 26, -82, -82, -82, 82, -82, + -82, 222, -82, -82, -82, -82, -82, -82, -12, 76, + -82, 55, -82, -82, -82, -82, 46, -82, -82, -3, + -82, 50, -82, -82, 48, -82, -82, 61, -82, -82, + -82, -82, -82, 0, -82, -82, 62, 67, -82, -82, + 150, -82, 89, -82, -82, -82, -82, -82, -82, 29, + 129, -82, -82, -82, 25, -82, -82, 35, -82, -82, + -53, -82, -82, -82, -82, -82, -82, -82, -82, 134, + 90, -82, -82, -82, 80, -82, -82, -82, -82, -82, + -82, 101, -82, -82, -82}; + +const short GLSLParserTable::action_info [] = { + 360, 386, 361, 300, 298, 389, 359, -24, 368, 314, + 385, 412, 409, 363, 132, 325, 317, 364, 314, 315, + 367, 394, 410, 406, 381, 301, 379, -24, 356, 403, + 133, 303, 427, 252, 322, 233, 251, 256, 439, 268, + 290, 261, 260, 263, 150, 448, -25, 133, 136, 145, + 137, 451, 449, 450, 159, 263, 454, 159, 162, 159, + -19, 418, 261, 268, 252, 424, 281, 426, 233, -25, + 257, 419, 223, 207, 223, 324, 141, 358, 207, 207, + 138, 283, 146, 416, 271, 207, 243, 283, 207, 235, + 444, 148, 243, 235, 207, 207, 442, 207, 265, 243, + 128, 223, 243, 420, 266, 226, 0, 243, 226, 0, + 0, 305, 0, 306, 0, 149, 0, 0, 291, 26, + 0, 244, 0, 0, 142, 0, 304, 244, 0, 0, + 147, 0, 0, 325, 244, 0, 227, 244, 228, 227, + 236, 228, 244, 238, 236, 304, 226, 445, 129, 45, + 292, 0, 293, 273, 0, 207, 224, 0, 224, 307, + 1, 305, 58, 306, 238, 0, 258, 239, 238, 6, + 274, 0, 7, 240, 0, 391, 139, 227, 443, 228, + 305, 0, 306, 0, 366, 224, 275, 0, 239, 414, + 208, 0, 239, 405, 240, 0, 0, 287, 240, 417, + 24, 0, 241, 284, 0, 0, 130, 27, 276, 307, + 210, 402, 211, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 241, -124, 0, 0, 241, 307, -124, + 0, 0, 212, -124, 0, 0, -124, 0, -124, 0, + -91, -124, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 59, 213, 0, 0, 60, 61, 0, 0, 0, + 0, 0, 0, 0, -124, 0, 0, 0, 63, -124, + 0, -124, 0, 0, 131, 0, -124, 0, 0, 0, + 0, 0, 214, 0, 0, 0, 0, 0, 0, 83, + 0, 0, 0, 0, 0, 0, 0, 0, 87, 0, + 0, 0, 215, 216, 0, 0, 0, 217, 0, 1, + 0, 0, 0, 102, 0, -124, 0, 218, 6, -124, + -124, 7, 0, 0, -124, -124, 0, 0, 0, 0, + 0, 0, -124, 0, 0, 0, 0, -124, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 219, 0, 0, + 0, 0, 0, -124, 0, 0, 27, 0, -124, 0, + 0, 0, -124, 0, 0, 0, 0, -124, 0, 0, + 0, 0, 0, 0, 220, 0, 0, -124, 0, 0, + 0, 0, -124, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 60, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 102, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 3, 4, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 0, 0, 20, 21, 22, 23, 0, + 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, + 0, 0, 28, 0, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 0, + 0, 0, 0, 84, 0, 0, 0, 0, 85, 86, + 0, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 0, 103, 104, 105, 0, + 106, 0, 0, 0, 0, 0, 0, 2, 0, 3, + 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 0, 0, 20, 21, + 22, 23, 0, 0, 0, 0, 25, 0, 0, 26, + 0, 0, 0, 0, 0, 28, 0, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 0, 0, 0, 0, 0, 0, 0, 0, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 0, 0, 0, 0, 84, 0, 0, 0, + 0, 85, 86, 0, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 0, 103, + 104, 105, 0, 106, 0, 0, 0, 0, 0, 0, + 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 20, 21, 22, 23, 0, 0, 0, 0, 25, + 0, 0, 26, 277, 0, 0, 0, 0, 28, 0, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 0, 0, 0, 0, 0, 0, + 0, 0, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 0, 0, 0, 0, 84, + 0, 0, 0, 0, 85, 86, 0, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 0, 103, 104, 105, 0, 106, 0, 0, 0, + 0, 0, 0, 2, 0, 3, 4, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 20, 21, 22, 23, 0, 0, + 0, 0, 25, 0, 0, 26, 437, 0, 0, 0, + 0, 28, 0, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 0, 0, 0, + 0, 0, 0, 0, 0, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 438, 0, + 0, 0, 84, 0, 0, 0, 0, 85, 86, 0, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 0, 103, 104, 105, 0, 106, + 0, 0, 0, 0, 0, 0, 163, 2, 0, 3, + 4, 5, 0, 0, 0, 0, 0, 0, 0, 164, + 165, 0, 0, 0, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 0, 0, 20, 21, + 22, 23, 0, 0, 0, 0, 25, 0, 0, 26, + 167, 0, 0, 168, 0, 28, 0, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 0, 0, 0, 0, 0, 0, 169, 0, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 0, 0, 0, 0, 170, 0, 0, + 0, 0, 0, 171, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 0, 0, 0, 0, 84, 0, 0, 0, + 173, 85, 86, 0, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 0, 103, + 104, 105, 0, 106, 0, 0, 0, 174, 166, 0, + 163, 2, 0, 3, 4, 5, 0, 0, 0, 0, + 0, 0, 0, 164, 165, 0, 0, 0, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 0, 0, 20, 21, 22, 23, 0, 0, 0, 0, + 25, 0, 0, 26, 167, 0, 0, 168, 0, 28, + 0, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 0, 0, 0, 0, 0, + 0, 169, 0, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 0, 0, 0, + 0, 170, 0, 0, 0, 0, 0, 171, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 0, 0, 0, 0, + 84, 0, 0, 0, 173, 85, 86, 0, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 0, 103, 104, 105, 0, 254, 0, 0, + 0, 174, 166, 0, 163, 2, 0, 3, 4, 5, + 0, 0, 0, 0, 0, 0, 0, 164, 165, 0, + 0, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 20, 21, 22, 23, + 0, 0, 0, 0, 25, 0, 0, 26, 167, 0, + 0, 168, 0, 28, 0, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 0, + 0, 0, 0, 0, 0, 169, 0, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 0, 0, 170, 0, 0, 0, 0, + 0, 171, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 400, 0, 0, 0, 84, 0, 0, 0, 173, 85, + 86, 0, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 0, 103, 104, 105, + 0, 106, 0, 0, 0, 174, 166, 0, 163, 2, + 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, + 0, 164, 165, 0, 0, 0, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 20, 21, 22, 23, 0, 0, 0, 0, 25, 0, + 0, 26, 167, 0, 0, 168, 0, 28, 0, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 0, 0, 0, 0, 0, 0, 169, + 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 0, 0, 0, 0, 170, + 0, 0, 0, 0, 0, 171, 0, 0, 0, 0, + 0, 0, 172, 0, 0, 0, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 0, 0, 0, 0, 84, 0, + 0, 0, 173, 85, 86, 0, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 0, 103, 104, 105, 0, 106, 0, 0, 0, 174, + 166, 0, 163, 2, 0, 3, 4, 5, 0, 0, + 0, 0, 0, 0, 0, 164, 165, 0, 0, 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 20, 21, 22, 23, 0, 0, + 0, 0, 25, 0, 0, 26, 167, 0, 0, 168, + 0, 28, 0, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 0, 0, 0, + 0, 0, 0, 169, 0, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + 0, 0, 0, 170, 0, 0, 0, 0, 0, 171, + 0, 0, 0, 0, 0, 0, 446, 0, 0, 0, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 0, 0, + 0, 0, 84, 0, 0, 0, 173, 85, 86, 0, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 0, 103, 104, 105, 0, 106, + 0, 0, 0, 174, 166, 0, 163, 2, 0, 3, + 4, 5, 0, 0, 0, 0, 0, 0, 0, 164, + 165, 0, 0, 0, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 0, 0, 20, 21, + 22, 23, 0, 0, 0, 0, 25, 0, 0, 26, + 167, 0, 0, 168, 0, 28, 0, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 0, 0, 0, 0, 0, 0, 169, 0, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 0, 0, 0, 0, 170, 0, 0, + 0, 0, 0, 171, 0, 0, 0, 0, 0, 0, + 422, 0, 0, 0, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 0, 0, 0, 0, 84, 0, 0, 0, + 173, 85, 86, 0, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 0, 103, + 104, 105, 0, 106, 0, 0, 0, 174, 166, 0, + 163, 2, 0, 3, 4, 5, 0, 0, 0, 0, + 0, 0, 0, 164, 165, 0, 0, 0, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 0, 0, 20, 21, 22, 23, 0, 0, 0, 0, + 25, 0, 0, 26, 167, 0, 0, 168, 0, 28, + 0, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 0, 0, 0, 0, 0, + 0, 169, 0, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 0, 0, 0, + 0, 170, 0, 0, 0, 0, 0, 171, 0, 0, + 0, 0, 0, 0, 452, 0, 0, 0, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 0, 0, 0, 0, + 84, 0, 0, 0, 173, 85, 86, 0, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 0, 103, 104, 105, 0, 106, 0, 0, + 0, 174, 166, 0, 163, 2, 0, 3, 4, 5, + 0, 0, 0, 0, 0, 0, 0, 164, 165, 0, + 0, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 20, 21, 22, 23, + 0, 0, 0, 0, 25, 0, 0, 26, 167, 0, + 0, 168, 0, 28, 0, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 0, + 0, 0, 0, 0, 0, 169, 0, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 0, 0, 170, 0, 0, 0, 0, + 0, 171, 0, 0, 0, 0, 0, 0, 296, 0, + 0, 0, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 0, 0, 0, 0, 84, 0, 0, 0, 173, 85, + 86, 0, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 0, 103, 104, 105, + 0, 106, 0, 0, 0, 174, 166, 0, 1, 0, + 2, 0, 3, 4, 5, 0, 0, 6, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 20, 21, 22, 23, 0, 0, 0, 24, 25, + 0, 0, 26, 0, 0, 27, 0, 0, 28, 151, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, + 0, 0, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 0, 59, + 0, 0, 0, 60, 61, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 0, 0, 83, 0, 84, + 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 0, 106, 0, 0, 0, + 0, 0, 0, 1, 0, 2, 0, 3, 4, 5, + 0, 0, 6, 0, 0, 7, 0, 0, 0, 0, + 0, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 20, 21, 22, 23, + 0, 0, 0, 24, 25, 0, 0, 26, 0, 0, + 27, 0, 0, 28, 151, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 0, 0, 0, 0, 0, 0, 0, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 0, 59, 0, 0, 0, 60, 61, + 0, 0, 0, 0, 0, 0, 0, 289, 0, 0, + 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 0, 0, 83, 0, 84, 0, 0, 0, 0, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 0, 106, 0, 0, 0, 0, 0, 0, 1, 0, + 2, 0, 3, 4, 5, 0, 0, 6, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 20, 21, 22, 23, 0, 0, 0, 24, 25, + 0, 0, 26, 0, 0, 27, 0, 0, 28, 151, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, + 0, 0, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 0, 59, + 0, 0, 0, 60, 61, 0, 0, 0, 0, 0, + 0, 0, 156, 0, 0, 0, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 0, 0, 83, 0, 84, + 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 0, 106, 0, 0, 0, + 0, 0, 0, 1, 0, 2, 0, 3, 4, 5, + 0, 0, 6, 0, 0, 7, 0, 0, 0, 0, + 0, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 20, 21, 22, 23, + 0, 0, 0, 24, 25, 0, 0, 26, 0, 0, + 27, 0, 0, 28, 151, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 0, 0, 0, 0, 0, 0, 0, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 0, 59, 0, 0, 0, 60, 61, + 0, 0, 0, 0, 0, 0, 0, 441, 0, 0, + 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 0, 0, 83, 0, 84, 0, 0, 0, 0, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 0, 106, 0, 0, 0, 0, 0, 0, 1, 0, + 2, 0, 3, 4, 5, 0, 0, 6, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 20, 21, 22, 23, 0, 0, 0, 24, 25, + 0, 0, 26, 0, 0, 27, 0, 0, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, + 0, 0, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 0, 59, + 0, 0, 0, 60, 61, 0, 0, 62, 0, 0, + 0, 0, 0, 0, 0, 0, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 0, 83, 0, 84, + 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 0, 106, 0, 0, 0, + 0, 0, 0, 435, 0, 0, 0, 0, 1, 0, + 2, 0, 3, 4, 5, 0, 0, 6, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 20, 21, 22, 23, 0, 0, 0, 24, 25, + 0, 0, 26, 0, 0, 27, 0, 0, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, + 0, 0, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 0, 59, + 0, 0, 0, 60, 61, 0, 0, 62, 0, 0, + 0, 0, 0, 0, 0, 0, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 0, 83, 0, 84, + 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 0, 106, 0, 0, 0, + 0, 0, 0, 1, 163, 2, 0, 3, 4, 5, + 0, 0, 6, 0, 0, 7, 0, 164, 165, 0, + 0, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 20, 21, 22, 23, + 0, 0, 0, 24, 25, 0, 0, 26, 167, 0, + 27, 168, 0, 28, 151, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 0, 0, 0, 0, 0, 169, 0, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 0, 59, 170, 0, 0, 60, 61, + 0, 171, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 0, 0, 83, 0, 84, 0, 0, 0, 173, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 0, 106, 0, 0, 0, 174, 166, 0, 1, 163, + 2, 0, 3, 4, 5, 0, 0, 6, 0, 0, + 7, 0, 164, 165, 0, 0, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 20, 21, 22, 23, 0, 0, 0, 24, 25, + 0, 0, 26, 167, 0, 27, 168, 0, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, + 169, 0, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 0, 59, + 170, 0, 0, 60, 61, 0, 171, 62, 0, 0, + 0, 0, 0, 0, 0, 0, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 338, 0, 83, 0, 84, + 0, 0, 0, 173, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 0, 106, 0, 0, 0, + 174, 166, 0, 1, 163, 2, 327, 3, 4, 5, + 0, 328, 6, 0, 0, 7, 329, 164, 165, 330, + 331, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 332, 0, 20, 21, 22, 23, + 0, 0, 0, 24, 25, 333, 0, 26, 167, 334, + 27, 168, 0, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 0, 0, 335, 0, 0, 169, 0, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 0, 59, 170, 0, 0, 60, 61, + 0, 171, 62, 0, 336, 0, 0, 0, 0, 0, + 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 338, 0, 83, 0, 84, 0, 0, 339, 173, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 0, 106, 340, 0, 0, 174, 166, 0, 1, 163, + 2, 327, 3, 4, 5, 0, 328, 6, 0, 0, + 7, 329, 164, 165, 330, 331, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 332, + 0, 20, 21, 22, 23, 0, 0, 0, 24, 25, + 333, 0, 26, 167, 334, 27, 168, 0, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 0, 0, 324, 0, 0, + 169, 0, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 0, 59, + 170, 0, 0, 60, 61, 0, 171, 62, 0, 336, + 0, 0, 0, 0, 0, 0, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 338, 0, 83, 0, 84, + 0, 0, 339, 173, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 0, 106, 340, 0, 0, + 174, 166, 0, 1, 163, 2, 327, 3, 4, 5, + 0, 328, 6, 0, 0, 7, 329, 164, 165, 330, + 331, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 332, 0, 20, 21, 22, 23, + 0, 0, 0, 24, 25, 333, 0, 26, 167, 334, + 27, 168, 0, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 0, 0, 335, 0, 0, 169, 0, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 0, 59, 170, 0, 0, 60, 61, + 0, 171, 62, 0, 336, 0, 0, 396, 0, 0, + 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 338, 0, 83, 0, 84, 0, 0, 339, 173, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 0, 106, 340, 0, 0, 174, 166, 0, 1, 163, + 2, 327, 3, 4, 5, 0, 328, 6, 0, 0, + 7, 329, 164, 165, 330, 331, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 332, + 0, 20, 21, 22, 23, 0, 0, 0, 24, 25, + 333, 0, 26, 167, 334, 27, 168, 0, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 0, 0, 335, 0, 0, + 169, 0, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 0, 59, + 170, 0, 0, 60, 61, 0, 171, 62, 0, 336, + 0, 0, 398, 0, 0, 0, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 338, 0, 83, 0, 84, + 0, 0, 339, 173, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 0, 106, 340, 0, 0, + 174, 166, 0, 1, 163, 2, 327, 3, 4, 5, + 0, 328, 6, 0, 0, 7, 329, 164, 165, 330, + 331, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 332, 0, 20, 21, 22, 23, + 0, 0, 0, 24, 25, 333, 0, 26, 167, 334, + 27, 168, 0, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 0, 0, 335, 0, 0, 169, 0, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 0, 59, 170, 0, 0, 60, 61, + 0, 171, 62, 0, 336, 0, 0, 415, 0, 0, + 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 338, 0, 83, 0, 84, 0, 0, 339, 173, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 0, 106, 340, 0, 0, 174, 166, 0, 1, 163, + 2, 327, 3, 4, 5, 0, 328, 6, 0, 0, + 7, 329, 164, 165, 330, 331, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 332, + 0, 20, 21, 22, 23, 0, 0, 0, 24, 25, + 333, 0, 26, 167, 334, 27, 168, 0, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 0, 0, 335, 0, 0, + 169, 0, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 0, 0, 0, 59, + 170, 0, 0, 60, 61, 0, 171, 62, 0, 336, + 0, 0, 337, 0, 0, 0, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 338, 0, 83, 0, 84, + 0, 0, 339, 173, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 0, 106, 340, 0, 0, + 174, 166, 0, + + 390, 432, 388, 404, 230, 209, 279, 255, 434, 429, + 294, 282, 278, 433, 231, 388, 270, 272, 357, 222, + 259, 229, 285, 161, 355, 158, 401, 144, 140, 365, + 205, 318, 326, 202, 201, 313, 143, 294, 0, 198, + 0, 294, 0, 198, 237, 198, 198, 294, 250, 242, + 323, 198, 234, 232, 198, 198, 225, 198, 294, 198, + 246, 294, 355, 248, 355, 294, 198, 0, 177, 355, + 247, 355, 355, 425, 355, 355, 355, 421, 198, 380, + 198, 355, 430, 428, 249, 155, 431, 198, 269, 198, + 245, 0, 198, 198, 387, 198, 372, 299, 155, 253, + 267, 302, 264, 355, 155, 321, 0, 154, 177, 395, + 447, 393, 0, 155, 0, 0, 198, 155, 383, 399, + 154, 362, 399, 198, 0, 0, 154, 397, 399, 177, + 198, 453, 407, 125, 319, 154, 177, 320, 297, 154, + 153, 157, 369, 177, 198, 316, 370, 157, 155, 0, + 107, 114, 383, 375, 0, 125, 157, 177, 198, 423, + 413, 0, 0, 0, 372, 0, 262, 0, 0, 0, + 154, 440, 107, 114, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 378, 0, 0, 0, + 0, 0, 377, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 436, 0, 0, 0, 411, 375, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 372, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 378, 0, + 0, 0, 0, 0, 377, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0}; + +const short GLSLParserTable::action_check [] = { + 15, 43, 132, 110, 43, 77, 132, 77, 77, 50, + 50, 112, 109, 164, 77, 132, 110, 77, 50, 75, + 132, 42, 77, 74, 112, 43, 132, 77, 132, 77, + 50, 112, 43, 12, 16, 2, 110, 112, 74, 166, + 50, 162, 77, 4, 74, 132, 77, 50, 43, 132, + 97, 75, 110, 132, 50, 4, 110, 50, 75, 50, + 112, 50, 162, 166, 12, 43, 110, 110, 2, 77, + 16, 43, 19, 16, 19, 74, 52, 15, 16, 16, + 16, 16, 52, 16, 15, 16, 76, 16, 16, 44, + 75, 50, 76, 44, 16, 16, 50, 16, 99, 76, + 52, 19, 76, 75, 105, 102, -1, 76, 102, -1, + -1, 52, -1, 54, -1, 74, -1, -1, 43, 49, + -1, 111, -1, -1, 100, -1, 17, 111, -1, -1, + 100, -1, -1, 132, 111, -1, 133, 111, 135, 133, + 95, 135, 111, 48, 95, 17, 102, 132, 100, 79, + 75, -1, 77, 20, -1, 16, 103, -1, 103, 100, + 5, 52, 92, 54, 48, -1, 112, 72, 48, 14, + 37, -1, 17, 78, -1, 112, 112, 133, 132, 135, + 52, -1, 54, -1, 112, 103, 53, -1, 72, 132, + 112, -1, 72, 112, 78, -1, -1, 132, 78, 132, + 45, -1, 107, 132, -1, -1, 158, 52, 75, 100, + 1, 132, 3, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 107, 5, -1, -1, 107, 100, 5, + -1, -1, 23, 14, -1, -1, 17, -1, 14, -1, + 112, 17, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 96, 43, -1, -1, 100, 101, -1, -1, -1, + -1, -1, -1, -1, 45, -1, -1, -1, 113, 45, + -1, 52, -1, -1, 50, -1, 52, -1, -1, -1, + -1, -1, 73, -1, -1, -1, -1, -1, -1, 134, + -1, -1, -1, -1, -1, -1, -1, -1, 143, -1, + -1, -1, 93, 94, -1, -1, -1, 98, -1, 5, + -1, -1, -1, 158, -1, 96, -1, 108, 14, 100, + 96, 17, -1, -1, 100, 101, -1, -1, -1, -1, + -1, -1, 113, -1, -1, -1, -1, 113, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, + -1, -1, -1, 134, -1, -1, 52, -1, 134, -1, + -1, -1, 143, -1, -1, -1, -1, 143, -1, -1, + -1, -1, -1, -1, 165, -1, -1, 158, -1, -1, + -1, -1, 158, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 100, 101, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 113, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 143, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 158, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 7, -1, 9, 10, 11, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, -1, -1, 38, 39, 40, 41, -1, + -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, + -1, -1, 55, -1, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, -1, + -1, -1, -1, 136, -1, -1, -1, -1, 141, 142, + -1, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, -1, 159, 160, 161, -1, + 163, -1, -1, -1, -1, -1, -1, 7, -1, 9, + 10, 11, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, -1, -1, 38, 39, + 40, 41, -1, -1, -1, -1, 46, -1, -1, 49, + -1, -1, -1, -1, -1, 55, -1, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, -1, -1, -1, -1, -1, -1, -1, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, -1, -1, -1, -1, 136, -1, -1, -1, + -1, 141, 142, -1, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, -1, 159, + 160, 161, -1, 163, -1, -1, -1, -1, -1, -1, + 7, -1, 9, 10, 11, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, + -1, 38, 39, 40, 41, -1, -1, -1, -1, 46, + -1, -1, 49, 50, -1, -1, -1, -1, 55, -1, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, -1, -1, -1, -1, -1, -1, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, -1, -1, -1, -1, 136, + -1, -1, -1, -1, 141, 142, -1, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, -1, 159, 160, 161, -1, 163, -1, -1, -1, + -1, -1, -1, 7, -1, 9, 10, 11, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, -1, -1, 38, 39, 40, 41, -1, -1, + -1, -1, 46, -1, -1, 49, 50, -1, -1, -1, + -1, 55, -1, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, -1, -1, -1, + -1, -1, -1, -1, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, -1, + -1, -1, 136, -1, -1, -1, -1, 141, 142, -1, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, -1, 159, 160, 161, -1, 163, + -1, -1, -1, -1, -1, -1, 6, 7, -1, 9, + 10, 11, -1, -1, -1, -1, -1, -1, -1, 19, + 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, -1, -1, 38, 39, + 40, 41, -1, -1, -1, -1, 46, -1, -1, 49, + 50, -1, -1, 53, -1, 55, -1, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, -1, -1, -1, -1, -1, -1, 77, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, -1, -1, -1, -1, 97, -1, -1, + -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, -1, -1, -1, -1, 136, -1, -1, -1, + 140, 141, 142, -1, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, -1, 159, + 160, 161, -1, 163, -1, -1, -1, 167, 168, -1, + 6, 7, -1, 9, 10, 11, -1, -1, -1, -1, + -1, -1, -1, 19, 20, -1, -1, -1, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + -1, -1, 38, 39, 40, 41, -1, -1, -1, -1, + 46, -1, -1, 49, 50, -1, -1, 53, -1, 55, + -1, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, -1, -1, -1, -1, -1, + -1, 77, -1, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, -1, -1, -1, + -1, 97, -1, -1, -1, -1, -1, 103, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, -1, -1, -1, -1, + 136, -1, -1, -1, 140, 141, 142, -1, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, -1, 159, 160, 161, -1, 163, -1, -1, + -1, 167, 168, -1, 6, 7, -1, 9, 10, 11, + -1, -1, -1, -1, -1, -1, -1, 19, 20, -1, + -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, -1, -1, 38, 39, 40, 41, + -1, -1, -1, -1, 46, -1, -1, 49, 50, -1, + -1, 53, -1, 55, -1, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, + -1, -1, -1, -1, -1, 77, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, -1, -1, -1, 97, -1, -1, -1, -1, + -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, -1, -1, -1, 136, -1, -1, -1, 140, 141, + 142, -1, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, -1, 159, 160, 161, + -1, 163, -1, -1, -1, 167, 168, -1, 6, 7, + -1, 9, 10, 11, -1, -1, -1, -1, -1, -1, + -1, 19, 20, -1, -1, -1, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, + 38, 39, 40, 41, -1, -1, -1, -1, 46, -1, + -1, 49, 50, -1, -1, 53, -1, 55, -1, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, -1, -1, -1, -1, -1, -1, 77, + -1, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, -1, -1, -1, -1, 97, + -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, + -1, -1, 110, -1, -1, -1, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, -1, -1, -1, -1, 136, -1, + -1, -1, 140, 141, 142, -1, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + -1, 159, 160, 161, -1, 163, -1, -1, -1, 167, + 168, -1, 6, 7, -1, 9, 10, 11, -1, -1, + -1, -1, -1, -1, -1, 19, 20, -1, -1, -1, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, -1, -1, 38, 39, 40, 41, -1, -1, + -1, -1, 46, -1, -1, 49, 50, -1, -1, 53, + -1, 55, -1, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, -1, -1, -1, + -1, -1, -1, 77, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, + -1, -1, -1, 97, -1, -1, -1, -1, -1, 103, + -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, -1, -1, + -1, -1, 136, -1, -1, -1, 140, 141, 142, -1, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, -1, 159, 160, 161, -1, 163, + -1, -1, -1, 167, 168, -1, 6, 7, -1, 9, + 10, 11, -1, -1, -1, -1, -1, -1, -1, 19, + 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, -1, -1, 38, 39, + 40, 41, -1, -1, -1, -1, 46, -1, -1, 49, + 50, -1, -1, 53, -1, 55, -1, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, -1, -1, -1, -1, -1, -1, 77, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, -1, -1, -1, -1, 97, -1, -1, + -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, + 110, -1, -1, -1, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, -1, -1, -1, -1, 136, -1, -1, -1, + 140, 141, 142, -1, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, -1, 159, + 160, 161, -1, 163, -1, -1, -1, 167, 168, -1, + 6, 7, -1, 9, 10, 11, -1, -1, -1, -1, + -1, -1, -1, 19, 20, -1, -1, -1, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + -1, -1, 38, 39, 40, 41, -1, -1, -1, -1, + 46, -1, -1, 49, 50, -1, -1, 53, -1, 55, + -1, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, -1, -1, -1, -1, -1, + -1, 77, -1, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, -1, -1, -1, + -1, 97, -1, -1, -1, -1, -1, 103, -1, -1, + -1, -1, -1, -1, 110, -1, -1, -1, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, -1, -1, -1, -1, + 136, -1, -1, -1, 140, 141, 142, -1, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, -1, 159, 160, 161, -1, 163, -1, -1, + -1, 167, 168, -1, 6, 7, -1, 9, 10, 11, + -1, -1, -1, -1, -1, -1, -1, 19, 20, -1, + -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, -1, -1, 38, 39, 40, 41, + -1, -1, -1, -1, 46, -1, -1, 49, 50, -1, + -1, 53, -1, 55, -1, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, + -1, -1, -1, -1, -1, 77, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, -1, -1, -1, 97, -1, -1, -1, -1, + -1, 103, -1, -1, -1, -1, -1, -1, 110, -1, + -1, -1, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + -1, -1, -1, -1, 136, -1, -1, -1, 140, 141, + 142, -1, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, -1, 159, 160, 161, + -1, 163, -1, -1, -1, 167, 168, -1, 5, -1, + 7, -1, 9, 10, 11, -1, -1, 14, -1, -1, + 17, -1, -1, -1, -1, -1, -1, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, + -1, 38, 39, 40, 41, -1, -1, -1, 45, 46, + -1, -1, 49, -1, -1, 52, -1, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, -1, -1, -1, -1, -1, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + -1, -1, -1, 100, 101, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, -1, -1, 134, -1, 136, + -1, -1, -1, -1, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, -1, -1, -1, + -1, -1, -1, 5, -1, 7, -1, 9, 10, 11, + -1, -1, 14, -1, -1, 17, -1, -1, -1, -1, + -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, -1, -1, 38, 39, 40, 41, + -1, -1, -1, 45, 46, -1, -1, 49, -1, -1, + 52, -1, -1, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + -1, -1, -1, -1, -1, -1, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, -1, -1, 96, -1, -1, -1, 100, 101, + -1, -1, -1, -1, -1, -1, -1, 109, -1, -1, + -1, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + -1, -1, 134, -1, 136, -1, -1, -1, -1, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + -1, 163, -1, -1, -1, -1, -1, -1, 5, -1, + 7, -1, 9, 10, 11, -1, -1, 14, -1, -1, + 17, -1, -1, -1, -1, -1, -1, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, + -1, 38, 39, 40, 41, -1, -1, -1, 45, 46, + -1, -1, 49, -1, -1, 52, -1, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, -1, -1, -1, -1, -1, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + -1, -1, -1, 100, 101, -1, -1, -1, -1, -1, + -1, -1, 109, -1, -1, -1, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, -1, -1, 134, -1, 136, + -1, -1, -1, -1, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, -1, -1, -1, + -1, -1, -1, 5, -1, 7, -1, 9, 10, 11, + -1, -1, 14, -1, -1, 17, -1, -1, -1, -1, + -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, -1, -1, 38, 39, 40, 41, + -1, -1, -1, 45, 46, -1, -1, 49, -1, -1, + 52, -1, -1, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + -1, -1, -1, -1, -1, -1, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, -1, -1, 96, -1, -1, -1, 100, 101, + -1, -1, -1, -1, -1, -1, -1, 109, -1, -1, + -1, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + -1, -1, 134, -1, 136, -1, -1, -1, -1, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + -1, 163, -1, -1, -1, -1, -1, -1, 5, -1, + 7, -1, 9, 10, 11, -1, -1, 14, -1, -1, + 17, -1, -1, -1, -1, -1, -1, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, + -1, 38, 39, 40, 41, -1, -1, -1, 45, 46, + -1, -1, 49, -1, -1, 52, -1, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, -1, -1, -1, -1, -1, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + -1, -1, -1, 100, 101, -1, -1, 104, -1, -1, + -1, -1, -1, -1, -1, -1, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, -1, 134, -1, 136, + -1, -1, -1, -1, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, -1, -1, -1, + -1, -1, -1, 0, -1, -1, -1, -1, 5, -1, + 7, -1, 9, 10, 11, -1, -1, 14, -1, -1, + 17, -1, -1, -1, -1, -1, -1, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, + -1, 38, 39, 40, 41, -1, -1, -1, 45, 46, + -1, -1, 49, -1, -1, 52, -1, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, -1, -1, -1, -1, -1, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + -1, -1, -1, 100, 101, -1, -1, 104, -1, -1, + -1, -1, -1, -1, -1, -1, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, -1, 134, -1, 136, + -1, -1, -1, -1, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, -1, -1, -1, + -1, -1, -1, 5, 6, 7, -1, 9, 10, 11, + -1, -1, 14, -1, -1, 17, -1, 19, 20, -1, + -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, -1, -1, 38, 39, 40, 41, + -1, -1, -1, 45, 46, -1, -1, 49, 50, -1, + 52, 53, -1, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + -1, -1, -1, -1, -1, 77, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, -1, -1, 96, 97, -1, -1, 100, 101, + -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + -1, -1, 134, -1, 136, -1, -1, -1, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + -1, 163, -1, -1, -1, 167, 168, -1, 5, 6, + 7, -1, 9, 10, 11, -1, -1, 14, -1, -1, + 17, -1, 19, 20, -1, -1, -1, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, + -1, 38, 39, 40, 41, -1, -1, -1, 45, 46, + -1, -1, 49, 50, -1, 52, 53, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, -1, -1, -1, -1, -1, + 77, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + 97, -1, -1, 100, 101, -1, 103, 104, -1, -1, + -1, -1, -1, -1, -1, -1, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, -1, 134, -1, 136, + -1, -1, -1, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, -1, -1, -1, + 167, 168, -1, 5, 6, 7, 8, 9, 10, 11, + -1, 13, 14, -1, -1, 17, 18, 19, 20, 21, + 22, -1, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, -1, 38, 39, 40, 41, + -1, -1, -1, 45, 46, 47, -1, 49, 50, 51, + 52, 53, -1, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + -1, -1, 74, -1, -1, 77, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, -1, -1, 96, 97, -1, -1, 100, 101, + -1, 103, 104, -1, 106, -1, -1, -1, -1, -1, + -1, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, -1, 134, -1, 136, -1, -1, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + -1, 163, 164, -1, -1, 167, 168, -1, 5, 6, + 7, 8, 9, 10, 11, -1, 13, 14, -1, -1, + 17, 18, 19, 20, 21, 22, -1, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + -1, 38, 39, 40, 41, -1, -1, -1, 45, 46, + 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, -1, -1, 74, -1, -1, + 77, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + 97, -1, -1, 100, 101, -1, 103, 104, -1, 106, + -1, -1, -1, -1, -1, -1, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, -1, 134, -1, 136, + -1, -1, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, 164, -1, -1, + 167, 168, -1, 5, 6, 7, 8, 9, 10, 11, + -1, 13, 14, -1, -1, 17, 18, 19, 20, 21, + 22, -1, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, -1, 38, 39, 40, 41, + -1, -1, -1, 45, 46, 47, -1, 49, 50, 51, + 52, 53, -1, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + -1, -1, 74, -1, -1, 77, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, -1, -1, 96, 97, -1, -1, 100, 101, + -1, 103, 104, -1, 106, -1, -1, 109, -1, -1, + -1, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, -1, 134, -1, 136, -1, -1, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + -1, 163, 164, -1, -1, 167, 168, -1, 5, 6, + 7, 8, 9, 10, 11, -1, 13, 14, -1, -1, + 17, 18, 19, 20, 21, 22, -1, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + -1, 38, 39, 40, 41, -1, -1, -1, 45, 46, + 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, -1, -1, 74, -1, -1, + 77, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + 97, -1, -1, 100, 101, -1, 103, 104, -1, 106, + -1, -1, 109, -1, -1, -1, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, -1, 134, -1, 136, + -1, -1, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, 164, -1, -1, + 167, 168, -1, 5, 6, 7, 8, 9, 10, 11, + -1, 13, 14, -1, -1, 17, 18, 19, 20, 21, + 22, -1, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, -1, 38, 39, 40, 41, + -1, -1, -1, 45, 46, 47, -1, 49, 50, 51, + 52, 53, -1, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + -1, -1, 74, -1, -1, 77, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, -1, -1, 96, 97, -1, -1, 100, 101, + -1, 103, 104, -1, 106, -1, -1, 109, -1, -1, + -1, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, -1, 134, -1, 136, -1, -1, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + -1, 163, 164, -1, -1, 167, 168, -1, 5, 6, + 7, 8, 9, 10, 11, -1, 13, 14, -1, -1, + 17, 18, 19, 20, 21, 22, -1, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + -1, 38, 39, 40, 41, -1, -1, -1, 45, 46, + 47, -1, 49, 50, 51, 52, 53, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, -1, -1, 74, -1, -1, + 77, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + 97, -1, -1, 100, 101, -1, 103, 104, -1, 106, + -1, -1, 109, -1, -1, -1, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, -1, 134, -1, 136, + -1, -1, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, -1, 163, 164, -1, -1, + 167, 168, -1, + + 3, 54, 14, 3, 15, 12, 3, 12, 35, 54, + 12, 15, 8, 54, 15, 14, 3, 12, 3, 12, + 12, 15, 59, 58, 14, 14, 3, 35, 53, 3, + 3, 45, 72, 15, 15, 14, 34, 12, -1, 15, + -1, 12, -1, 15, 20, 15, 15, 12, 20, 19, + 41, 15, 21, 17, 15, 15, 17, 15, 12, 15, + 18, 12, 14, 19, 14, 12, 15, -1, 28, 14, + 19, 14, 14, 48, 14, 14, 14, 48, 15, 3, + 15, 14, 50, 48, 19, 14, 54, 15, 25, 15, + 18, -1, 15, 15, 48, 15, 14, 48, 14, 22, + 26, 48, 24, 14, 14, 14, -1, 36, 28, 61, + 30, 61, -1, 14, -1, -1, 15, 14, 63, 61, + 36, 61, 61, 15, -1, -1, 36, 70, 61, 28, + 15, 30, 70, 14, 43, 36, 28, 46, 30, 36, + 37, 57, 60, 28, 15, 30, 64, 57, 14, -1, + 31, 32, 63, 3, -1, 14, 57, 28, 15, 30, + 71, -1, -1, -1, 14, -1, 23, -1, -1, -1, + 36, 37, 31, 32, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, + -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 79, -1, -1, -1, 74, 3, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 14, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, + -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1}; + diff --git a/src/libs/glsl/glslparsertable_p.h b/src/libs/glsl/glslparsertable_p.h new file mode 100644 index 00000000000..cab2f07abe8 --- /dev/null +++ b/src/libs/glsl/glslparsertable_p.h @@ -0,0 +1,222 @@ +// This file was generated by qlalr - DO NOT EDIT! +#ifndef GLSLPARSERTABLE_P_H +#define GLSLPARSERTABLE_P_H + +class GLSLParserTable +{ +public: + enum VariousConstants { + EOF_SYMBOL = 0, + T_ADD_ASSIGN = 1, + T_AMPERSAND = 2, + T_AND_ASSIGN = 3, + T_AND_OP = 4, + T_ATTRIBUTE = 5, + T_BANG = 6, + T_BOOL = 7, + T_BREAK = 8, + T_BVEC2 = 9, + T_BVEC3 = 10, + T_BVEC4 = 11, + T_CARET = 12, + T_CASE = 13, + T_CENTROID = 14, + T_COLON = 15, + T_COMMA = 16, + T_CONST = 17, + T_CONTINUE = 18, + T_DASH = 19, + T_DEC_OP = 20, + T_DEFAULT = 21, + T_DISCARD = 22, + T_DIV_ASSIGN = 23, + T_DMAT2 = 24, + T_DMAT2X2 = 25, + T_DMAT2X3 = 26, + T_DMAT2X4 = 27, + T_DMAT3 = 28, + T_DMAT3X2 = 29, + T_DMAT3X3 = 30, + T_DMAT3X4 = 31, + T_DMAT4 = 32, + T_DMAT4X2 = 33, + T_DMAT4X3 = 34, + T_DMAT4X4 = 35, + T_DO = 36, + T_DOT = 37, + T_DOUBLE = 38, + T_DVEC2 = 39, + T_DVEC3 = 40, + T_DVEC4 = 41, + T_ELSE = 42, + T_EQUAL = 43, + T_EQ_OP = 44, + T_ERROR = 169, + T_FALSE = 168, + T_FLAT = 45, + T_FLOAT = 46, + T_FOR = 47, + T_GE_OP = 48, + T_HIGHP = 49, + T_IDENTIFIER = 50, + T_IF = 51, + T_IN = 52, + T_INC_OP = 53, + T_INOUT = 54, + T_INT = 55, + T_INVARIANT = 56, + T_ISAMPLER1D = 57, + T_ISAMPLER1DARRAY = 58, + T_ISAMPLER2D = 59, + T_ISAMPLER2DARRAY = 60, + T_ISAMPLER2DMS = 61, + T_ISAMPLER2DMSARRAY = 62, + T_ISAMPLER2DRECT = 63, + T_ISAMPLER3D = 64, + T_ISAMPLERBUFFER = 65, + T_ISAMPLERCUBE = 66, + T_ISAMPLERCUBEARRAY = 67, + T_IVEC2 = 68, + T_IVEC3 = 69, + T_IVEC4 = 70, + T_LAYOUT = 71, + T_LEFT_ANGLE = 72, + T_LEFT_ASSIGN = 73, + T_LEFT_BRACE = 74, + T_LEFT_BRACKET = 75, + T_LEFT_OP = 76, + T_LEFT_PAREN = 77, + T_LE_OP = 78, + T_LOWP = 79, + T_MAT2 = 80, + T_MAT2X2 = 81, + T_MAT2X3 = 82, + T_MAT2X4 = 83, + T_MAT3 = 84, + T_MAT3X2 = 85, + T_MAT3X3 = 86, + T_MAT3X4 = 87, + T_MAT4 = 88, + T_MAT4X2 = 89, + T_MAT4X3 = 90, + T_MAT4X4 = 91, + T_MEDIUMP = 92, + T_MOD_ASSIGN = 93, + T_MUL_ASSIGN = 94, + T_NE_OP = 95, + T_NOPERSPECTIVE = 96, + T_NUMBER = 97, + T_OR_ASSIGN = 98, + T_OR_OP = 99, + T_OUT = 100, + T_PATCH = 101, + T_PERCENT = 102, + T_PLUS = 103, + T_PRECISION = 104, + T_QUESTION = 105, + T_RETURN = 106, + T_RIGHT_ANGLE = 107, + T_RIGHT_ASSIGN = 108, + T_RIGHT_BRACE = 109, + T_RIGHT_BRACKET = 110, + T_RIGHT_OP = 111, + T_RIGHT_PAREN = 112, + T_SAMPLE = 113, + T_SAMPLER1D = 114, + T_SAMPLER1DARRAY = 115, + T_SAMPLER1DARRAYSHADOW = 116, + T_SAMPLER1DSHADOW = 117, + T_SAMPLER2D = 118, + T_SAMPLER2DARRAY = 119, + T_SAMPLER2DARRAYSHADOW = 120, + T_SAMPLER2DMS = 121, + T_SAMPLER2DMSARRAY = 122, + T_SAMPLER2DRECT = 123, + T_SAMPLER2DRECTSHADOW = 124, + T_SAMPLER2DSHADOW = 125, + T_SAMPLER3D = 126, + T_SAMPLERBUFFER = 127, + T_SAMPLERCUBE = 128, + T_SAMPLERCUBEARRAY = 129, + T_SAMPLERCUBEARRAYSHADOW = 130, + T_SAMPLERCUBESHADOW = 131, + T_SEMICOLON = 132, + T_SLASH = 133, + T_SMOOTH = 134, + T_STAR = 135, + T_STRUCT = 136, + T_SUBROUTINE = 137, + T_SUB_ASSIGN = 138, + T_SWITCH = 139, + T_TILDE = 140, + T_TRUE = 167, + T_TYPE_NAME = 141, + T_UINT = 142, + T_UNIFORM = 143, + T_USAMPLER1D = 144, + T_USAMPLER1DARRAY = 145, + T_USAMPLER2D = 146, + T_USAMPLER2DARRAY = 147, + T_USAMPLER2DMS = 148, + T_USAMPLER2DMSARRAY = 149, + T_USAMPLER2DRECT = 150, + T_USAMPLER3D = 151, + T_USAMPLERBUFFER = 152, + T_USAMPLERCUBE = 153, + T_USAMPLERCUBEARRAY = 154, + T_UVEC2 = 155, + T_UVEC3 = 156, + T_UVEC4 = 157, + T_VARYING = 158, + T_VEC2 = 159, + T_VEC3 = 160, + T_VEC4 = 161, + T_VERTICAL_BAR = 162, + T_VOID = 163, + T_WHILE = 164, + T_XOR_ASSIGN = 165, + T_XOR_OP = 166, + + ACCEPT_STATE = 435, + RULE_COUNT = 312, + STATE_COUNT = 455, + TERMINAL_COUNT = 170, + NON_TERMINAL_COUNT = 82, + + GOTO_INDEX_OFFSET = 455, + GOTO_INFO_OFFSET = 4753, + GOTO_CHECK_OFFSET = 4753 + }; + + static const char *const spell []; + static const short lhs []; + static const short rhs []; + static const short goto_default []; + static const short action_default []; + static const short action_index []; + static const short action_info []; + static const short action_check []; + + static inline int nt_action (int state, int nt) + { + const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt; + if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt) + return goto_default [nt]; + + return action_info [GOTO_INFO_OFFSET + yyn]; + } + + static inline int t_action (int state, int token) + { + const int yyn = action_index [state] + token; + + if (yyn < 0 || action_check [yyn] != token) + return - action_default [state]; + + return action_info [yyn]; + } +}; + + +#endif // GLSLPARSERTABLE_P_H + diff --git a/src/libs/glsl/make-parser.sh b/src/libs/glsl/make-parser.sh new file mode 100755 index 00000000000..9fc769e6aef --- /dev/null +++ b/src/libs/glsl/make-parser.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +me=$(dirname $0) +cat $me/specs/glsl.g.in $me/specs/grammar.txt > $me/glsl.g +qlalr --no-lines --no-debug $me/glsl.g + diff --git a/src/libs/glsl/specs/glsl.g.in b/src/libs/glsl/specs/glsl.g.in new file mode 100644 index 00000000000..44c753be9ff --- /dev/null +++ b/src/libs/glsl/specs/glsl.g.in @@ -0,0 +1,357 @@ +-- todo: +-- spelling of XOR_OP and CARET + +%decl glslparser.h +%impl glslparser.cpp +%parser GLSLParserTable +%token_prefix T_ + +%token ADD_ASSIGN "+=" +%token AMPERSAND "&" +%token AND_ASSIGN "&=" +%token AND_OP "&&" +%token ATTRIBUTE "attribute" +%token BANG "!" +%token BOOL "bool" +%token BREAK "break" +%token BVEC2 "bvec2" +%token BVEC3 "bvec3" +%token BVEC4 "bvec4" +%token CARET "^" +%token CASE "case" +%token CENTROID "centroid" +%token COLON ":" +%token COMMA "," +%token CONST "const" +%token CONTINUE "continue" +%token DASH "-" +%token DEC_OP "--" +%token DEFAULT "default" +%token DISCARD "discard" +%token DIV_ASSIGN "/=" +%token DMAT2 "dmat2" +%token DMAT2X2 "dmat2x2" +%token DMAT2X3 "dmat2x3" +%token DMAT2X4 "dmat2x4" +%token DMAT3 "dmat3" +%token DMAT3X2 "dmat3x2" +%token DMAT3X3 "dmat3x3" +%token DMAT3X4 "dmat3x4" +%token DMAT4 "dmat4" +%token DMAT4X2 "dmat4x2" +%token DMAT4X3 "dmat4x3" +%token DMAT4X4 "dmat4x4" +%token DO "do" +%token DOT "." +%token DOUBLE "double" +%token DVEC2 "dvec2" +%token DVEC3 "dvec3" +%token DVEC4 "dvec4" +%token ELSE "else" +%token EQUAL "=" +%token EQ_OP "==" +%token FLAT "flat" +%token FLOAT "float" +%token FOR "for" +%token GE_OP ">=" +%token HIGHP "highp" +%token IDENTIFIER "identifier" +%token IF "if" +%token IN "in" +%token INC_OP "++" +%token INOUT "inout" +%token INT "int" +%token INVARIANT "invariant" +%token ISAMPLER1D "isampler1D" +%token ISAMPLER1DARRAY "isampler1DArray" +%token ISAMPLER2D "isampler2D" +%token ISAMPLER2DARRAY "isampler2DArray" +%token ISAMPLER2DMS "isampler2DMS" +%token ISAMPLER2DMSARRAY "isampler2DMSArray" +%token ISAMPLER2DRECT "isampler2DRect" +%token ISAMPLER3D "isampler3D" +%token ISAMPLERBUFFER "isamplerBuffer" +%token ISAMPLERCUBE "isamplerCube" +%token ISAMPLERCUBEARRAY "isamplerCubeArray" +%token IVEC2 "ivec2" +%token IVEC3 "ivec3" +%token IVEC4 "ivec4" +%token LAYOUT "layout" +%token LEFT_ANGLE "<" +%token LEFT_ASSIGN "<<=" +%token LEFT_BRACE "{" +%token LEFT_BRACKET "[" +%token LEFT_OP "<<" +%token LEFT_PAREN "(" +%token LE_OP "<=" +%token LOWP "lowp" +%token MAT2 "mat2" +%token MAT2X2 "mat2x2" +%token MAT2X3 "mat2x3" +%token MAT2X4 "mat2x4" +%token MAT3 "mat3" +%token MAT3X2 "mat3x2" +%token MAT3X3 "mat3x3" +%token MAT3X4 "mat3x4" +%token MAT4 "mat4" +%token MAT4X2 "mat4x2" +%token MAT4X3 "mat4x3" +%token MAT4X4 "mat4x4" +%token MEDIUMP "mediump" +%token MOD_ASSIGN "%=" +%token MUL_ASSIGN "*=" +%token NE_OP "!=" +%token NOPERSPECTIVE "noperspective" +%token NUMBER "number constant" +%token OR_ASSIGN "|=" +%token OR_OP "||" +%token OUT "out" +%token PATCH "patch" +%token PERCENT "%" +%token PLUS "plus" +%token PRECISION "precision" +%token QUESTION "?" +%token RETURN "return" +%token RIGHT_ANGLE ">" +%token RIGHT_ASSIGN ">>=" +%token RIGHT_BRACE "}" +%token RIGHT_BRACKET "]" +%token RIGHT_OP ">>" +%token RIGHT_PAREN ")" +%token SAMPLE "sample" +%token SAMPLER1D "sampler1D" +%token SAMPLER1DARRAY "sampler1DArray" +%token SAMPLER1DARRAYSHADOW "sampler1DArrayShadow" +%token SAMPLER1DSHADOW "sampler1DShadow" +%token SAMPLER2D "sampler2D" +%token SAMPLER2DARRAY "sampler2DArray" +%token SAMPLER2DARRAYSHADOW "sampler2DArrayShadow" +%token SAMPLER2DMS "sampler2DMS" +%token SAMPLER2DMSARRAY "sampler2DMSArray" +%token SAMPLER2DRECT "sampler2DRect" +%token SAMPLER2DRECTSHADOW "sampler2DRectShadow" +%token SAMPLER2DSHADOW "sampler2DShadow" +%token SAMPLER3D "sampler3D" +%token SAMPLERBUFFER "samplerBuffer" +%token SAMPLERCUBE "samplerCube" +%token SAMPLERCUBEARRAY "samplerCubeArray" +%token SAMPLERCUBEARRAYSHADOW "samplerCubeArrayShadow" +%token SAMPLERCUBESHADOW "samplerCubeShadow" +%token SEMICOLON ";" +%token SLASH "/" +%token SMOOTH "smooth" +%token STAR "*" +%token STRUCT "struct" +%token SUBROUTINE "subroutine" +%token SUB_ASSIGN "-=" +%token SWITCH "switch" +%token TILDE "~" +%token TYPE_NAME "type_name" +%token UINT "uint" +%token UNIFORM "uniform" +%token USAMPLER1D "usampler1D" +%token USAMPLER1DARRAY "usampler1DArray" +%token USAMPLER2D "usampler2D" +%token USAMPLER2DARRAY "usampler2DArray" +%token USAMPLER2DMS "usampler2DMS" +%token USAMPLER2DMSARRAY "usampler2DMSarray" +%token USAMPLER2DRECT "usampler2DRect" +%token USAMPLER3D "usampler3D" +%token USAMPLERBUFFER "usamplerBuffer" +%token USAMPLERCUBE "usamplerCube" +%token USAMPLERCUBEARRAY "usamplerCubeArray" +%token UVEC2 "uvec2" +%token UVEC3 "uvec3" +%token UVEC4 "uvec4" +%token VARYING "varying" +%token VEC2 "vec2" +%token VEC3 "vec3" +%token VEC4 "vec4" +%token VERTICAL_BAR "|" +%token VOID "void" +%token WHILE "while" +%token XOR_ASSIGN "^=" +%token XOR_OP "^" +%token TRUE "true" +%token FALSE "false" +%token ERROR "error" + +%start translation_unit + +/: +#include "$header" +#include "glsllexer.h" +#include "glslast.h" +#include +#include + +namespace GLSL { + +class Parser: public $table +{ +public: + Parser(const char *source, unsigned size, int variant); + ~Parser(); + + bool parse(); + +private: + inline int consumeToken() { return _index++; } + inline const Token &tokenAt(int index) const { return _tokens.at(index); } + inline int tokenKind(int index) const { return _tokens.at(index).kind; } + void dump(AST *ast); + +private: + int _tos; + int _index; + std::vector _stateStack; + std::vector _locationStack; + std::vector _astStack; + std::vector _tokens; +}; + +} // end of namespace GLSL +:/ + +/. +#include "glslparser.h" +#include + +using namespace GLSL; + +namespace GLSL { +void dumpAST(AST *); +void deleteAST(AST *ast); +} + +Parser::Parser(const char *source, unsigned size, int variant) + : _tos(-1), _index(0) +{ + _tokens.reserve(1024); + + _stateStack.resize(128); + _locationStack.resize(128); + _astStack.resize(128); + + _tokens.push_back(Token()); // invalid token + + std::stack parenStack; + std::stack bracketStack; + std::stack braceStack; + + Lexer lexer(source, size); + lexer.setVariant(variant); + Token tk; + do { + lexer.yylex(&tk); + + switch (tk.kind) { + case T_LEFT_PAREN: + parenStack.push(_tokens.size()); + break; + case T_LEFT_BRACKET: + bracketStack.push(_tokens.size()); + break; + case T_LEFT_BRACE: + braceStack.push(_tokens.size()); + break; + + case T_RIGHT_PAREN: + if (! parenStack.empty()) { + _tokens[parenStack.top()].matchingBrace = _tokens.size(); + parenStack.pop(); + } + break; + case T_RIGHT_BRACKET: + if (! bracketStack.empty()) { + _tokens[bracketStack.top()].matchingBrace = _tokens.size(); + bracketStack.pop(); + } + break; + case T_RIGHT_BRACE: + if (! braceStack.empty()) { + _tokens[braceStack.top()].matchingBrace = _tokens.size(); + braceStack.pop(); + } + break; + default: + break; + } + + _tokens.push_back(tk); + } while (tk.isNot(EOF_SYMBOL)); + + _index = 1; +} + +Parser::~Parser() +{ +} + +void Parser::dump(AST *ast) +{ + dumpAST(ast); +} + +bool Parser::parse() +{ + int action = 0; + int yytoken = -1; + int yyloc = -1; + Operand *opd = 0; + + _tos = -1; + + do { + if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) { + yyloc = consumeToken(); + yytoken = tokenKind(yyloc); + if (yytoken == T_IDENTIFIER && t_action(action, T_TYPE_NAME) != 0) { + const Token &la = tokenAt(_index); + + if (la.is(T_IDENTIFIER)) { + yytoken = T_TYPE_NAME; + } else if (la.is(T_LEFT_BRACKET) && la.matchingBrace != 0 && + tokenAt(la.matchingBrace + 1).is(T_IDENTIFIER)) { + yytoken = T_TYPE_NAME; + } + } + opd = new Operand(yyloc); + } + + if (unsigned(++_tos) == _stateStack.size()) { + _stateStack.resize(_tos * 2); + _locationStack.resize(_tos * 2); + _astStack.resize(_tos * 2); + } + + _stateStack[_tos] = action; + action = t_action(action, yytoken); + if (action > 0) { + if (action == ACCEPT_STATE) { + --_tos; + dump(_astStack[0]); + deleteAST(_astStack[0]); + return true; + } + _astStack[_tos] = opd; + _locationStack[_tos] = yyloc; + yytoken = -1; + } else if (action < 0) { + const int ruleno = -action - 1; + const int N = rhs[ruleno]; + _tos -= N; + if (N == 0) + _astStack[_tos] = 0; + else + _astStack[_tos] = new Operator(ruleno, &_astStack[_tos], &_astStack[_tos + N]); + action = nt_action(_stateStack[_tos], lhs[ruleno] - TERMINAL_COUNT); + } + } while (action); + + fprintf(stderr, "unexpected token `%s' at line %d\n", yytoken != -1 ? spell[yytoken] : "", + _tokens[yyloc].line + 1); + + return false; +} +./ diff --git a/src/libs/glsl/specs/glsl.keywords b/src/libs/glsl/specs/glsl.keywords new file mode 100644 index 00000000000..b964fae7cfa --- /dev/null +++ b/src/libs/glsl/specs/glsl.keywords @@ -0,0 +1,134 @@ +#include "glsllexer.h" +#include "glslparser.h" + +%no-enums +%token-prefix=T_ +%toupper +%namespace=Parser +%lexer-class=Lexer +%variant-prefix=Lexer::Variant_ + +using namespace GLSL; + +%% + +attribute %variant VertexShader +bool +break +bvec2 +bvec3 +bvec4 +case %variant GLSL_150 +centroid %variant GLSL_120 +const +continue +default %variant GLSL_150 +discard %variant FragmentShader +dmat2 %variant GLSL_400 +dmat2x2 %variant GLSL_400 +dmat2x3 %variant GLSL_400 +dmat2x4 %variant GLSL_400 +dmat3 %variant GLSL_400 +dmat3x2 %variant GLSL_400 +dmat3x3 %variant GLSL_400 +dmat3x4 %variant GLSL_400 +dmat4 %variant GLSL_400 +dmat4x2 %variant GLSL_400 +dmat4x3 %variant GLSL_400 +dmat4x4 %variant GLSL_400 +do +double %variant GLSL_400 +dvec2 %variant GLSL_400 +dvec3 %variant GLSL_400 +dvec4 %variant GLSL_400 +else +flat %variant GLSL_150 +float +for +highp %variant GLSL_Qt | GLSL_ES_100 | GLSL_400 +if +in +inout +int +invariant +isampler1D %variant GLSL_150 +isampler1DArray %variant GLSL_150 +isampler2D %variant GLSL_150 +isampler2DArray %variant GLSL_150 +isampler2DMS %variant GLSL_150 +isampler2DMSArray %variant GLSL_150 +isampler2DRect %variant GLSL_150 +isampler3D %variant GLSL_150 +isamplerBuffer %variant GLSL_150 +isamplerCube %variant GLSL_150 +isamplerCubeArray %variant GLSL_400 +ivec2 +ivec3 +ivec4 +layout %variant GLSL_150 +lowp %variant GLSL_Qt | GLSL_ES_100 | GLSL_400 +mat2 +mat2x2 %variant GLSL_120 +mat2x3 %variant GLSL_120 +mat2x4 %variant GLSL_120 +mat3 +mat3x2 %variant GLSL_120 +mat3x3 %variant GLSL_120 +mat3x4 %variant GLSL_120 +mat4 +mat4x2 %variant GLSL_120 +mat4x3 %variant GLSL_120 +mat4x4 %variant GLSL_120 +mediump %variant GLSL_Qt | GLSL_ES_100 | GLSL_400 +noperspective %variant GLSL_150 +out +patch %variant GLSL_400 +precision %variant GLSL_ES_100 +return +sample %variant Reserved +sampler1D %variant GLSL_120 +sampler1DArray %variant GLSL_150 +sampler1DArrayShadow %variant GLSL_150 +sampler1DShadow %variant GLSL_120 +sampler2D +sampler2DArray %variant GLSL_150 +sampler2DArrayShadow %variant GLSL_150 +sampler2DMS %variant GLSL_150 +sampler2DMSArray %variant GLSL_150 +sampler2DRect %variang GLSL_150 +sampler2DRectShadow %variang GLSL_150 +sampler2DShadow %variant GLSL_120 +sampler3D %variant GLSL_120 +samplerBuffer %variant GLSL_150 +samplerCube +samplerCubeArray %variant GLSL_400 +samplerCubeArrayShadow %variant GLSL_400 +samplerCubeShadow %variant GLSL_400 +smooth %variant GLSL_150 +struct +subroutine %variant GLSL_400 +switch %variant GLSL_150 +uint %variant GLSL_150 +uniform +usampler1D %variant GLSL_150 +usampler1DArray %variant GLSL_150 +usampler2D %variant GLSL_150 +usampler2DArray %variant GLSL_150 +usampler2DMS %variant GLSL_150 +usampler2DMSarray %variant GLSL_150 +usampler2DRect %variant GLSL_150 +usampler3D %variant GLSL_150 +usamplerBuffer %variant GLSL_150 +usamplerCube %variant GLSL_150 +usamplerCubeArray %variant GLSL_400 +uvec2 %variant GLSL_150 +uvec3 %variant GLSL_150 +uvec4 %variant GLSL_150 +varying +vec2 +vec3 +vec4 +void +while +true +false diff --git a/src/libs/glsl/specs/grammar.txt b/src/libs/glsl/specs/grammar.txt new file mode 100644 index 00000000000..3620800ea08 --- /dev/null +++ b/src/libs/glsl/specs/grammar.txt @@ -0,0 +1,311 @@ +variable_identifier ::= IDENTIFIER ; +primary_expression ::= NUMBER ; +primary_expression ::= TRUE ; +primary_expression ::= FALSE ; +primary_expression ::= variable_identifier ; +primary_expression ::= LEFT_PAREN expression RIGHT_PAREN ; +postfix_expression ::= primary_expression ; +postfix_expression ::= postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET ; +postfix_expression ::= function_call ; +postfix_expression ::= postfix_expression DOT IDENTIFIER ; +postfix_expression ::= postfix_expression INC_OP ; +postfix_expression ::= postfix_expression DEC_OP ; +integer_expression ::= expression ; +function_call ::= function_call_or_method ; +function_call_or_method ::= function_call_generic ; +function_call_or_method ::= postfix_expression DOT function_call_generic ; +function_call_generic ::= function_call_header_with_parameters RIGHT_PAREN ; +function_call_generic ::= function_call_header_no_parameters RIGHT_PAREN ; +function_call_header_no_parameters ::= function_call_header VOID ; +function_call_header_no_parameters ::= function_call_header ; +function_call_header_with_parameters ::= function_call_header assignment_expression ; +function_call_header_with_parameters ::= function_call_header_with_parameters COMMA assignment_expression ; +function_call_header ::= function_identifier LEFT_PAREN ; +function_identifier ::= type_specifier ; +function_identifier ::= IDENTIFIER ; +unary_expression ::= postfix_expression ; +unary_expression ::= INC_OP unary_expression ; +unary_expression ::= DEC_OP unary_expression ; +unary_expression ::= unary_operator unary_expression ; +unary_operator ::= PLUS ; +unary_operator ::= DASH ; +unary_operator ::= BANG ; +unary_operator ::= TILDE ; +multiplicative_expression ::= unary_expression ; +multiplicative_expression ::= multiplicative_expression STAR unary_expression ; +multiplicative_expression ::= multiplicative_expression SLASH unary_expression ; +multiplicative_expression ::= multiplicative_expression PERCENT unary_expression ; +additive_expression ::= multiplicative_expression ; +additive_expression ::= additive_expression PLUS multiplicative_expression ; +additive_expression ::= additive_expression DASH multiplicative_expression ; +shift_expression ::= additive_expression ; +shift_expression ::= shift_expression LEFT_OP additive_expression ; +shift_expression ::= shift_expression RIGHT_OP additive_expression ; +relational_expression ::= shift_expression ; +relational_expression ::= relational_expression LEFT_ANGLE shift_expression ; +relational_expression ::= relational_expression RIGHT_ANGLE shift_expression ; +relational_expression ::= relational_expression LE_OP shift_expression ; +relational_expression ::= relational_expression GE_OP shift_expression ; +equality_expression ::= relational_expression ; +equality_expression ::= equality_expression EQ_OP relational_expression ; +equality_expression ::= equality_expression NE_OP relational_expression ; +and_expression ::= equality_expression ; +and_expression ::= and_expression AMPERSAND equality_expression ; +exclusive_or_expression ::= and_expression ; +exclusive_or_expression ::= exclusive_or_expression CARET and_expression ; +inclusive_or_expression ::= exclusive_or_expression ; +inclusive_or_expression ::= inclusive_or_expression VERTICAL_BAR exclusive_or_expression ; +logical_and_expression ::= inclusive_or_expression ; +logical_and_expression ::= logical_and_expression AND_OP inclusive_or_expression ; +logical_xor_expression ::= logical_and_expression ; +logical_xor_expression ::= logical_xor_expression XOR_OP logical_and_expression ; +logical_or_expression ::= logical_xor_expression ; +logical_or_expression ::= logical_or_expression OR_OP logical_xor_expression ; +conditional_expression ::= logical_or_expression ; +conditional_expression ::= logical_or_expression QUESTION expression COLON assignment_expression ; +assignment_expression ::= conditional_expression ; +assignment_expression ::= unary_expression assignment_operator assignment_expression ; +assignment_operator ::= EQUAL ; +assignment_operator ::= MUL_ASSIGN ; +assignment_operator ::= DIV_ASSIGN ; +assignment_operator ::= MOD_ASSIGN ; +assignment_operator ::= ADD_ASSIGN ; +assignment_operator ::= SUB_ASSIGN ; +assignment_operator ::= LEFT_ASSIGN ; +assignment_operator ::= RIGHT_ASSIGN ; +assignment_operator ::= AND_ASSIGN ; +assignment_operator ::= XOR_ASSIGN ; +assignment_operator ::= OR_ASSIGN ; +expression ::= assignment_expression ; +expression ::= expression COMMA assignment_expression ; +constant_expression ::= conditional_expression ; +declaration ::= function_prototype SEMICOLON ; +declaration ::= init_declarator_list SEMICOLON ; +declaration ::= PRECISION precision_qualifier type_specifier_no_prec SEMICOLON ; +declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE SEMICOLON ; +declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER SEMICOLON ; +declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET RIGHT_BRACKET SEMICOLON ; +declaration ::= type_qualifier IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET SEMICOLON ; +declaration ::= type_qualifier SEMICOLON ; +function_prototype ::= function_declarator RIGHT_PAREN ; +function_declarator ::= function_header ; +function_declarator ::= function_header_with_parameters ; +function_header_with_parameters ::= function_header parameter_declaration ; +function_header_with_parameters ::= function_header_with_parameters COMMA parameter_declaration ; +function_header ::= fully_specified_type IDENTIFIER LEFT_PAREN ; +parameter_declarator ::= type_specifier IDENTIFIER ; +parameter_declarator ::= type_specifier IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_declarator ; +parameter_declaration ::= parameter_qualifier parameter_declarator ; +parameter_declaration ::= parameter_type_qualifier parameter_qualifier parameter_type_specifier ; +parameter_declaration ::= parameter_qualifier parameter_type_specifier ; +parameter_qualifier ::= ; +parameter_qualifier ::= IN ; +parameter_qualifier ::= OUT ; +parameter_qualifier ::= INOUT ; +parameter_type_specifier ::= type_specifier ; +init_declarator_list ::= single_declaration ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer ; +init_declarator_list ::= init_declarator_list COMMA IDENTIFIER EQUAL initializer ; +single_declaration ::= fully_specified_type ; +single_declaration ::= fully_specified_type IDENTIFIER ; +single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer ; +single_declaration ::= fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer ; +single_declaration ::= fully_specified_type IDENTIFIER EQUAL initializer ; +single_declaration ::= INVARIANT IDENTIFIER ; +fully_specified_type ::= type_specifier ; +fully_specified_type ::= type_qualifier type_specifier ; +invariant_qualifier ::= INVARIANT ; +interpolation_qualifier ::= SMOOTH ; +interpolation_qualifier ::= FLAT ; +interpolation_qualifier ::= NOPERSPECTIVE ; +layout_qualifier ::= LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN ; +layout_qualifier_id_list ::= layout_qualifier_id ; +layout_qualifier_id_list ::= layout_qualifier_id_list COMMA layout_qualifier_id ; +layout_qualifier_id ::= IDENTIFIER ; +layout_qualifier_id ::= IDENTIFIER EQUAL NUMBER ; +parameter_type_qualifier ::= CONST ; +type_qualifier ::= storage_qualifier ; +type_qualifier ::= layout_qualifier ; +type_qualifier ::= layout_qualifier storage_qualifier ; +type_qualifier ::= interpolation_qualifier storage_qualifier ; +type_qualifier ::= interpolation_qualifier ; +type_qualifier ::= invariant_qualifier storage_qualifier ; +type_qualifier ::= invariant_qualifier interpolation_qualifier storage_qualifier ; +type_qualifier ::= INVARIANT ; +storage_qualifier ::= CONST ; +storage_qualifier ::= ATTRIBUTE ; +storage_qualifier ::= VARYING ; +storage_qualifier ::= CENTROID VARYING ; +storage_qualifier ::= IN ; +storage_qualifier ::= OUT ; +storage_qualifier ::= CENTROID IN ; +storage_qualifier ::= CENTROID OUT ; +storage_qualifier ::= PATCH IN ; +storage_qualifier ::= PATCH OUT ; +storage_qualifier ::= SAMPLE IN ; +storage_qualifier ::= SAMPLE OUT ; +storage_qualifier ::= UNIFORM ; +type_specifier ::= type_specifier_no_prec ; +type_specifier ::= precision_qualifier type_specifier_no_prec ; +type_specifier_no_prec ::= type_specifier_nonarray ; +type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET RIGHT_BRACKET ; +type_specifier_no_prec ::= type_specifier_nonarray LEFT_BRACKET constant_expression RIGHT_BRACKET ; +type_specifier_nonarray ::= VOID ; +type_specifier_nonarray ::= FLOAT ; +type_specifier_nonarray ::= DOUBLE ; +type_specifier_nonarray ::= INT ; +type_specifier_nonarray ::= UINT ; +type_specifier_nonarray ::= BOOL ; +type_specifier_nonarray ::= VEC2 ; +type_specifier_nonarray ::= VEC3 ; +type_specifier_nonarray ::= VEC4 ; +type_specifier_nonarray ::= DVEC2 ; +type_specifier_nonarray ::= DVEC3 ; +type_specifier_nonarray ::= DVEC4 ; +type_specifier_nonarray ::= BVEC2 ; +type_specifier_nonarray ::= BVEC3 ; +type_specifier_nonarray ::= BVEC4 ; +type_specifier_nonarray ::= IVEC2 ; +type_specifier_nonarray ::= IVEC3 ; +type_specifier_nonarray ::= IVEC4 ; +type_specifier_nonarray ::= UVEC2 ; +type_specifier_nonarray ::= UVEC3 ; +type_specifier_nonarray ::= UVEC4 ; +type_specifier_nonarray ::= MAT2 ; +type_specifier_nonarray ::= MAT3 ; +type_specifier_nonarray ::= MAT4 ; +type_specifier_nonarray ::= MAT2X2 ; +type_specifier_nonarray ::= MAT2X3 ; +type_specifier_nonarray ::= MAT2X4 ; +type_specifier_nonarray ::= MAT3X2 ; +type_specifier_nonarray ::= MAT3X3 ; +type_specifier_nonarray ::= MAT3X4 ; +type_specifier_nonarray ::= MAT4X2 ; +type_specifier_nonarray ::= MAT4X3 ; +type_specifier_nonarray ::= MAT4X4 ; +type_specifier_nonarray ::= DMAT2 ; +type_specifier_nonarray ::= DMAT3 ; +type_specifier_nonarray ::= DMAT4 ; +type_specifier_nonarray ::= DMAT2X2 ; +type_specifier_nonarray ::= DMAT2X3 ; +type_specifier_nonarray ::= DMAT2X4 ; +type_specifier_nonarray ::= DMAT3X2 ; +type_specifier_nonarray ::= DMAT3X3 ; +type_specifier_nonarray ::= DMAT3X4 ; +type_specifier_nonarray ::= DMAT4X2 ; +type_specifier_nonarray ::= DMAT4X3 ; +type_specifier_nonarray ::= DMAT4X4 ; +type_specifier_nonarray ::= SAMPLER1D ; +type_specifier_nonarray ::= SAMPLER2D ; +type_specifier_nonarray ::= SAMPLER3D ; +type_specifier_nonarray ::= SAMPLERCUBE ; +type_specifier_nonarray ::= SAMPLER1DSHADOW ; +type_specifier_nonarray ::= SAMPLER2DSHADOW ; +type_specifier_nonarray ::= SAMPLERCUBESHADOW ; +type_specifier_nonarray ::= SAMPLER1DARRAY ; +type_specifier_nonarray ::= SAMPLER2DARRAY ; +type_specifier_nonarray ::= SAMPLER1DARRAYSHADOW ; +type_specifier_nonarray ::= SAMPLER2DARRAYSHADOW ; +type_specifier_nonarray ::= SAMPLERCUBEARRAY ; +type_specifier_nonarray ::= SAMPLERCUBEARRAYSHADOW ; +type_specifier_nonarray ::= ISAMPLER1D ; +type_specifier_nonarray ::= ISAMPLER2D ; +type_specifier_nonarray ::= ISAMPLER3D ; +type_specifier_nonarray ::= ISAMPLERCUBE ; +type_specifier_nonarray ::= ISAMPLER1DARRAY ; +type_specifier_nonarray ::= ISAMPLER2DARRAY ; +type_specifier_nonarray ::= ISAMPLERCUBEARRAY ; +type_specifier_nonarray ::= USAMPLER1D ; +type_specifier_nonarray ::= USAMPLER2D ; +type_specifier_nonarray ::= USAMPLER3D ; +type_specifier_nonarray ::= USAMPLERCUBE ; +type_specifier_nonarray ::= USAMPLER1DARRAY ; +type_specifier_nonarray ::= USAMPLER2DARRAY ; +type_specifier_nonarray ::= USAMPLERCUBEARRAY ; +type_specifier_nonarray ::= SAMPLER2DRECT ; +type_specifier_nonarray ::= SAMPLER2DRECTSHADOW ; +type_specifier_nonarray ::= ISAMPLER2DRECT ; +type_specifier_nonarray ::= USAMPLER2DRECT ; +type_specifier_nonarray ::= SAMPLERBUFFER ; +type_specifier_nonarray ::= ISAMPLERBUFFER ; +type_specifier_nonarray ::= USAMPLERBUFFER ; +type_specifier_nonarray ::= SAMPLER2DMS ; +type_specifier_nonarray ::= ISAMPLER2DMS ; +type_specifier_nonarray ::= USAMPLER2DMS ; +type_specifier_nonarray ::= SAMPLER2DMSARRAY ; +type_specifier_nonarray ::= ISAMPLER2DMSARRAY ; +type_specifier_nonarray ::= USAMPLER2DMSARRAY ; +type_specifier_nonarray ::= struct_specifier ; +type_specifier_nonarray ::= TYPE_NAME ; +precision_qualifier ::= HIGHP ; +precision_qualifier ::= MEDIUMP ; +precision_qualifier ::= LOWP ; +struct_specifier ::= STRUCT IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE ; +struct_specifier ::= STRUCT LEFT_BRACE struct_declaration_list RIGHT_BRACE ; +struct_declaration_list ::= struct_declaration ; +struct_declaration_list ::= struct_declaration_list struct_declaration ; +struct_declaration ::= type_specifier struct_declarator_list SEMICOLON ; +struct_declaration ::= type_qualifier type_specifier struct_declarator_list SEMICOLON ; +struct_declarator_list ::= struct_declarator ; +struct_declarator_list ::= struct_declarator_list COMMA struct_declarator ; +struct_declarator ::= IDENTIFIER ; +struct_declarator ::= IDENTIFIER LEFT_BRACKET RIGHT_BRACKET ; +struct_declarator ::= IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET ; +initializer ::= assignment_expression ; +declaration_statement ::= declaration ; +statement ::= compound_statement ; +statement ::= simple_statement ; +simple_statement ::= declaration_statement ; +simple_statement ::= expression_statement ; +simple_statement ::= selection_statement ; +simple_statement ::= switch_statement ; +simple_statement ::= case_label ; +simple_statement ::= iteration_statement ; +simple_statement ::= jump_statement ; +compound_statement ::= LEFT_BRACE RIGHT_BRACE ; +compound_statement ::= LEFT_BRACE statement_list RIGHT_BRACE ; +statement_no_new_scope ::= compound_statement_no_new_scope ; +statement_no_new_scope ::= simple_statement ; +compound_statement_no_new_scope ::= LEFT_BRACE RIGHT_BRACE ; +compound_statement_no_new_scope ::= LEFT_BRACE statement_list RIGHT_BRACE ; +statement_list ::= statement ; +statement_list ::= statement_list statement ; +expression_statement ::= SEMICOLON ; +expression_statement ::= expression SEMICOLON ; +selection_statement ::= IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement ; +selection_rest_statement ::= statement ELSE statement ; +selection_rest_statement ::= statement ; +condition ::= expression ; +condition ::= fully_specified_type IDENTIFIER EQUAL initializer ; +switch_statement ::= SWITCH LEFT_PAREN expression RIGHT_PAREN LEFT_BRACE switch_statement_list RIGHT_BRACE ; +switch_statement_list ::= ; +switch_statement_list ::= statement_list ; +case_label ::= CASE expression COLON ; +case_label ::= DEFAULT COLON ; +iteration_statement ::= WHILE LEFT_PAREN condition RIGHT_PAREN statement_no_new_scope ; +iteration_statement ::= DO statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON ; +iteration_statement ::= FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope ; +for_init_statement ::= expression_statement ; +for_init_statement ::= declaration_statement ; +conditionopt ::= ; +conditionopt ::= condition ; +for_rest_statement ::= conditionopt SEMICOLON ; +for_rest_statement ::= conditionopt SEMICOLON expression ; +jump_statement ::= CONTINUE SEMICOLON ; +jump_statement ::= BREAK SEMICOLON ; +jump_statement ::= RETURN SEMICOLON ; +jump_statement ::= RETURN expression SEMICOLON ; +jump_statement ::= DISCARD SEMICOLON ; +translation_unit ::= external_declaration ; +translation_unit ::= translation_unit external_declaration ; +external_declaration ::= function_definition ; +external_declaration ::= declaration ; +external_declaration ::= SEMICOLON ; +function_definition ::= function_prototype compound_statement_no_new_scope ; diff --git a/src/libs/glsl/tests/main.cpp b/src/libs/glsl/tests/main.cpp new file mode 100644 index 00000000000..db4921cb021 --- /dev/null +++ b/src/libs/glsl/tests/main.cpp @@ -0,0 +1,70 @@ + +#include "glslparser.h" +#include "glsllexer.h" +#include +#include +#include + +using namespace GLSL; + +#ifndef EXIT_FAILURE +#define EXIT_FAILURE 1 +#endif +#ifndef EXIT_SUCCESS +#define EXIT_SUCCESS 0 +#endif + +int main(int argc, char *argv[]) +{ + int variant = 0; + + while (argc > 1 && argv[1][0] == '-' && argv[1][1] == '-') { + if (!strcmp(argv[1], "--version=1.20")) { + variant |= Lexer::Variant_GLSL_120; + } else if (!strcmp(argv[1], "--version=1.50")) { + variant |= Lexer::Variant_GLSL_150; + } else if (!strcmp(argv[1], "--version=4.00")) { + variant |= Lexer::Variant_GLSL_400; + } else if (!strcmp(argv[1], "--version=es")) { + variant |= Lexer::Variant_GLSL_ES_100; + } else if (!strcmp(argv[1], "--version=qt")) { + variant |= Lexer::Variant_GLSL_ES_100 | + Lexer::Variant_GLSL_Qt; + } else if (!strcmp(argv[1], "--shader=vertex")) { + variant |= Lexer::Variant_VertexShader; + } else if (!strcmp(argv[1], "--shader=fragment")) { + variant |= Lexer::Variant_FragmentShader; + } else { + std::cerr << "glsl: unknown option: " << argv[1] << std::endl; + return EXIT_FAILURE; + } + ++argv; + --argc; + } + + if (argc != 2) { + std::cerr << "glsl: no input file" << std::endl; + return EXIT_FAILURE; + } + + std::ifstream fin(argv[1]); + if (! fin) { + std::cerr << "glsl: No such file or directory" << std::endl; + return EXIT_FAILURE; + } + fin.seekg(0, std::ios::end); + size_t size = fin.tellg(); + fin.seekg(0, std::ios::beg); + char *source = new char[size]; + fin.read(source, size); + fin.close(); + if (!variant) + variant = Lexer::Variant_Mask & ~Lexer::Variant_Reserved; + else if ((variant & (Lexer::Variant_VertexShader | Lexer::Variant_FragmentShader)) == 0) + variant |= Lexer::Variant_VertexShader | Lexer::Variant_FragmentShader; + Parser parser(source, size, variant); + std::cout << argv[1] << (parser.parse() ? " OK " : " KO ") << std::endl; + delete source; + + return EXIT_SUCCESS; +} diff --git a/src/libs/glsl/tools/kwgen.cpp b/src/libs/glsl/tools/kwgen.cpp new file mode 100644 index 00000000000..a20be70533b --- /dev/null +++ b/src/libs/glsl/tools/kwgen.cpp @@ -0,0 +1,385 @@ +/* + Copyright 2007 Roberto Raggi + + Permission to use, copy, modify, distribute, and sell this software and its + documentation for any purpose is hereby granted without fee, provided that + the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + KDEVELOP TEAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class State; +class DottedItem; + +typedef std::list RuleList; +typedef RuleList::iterator RulePtr; +typedef std::list StateList; +typedef StateList::iterator StatePtr; +typedef std::string::iterator Dot; +typedef std::vector::iterator DottedItemPtr; + +class DottedItem { +public: + RulePtr rule; + Dot dot; + + DottedItem() {} + + DottedItem(RulePtr rule, Dot dot): + rule(rule), dot(dot) {} + + bool operator == (const DottedItem &other) const { + return rule == other.rule && dot == other.dot; + } + + bool operator != (const DottedItem &other) const { + return ! operator == (other); + } + + bool terminal() const { + return dot == rule->end(); + } + + DottedItem next() const { + DottedItem item; + item.rule = rule; + item.dot = dot; + ++item.dot; + return item; + } +}; + +struct State { +public: + State() {} + + template + State(_ForwardIterator first, _ForwardIterator last) { + _items.insert(_items.end(), first, last); + } + + static State &intern(const State &state) { + StatePtr ptr = std::find(first_state(), last_state(), state); + if (ptr == last_state()) + ptr = states().insert(last_state(), state); + return *ptr; + } + + State &next(char ch) { + std::vector n; + for (DottedItemPtr it = first_item(); it != last_item(); ++it) { + if (! it->terminal() && *it->dot == ch) + n.push_back(it->next()); + } + return intern(State(n.begin(), n.end())); + } + + std::set firsts() { + std::set s; + for (DottedItemPtr it = first_item(); it != last_item(); ++it) { + if (! it->terminal()) + s.insert(*it->dot); + } + return s; + } + + size_t item_count() const { return _items.size(); } + + DottedItemPtr first_item() { return _items.begin(); } + DottedItemPtr last_item() { return _items.end(); } + + static StatePtr first_state() { return states().begin(); } + static StatePtr last_state() { return states().end(); } + + bool operator == (const State &other) const { return _items == other._items; } + bool operator != (const State &other) const { return _items != other._items; } + + template + static State &start(_Iterator first, _Iterator last) { + std::vector items; + for (; first != last; ++first) + items.push_back(DottedItem(first, first->begin())); + return intern(State(items.begin(), items.end())); + } + + static void reset() { + states().clear(); + } + +private: + static StateList &states() { + static StateList _states; + return _states; + } + +private: + std::vector _items; +}; + +static bool option_no_enums = false; +static bool option_toupper = false; +static std::string option_namespace_name; +static std::string option_class_name; +static std::string option_token_prefix = "Token_"; +static std::string option_variant_prefix = "Variant_"; +static std::string option_char_type = "char"; +static std::string option_unicode_function = ""; +static std::map variants; + +std::string token_id(const std::string &id) +{ + std::string token = option_token_prefix; + + if (! option_toupper) + token += id; + else { + for (size_t i = 0; i < id.size(); ++i) + token += toupper(id[i]); + } + + return token; +} + +std::string variant_id(const std::string &id) +{ + if (variants.find(id) == variants.end()) + return ""; + std::string variant = variants[id]; + size_t posn = 0; + bool sep = true; + std::string result; + while (posn < variant.size()) { + char ch = variant[posn++]; + if (isalnum(ch) || ch == '_') { + if (sep) { + result += " | " + option_variant_prefix; + sep = false; + } + result += ch; + } else if (!sep) { + sep = true; + } + } + return result; +} + +bool starts_with(const std::string &line, const std::string &text) { + if (text.length() < line.length()) { + return std::equal(line.begin(), line.begin() + text.size(), text.begin()); + } + return false; +} + +void doit(State &state) +{ + static int depth = 0; + + ++depth; + + std::string indent(depth * 2, ' '); + + std::set firsts = state.firsts(); + for (std::set::iterator it = firsts.begin(); it != firsts.end(); ++it) { + std::string _else = it == firsts.begin() ? "" : "else "; + std::cout << indent << _else << "if (s[" << (depth - 1) << "]" << option_unicode_function << " == '" << *it << "') {" << std::endl; + State &next_state = state.next(*it); + + bool found = false; + for (DottedItemPtr item = next_state.first_item(); item != next_state.last_item(); ++item) { + if (item->terminal()) { + if (found) { + std::cerr << "*** Error. Too many accepting states" << std::endl; + exit(EXIT_FAILURE); + } + found = true; + std::cout << indent << " return " << option_namespace_name << token_id(*item->rule) << variant_id(*item->rule) << ";" << std::endl; + } + } + + if (! found) + doit(next_state); + + std::cout << indent << "}" << std::endl; + } + + --depth; +} + +void gen_classify_n(State &start_state, int N) +{ + std::cout << "static inline int classify" << N << "(const " << option_char_type << " *s) {" << std::endl; + doit(start_state); + std::cout << " return " << option_namespace_name << token_id("identifier") << ";" << std::endl + << "}" << std::endl << std::endl; +} + +void gen_classify(const std::multimap &keywords) +{ + std::cout << "int " << option_class_name << "classify(const " << option_char_type << " *s, int n) {" << std::endl + << " switch (n) {" << std::endl; + std::multimap::const_iterator it = keywords.begin(); + while (it != keywords.end()) { + size_t size = it->first; + std::cout << " case " << size << ": return classify" << size << "(s);" << std::endl; + do { ++it; } while (it != keywords.end() && it->first == size); + } + std::cout << " default: return " << option_namespace_name << token_id("identifier") << ";" << std::endl + << " } // switch" << std::endl + << "}" << std::endl << std::endl; +} + +void gen_enums(const std::multimap &keywords) +{ + std::cout << "enum {" << std::endl; + std::multimap::const_iterator it = keywords.begin(); + for (; it != keywords.end(); ++it) { + std::cout << " " << token_id(it->second) << variant_id(it->second) << "," << std::endl; + } + std::cout << " " << token_id("identifier") << std::endl + << "};" << std::endl << std::endl; +} + +inline bool not_whitespace_p(char ch) { + return ! std::isspace(ch); +} + +int main(int argc, char *argv[]) { + const std::string ns = "--namespace="; + + for (int i = 0; i < argc; ++i) { + const std::string arg(argv[i]); + if (arg == "--no-enums") + option_no_enums = true; + else if (starts_with(arg, ns)) { + option_namespace_name.assign(arg.begin() + ns.size(), arg.end()); + option_namespace_name += "::"; + } + } + + std::multimap keywords; + std::string textline; + + bool readKeywords = false; + + const std::string opt_no_enums = "%no-enums"; + const std::string opt_toupper = "%toupper"; + const std::string opt_ns = "%namespace="; + const std::string opt_class = "%lexer-class="; + const std::string opt_tok_prefix = "%token-prefix="; + const std::string opt_var_prefix = "%variant-prefix="; + const std::string opt_char_type = "%char-type="; + const std::string opt_unicode_function = "%unicode-function="; + + while (getline(std::cin, textline)) { + + // remove trailing spaces + textline.assign(textline.begin(), std::find_if(textline.rbegin(), textline.rend(), not_whitespace_p).base()); + + if (! readKeywords) { + if (textline.size() >= 2 && textline[0] == '%') { + if (textline[1] == '%') { + readKeywords = true; + } else if (textline == opt_no_enums) { + option_no_enums = true; + } else if (textline == opt_toupper) { + option_toupper = true; + } else if (starts_with(textline, opt_tok_prefix)) { + option_token_prefix.assign(textline.begin() + opt_tok_prefix.size(), textline.end()); + } else if (starts_with(textline, opt_var_prefix)) { + option_variant_prefix.assign(textline.begin() + opt_var_prefix.size(), textline.end()); + } else if (starts_with(textline, opt_char_type)) { + option_char_type.assign(textline.begin() + opt_char_type.size(), textline.end()); + } else if (starts_with(textline, opt_unicode_function)) { + option_unicode_function.assign(textline.begin() + opt_unicode_function.size(), textline.end()); + } else if (starts_with(textline, opt_ns)) { + option_namespace_name.assign(textline.begin() + opt_ns.size(), textline.end()); + option_namespace_name += "::"; + } else if (starts_with(textline, opt_class)) { + option_class_name.assign(textline.begin() + opt_class.size(), textline.end()); + option_class_name += "::"; + } + + continue; + } + std::cout << textline << std::endl; + } else { + if (textline.empty()) + continue; + + std::string::iterator start = textline.begin(); + while (start != textline.end() && std::isspace(*start)) + ++start; + + std::string::iterator stop = start; + while (stop != textline.end() && (std::isalnum(*stop) || *stop == '_')) + ++stop; + + if (start != stop) { + std::string keyword(start, stop); + if (keyword == "identifier") { + std::cerr << "*** Error. `identifier' is reserved" << std::endl; + exit(EXIT_FAILURE); + } + + keywords.insert(std::make_pair(keyword.size(), keyword)); + + start = stop; + while (start != textline.end() && std::isspace(*start)) + ++start; + + if (start != textline.end() && *start == '%') { + ++start; + std::string::iterator stop = start; + while (stop != textline.end() && (std::isalnum(*stop) || *stop == '_')) + ++stop; + std::string directive(start, stop); + if (directive == "variant") { + while (stop != textline.end() && std::isspace(*stop)) + ++stop; + std::string variant(stop, textline.end()); + variants.insert(std::make_pair(keyword, variant)); + } + } + } + } + } + + if (option_class_name.empty()) + option_class_name = option_namespace_name; + + if (! option_no_enums) + gen_enums(keywords); + + std::multimap::iterator it = keywords.begin(); + while (it != keywords.end()) { + size_t size = it->first; + RuleList rules; + do { rules.push_back(it->second); ++it; } + while (it != keywords.end() && it->first == size); + gen_classify_n(State::start(rules.begin(), rules.end()), size); + State::reset(); + } + + gen_classify(keywords); +} diff --git a/src/libs/glsl/tools/mkvisitor.py b/src/libs/glsl/tools/mkvisitor.py new file mode 100755 index 00000000000..edeb292a05d --- /dev/null +++ b/src/libs/glsl/tools/mkvisitor.py @@ -0,0 +1,85 @@ +#!/usr/bin/python + +import sys + +try: + file = open(sys.argv[1], "r") + klass = sys.argv[2] +except: + print("Usage: mkvisitor.py grammar.txt classname") + exit() + +lines = file.readlines() +ruleno = 0 +print(""" +#include "glslast.h" + +namespace GLSL { + +class %s +{ + typedef void (%s::*dispatch_func)(AST *); + static dispatch_func dispatch[]; + +public: + void accept(AST *ast) + { + if (! ast) + return; + else if (Operator *op = ast->asOperator()) + (this->*dispatch[op->ruleno])(ast); + } + + template + void accept(It first, It last) + { + for (; first != last; ++first) + accept(*first); + } + +private:""" % (klass, klass)) + +for line in lines: + sections = line.split() + if len(sections) and sections[1] == "::=": + ruleno = ruleno + 1 + print(" void on_%s_%d(AST *);" % (sections[0], ruleno)) + +print("};") +print("} // end of namespace GLSL") + +print(""" +#include + +using namespace GLSL; + +namespace { +bool debug = false; +} + +""") + +print("%s::dispatch_func %s::dispatch[] = {" % (klass, klass)) + +ruleno = 0 +for line in lines: + sections = line.split() + if len(sections) and sections[1] == "::=": + ruleno = ruleno + 1 + print(" &%s::on_%s_%d," % (klass, sections[0], ruleno)) + +print("0, };\n") + +ruleno = 0 +for line in lines: + sections = line.split() + if len(sections) and sections[1] == "::=": + ruleno = ruleno + 1 + print("""// %svoid %s::on_%s_%d(AST *ast) +{ + if (debug) + std::cout << "%s" << std::endl; + Operator *op = ast->asOperator(); + accept(op->begin(), op->end()); +} +""" % (line, klass, sections[0], ruleno, line[:-3])) diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 83db8c18f5d..570785f8344 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -10,6 +10,7 @@ SUBDIRS = \ utils/process_stub.pro \ cplusplus \ qmljs \ + glsl \ qmleditorwidgets \ symbianutils \ 3rdparty