diff --git a/ast_stmt.cc b/ast_stmt.cc index b491b36..2a2073b 100644 --- a/ast_stmt.cc +++ b/ast_stmt.cc @@ -295,6 +295,7 @@ llvm::Value * BreakStmt::Emit(){ llvm::Function * func = irgen.GetFunction(); llvm::BasicBlock * breakBlock = llvm::BasicBlock::Create(*context, "breakBlock", func); val=llvm::BranchInst::Create (breakBlock, irgen.GetBasicBlock()); + return val; } llvm::Value * ContinueStmt::Emit(){ @@ -303,6 +304,7 @@ llvm::Value * ContinueStmt::Emit(){ llvm::Function * func = irgen.GetFunction(); llvm::BasicBlock * contBlock = llvm::BasicBlock::Create(*context, "contBlock", func); val=llvm::BranchInst::Create (contBlock, irgen.GetBasicBlock()); + return val; } //Not sure @@ -322,18 +324,25 @@ llvm::Value * SwitchStmt::Emit(){ llvm::Value * val; llvm::LLVMContext * context = irgen.GetContext(); llvm::Function * func = irgen.GetFunction(); - + llvm::BasicBlock * blockArr = new llvm::BasicBlock [cases->NumElements()]; //find all cases and create a basic block for all of them for (int i = 0; i < cases->NumElements(); i++){ - //cases->Nth(i)->Emit(); - //llvm::BasicBlock * headBlock = llvm::BasicBlock::Create(*context, "headBlock", func); + blockArr[i]= new llvm::BasicBlock::Create(*context, "switchBlock", func); } //Emit of expression llvm::Value * exprVal=expr->Emit(); //create switch instruction - //val=llvm::SwitchInst::Create(Value *Value, BasicBlock *Default, unsigned NumCases, BasicBlock *InsertAtEnd); + val=llvm::SwitchInst::Create(exprVal, blockArr[cases->NumElements()], cases->NumElements(), irgen.GetBasicBlock()); + //for each case 'addCase to switch stmt', EMIT for stmt in case, create terminator instruction + for(int i=0; iNumElements();i++){ + //add addCase to switch stmt + cases->Nth(i)->Emit(); + irgen.GetBasicBlock()->getTerminator(); + } + return NULL; + } llvm::Value * SwitchLabel::Emit(){ @@ -341,13 +350,13 @@ llvm::Value * SwitchLabel::Emit(){ } llvm::Value * Case::Emit(){ - - return NULL; + stmt->Emit(); + return label->Emit(); //stmt and label emit on stmt //return on label } llvm::Value * Default::Emit(){ - //stmt->emit(); + stmt->Emit(); return NULL; //stmt emit return null } diff --git a/y.output b/y.output new file mode 100644 index 0000000..3ddc147 --- /dev/null +++ b/y.output @@ -0,0 +1,3205 @@ +Terminals which are not used + + T_Uint + T_Bvec2 + T_Bvec3 + T_Bvec4 + T_Ivec2 + T_Ivec3 + T_Ivec4 + T_Uvec2 + T_Uvec3 + T_Uvec4 + T_Do + LOWEST + + +Grammar + + 0 $accept: Program $end + + 1 Program: DeclList + + 2 DeclList: DeclList Decl + 3 | Decl + + 4 Decl: Declaration + 5 | FuncDecl CompoundStatement + + 6 Declaration: FuncDecl T_Semicolon + 7 | SingleDecl T_Semicolon + + 8 FuncDecl: TypeDecl T_Identifier T_LeftParen T_RightParen + 9 | TypeDecl T_Identifier T_LeftParen ParameterList T_RightParen + + 10 ParameterList: SingleDecl + 11 | ParameterList T_Comma SingleDecl + + 12 SingleDecl: TypeDecl T_Identifier + 13 | TypeQualify TypeDecl T_Identifier + 14 | TypeDecl T_Identifier T_Equal Initializer + 15 | TypeQualify TypeDecl T_Identifier T_Equal Initializer + 16 | TypeDecl T_Identifier T_LeftBracket T_IntConstant T_RightBracket + 17 | TypeQualify TypeDecl T_Identifier T_LeftBracket T_IntConstant T_RightBracket + + 18 Initializer: Expression + + 19 TypeQualify: T_In + 20 | T_Out + 21 | T_Const + 22 | T_Uniform + + 23 TypeDecl: T_Int + 24 | T_Void + 25 | T_Float + 26 | T_Bool + 27 | T_Vec2 + 28 | T_Vec3 + 29 | T_Vec4 + 30 | T_Mat2 + 31 | T_Mat3 + 32 | T_Mat4 + + 33 CompoundStatement: T_LeftBrace T_RightBrace + 34 | T_LeftBrace StatementList T_RightBrace + + 35 StatementList: Statement + 36 | StatementList Statement + + 37 Statement: CompoundStatement + 38 | SingleStatement + + 39 SingleStatement: T_Semicolon + 40 | SingleDecl T_Semicolon + 41 | Expression T_Semicolon + 42 | SelectionStmt + 43 | SwitchStmt + 44 | CaseStmt + 45 | JumpStmt + 46 | WhileStmt + 47 | ForStmt + + 48 SelectionStmt: T_If T_LeftParen Expression T_RightParen Statement T_Else Statement + 49 | T_If T_LeftParen Expression T_RightParen Statement + + 50 SwitchStmt: T_Switch T_LeftParen Expression T_RightParen T_LeftBrace StatementList T_RightBrace + + 51 CaseStmt: T_Case Expression T_Colon Statement + 52 | T_Default T_Colon Statement + + 53 JumpStmt: T_Break T_Semicolon + 54 | T_Continue T_Semicolon + 55 | T_Return T_Semicolon + 56 | T_Return Expression T_Semicolon + + 57 WhileStmt: T_While T_LeftParen Expression T_RightParen Statement + + 58 ForStmt: T_For T_LeftParen Expression T_Semicolon Expression T_Semicolon Expression T_RightParen Statement + + 59 PrimaryExpr: T_Identifier + 60 | T_IntConstant + 61 | T_FloatConstant + 62 | T_BoolConstant + 63 | T_LeftParen Expression T_RightParen + + 64 FunctionCallExpr: FunctionCallHeaderWithParameters T_RightParen + 65 | FunctionCallHeaderNoParameters T_RightParen + + 66 FunctionCallHeaderNoParameters: FunctionIdentifier T_LeftParen T_Void + 67 | FunctionIdentifier T_LeftParen + + 68 FunctionCallHeaderWithParameters: FunctionIdentifier T_LeftParen ArgumentList + + 69 ArgumentList: Expression + 70 | ArgumentList T_Comma Expression + + 71 FunctionIdentifier: T_Identifier + + 72 PostfixExpr: PrimaryExpr + 73 | PostfixExpr T_LeftBracket Expression T_RightBracket + 74 | FunctionCallExpr + 75 | PostfixExpr T_Inc + 76 | PostfixExpr T_Dec + 77 | PostfixExpr T_Dot T_FieldSelection + + 78 UnaryExpr: PostfixExpr + 79 | T_Inc UnaryExpr + 80 | T_Dec UnaryExpr + 81 | T_Plus UnaryExpr + 82 | T_Dash UnaryExpr + + 83 MultiExpr: UnaryExpr + 84 | MultiExpr T_Star UnaryExpr + 85 | MultiExpr T_Slash UnaryExpr + + 86 AdditionExpr: MultiExpr + 87 | AdditionExpr T_Plus MultiExpr + 88 | AdditionExpr T_Dash MultiExpr + + 89 RelationExpr: AdditionExpr + 90 | RelationExpr T_LeftAngle AdditionExpr + 91 | RelationExpr T_RightAngle AdditionExpr + 92 | RelationExpr T_GreaterEqual AdditionExpr + 93 | RelationExpr T_LessEqual AdditionExpr + + 94 EqualityExpr: RelationExpr + 95 | EqualityExpr T_EQ RelationExpr + 96 | EqualityExpr T_NE RelationExpr + + 97 LogicAndExpr: EqualityExpr + 98 | LogicAndExpr T_And EqualityExpr + + 99 LogicOrExpr: LogicAndExpr + 100 | LogicOrExpr T_Or LogicAndExpr + + 101 Expression: LogicOrExpr + 102 | LogicOrExpr T_Question LogicOrExpr T_Colon LogicOrExpr + 103 | UnaryExpr AssignOp Expression + + 104 AssignOp: T_Equal + 105 | T_AddAssign + 106 | T_SubAssign + 107 | T_MulAssign + 108 | T_DivAssign + + +Terminals, with rules where they appear + +$end (0) 0 +error (256) +T_Void (258) 24 66 +T_Bool (259) 26 +T_Int (260) 23 +T_Float (261) 25 +T_Uint (262) +T_Bvec2 (263) +T_Bvec3 (264) +T_Bvec4 (265) +T_Ivec2 (266) +T_Ivec3 (267) +T_Ivec4 (268) +T_Uvec2 (269) +T_Uvec3 (270) +T_Uvec4 (271) +T_Vec2 (272) 27 +T_Vec3 (273) 28 +T_Vec4 (274) 29 +T_Mat2 (275) 30 +T_Mat3 (276) 31 +T_Mat4 (277) 32 +T_While (278) 57 +T_For (279) 58 +T_If (280) 48 49 +T_Else (281) 48 +T_Return (282) 55 56 +T_Break (283) 53 +T_Continue (284) 54 +T_Do (285) +T_Switch (286) 50 +T_Case (287) 51 +T_Default (288) 52 +T_In (289) 19 +T_Out (290) 20 +T_Const (291) 21 +T_Uniform (292) 22 +T_LeftParen (293) 8 9 48 49 50 57 58 63 66 67 68 +T_RightParen (294) 8 9 48 49 50 57 58 63 64 65 +T_LeftBracket (295) 16 17 73 +T_RightBracket (296) 16 17 73 +T_LeftBrace (297) 33 34 50 +T_RightBrace (298) 33 34 50 +T_Dot (299) 77 +T_Comma (300) 11 70 +T_Colon (301) 51 52 102 +T_Semicolon (302) 6 7 39 40 41 53 54 55 56 58 +T_Question (303) 102 +T_LessEqual (304) 93 +T_GreaterEqual (305) 92 +T_EQ (306) 95 +T_NE (307) 96 +T_And (308) 98 +T_Or (309) 100 +T_Plus (310) 81 87 +T_Star (311) 84 +T_MulAssign (312) 107 +T_DivAssign (313) 108 +T_AddAssign (314) 105 +T_SubAssign (315) 106 +T_Equal (316) 14 15 104 +T_LeftAngle (317) 90 +T_RightAngle (318) 91 +T_Dash (319) 82 88 +T_Slash (320) 85 +T_Inc (321) 75 79 +T_Dec (322) 76 80 +T_Identifier (323) 8 9 12 13 14 15 16 17 59 71 +T_IntConstant (324) 16 17 60 +T_FloatConstant (325) 61 +T_BoolConstant (326) 62 +T_FieldSelection (327) 77 +LOWEST (328) +LOWER_THAN_ELSE (329) + + +Nonterminals, with rules where they appear + +$accept (75) + on left: 0 +Program (76) + on left: 1, on right: 0 +DeclList (77) + on left: 2 3, on right: 1 2 +Decl (78) + on left: 4 5, on right: 2 3 +Declaration (79) + on left: 6 7, on right: 4 +FuncDecl (80) + on left: 8 9, on right: 5 6 +ParameterList (81) + on left: 10 11, on right: 9 11 +SingleDecl (82) + on left: 12 13 14 15 16 17, on right: 7 10 11 40 +Initializer (83) + on left: 18, on right: 14 15 +TypeQualify (84) + on left: 19 20 21 22, on right: 13 15 17 +TypeDecl (85) + on left: 23 24 25 26 27 28 29 30 31 32, on right: 8 9 12 13 14 + 15 16 17 +CompoundStatement (86) + on left: 33 34, on right: 5 37 +StatementList (87) + on left: 35 36, on right: 34 36 50 +Statement (88) + on left: 37 38, on right: 35 36 48 49 51 52 57 58 +SingleStatement (89) + on left: 39 40 41 42 43 44 45 46 47, on right: 38 +SelectionStmt (90) + on left: 48 49, on right: 42 +SwitchStmt (91) + on left: 50, on right: 43 +CaseStmt (92) + on left: 51 52, on right: 44 +JumpStmt (93) + on left: 53 54 55 56, on right: 45 +WhileStmt (94) + on left: 57, on right: 46 +ForStmt (95) + on left: 58, on right: 47 +PrimaryExpr (96) + on left: 59 60 61 62 63, on right: 72 +FunctionCallExpr (97) + on left: 64 65, on right: 74 +FunctionCallHeaderNoParameters (98) + on left: 66 67, on right: 65 +FunctionCallHeaderWithParameters (99) + on left: 68, on right: 64 +ArgumentList (100) + on left: 69 70, on right: 68 70 +FunctionIdentifier (101) + on left: 71, on right: 66 67 68 +PostfixExpr (102) + on left: 72 73 74 75 76 77, on right: 73 75 76 77 78 +UnaryExpr (103) + on left: 78 79 80 81 82, on right: 79 80 81 82 83 84 85 103 +MultiExpr (104) + on left: 83 84 85, on right: 84 85 86 87 88 +AdditionExpr (105) + on left: 86 87 88, on right: 87 88 89 90 91 92 93 +RelationExpr (106) + on left: 89 90 91 92 93, on right: 90 91 92 93 94 95 96 +EqualityExpr (107) + on left: 94 95 96, on right: 95 96 97 98 +LogicAndExpr (108) + on left: 97 98, on right: 98 99 100 +LogicOrExpr (109) + on left: 99 100, on right: 100 101 102 +Expression (110) + on left: 101 102 103, on right: 18 41 48 49 50 51 56 57 58 63 69 + 70 73 103 +AssignOp (111) + on left: 104 105 106 107 108, on right: 103 + + +state 0 + + 0 $accept: . Program $end + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + + Program go to state 15 + DeclList go to state 16 + Decl go to state 17 + Declaration go to state 18 + FuncDecl go to state 19 + SingleDecl go to state 20 + TypeQualify go to state 21 + TypeDecl go to state 22 + + +state 1 + + 24 TypeDecl: T_Void . + + $default reduce using rule 24 (TypeDecl) + + +state 2 + + 26 TypeDecl: T_Bool . + + $default reduce using rule 26 (TypeDecl) + + +state 3 + + 23 TypeDecl: T_Int . + + $default reduce using rule 23 (TypeDecl) + + +state 4 + + 25 TypeDecl: T_Float . + + $default reduce using rule 25 (TypeDecl) + + +state 5 + + 27 TypeDecl: T_Vec2 . + + $default reduce using rule 27 (TypeDecl) + + +state 6 + + 28 TypeDecl: T_Vec3 . + + $default reduce using rule 28 (TypeDecl) + + +state 7 + + 29 TypeDecl: T_Vec4 . + + $default reduce using rule 29 (TypeDecl) + + +state 8 + + 30 TypeDecl: T_Mat2 . + + $default reduce using rule 30 (TypeDecl) + + +state 9 + + 31 TypeDecl: T_Mat3 . + + $default reduce using rule 31 (TypeDecl) + + +state 10 + + 32 TypeDecl: T_Mat4 . + + $default reduce using rule 32 (TypeDecl) + + +state 11 + + 19 TypeQualify: T_In . + + $default reduce using rule 19 (TypeQualify) + + +state 12 + + 20 TypeQualify: T_Out . + + $default reduce using rule 20 (TypeQualify) + + +state 13 + + 21 TypeQualify: T_Const . + + $default reduce using rule 21 (TypeQualify) + + +state 14 + + 22 TypeQualify: T_Uniform . + + $default reduce using rule 22 (TypeQualify) + + +state 15 + + 0 $accept: Program . $end + + $end shift, and go to state 23 + + +state 16 + + 1 Program: DeclList . + 2 DeclList: DeclList . Decl + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + + $default reduce using rule 1 (Program) + + Decl go to state 24 + Declaration go to state 18 + FuncDecl go to state 19 + SingleDecl go to state 20 + TypeQualify go to state 21 + TypeDecl go to state 22 + + +state 17 + + 3 DeclList: Decl . + + $default reduce using rule 3 (DeclList) + + +state 18 + + 4 Decl: Declaration . + + $default reduce using rule 4 (Decl) + + +state 19 + + 5 Decl: FuncDecl . CompoundStatement + 6 Declaration: FuncDecl . T_Semicolon + + T_LeftBrace shift, and go to state 25 + T_Semicolon shift, and go to state 26 + + CompoundStatement go to state 27 + + +state 20 + + 7 Declaration: SingleDecl . T_Semicolon + + T_Semicolon shift, and go to state 28 + + +state 21 + + 13 SingleDecl: TypeQualify . TypeDecl T_Identifier + 15 | TypeQualify . TypeDecl T_Identifier T_Equal Initializer + 17 | TypeQualify . TypeDecl T_Identifier T_LeftBracket T_IntConstant T_RightBracket + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + + TypeDecl go to state 29 + + +state 22 + + 8 FuncDecl: TypeDecl . T_Identifier T_LeftParen T_RightParen + 9 | TypeDecl . T_Identifier T_LeftParen ParameterList T_RightParen + 12 SingleDecl: TypeDecl . T_Identifier + 14 | TypeDecl . T_Identifier T_Equal Initializer + 16 | TypeDecl . T_Identifier T_LeftBracket T_IntConstant T_RightBracket + + T_Identifier shift, and go to state 30 + + +state 23 + + 0 $accept: Program $end . + + $default accept + + +state 24 + + 2 DeclList: DeclList Decl . + + $default reduce using rule 2 (DeclList) + + +state 25 + + 33 CompoundStatement: T_LeftBrace . T_RightBrace + 34 | T_LeftBrace . StatementList T_RightBrace + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_RightBrace shift, and go to state 41 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + StatementList go to state 54 + Statement go to state 55 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 26 + + 6 Declaration: FuncDecl T_Semicolon . + + $default reduce using rule 6 (Declaration) + + +state 27 + + 5 Decl: FuncDecl CompoundStatement . + + $default reduce using rule 5 (Decl) + + +state 28 + + 7 Declaration: SingleDecl T_Semicolon . + + $default reduce using rule 7 (Declaration) + + +state 29 + + 13 SingleDecl: TypeQualify TypeDecl . T_Identifier + 15 | TypeQualify TypeDecl . T_Identifier T_Equal Initializer + 17 | TypeQualify TypeDecl . T_Identifier T_LeftBracket T_IntConstant T_RightBracket + + T_Identifier shift, and go to state 77 + + +state 30 + + 8 FuncDecl: TypeDecl T_Identifier . T_LeftParen T_RightParen + 9 | TypeDecl T_Identifier . T_LeftParen ParameterList T_RightParen + 12 SingleDecl: TypeDecl T_Identifier . + 14 | TypeDecl T_Identifier . T_Equal Initializer + 16 | TypeDecl T_Identifier . T_LeftBracket T_IntConstant T_RightBracket + + T_LeftParen shift, and go to state 78 + T_LeftBracket shift, and go to state 79 + T_Equal shift, and go to state 80 + + $default reduce using rule 12 (SingleDecl) + + +state 31 + + 57 WhileStmt: T_While . T_LeftParen Expression T_RightParen Statement + + T_LeftParen shift, and go to state 81 + + +state 32 + + 58 ForStmt: T_For . T_LeftParen Expression T_Semicolon Expression T_Semicolon Expression T_RightParen Statement + + T_LeftParen shift, and go to state 82 + + +state 33 + + 48 SelectionStmt: T_If . T_LeftParen Expression T_RightParen Statement T_Else Statement + 49 | T_If . T_LeftParen Expression T_RightParen Statement + + T_LeftParen shift, and go to state 83 + + +state 34 + + 55 JumpStmt: T_Return . T_Semicolon + 56 | T_Return . Expression T_Semicolon + + T_LeftParen shift, and go to state 40 + T_Semicolon shift, and go to state 84 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 85 + + +state 35 + + 53 JumpStmt: T_Break . T_Semicolon + + T_Semicolon shift, and go to state 86 + + +state 36 + + 54 JumpStmt: T_Continue . T_Semicolon + + T_Semicolon shift, and go to state 87 + + +state 37 + + 50 SwitchStmt: T_Switch . T_LeftParen Expression T_RightParen T_LeftBrace StatementList T_RightBrace + + T_LeftParen shift, and go to state 88 + + +state 38 + + 51 CaseStmt: T_Case . Expression T_Colon Statement + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 89 + + +state 39 + + 52 CaseStmt: T_Default . T_Colon Statement + + T_Colon shift, and go to state 90 + + +state 40 + + 63 PrimaryExpr: T_LeftParen . Expression T_RightParen + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 91 + + +state 41 + + 33 CompoundStatement: T_LeftBrace T_RightBrace . + + $default reduce using rule 33 (CompoundStatement) + + +state 42 + + 39 SingleStatement: T_Semicolon . + + $default reduce using rule 39 (SingleStatement) + + +state 43 + + 81 UnaryExpr: T_Plus . UnaryExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 92 + + +state 44 + + 82 UnaryExpr: T_Dash . UnaryExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 93 + + +state 45 + + 79 UnaryExpr: T_Inc . UnaryExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 94 + + +state 46 + + 80 UnaryExpr: T_Dec . UnaryExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 95 + + +state 47 + + 59 PrimaryExpr: T_Identifier . + 71 FunctionIdentifier: T_Identifier . + + T_LeftParen reduce using rule 71 (FunctionIdentifier) + $default reduce using rule 59 (PrimaryExpr) + + +state 48 + + 60 PrimaryExpr: T_IntConstant . + + $default reduce using rule 60 (PrimaryExpr) + + +state 49 + + 61 PrimaryExpr: T_FloatConstant . + + $default reduce using rule 61 (PrimaryExpr) + + +state 50 + + 62 PrimaryExpr: T_BoolConstant . + + $default reduce using rule 62 (PrimaryExpr) + + +state 51 + + 40 SingleStatement: SingleDecl . T_Semicolon + + T_Semicolon shift, and go to state 96 + + +state 52 + + 12 SingleDecl: TypeDecl . T_Identifier + 14 | TypeDecl . T_Identifier T_Equal Initializer + 16 | TypeDecl . T_Identifier T_LeftBracket T_IntConstant T_RightBracket + + T_Identifier shift, and go to state 97 + + +state 53 + + 37 Statement: CompoundStatement . + + $default reduce using rule 37 (Statement) + + +state 54 + + 34 CompoundStatement: T_LeftBrace StatementList . T_RightBrace + 36 StatementList: StatementList . Statement + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_RightBrace shift, and go to state 98 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + Statement go to state 99 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 55 + + 35 StatementList: Statement . + + $default reduce using rule 35 (StatementList) + + +state 56 + + 38 Statement: SingleStatement . + + $default reduce using rule 38 (Statement) + + +state 57 + + 42 SingleStatement: SelectionStmt . + + $default reduce using rule 42 (SingleStatement) + + +state 58 + + 43 SingleStatement: SwitchStmt . + + $default reduce using rule 43 (SingleStatement) + + +state 59 + + 44 SingleStatement: CaseStmt . + + $default reduce using rule 44 (SingleStatement) + + +state 60 + + 45 SingleStatement: JumpStmt . + + $default reduce using rule 45 (SingleStatement) + + +state 61 + + 46 SingleStatement: WhileStmt . + + $default reduce using rule 46 (SingleStatement) + + +state 62 + + 47 SingleStatement: ForStmt . + + $default reduce using rule 47 (SingleStatement) + + +state 63 + + 72 PostfixExpr: PrimaryExpr . + + $default reduce using rule 72 (PostfixExpr) + + +state 64 + + 74 PostfixExpr: FunctionCallExpr . + + $default reduce using rule 74 (PostfixExpr) + + +state 65 + + 65 FunctionCallExpr: FunctionCallHeaderNoParameters . T_RightParen + + T_RightParen shift, and go to state 100 + + +state 66 + + 64 FunctionCallExpr: FunctionCallHeaderWithParameters . T_RightParen + + T_RightParen shift, and go to state 101 + + +state 67 + + 66 FunctionCallHeaderNoParameters: FunctionIdentifier . T_LeftParen T_Void + 67 | FunctionIdentifier . T_LeftParen + 68 FunctionCallHeaderWithParameters: FunctionIdentifier . T_LeftParen ArgumentList + + T_LeftParen shift, and go to state 102 + + +state 68 + + 73 PostfixExpr: PostfixExpr . T_LeftBracket Expression T_RightBracket + 75 | PostfixExpr . T_Inc + 76 | PostfixExpr . T_Dec + 77 | PostfixExpr . T_Dot T_FieldSelection + 78 UnaryExpr: PostfixExpr . + + T_LeftBracket shift, and go to state 103 + T_Dot shift, and go to state 104 + T_Inc shift, and go to state 105 + T_Dec shift, and go to state 106 + + $default reduce using rule 78 (UnaryExpr) + + +state 69 + + 83 MultiExpr: UnaryExpr . + 103 Expression: UnaryExpr . AssignOp Expression + + T_MulAssign shift, and go to state 107 + T_DivAssign shift, and go to state 108 + T_AddAssign shift, and go to state 109 + T_SubAssign shift, and go to state 110 + T_Equal shift, and go to state 111 + + $default reduce using rule 83 (MultiExpr) + + AssignOp go to state 112 + + +state 70 + + 84 MultiExpr: MultiExpr . T_Star UnaryExpr + 85 | MultiExpr . T_Slash UnaryExpr + 86 AdditionExpr: MultiExpr . + + T_Star shift, and go to state 113 + T_Slash shift, and go to state 114 + + $default reduce using rule 86 (AdditionExpr) + + +state 71 + + 87 AdditionExpr: AdditionExpr . T_Plus MultiExpr + 88 | AdditionExpr . T_Dash MultiExpr + 89 RelationExpr: AdditionExpr . + + T_Plus shift, and go to state 115 + T_Dash shift, and go to state 116 + + $default reduce using rule 89 (RelationExpr) + + +state 72 + + 90 RelationExpr: RelationExpr . T_LeftAngle AdditionExpr + 91 | RelationExpr . T_RightAngle AdditionExpr + 92 | RelationExpr . T_GreaterEqual AdditionExpr + 93 | RelationExpr . T_LessEqual AdditionExpr + 94 EqualityExpr: RelationExpr . + + T_LessEqual shift, and go to state 117 + T_GreaterEqual shift, and go to state 118 + T_LeftAngle shift, and go to state 119 + T_RightAngle shift, and go to state 120 + + $default reduce using rule 94 (EqualityExpr) + + +state 73 + + 95 EqualityExpr: EqualityExpr . T_EQ RelationExpr + 96 | EqualityExpr . T_NE RelationExpr + 97 LogicAndExpr: EqualityExpr . + + T_EQ shift, and go to state 121 + T_NE shift, and go to state 122 + + $default reduce using rule 97 (LogicAndExpr) + + +state 74 + + 98 LogicAndExpr: LogicAndExpr . T_And EqualityExpr + 99 LogicOrExpr: LogicAndExpr . + + T_And shift, and go to state 123 + + $default reduce using rule 99 (LogicOrExpr) + + +state 75 + + 100 LogicOrExpr: LogicOrExpr . T_Or LogicAndExpr + 101 Expression: LogicOrExpr . + 102 | LogicOrExpr . T_Question LogicOrExpr T_Colon LogicOrExpr + + T_Question shift, and go to state 124 + T_Or shift, and go to state 125 + + $default reduce using rule 101 (Expression) + + +state 76 + + 41 SingleStatement: Expression . T_Semicolon + + T_Semicolon shift, and go to state 126 + + +state 77 + + 13 SingleDecl: TypeQualify TypeDecl T_Identifier . + 15 | TypeQualify TypeDecl T_Identifier . T_Equal Initializer + 17 | TypeQualify TypeDecl T_Identifier . T_LeftBracket T_IntConstant T_RightBracket + + T_LeftBracket shift, and go to state 127 + T_Equal shift, and go to state 128 + + $default reduce using rule 13 (SingleDecl) + + +state 78 + + 8 FuncDecl: TypeDecl T_Identifier T_LeftParen . T_RightParen + 9 | TypeDecl T_Identifier T_LeftParen . ParameterList T_RightParen + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_RightParen shift, and go to state 129 + + ParameterList go to state 130 + SingleDecl go to state 131 + TypeQualify go to state 21 + TypeDecl go to state 52 + + +state 79 + + 16 SingleDecl: TypeDecl T_Identifier T_LeftBracket . T_IntConstant T_RightBracket + + T_IntConstant shift, and go to state 132 + + +state 80 + + 14 SingleDecl: TypeDecl T_Identifier T_Equal . Initializer + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + Initializer go to state 133 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 134 + + +state 81 + + 57 WhileStmt: T_While T_LeftParen . Expression T_RightParen Statement + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 135 + + +state 82 + + 58 ForStmt: T_For T_LeftParen . Expression T_Semicolon Expression T_Semicolon Expression T_RightParen Statement + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 136 + + +state 83 + + 48 SelectionStmt: T_If T_LeftParen . Expression T_RightParen Statement T_Else Statement + 49 | T_If T_LeftParen . Expression T_RightParen Statement + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 137 + + +state 84 + + 55 JumpStmt: T_Return T_Semicolon . + + $default reduce using rule 55 (JumpStmt) + + +state 85 + + 56 JumpStmt: T_Return Expression . T_Semicolon + + T_Semicolon shift, and go to state 138 + + +state 86 + + 53 JumpStmt: T_Break T_Semicolon . + + $default reduce using rule 53 (JumpStmt) + + +state 87 + + 54 JumpStmt: T_Continue T_Semicolon . + + $default reduce using rule 54 (JumpStmt) + + +state 88 + + 50 SwitchStmt: T_Switch T_LeftParen . Expression T_RightParen T_LeftBrace StatementList T_RightBrace + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 139 + + +state 89 + + 51 CaseStmt: T_Case Expression . T_Colon Statement + + T_Colon shift, and go to state 140 + + +state 90 + + 52 CaseStmt: T_Default T_Colon . Statement + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + Statement go to state 141 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 91 + + 63 PrimaryExpr: T_LeftParen Expression . T_RightParen + + T_RightParen shift, and go to state 142 + + +state 92 + + 81 UnaryExpr: T_Plus UnaryExpr . + + $default reduce using rule 81 (UnaryExpr) + + +state 93 + + 82 UnaryExpr: T_Dash UnaryExpr . + + $default reduce using rule 82 (UnaryExpr) + + +state 94 + + 79 UnaryExpr: T_Inc UnaryExpr . + + $default reduce using rule 79 (UnaryExpr) + + +state 95 + + 80 UnaryExpr: T_Dec UnaryExpr . + + $default reduce using rule 80 (UnaryExpr) + + +state 96 + + 40 SingleStatement: SingleDecl T_Semicolon . + + $default reduce using rule 40 (SingleStatement) + + +state 97 + + 12 SingleDecl: TypeDecl T_Identifier . + 14 | TypeDecl T_Identifier . T_Equal Initializer + 16 | TypeDecl T_Identifier . T_LeftBracket T_IntConstant T_RightBracket + + T_LeftBracket shift, and go to state 79 + T_Equal shift, and go to state 80 + + $default reduce using rule 12 (SingleDecl) + + +state 98 + + 34 CompoundStatement: T_LeftBrace StatementList T_RightBrace . + + $default reduce using rule 34 (CompoundStatement) + + +state 99 + + 36 StatementList: StatementList Statement . + + $default reduce using rule 36 (StatementList) + + +state 100 + + 65 FunctionCallExpr: FunctionCallHeaderNoParameters T_RightParen . + + $default reduce using rule 65 (FunctionCallExpr) + + +state 101 + + 64 FunctionCallExpr: FunctionCallHeaderWithParameters T_RightParen . + + $default reduce using rule 64 (FunctionCallExpr) + + +state 102 + + 66 FunctionCallHeaderNoParameters: FunctionIdentifier T_LeftParen . T_Void + 67 | FunctionIdentifier T_LeftParen . + 68 FunctionCallHeaderWithParameters: FunctionIdentifier T_LeftParen . ArgumentList + + T_Void shift, and go to state 143 + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + $default reduce using rule 67 (FunctionCallHeaderNoParameters) + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + ArgumentList go to state 144 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 145 + + +state 103 + + 73 PostfixExpr: PostfixExpr T_LeftBracket . Expression T_RightBracket + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 146 + + +state 104 + + 77 PostfixExpr: PostfixExpr T_Dot . T_FieldSelection + + T_FieldSelection shift, and go to state 147 + + +state 105 + + 75 PostfixExpr: PostfixExpr T_Inc . + + $default reduce using rule 75 (PostfixExpr) + + +state 106 + + 76 PostfixExpr: PostfixExpr T_Dec . + + $default reduce using rule 76 (PostfixExpr) + + +state 107 + + 107 AssignOp: T_MulAssign . + + $default reduce using rule 107 (AssignOp) + + +state 108 + + 108 AssignOp: T_DivAssign . + + $default reduce using rule 108 (AssignOp) + + +state 109 + + 105 AssignOp: T_AddAssign . + + $default reduce using rule 105 (AssignOp) + + +state 110 + + 106 AssignOp: T_SubAssign . + + $default reduce using rule 106 (AssignOp) + + +state 111 + + 104 AssignOp: T_Equal . + + $default reduce using rule 104 (AssignOp) + + +state 112 + + 103 Expression: UnaryExpr AssignOp . Expression + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 148 + + +state 113 + + 84 MultiExpr: MultiExpr T_Star . UnaryExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 149 + + +state 114 + + 85 MultiExpr: MultiExpr T_Slash . UnaryExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 150 + + +state 115 + + 87 AdditionExpr: AdditionExpr T_Plus . MultiExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 152 + + +state 116 + + 88 AdditionExpr: AdditionExpr T_Dash . MultiExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 153 + + +state 117 + + 93 RelationExpr: RelationExpr T_LessEqual . AdditionExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 154 + + +state 118 + + 92 RelationExpr: RelationExpr T_GreaterEqual . AdditionExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 155 + + +state 119 + + 90 RelationExpr: RelationExpr T_LeftAngle . AdditionExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 156 + + +state 120 + + 91 RelationExpr: RelationExpr T_RightAngle . AdditionExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 157 + + +state 121 + + 95 EqualityExpr: EqualityExpr T_EQ . RelationExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 158 + + +state 122 + + 96 EqualityExpr: EqualityExpr T_NE . RelationExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 159 + + +state 123 + + 98 LogicAndExpr: LogicAndExpr T_And . EqualityExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 160 + + +state 124 + + 102 Expression: LogicOrExpr T_Question . LogicOrExpr T_Colon LogicOrExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 161 + + +state 125 + + 100 LogicOrExpr: LogicOrExpr T_Or . LogicAndExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 162 + + +state 126 + + 41 SingleStatement: Expression T_Semicolon . + + $default reduce using rule 41 (SingleStatement) + + +state 127 + + 17 SingleDecl: TypeQualify TypeDecl T_Identifier T_LeftBracket . T_IntConstant T_RightBracket + + T_IntConstant shift, and go to state 163 + + +state 128 + + 15 SingleDecl: TypeQualify TypeDecl T_Identifier T_Equal . Initializer + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + Initializer go to state 164 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 134 + + +state 129 + + 8 FuncDecl: TypeDecl T_Identifier T_LeftParen T_RightParen . + + $default reduce using rule 8 (FuncDecl) + + +state 130 + + 9 FuncDecl: TypeDecl T_Identifier T_LeftParen ParameterList . T_RightParen + 11 ParameterList: ParameterList . T_Comma SingleDecl + + T_RightParen shift, and go to state 165 + T_Comma shift, and go to state 166 + + +state 131 + + 10 ParameterList: SingleDecl . + + $default reduce using rule 10 (ParameterList) + + +state 132 + + 16 SingleDecl: TypeDecl T_Identifier T_LeftBracket T_IntConstant . T_RightBracket + + T_RightBracket shift, and go to state 167 + + +state 133 + + 14 SingleDecl: TypeDecl T_Identifier T_Equal Initializer . + + $default reduce using rule 14 (SingleDecl) + + +state 134 + + 18 Initializer: Expression . + + $default reduce using rule 18 (Initializer) + + +state 135 + + 57 WhileStmt: T_While T_LeftParen Expression . T_RightParen Statement + + T_RightParen shift, and go to state 168 + + +state 136 + + 58 ForStmt: T_For T_LeftParen Expression . T_Semicolon Expression T_Semicolon Expression T_RightParen Statement + + T_Semicolon shift, and go to state 169 + + +state 137 + + 48 SelectionStmt: T_If T_LeftParen Expression . T_RightParen Statement T_Else Statement + 49 | T_If T_LeftParen Expression . T_RightParen Statement + + T_RightParen shift, and go to state 170 + + +state 138 + + 56 JumpStmt: T_Return Expression T_Semicolon . + + $default reduce using rule 56 (JumpStmt) + + +state 139 + + 50 SwitchStmt: T_Switch T_LeftParen Expression . T_RightParen T_LeftBrace StatementList T_RightBrace + + T_RightParen shift, and go to state 171 + + +state 140 + + 51 CaseStmt: T_Case Expression T_Colon . Statement + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + Statement go to state 172 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 141 + + 52 CaseStmt: T_Default T_Colon Statement . + + $default reduce using rule 52 (CaseStmt) + + +state 142 + + 63 PrimaryExpr: T_LeftParen Expression T_RightParen . + + $default reduce using rule 63 (PrimaryExpr) + + +state 143 + + 66 FunctionCallHeaderNoParameters: FunctionIdentifier T_LeftParen T_Void . + + $default reduce using rule 66 (FunctionCallHeaderNoParameters) + + +state 144 + + 68 FunctionCallHeaderWithParameters: FunctionIdentifier T_LeftParen ArgumentList . + 70 ArgumentList: ArgumentList . T_Comma Expression + + T_Comma shift, and go to state 173 + + $default reduce using rule 68 (FunctionCallHeaderWithParameters) + + +state 145 + + 69 ArgumentList: Expression . + + $default reduce using rule 69 (ArgumentList) + + +state 146 + + 73 PostfixExpr: PostfixExpr T_LeftBracket Expression . T_RightBracket + + T_RightBracket shift, and go to state 174 + + +state 147 + + 77 PostfixExpr: PostfixExpr T_Dot T_FieldSelection . + + $default reduce using rule 77 (PostfixExpr) + + +state 148 + + 103 Expression: UnaryExpr AssignOp Expression . + + $default reduce using rule 103 (Expression) + + +state 149 + + 84 MultiExpr: MultiExpr T_Star UnaryExpr . + + $default reduce using rule 84 (MultiExpr) + + +state 150 + + 85 MultiExpr: MultiExpr T_Slash UnaryExpr . + + $default reduce using rule 85 (MultiExpr) + + +state 151 + + 83 MultiExpr: UnaryExpr . + + $default reduce using rule 83 (MultiExpr) + + +state 152 + + 84 MultiExpr: MultiExpr . T_Star UnaryExpr + 85 | MultiExpr . T_Slash UnaryExpr + 87 AdditionExpr: AdditionExpr T_Plus MultiExpr . + + T_Star shift, and go to state 113 + T_Slash shift, and go to state 114 + + $default reduce using rule 87 (AdditionExpr) + + +state 153 + + 84 MultiExpr: MultiExpr . T_Star UnaryExpr + 85 | MultiExpr . T_Slash UnaryExpr + 88 AdditionExpr: AdditionExpr T_Dash MultiExpr . + + T_Star shift, and go to state 113 + T_Slash shift, and go to state 114 + + $default reduce using rule 88 (AdditionExpr) + + +state 154 + + 87 AdditionExpr: AdditionExpr . T_Plus MultiExpr + 88 | AdditionExpr . T_Dash MultiExpr + 93 RelationExpr: RelationExpr T_LessEqual AdditionExpr . + + T_Plus shift, and go to state 115 + T_Dash shift, and go to state 116 + + $default reduce using rule 93 (RelationExpr) + + +state 155 + + 87 AdditionExpr: AdditionExpr . T_Plus MultiExpr + 88 | AdditionExpr . T_Dash MultiExpr + 92 RelationExpr: RelationExpr T_GreaterEqual AdditionExpr . + + T_Plus shift, and go to state 115 + T_Dash shift, and go to state 116 + + $default reduce using rule 92 (RelationExpr) + + +state 156 + + 87 AdditionExpr: AdditionExpr . T_Plus MultiExpr + 88 | AdditionExpr . T_Dash MultiExpr + 90 RelationExpr: RelationExpr T_LeftAngle AdditionExpr . + + T_Plus shift, and go to state 115 + T_Dash shift, and go to state 116 + + $default reduce using rule 90 (RelationExpr) + + +state 157 + + 87 AdditionExpr: AdditionExpr . T_Plus MultiExpr + 88 | AdditionExpr . T_Dash MultiExpr + 91 RelationExpr: RelationExpr T_RightAngle AdditionExpr . + + T_Plus shift, and go to state 115 + T_Dash shift, and go to state 116 + + $default reduce using rule 91 (RelationExpr) + + +state 158 + + 90 RelationExpr: RelationExpr . T_LeftAngle AdditionExpr + 91 | RelationExpr . T_RightAngle AdditionExpr + 92 | RelationExpr . T_GreaterEqual AdditionExpr + 93 | RelationExpr . T_LessEqual AdditionExpr + 95 EqualityExpr: EqualityExpr T_EQ RelationExpr . + + T_LessEqual shift, and go to state 117 + T_GreaterEqual shift, and go to state 118 + T_LeftAngle shift, and go to state 119 + T_RightAngle shift, and go to state 120 + + $default reduce using rule 95 (EqualityExpr) + + +state 159 + + 90 RelationExpr: RelationExpr . T_LeftAngle AdditionExpr + 91 | RelationExpr . T_RightAngle AdditionExpr + 92 | RelationExpr . T_GreaterEqual AdditionExpr + 93 | RelationExpr . T_LessEqual AdditionExpr + 96 EqualityExpr: EqualityExpr T_NE RelationExpr . + + T_LessEqual shift, and go to state 117 + T_GreaterEqual shift, and go to state 118 + T_LeftAngle shift, and go to state 119 + T_RightAngle shift, and go to state 120 + + $default reduce using rule 96 (EqualityExpr) + + +state 160 + + 95 EqualityExpr: EqualityExpr . T_EQ RelationExpr + 96 | EqualityExpr . T_NE RelationExpr + 98 LogicAndExpr: LogicAndExpr T_And EqualityExpr . + + T_EQ shift, and go to state 121 + T_NE shift, and go to state 122 + + $default reduce using rule 98 (LogicAndExpr) + + +state 161 + + 100 LogicOrExpr: LogicOrExpr . T_Or LogicAndExpr + 102 Expression: LogicOrExpr T_Question LogicOrExpr . T_Colon LogicOrExpr + + T_Colon shift, and go to state 175 + T_Or shift, and go to state 125 + + +state 162 + + 98 LogicAndExpr: LogicAndExpr . T_And EqualityExpr + 100 LogicOrExpr: LogicOrExpr T_Or LogicAndExpr . + + T_And shift, and go to state 123 + + $default reduce using rule 100 (LogicOrExpr) + + +state 163 + + 17 SingleDecl: TypeQualify TypeDecl T_Identifier T_LeftBracket T_IntConstant . T_RightBracket + + T_RightBracket shift, and go to state 176 + + +state 164 + + 15 SingleDecl: TypeQualify TypeDecl T_Identifier T_Equal Initializer . + + $default reduce using rule 15 (SingleDecl) + + +state 165 + + 9 FuncDecl: TypeDecl T_Identifier T_LeftParen ParameterList T_RightParen . + + $default reduce using rule 9 (FuncDecl) + + +state 166 + + 11 ParameterList: ParameterList T_Comma . SingleDecl + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + + SingleDecl go to state 177 + TypeQualify go to state 21 + TypeDecl go to state 52 + + +state 167 + + 16 SingleDecl: TypeDecl T_Identifier T_LeftBracket T_IntConstant T_RightBracket . + + $default reduce using rule 16 (SingleDecl) + + +state 168 + + 57 WhileStmt: T_While T_LeftParen Expression T_RightParen . Statement + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + Statement go to state 178 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 169 + + 58 ForStmt: T_For T_LeftParen Expression T_Semicolon . Expression T_Semicolon Expression T_RightParen Statement + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 179 + + +state 170 + + 48 SelectionStmt: T_If T_LeftParen Expression T_RightParen . Statement T_Else Statement + 49 | T_If T_LeftParen Expression T_RightParen . Statement + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + Statement go to state 180 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 171 + + 50 SwitchStmt: T_Switch T_LeftParen Expression T_RightParen . T_LeftBrace StatementList T_RightBrace + + T_LeftBrace shift, and go to state 181 + + +state 172 + + 51 CaseStmt: T_Case Expression T_Colon Statement . + + $default reduce using rule 51 (CaseStmt) + + +state 173 + + 70 ArgumentList: ArgumentList T_Comma . Expression + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 182 + + +state 174 + + 73 PostfixExpr: PostfixExpr T_LeftBracket Expression T_RightBracket . + + $default reduce using rule 73 (PostfixExpr) + + +state 175 + + 102 Expression: LogicOrExpr T_Question LogicOrExpr T_Colon . LogicOrExpr + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 151 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 183 + + +state 176 + + 17 SingleDecl: TypeQualify TypeDecl T_Identifier T_LeftBracket T_IntConstant T_RightBracket . + + $default reduce using rule 17 (SingleDecl) + + +state 177 + + 11 ParameterList: ParameterList T_Comma SingleDecl . + + $default reduce using rule 11 (ParameterList) + + +state 178 + + 57 WhileStmt: T_While T_LeftParen Expression T_RightParen Statement . + + $default reduce using rule 57 (WhileStmt) + + +state 179 + + 58 ForStmt: T_For T_LeftParen Expression T_Semicolon Expression . T_Semicolon Expression T_RightParen Statement + + T_Semicolon shift, and go to state 184 + + +state 180 + + 48 SelectionStmt: T_If T_LeftParen Expression T_RightParen Statement . T_Else Statement + 49 | T_If T_LeftParen Expression T_RightParen Statement . + + T_Else shift, and go to state 185 + + $default reduce using rule 49 (SelectionStmt) + + +state 181 + + 50 SwitchStmt: T_Switch T_LeftParen Expression T_RightParen T_LeftBrace . StatementList T_RightBrace + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + StatementList go to state 186 + Statement go to state 55 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 182 + + 70 ArgumentList: ArgumentList T_Comma Expression . + + $default reduce using rule 70 (ArgumentList) + + +state 183 + + 100 LogicOrExpr: LogicOrExpr . T_Or LogicAndExpr + 102 Expression: LogicOrExpr T_Question LogicOrExpr T_Colon LogicOrExpr . + + T_Or shift, and go to state 125 + + $default reduce using rule 102 (Expression) + + +state 184 + + 58 ForStmt: T_For T_LeftParen Expression T_Semicolon Expression T_Semicolon . Expression T_RightParen Statement + + T_LeftParen shift, and go to state 40 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 187 + + +state 185 + + 48 SelectionStmt: T_If T_LeftParen Expression T_RightParen Statement T_Else . Statement + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + Statement go to state 188 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 186 + + 36 StatementList: StatementList . Statement + 50 SwitchStmt: T_Switch T_LeftParen Expression T_RightParen T_LeftBrace StatementList . T_RightBrace + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_RightBrace shift, and go to state 189 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + Statement go to state 99 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 187 + + 58 ForStmt: T_For T_LeftParen Expression T_Semicolon Expression T_Semicolon Expression . T_RightParen Statement + + T_RightParen shift, and go to state 190 + + +state 188 + + 48 SelectionStmt: T_If T_LeftParen Expression T_RightParen Statement T_Else Statement . + + $default reduce using rule 48 (SelectionStmt) + + +state 189 + + 50 SwitchStmt: T_Switch T_LeftParen Expression T_RightParen T_LeftBrace StatementList T_RightBrace . + + $default reduce using rule 50 (SwitchStmt) + + +state 190 + + 58 ForStmt: T_For T_LeftParen Expression T_Semicolon Expression T_Semicolon Expression T_RightParen . Statement + + T_Void shift, and go to state 1 + T_Bool shift, and go to state 2 + T_Int shift, and go to state 3 + T_Float shift, and go to state 4 + T_Vec2 shift, and go to state 5 + T_Vec3 shift, and go to state 6 + T_Vec4 shift, and go to state 7 + T_Mat2 shift, and go to state 8 + T_Mat3 shift, and go to state 9 + T_Mat4 shift, and go to state 10 + T_While shift, and go to state 31 + T_For shift, and go to state 32 + T_If shift, and go to state 33 + T_Return shift, and go to state 34 + T_Break shift, and go to state 35 + T_Continue shift, and go to state 36 + T_Switch shift, and go to state 37 + T_Case shift, and go to state 38 + T_Default shift, and go to state 39 + T_In shift, and go to state 11 + T_Out shift, and go to state 12 + T_Const shift, and go to state 13 + T_Uniform shift, and go to state 14 + T_LeftParen shift, and go to state 40 + T_LeftBrace shift, and go to state 25 + T_Semicolon shift, and go to state 42 + T_Plus shift, and go to state 43 + T_Dash shift, and go to state 44 + T_Inc shift, and go to state 45 + T_Dec shift, and go to state 46 + T_Identifier shift, and go to state 47 + T_IntConstant shift, and go to state 48 + T_FloatConstant shift, and go to state 49 + T_BoolConstant shift, and go to state 50 + + SingleDecl go to state 51 + TypeQualify go to state 21 + TypeDecl go to state 52 + CompoundStatement go to state 53 + Statement go to state 191 + SingleStatement go to state 56 + SelectionStmt go to state 57 + SwitchStmt go to state 58 + CaseStmt go to state 59 + JumpStmt go to state 60 + WhileStmt go to state 61 + ForStmt go to state 62 + PrimaryExpr go to state 63 + FunctionCallExpr go to state 64 + FunctionCallHeaderNoParameters go to state 65 + FunctionCallHeaderWithParameters go to state 66 + FunctionIdentifier go to state 67 + PostfixExpr go to state 68 + UnaryExpr go to state 69 + MultiExpr go to state 70 + AdditionExpr go to state 71 + RelationExpr go to state 72 + EqualityExpr go to state 73 + LogicAndExpr go to state 74 + LogicOrExpr go to state 75 + Expression go to state 76 + + +state 191 + + 58 ForStmt: T_For T_LeftParen Expression T_Semicolon Expression T_Semicolon Expression T_RightParen Statement . + + $default reduce using rule 58 (ForStmt) diff --git a/y.tab.c b/y.tab.c new file mode 100644 index 0000000..ff54c9f --- /dev/null +++ b/y.tab.c @@ -0,0 +1,2654 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 1 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + T_Void = 258, + T_Bool = 259, + T_Int = 260, + T_Float = 261, + T_Uint = 262, + T_Bvec2 = 263, + T_Bvec3 = 264, + T_Bvec4 = 265, + T_Ivec2 = 266, + T_Ivec3 = 267, + T_Ivec4 = 268, + T_Uvec2 = 269, + T_Uvec3 = 270, + T_Uvec4 = 271, + T_Vec2 = 272, + T_Vec3 = 273, + T_Vec4 = 274, + T_Mat2 = 275, + T_Mat3 = 276, + T_Mat4 = 277, + T_While = 278, + T_For = 279, + T_If = 280, + T_Else = 281, + T_Return = 282, + T_Break = 283, + T_Continue = 284, + T_Do = 285, + T_Switch = 286, + T_Case = 287, + T_Default = 288, + T_In = 289, + T_Out = 290, + T_Const = 291, + T_Uniform = 292, + T_LeftParen = 293, + T_RightParen = 294, + T_LeftBracket = 295, + T_RightBracket = 296, + T_LeftBrace = 297, + T_RightBrace = 298, + T_Dot = 299, + T_Comma = 300, + T_Colon = 301, + T_Semicolon = 302, + T_Question = 303, + T_LessEqual = 304, + T_GreaterEqual = 305, + T_EQ = 306, + T_NE = 307, + T_And = 308, + T_Or = 309, + T_Plus = 310, + T_Star = 311, + T_MulAssign = 312, + T_DivAssign = 313, + T_AddAssign = 314, + T_SubAssign = 315, + T_Equal = 316, + T_LeftAngle = 317, + T_RightAngle = 318, + T_Dash = 319, + T_Slash = 320, + T_Inc = 321, + T_Dec = 322, + T_Identifier = 323, + T_IntConstant = 324, + T_FloatConstant = 325, + T_BoolConstant = 326, + T_FieldSelection = 327, + LOWEST = 328, + LOWER_THAN_ELSE = 329 + }; +#endif +/* Tokens. */ +#define T_Void 258 +#define T_Bool 259 +#define T_Int 260 +#define T_Float 261 +#define T_Uint 262 +#define T_Bvec2 263 +#define T_Bvec3 264 +#define T_Bvec4 265 +#define T_Ivec2 266 +#define T_Ivec3 267 +#define T_Ivec4 268 +#define T_Uvec2 269 +#define T_Uvec3 270 +#define T_Uvec4 271 +#define T_Vec2 272 +#define T_Vec3 273 +#define T_Vec4 274 +#define T_Mat2 275 +#define T_Mat3 276 +#define T_Mat4 277 +#define T_While 278 +#define T_For 279 +#define T_If 280 +#define T_Else 281 +#define T_Return 282 +#define T_Break 283 +#define T_Continue 284 +#define T_Do 285 +#define T_Switch 286 +#define T_Case 287 +#define T_Default 288 +#define T_In 289 +#define T_Out 290 +#define T_Const 291 +#define T_Uniform 292 +#define T_LeftParen 293 +#define T_RightParen 294 +#define T_LeftBracket 295 +#define T_RightBracket 296 +#define T_LeftBrace 297 +#define T_RightBrace 298 +#define T_Dot 299 +#define T_Comma 300 +#define T_Colon 301 +#define T_Semicolon 302 +#define T_Question 303 +#define T_LessEqual 304 +#define T_GreaterEqual 305 +#define T_EQ 306 +#define T_NE 307 +#define T_And 308 +#define T_Or 309 +#define T_Plus 310 +#define T_Star 311 +#define T_MulAssign 312 +#define T_DivAssign 313 +#define T_AddAssign 314 +#define T_SubAssign 315 +#define T_Equal 316 +#define T_LeftAngle 317 +#define T_RightAngle 318 +#define T_Dash 319 +#define T_Slash 320 +#define T_Inc 321 +#define T_Dec 322 +#define T_Identifier 323 +#define T_IntConstant 324 +#define T_FloatConstant 325 +#define T_BoolConstant 326 +#define T_FieldSelection 327 +#define LOWEST 328 +#define LOWER_THAN_ELSE 329 + + + + +/* Copy the first part of user declarations. */ +#line 11 "parser.y" + + +/* Just like lex, the text within this first region delimited by %{ and %} + * is assumed to be C/C++ code and will be copied verbatim to the y.tab.c + * file ahead of the definitions of the yyparse() function. Add other header + * file inclusions or C++ variable declarations/prototypes that are needed + * by your code here. + */ +#include "scanner.h" // for yylex +#include "parser.h" +#include "errors.h" + +void yyerror(const char *msg); // standard error-handling routine + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 41 "parser.y" +{ + int integerConstant; + bool boolConstant; + double floatConstant; + char identifier[MaxIdentLen+1]; // +1 for terminating null + Decl *decl; + FnDecl *funcDecl; + List *declList; + Type *typeDecl; + TypeQualifier *typeQualifier; + Expr *expression; + VarDecl *varDecl; + List *varDeclList; + List *stmtList; + Stmt *stmt; + Operator *ops; + Identifier *funcId; + List *argList; +} +/* Line 193 of yacc.c. */ +#line 280 "y.tab.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +} YYLTYPE; +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + + +/* Copy the second part of user declarations. */ + + +/* Line 216 of yacc.c. */ +#line 305 "y.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + YYLTYPE yyls; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 23 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 386 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 75 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 37 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 109 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 192 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 329 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 8, 10, 12, 15, 18, 21, + 26, 32, 34, 38, 41, 45, 50, 56, 62, 69, + 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, + 91, 93, 95, 97, 99, 102, 106, 108, 111, 113, + 115, 117, 120, 123, 125, 127, 129, 131, 133, 135, + 143, 149, 157, 162, 166, 169, 172, 175, 179, 185, + 195, 197, 199, 201, 203, 207, 210, 213, 217, 220, + 224, 226, 230, 232, 234, 239, 241, 244, 247, 251, + 253, 256, 259, 262, 265, 267, 271, 275, 277, 281, + 285, 287, 291, 295, 299, 303, 305, 309, 313, 315, + 319, 321, 325, 327, 333, 337, 339, 341, 343, 345 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 76, 0, -1, 77, -1, 77, 78, -1, 78, -1, + 79, -1, 80, 86, -1, 80, 47, -1, 82, 47, + -1, 85, 68, 38, 39, -1, 85, 68, 38, 81, + 39, -1, 82, -1, 81, 45, 82, -1, 85, 68, + -1, 84, 85, 68, -1, 85, 68, 61, 83, -1, + 84, 85, 68, 61, 83, -1, 85, 68, 40, 69, + 41, -1, 84, 85, 68, 40, 69, 41, -1, 110, + -1, 34, -1, 35, -1, 36, -1, 37, -1, 5, + -1, 3, -1, 6, -1, 4, -1, 17, -1, 18, + -1, 19, -1, 20, -1, 21, -1, 22, -1, 42, + 43, -1, 42, 87, 43, -1, 88, -1, 87, 88, + -1, 86, -1, 89, -1, 47, -1, 82, 47, -1, + 110, 47, -1, 90, -1, 91, -1, 92, -1, 93, + -1, 94, -1, 95, -1, 25, 38, 110, 39, 88, + 26, 88, -1, 25, 38, 110, 39, 88, -1, 31, + 38, 110, 39, 42, 87, 43, -1, 32, 110, 46, + 88, -1, 33, 46, 88, -1, 28, 47, -1, 29, + 47, -1, 27, 47, -1, 27, 110, 47, -1, 23, + 38, 110, 39, 88, -1, 24, 38, 110, 47, 110, + 47, 110, 39, 88, -1, 68, -1, 69, -1, 70, + -1, 71, -1, 38, 110, 39, -1, 99, 39, -1, + 98, 39, -1, 101, 38, 3, -1, 101, 38, -1, + 101, 38, 100, -1, 110, -1, 100, 45, 110, -1, + 68, -1, 96, -1, 102, 40, 110, 41, -1, 97, + -1, 102, 66, -1, 102, 67, -1, 102, 44, 72, + -1, 102, -1, 66, 103, -1, 67, 103, -1, 55, + 103, -1, 64, 103, -1, 103, -1, 104, 56, 103, + -1, 104, 65, 103, -1, 104, -1, 105, 55, 104, + -1, 105, 64, 104, -1, 105, -1, 106, 62, 105, + -1, 106, 63, 105, -1, 106, 50, 105, -1, 106, + 49, 105, -1, 106, -1, 107, 51, 106, -1, 107, + 52, 106, -1, 107, -1, 108, 53, 107, -1, 108, + -1, 109, 54, 108, -1, 109, -1, 109, 48, 109, + 46, 109, -1, 103, 111, 110, -1, 61, -1, 59, + -1, 60, -1, 57, -1, 58, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 135, 135, 151, 152, 163, 164, 175, 176, 179, + 185, 192, 193, 196, 201, 206, 212, 217, 222, 230, + 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 251, 252, 255, 256, 259, 260, + 263, 264, 268, 269, 270, 271, 272, 273, 274, 277, + 281, 287, 292, 293, 296, 297, 298, 299, 302, 305, + 311, 314, 315, 316, 317, 320, 321, 324, 325, 328, + 331, 332, 335, 338, 339, 340, 343, 348, 353, 360, + 361, 366, 371, 376, 383, 384, 389, 396, 397, 402, + 409, 410, 415, 420, 425, 432, 433, 438, 445, 446, + 453, 454, 461, 462, 466, 472, 473, 474, 475, 476 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "T_Void", "T_Bool", "T_Int", "T_Float", + "T_Uint", "T_Bvec2", "T_Bvec3", "T_Bvec4", "T_Ivec2", "T_Ivec3", + "T_Ivec4", "T_Uvec2", "T_Uvec3", "T_Uvec4", "T_Vec2", "T_Vec3", "T_Vec4", + "T_Mat2", "T_Mat3", "T_Mat4", "T_While", "T_For", "T_If", "T_Else", + "T_Return", "T_Break", "T_Continue", "T_Do", "T_Switch", "T_Case", + "T_Default", "T_In", "T_Out", "T_Const", "T_Uniform", "T_LeftParen", + "T_RightParen", "T_LeftBracket", "T_RightBracket", "T_LeftBrace", + "T_RightBrace", "T_Dot", "T_Comma", "T_Colon", "T_Semicolon", + "T_Question", "T_LessEqual", "T_GreaterEqual", "T_EQ", "T_NE", "T_And", + "T_Or", "T_Plus", "T_Star", "T_MulAssign", "T_DivAssign", "T_AddAssign", + "T_SubAssign", "T_Equal", "T_LeftAngle", "T_RightAngle", "T_Dash", + "T_Slash", "T_Inc", "T_Dec", "T_Identifier", "T_IntConstant", + "T_FloatConstant", "T_BoolConstant", "T_FieldSelection", "LOWEST", + "LOWER_THAN_ELSE", "$accept", "Program", "DeclList", "Decl", + "Declaration", "FuncDecl", "ParameterList", "SingleDecl", "Initializer", + "TypeQualify", "TypeDecl", "CompoundStatement", "StatementList", + "Statement", "SingleStatement", "SelectionStmt", "SwitchStmt", + "CaseStmt", "JumpStmt", "WhileStmt", "ForStmt", "PrimaryExpr", + "FunctionCallExpr", "FunctionCallHeaderNoParameters", + "FunctionCallHeaderWithParameters", "ArgumentList", "FunctionIdentifier", + "PostfixExpr", "UnaryExpr", "MultiExpr", "AdditionExpr", "RelationExpr", + "EqualityExpr", "LogicAndExpr", "LogicOrExpr", "Expression", "AssignOp", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 75, 76, 77, 77, 78, 78, 79, 79, 80, + 80, 81, 81, 82, 82, 82, 82, 82, 82, 83, + 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 86, 86, 87, 87, 88, 88, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 90, + 90, 91, 92, 92, 93, 93, 93, 93, 94, 95, + 96, 96, 96, 96, 96, 97, 97, 98, 98, 99, + 100, 100, 101, 102, 102, 102, 102, 102, 102, 103, + 103, 103, 103, 103, 104, 104, 104, 105, 105, 105, + 106, 106, 106, 106, 106, 107, 107, 107, 108, 108, + 109, 109, 110, 110, 110, 111, 111, 111, 111, 111 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 2, 1, 1, 2, 2, 2, 4, + 5, 1, 3, 2, 3, 4, 5, 5, 6, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 3, 1, 2, 1, 1, + 1, 2, 2, 1, 1, 1, 1, 1, 1, 7, + 5, 7, 4, 3, 2, 2, 2, 3, 5, 9, + 1, 1, 1, 1, 3, 2, 2, 3, 2, 3, + 1, 3, 1, 1, 4, 1, 2, 2, 3, 1, + 2, 2, 2, 2, 1, 3, 3, 1, 3, 3, + 1, 3, 3, 3, 3, 1, 3, 3, 1, 3, + 1, 3, 1, 5, 3, 1, 1, 1, 1, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 25, 27, 24, 26, 28, 29, 30, 31, 32, + 33, 20, 21, 22, 23, 0, 2, 4, 5, 0, + 0, 0, 0, 1, 3, 0, 7, 6, 8, 0, + 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 34, 40, 0, 0, 0, 0, 60, 61, 62, + 63, 0, 0, 38, 0, 36, 39, 43, 44, 45, + 46, 47, 48, 73, 75, 0, 0, 0, 79, 84, + 87, 90, 95, 98, 100, 102, 0, 14, 0, 0, + 0, 0, 0, 0, 56, 0, 54, 55, 0, 0, + 0, 0, 82, 83, 80, 81, 41, 13, 35, 37, + 66, 65, 68, 0, 0, 76, 77, 108, 109, 106, + 107, 105, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 42, 0, 0, 9, + 0, 11, 0, 15, 19, 0, 0, 0, 57, 0, + 0, 53, 64, 67, 69, 70, 0, 78, 104, 85, + 86, 84, 88, 89, 94, 93, 91, 92, 96, 97, + 99, 0, 101, 0, 16, 10, 0, 17, 0, 0, + 0, 0, 52, 0, 74, 0, 18, 12, 58, 0, + 50, 0, 71, 103, 0, 0, 0, 0, 49, 51, + 0, 59 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 15, 16, 17, 18, 19, 130, 51, 133, 21, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 144, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 112 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -119 +static const yytype_int16 yypact[] = +{ + 107, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, 12, 107, -119, -119, 21, + -5, 355, -12, -119, -119, 150, -119, -119, -119, 13, + -30, 76, 79, 92, -34, 46, 85, 97, 93, 91, + 93, -119, -119, 93, 93, 93, 93, 101, -119, -119, + -119, 100, 82, -119, 205, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, 110, 113, 127, -26, 62, + -45, -2, 2, -6, 123, -39, 133, -37, 55, 120, + 93, 93, 93, 93, -119, 143, -119, -119, 93, 145, + 315, 155, -119, -119, -119, -119, -119, -18, -119, -119, + -119, -119, 16, 93, 124, -119, -119, -119, -119, -119, + -119, -119, 93, 93, 93, 93, 93, 93, 93, 93, + 93, 93, 93, 93, 93, 93, -119, 126, 93, -119, + 70, -119, 161, -119, -119, 164, 157, 167, -119, 168, + 315, -119, -119, -119, 170, -119, 171, -119, -119, -119, + -119, -119, -45, -45, -2, -2, -2, -2, 2, 2, + -6, -29, 123, 172, -119, -119, 107, -119, 315, 93, + 315, 189, -119, 93, -119, 93, -119, -119, -119, 188, + 218, 315, -119, 191, 93, 315, 260, 207, -119, -119, + 315, -119 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -119, -119, -119, 233, -119, -119, -119, 0, 122, -119, + 23, 232, 72, -52, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -17, -49, + 81, 24, 131, 130, -118, -33, -119 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -73 +static const yytype_int16 yytable[] = +{ + 20, 85, 99, 127, 40, 89, 161, 91, 78, 124, + 79, 113, 23, 84, 103, 125, 20, 175, 104, 143, + 114, 43, 79, 22, 128, 125, 92, 93, 94, 95, + 44, 80, 45, 46, 47, 48, 49, 50, 141, 22, + 105, 106, 28, 80, 29, 121, 122, 134, 135, 136, + 137, 117, 118, 115, 40, 139, 30, 183, 1, 2, + 3, 4, 116, 25, 119, 120, 152, 153, 26, 145, + 146, 43, 5, 6, 7, 8, 9, 10, 131, 148, + 44, 77, 45, 46, 47, 48, 49, 50, 172, 11, + 12, 13, 14, 86, 129, 134, 149, 150, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 165, + 1, 2, 3, 4, 81, 166, 178, 82, 180, 107, + 108, 109, 110, 111, 5, 6, 7, 8, 9, 10, + 83, 40, 87, 188, 99, 88, 179, 90, 191, -72, + 182, 11, 12, 13, 14, 158, 159, 96, 43, 100, + 97, 187, 101, 1, 2, 3, 4, 44, 151, 45, + 46, 47, 48, 49, 50, 102, 177, 5, 6, 7, + 8, 9, 10, 31, 32, 33, 123, 34, 35, 36, + 126, 37, 38, 39, 11, 12, 13, 14, 40, 132, + 138, 140, 25, 41, 142, 163, 147, 42, 154, 155, + 156, 157, 167, 168, 169, 43, 170, 171, 1, 2, + 3, 4, 174, 176, 44, 173, 45, 46, 47, 48, + 49, 50, 5, 6, 7, 8, 9, 10, 31, 32, + 33, 181, 34, 35, 36, 184, 37, 38, 39, 11, + 12, 13, 14, 40, 185, 125, 190, 25, 98, 24, + 164, 27, 42, 186, 160, 162, 0, 0, 0, 0, + 43, 0, 0, 1, 2, 3, 4, 0, 0, 44, + 0, 45, 46, 47, 48, 49, 50, 5, 6, 7, + 8, 9, 10, 31, 32, 33, 0, 34, 35, 36, + 0, 37, 38, 39, 11, 12, 13, 14, 40, 0, + 0, 0, 25, 189, 0, 0, 0, 42, 0, 0, + 0, 0, 0, 0, 0, 43, 0, 0, 1, 2, + 3, 4, 0, 0, 44, 0, 45, 46, 47, 48, + 49, 50, 5, 6, 7, 8, 9, 10, 31, 32, + 33, 0, 34, 35, 36, 0, 37, 38, 39, 11, + 12, 13, 14, 40, 0, 0, 0, 25, 1, 2, + 3, 4, 42, 0, 0, 0, 0, 0, 0, 0, + 43, 0, 5, 6, 7, 8, 9, 10, 0, 44, + 0, 45, 46, 47, 48, 49, 50 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 34, 54, 40, 38, 38, 124, 40, 38, 48, + 40, 56, 0, 47, 40, 54, 16, 46, 44, 3, + 65, 55, 40, 0, 61, 54, 43, 44, 45, 46, + 64, 61, 66, 67, 68, 69, 70, 71, 90, 16, + 66, 67, 47, 61, 21, 51, 52, 80, 81, 82, + 83, 49, 50, 55, 38, 88, 68, 175, 3, 4, + 5, 6, 64, 42, 62, 63, 115, 116, 47, 102, + 103, 55, 17, 18, 19, 20, 21, 22, 78, 112, + 64, 68, 66, 67, 68, 69, 70, 71, 140, 34, + 35, 36, 37, 47, 39, 128, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 39, + 3, 4, 5, 6, 38, 45, 168, 38, 170, 57, + 58, 59, 60, 61, 17, 18, 19, 20, 21, 22, + 38, 38, 47, 185, 186, 38, 169, 46, 190, 38, + 173, 34, 35, 36, 37, 121, 122, 47, 55, 39, + 68, 184, 39, 3, 4, 5, 6, 64, 175, 66, + 67, 68, 69, 70, 71, 38, 166, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 53, 27, 28, 29, + 47, 31, 32, 33, 34, 35, 36, 37, 38, 69, + 47, 46, 42, 43, 39, 69, 72, 47, 117, 118, + 119, 120, 41, 39, 47, 55, 39, 39, 3, 4, + 5, 6, 41, 41, 64, 45, 66, 67, 68, 69, + 70, 71, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 42, 27, 28, 29, 47, 31, 32, 33, 34, + 35, 36, 37, 38, 26, 54, 39, 42, 43, 16, + 128, 19, 47, 181, 123, 125, -1, -1, -1, -1, + 55, -1, -1, 3, 4, 5, 6, -1, -1, 64, + -1, 66, 67, 68, 69, 70, 71, 17, 18, 19, + 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, + -1, 31, 32, 33, 34, 35, 36, 37, 38, -1, + -1, -1, 42, 43, -1, -1, -1, 47, -1, -1, + -1, -1, -1, -1, -1, 55, -1, -1, 3, 4, + 5, 6, -1, -1, 64, -1, 66, 67, 68, 69, + 70, 71, 17, 18, 19, 20, 21, 22, 23, 24, + 25, -1, 27, 28, 29, -1, 31, 32, 33, 34, + 35, 36, 37, 38, -1, -1, -1, 42, 3, 4, + 5, 6, 47, -1, -1, -1, -1, -1, -1, -1, + 55, -1, 17, 18, 19, 20, 21, 22, -1, 64, + -1, 66, 67, 68, 69, 70, 71 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 3, 4, 5, 6, 17, 18, 19, 20, 21, + 22, 34, 35, 36, 37, 76, 77, 78, 79, 80, + 82, 84, 85, 0, 78, 42, 47, 86, 47, 85, + 68, 23, 24, 25, 27, 28, 29, 31, 32, 33, + 38, 43, 47, 55, 64, 66, 67, 68, 69, 70, + 71, 82, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 68, 38, 40, + 61, 38, 38, 38, 47, 110, 47, 47, 38, 110, + 46, 110, 103, 103, 103, 103, 47, 68, 43, 88, + 39, 39, 38, 40, 44, 66, 67, 57, 58, 59, + 60, 61, 111, 56, 65, 55, 64, 49, 50, 62, + 63, 51, 52, 53, 48, 54, 47, 40, 61, 39, + 81, 82, 69, 83, 110, 110, 110, 110, 47, 110, + 46, 88, 39, 3, 100, 110, 110, 72, 110, 103, + 103, 103, 104, 104, 105, 105, 105, 105, 106, 106, + 107, 109, 108, 69, 83, 39, 45, 41, 39, 47, + 39, 39, 88, 45, 41, 46, 41, 82, 88, 110, + 88, 42, 110, 109, 47, 26, 87, 110, 88, 43, + 39, 88 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, Location); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + YYLTYPE const * const yylocationp; +#endif +{ + if (!yyvaluep) + return; + YYUSE (yylocationp); +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + YYLTYPE const * const yylocationp; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + YY_LOCATION_PRINT (yyoutput, *yylocationp); + YYFPRINTF (yyoutput, ": "); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yylsp, yyrule) + YYSTYPE *yyvsp; + YYLTYPE *yylsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) ); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, yylsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) +#else +static void +yydestruct (yymsg, yytype, yyvaluep, yylocationp) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; + YYLTYPE *yylocationp; +#endif +{ + YYUSE (yyvaluep); + YYUSE (yylocationp); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; +/* Location data for the look-ahead symbol. */ +YYLTYPE yylloc; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[2]; + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + yylsp = yyls; +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + /* Initialize the default location before parsing starts. */ + yylloc.first_line = yylloc.last_line = 1; + yylloc.first_column = yylloc.last_column = 0; +#endif + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); + yyls = yyls1; + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + YYSTACK_RELOCATE (yyls); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + yylsp = yyls + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + *++yylsp = yylloc; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 135 "parser.y" + { + (yylsp[(1) - (1)]); + /* pp2: The @1 is needed to convince + * yacc to set up yylloc. You can remove + * it once you have other uses of @n*/ + Program *program = new Program((yyvsp[(1) - (1)].declList)); + // if no errors, advance to next phase + if (ReportError::NumErrors() == 0) { + if ( IsDebugOn("dumpAST") ) { + program->Print(0); + } + program->Emit(); + } + } + break; + + case 3: +#line 151 "parser.y" + { ((yyval.declList)=(yyvsp[(1) - (2)].declList))->Append((yyvsp[(2) - (2)].decl)); } + break; + + case 4: +#line 152 "parser.y" + { ((yyval.declList) = new List)->Append((yyvsp[(1) - (1)].decl)); } + break; + + case 5: +#line 163 "parser.y" + { (yyval.decl) = (yyvsp[(1) - (1)].decl); } + break; + + case 6: +#line 164 "parser.y" + { (yyvsp[(1) - (2)].funcDecl)->SetFunctionBody((yyvsp[(2) - (2)].stmt)); (yyval.decl) = (yyvsp[(1) - (2)].funcDecl); } + break; + + case 7: +#line 175 "parser.y" + { (yyval.decl) = (yyvsp[(1) - (2)].funcDecl); } + break; + + case 8: +#line 176 "parser.y" + { (yyval.decl) = (yyvsp[(1) - (2)].varDecl); } + break; + + case 9: +#line 180 "parser.y" + { + Identifier *id = new Identifier(yylloc, (const char *)(yyvsp[(2) - (4)].identifier)); + List *formals = new List; + (yyval.funcDecl) = new FnDecl(id, (yyvsp[(1) - (4)].typeDecl), formals); + } + break; + + case 10: +#line 186 "parser.y" + { + Identifier *id = new Identifier(yylloc, (const char *)(yyvsp[(2) - (5)].identifier)); + (yyval.funcDecl) = new FnDecl(id, (yyvsp[(1) - (5)].typeDecl), (yyvsp[(4) - (5)].varDeclList)); + } + break; + + case 11: +#line 192 "parser.y" + { ((yyval.varDeclList) = new List)->Append((yyvsp[(1) - (1)].varDecl)); } + break; + + case 12: +#line 193 "parser.y" + { ((yyval.varDeclList) = (yyvsp[(1) - (3)].varDeclList))->Append((yyvsp[(3) - (3)].varDecl)); } + break; + + case 13: +#line 197 "parser.y" + { + Identifier *id = new Identifier(yylloc, (const char *)(yyvsp[(2) - (2)].identifier)); + (yyval.varDecl) = new VarDecl(id, (yyvsp[(1) - (2)].typeDecl)); + } + break; + + case 14: +#line 202 "parser.y" + { + Identifier *id = new Identifier(yylloc, (const char *)(yyvsp[(3) - (3)].identifier)); + (yyval.varDecl) = new VarDecl(id, (yyvsp[(2) - (3)].typeDecl), (yyvsp[(1) - (3)].typeQualifier)); + } + break; + + case 15: +#line 207 "parser.y" + { + // incomplete: drop the initializer here + Identifier *id = new Identifier(yylloc, (const char *)(yyvsp[(2) - (4)].identifier)); + (yyval.varDecl) = new VarDecl(id, (yyvsp[(1) - (4)].typeDecl), (yyvsp[(4) - (4)].expression)); + } + break; + + case 16: +#line 213 "parser.y" + { + Identifier *id = new Identifier(yylloc, (const char *)(yyvsp[(3) - (5)].identifier)); + (yyval.varDecl) = new VarDecl(id, (yyvsp[(2) - (5)].typeDecl), (yyvsp[(1) - (5)].typeQualifier), (yyvsp[(5) - (5)].expression)); + } + break; + + case 17: +#line 218 "parser.y" + { + Identifier *id = new Identifier((yylsp[(2) - (5)]), (const char *)(yyvsp[(2) - (5)].identifier)); + (yyval.varDecl) = new VarDecl(id, new ArrayType((yylsp[(1) - (5)]), (yyvsp[(1) - (5)].typeDecl), (yyvsp[(4) - (5)].integerConstant))); + } + break; + + case 18: +#line 223 "parser.y" + { + Identifier *id = new Identifier((yylsp[(3) - (6)]), (yyvsp[(3) - (6)].identifier)); + (yyval.varDecl) = new VarDecl(id, new ArrayType((yylsp[(2) - (6)]), (yyvsp[(2) - (6)].typeDecl), (yyvsp[(5) - (6)].integerConstant)), (yyvsp[(1) - (6)].typeQualifier)); + } + break; + + case 19: +#line 230 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 20: +#line 233 "parser.y" + {(yyval.typeQualifier) = TypeQualifier::inTypeQualifier;} + break; + + case 21: +#line 234 "parser.y" + {(yyval.typeQualifier) = TypeQualifier::outTypeQualifier;} + break; + + case 22: +#line 235 "parser.y" + {(yyval.typeQualifier) = TypeQualifier::constTypeQualifier;} + break; + + case 23: +#line 236 "parser.y" + {(yyval.typeQualifier) = TypeQualifier::uniformTypeQualifier;} + break; + + case 24: +#line 239 "parser.y" + { (yyval.typeDecl) = Type::intType; } + break; + + case 25: +#line 240 "parser.y" + { (yyval.typeDecl) = Type::voidType; } + break; + + case 26: +#line 241 "parser.y" + { (yyval.typeDecl) = Type::floatType; } + break; + + case 27: +#line 242 "parser.y" + { (yyval.typeDecl) = Type::boolType; } + break; + + case 28: +#line 243 "parser.y" + { (yyval.typeDecl) = Type::vec2Type; } + break; + + case 29: +#line 244 "parser.y" + { (yyval.typeDecl) = Type::vec3Type; } + break; + + case 30: +#line 245 "parser.y" + { (yyval.typeDecl) = Type::vec4Type; } + break; + + case 31: +#line 246 "parser.y" + { (yyval.typeDecl) = Type::mat2Type; } + break; + + case 32: +#line 247 "parser.y" + { (yyval.typeDecl) = Type::mat3Type; } + break; + + case 33: +#line 248 "parser.y" + { (yyval.typeDecl) = Type::mat4Type; } + break; + + case 34: +#line 251 "parser.y" + { (yyval.stmt) = new StmtBlock(new List, new List); } + break; + + case 35: +#line 252 "parser.y" + { (yyval.stmt) = new StmtBlock(new List, (yyvsp[(2) - (3)].stmtList)); } + break; + + case 36: +#line 255 "parser.y" + { ((yyval.stmtList) = new List)->Append((yyvsp[(1) - (1)].stmt)); } + break; + + case 37: +#line 256 "parser.y" + { ((yyval.stmtList) = (yyvsp[(1) - (2)].stmtList))->Append((yyvsp[(2) - (2)].stmt)); } + break; + + case 38: +#line 259 "parser.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } + break; + + case 39: +#line 260 "parser.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } + break; + + case 40: +#line 263 "parser.y" + { (yyval.stmt) = new EmptyExpr(); } + break; + + case 41: +#line 265 "parser.y" + { + (yyval.stmt) = new DeclStmt((yyvsp[(1) - (2)].varDecl)); + } + break; + + case 42: +#line 268 "parser.y" + { (yyval.stmt) = (yyvsp[(1) - (2)].expression); } + break; + + case 43: +#line 269 "parser.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } + break; + + case 44: +#line 270 "parser.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } + break; + + case 45: +#line 271 "parser.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } + break; + + case 46: +#line 272 "parser.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } + break; + + case 47: +#line 273 "parser.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } + break; + + case 48: +#line 274 "parser.y" + { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } + break; + + case 49: +#line 278 "parser.y" + { + (yyval.stmt) = new IfStmt((yyvsp[(3) - (7)].expression), (yyvsp[(5) - (7)].stmt), (yyvsp[(7) - (7)].stmt)); + } + break; + + case 50: +#line 282 "parser.y" + { + (yyval.stmt) = new IfStmt((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].stmt), NULL); + } + break; + + case 51: +#line 288 "parser.y" + { + (yyval.stmt) = new SwitchStmt((yyvsp[(3) - (7)].expression), (yyvsp[(6) - (7)].stmtList), NULL); + } + break; + + case 52: +#line 292 "parser.y" + { (yyval.stmt) = new Case((yyvsp[(2) - (4)].expression), (yyvsp[(4) - (4)].stmt)); } + break; + + case 53: +#line 293 "parser.y" + { (yyval.stmt) = new Default((yyvsp[(3) - (3)].stmt)); } + break; + + case 54: +#line 296 "parser.y" + { (yyval.stmt) = new BreakStmt(yylloc); } + break; + + case 55: +#line 297 "parser.y" + { (yyval.stmt) = new ContinueStmt(yylloc); } + break; + + case 56: +#line 298 "parser.y" + { (yyval.stmt) = new ReturnStmt(yylloc); } + break; + + case 57: +#line 299 "parser.y" + { (yyval.stmt) = new ReturnStmt(yyloc, (yyvsp[(2) - (3)].expression)); } + break; + + case 58: +#line 302 "parser.y" + { (yyval.stmt) = new WhileStmt((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].stmt)); } + break; + + case 59: +#line 306 "parser.y" + { + (yyval.stmt) = new ForStmt((yyvsp[(3) - (9)].expression), (yyvsp[(5) - (9)].expression), (yyvsp[(7) - (9)].expression), (yyvsp[(9) - (9)].stmt)); + } + break; + + case 60: +#line 311 "parser.y" + { Identifier *id = new Identifier(yylloc, (const char*)(yyvsp[(1) - (1)].identifier)); + (yyval.expression) = new VarExpr(yyloc, id); + } + break; + + case 61: +#line 314 "parser.y" + { (yyval.expression) = new IntConstant(yylloc, (yyvsp[(1) - (1)].integerConstant)); } + break; + + case 62: +#line 315 "parser.y" + { (yyval.expression) = new FloatConstant(yylloc, (yyvsp[(1) - (1)].floatConstant)); } + break; + + case 63: +#line 316 "parser.y" + { (yyval.expression) = new BoolConstant(yylloc, (yyvsp[(1) - (1)].boolConstant)); } + break; + + case 64: +#line 317 "parser.y" + { (yyval.expression) = (yyvsp[(2) - (3)].expression);} + break; + + case 65: +#line 320 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (2)].expression); } + break; + + case 66: +#line 321 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (2)].expression); } + break; + + case 67: +#line 324 "parser.y" + { (yyval.expression) = new Call((yylsp[(1) - (3)]), NULL, (yyvsp[(1) - (3)].funcId), new List); } + break; + + case 68: +#line 325 "parser.y" + { (yyval.expression) = new Call((yylsp[(1) - (2)]), NULL, (yyvsp[(1) - (2)].funcId), new List); } + break; + + case 69: +#line 328 "parser.y" + { (yyval.expression) = new Call((yylsp[(1) - (3)]), NULL, (yyvsp[(1) - (3)].funcId), (yyvsp[(3) - (3)].argList));} + break; + + case 70: +#line 331 "parser.y" + { ((yyval.argList) = new List)->Append((yyvsp[(1) - (1)].expression));} + break; + + case 71: +#line 332 "parser.y" + { ((yyval.argList) = (yyvsp[(1) - (3)].argList))->Append((yyvsp[(3) - (3)].expression));} + break; + + case 72: +#line 335 "parser.y" + { (yyval.funcId) = new Identifier((yylsp[(1) - (1)]), (yyvsp[(1) - (1)].identifier)); } + break; + + case 73: +#line 338 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 74: +#line 339 "parser.y" + { (yyval.expression) = new ArrayAccess((yylsp[(1) - (4)]), (yyvsp[(1) - (4)].expression), (yyvsp[(3) - (4)].expression)); } + break; + + case 75: +#line 341 "parser.y" + { + } + break; + + case 76: +#line 344 "parser.y" + { + Operator *op = new Operator(yylloc, (const char *)(yyvsp[(2) - (2)].identifier)); + (yyval.expression) = new PostfixExpr((yyvsp[(1) - (2)].expression), op); + } + break; + + case 77: +#line 349 "parser.y" + { + Operator *op = new Operator(yylloc, (const char *)(yyvsp[(2) - (2)].identifier)); + (yyval.expression) = new PostfixExpr((yyvsp[(1) - (2)].expression), op); + } + break; + + case 78: +#line 354 "parser.y" + { + Identifier *id = new Identifier(yylloc, (const char *)(yyvsp[(3) - (3)].identifier)); + (yyval.expression) = new FieldAccess((yyvsp[(1) - (3)].expression), id); + } + break; + + case 79: +#line 360 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 80: +#line 362 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(1) - (2)].identifier)); + (yyval.expression) = new ArithmeticExpr(op, (yyvsp[(2) - (2)].expression)); + } + break; + + case 81: +#line 367 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(1) - (2)].identifier)); + (yyval.expression) = new ArithmeticExpr(op, (yyvsp[(2) - (2)].expression)); + } + break; + + case 82: +#line 372 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(1) - (2)].identifier)); + (yyval.expression) = new ArithmeticExpr(op, (yyvsp[(2) - (2)].expression)); + } + break; + + case 83: +#line 377 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(1) - (2)].identifier)); + (yyval.expression) = new ArithmeticExpr(op, (yyvsp[(2) - (2)].expression)); + } + break; + + case 84: +#line 383 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 85: +#line 385 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new ArithmeticExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 86: +#line 390 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new ArithmeticExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 87: +#line 396 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 88: +#line 398 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new ArithmeticExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 89: +#line 403 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new ArithmeticExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 90: +#line 409 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 91: +#line 411 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new RelationalExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 92: +#line 416 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new RelationalExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 93: +#line 421 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new RelationalExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 94: +#line 426 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new RelationalExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 95: +#line 432 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 96: +#line 434 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new ArithmeticExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 97: +#line 439 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new ArithmeticExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 98: +#line 445 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 99: +#line 447 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new ArithmeticExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 100: +#line 453 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 101: +#line 455 "parser.y" + { + Operator *op = new Operator(yylloc, (yyvsp[(2) - (3)].identifier)); + (yyval.expression) = new ArithmeticExpr((yyvsp[(1) - (3)].expression), op, (yyvsp[(3) - (3)].expression)); + } + break; + + case 102: +#line 461 "parser.y" + { (yyval.expression) = (yyvsp[(1) - (1)].expression); } + break; + + case 103: +#line 463 "parser.y" + { + (yyval.expression) = new ConditionalExpr((yyvsp[(1) - (5)].expression), (yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].expression)); + } + break; + + case 104: +#line 467 "parser.y" + { + (yyval.expression) = new AssignExpr((yyvsp[(1) - (3)].expression), (yyvsp[(2) - (3)].ops), (yyvsp[(3) - (3)].expression)); + } + break; + + case 105: +#line 472 "parser.y" + { (yyval.ops) = new Operator(yylloc, (yyvsp[(1) - (1)].identifier)); } + break; + + case 106: +#line 473 "parser.y" + { (yyval.ops) = new Operator(yylloc, "+="); } + break; + + case 107: +#line 474 "parser.y" + { (yyval.ops) = new Operator(yylloc, "-="); } + break; + + case 108: +#line 475 "parser.y" + { (yyval.ops) = new Operator(yylloc, "*="); } + break; + + case 109: +#line 476 "parser.y" + { (yyval.ops) = new Operator(yylloc, "/="); } + break; + + +/* Line 1267 of yacc.c. */ +#line 2408 "y.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + *++yylsp = yyloc; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + yyerror_range[0] = yylloc; + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + yyerror_range[0] = yylsp[1-yylen]; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + yyerror_range[0] = *yylsp; + yydestruct ("Error: popping", + yystos[yystate], yyvsp, yylsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + yyerror_range[1] = yylloc; + /* Using YYLLOC is tempting, but would change the location of + the look-ahead. YYLOC is available though. */ + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); + *++yylsp = yyloc; + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp, yylsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +#line 479 "parser.y" + + +/* The closing %% above marks the end of the Rules section and the beginning + * of the User Subroutines section. All text from here to the end of the + * file is copied verbatim to the end of the generated y.tab.c file. + * This section is where you put definitions of helper functions. + */ + +/* Function: InitParser + * -------------------- + * This function will be called before any calls to yyparse(). It is designed + * to give you an opportunity to do anything that must be done to initialize + * the parser (set global variables, configure starting state, etc.). One + * thing it already does for you is assign the value of the global variable + * yydebug that controls whether yacc prints debugging information about + * parser actions (shift/reduce) and contents of state stack during parser. + * If set to false, no information is printed. Setting it to true will give + * you a running trail that might be helpful when debugging your parser. + * Please be sure the variable is set to false when submitting your final + * version. + */ +void InitParser() +{ + PrintDebug("parser", "Initializing parser"); + yydebug = false; +} + diff --git a/y.tab.h b/y.tab.h new file mode 100644 index 0000000..5c801c4 --- /dev/null +++ b/y.tab.h @@ -0,0 +1,238 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + T_Void = 258, + T_Bool = 259, + T_Int = 260, + T_Float = 261, + T_Uint = 262, + T_Bvec2 = 263, + T_Bvec3 = 264, + T_Bvec4 = 265, + T_Ivec2 = 266, + T_Ivec3 = 267, + T_Ivec4 = 268, + T_Uvec2 = 269, + T_Uvec3 = 270, + T_Uvec4 = 271, + T_Vec2 = 272, + T_Vec3 = 273, + T_Vec4 = 274, + T_Mat2 = 275, + T_Mat3 = 276, + T_Mat4 = 277, + T_While = 278, + T_For = 279, + T_If = 280, + T_Else = 281, + T_Return = 282, + T_Break = 283, + T_Continue = 284, + T_Do = 285, + T_Switch = 286, + T_Case = 287, + T_Default = 288, + T_In = 289, + T_Out = 290, + T_Const = 291, + T_Uniform = 292, + T_LeftParen = 293, + T_RightParen = 294, + T_LeftBracket = 295, + T_RightBracket = 296, + T_LeftBrace = 297, + T_RightBrace = 298, + T_Dot = 299, + T_Comma = 300, + T_Colon = 301, + T_Semicolon = 302, + T_Question = 303, + T_LessEqual = 304, + T_GreaterEqual = 305, + T_EQ = 306, + T_NE = 307, + T_And = 308, + T_Or = 309, + T_Plus = 310, + T_Star = 311, + T_MulAssign = 312, + T_DivAssign = 313, + T_AddAssign = 314, + T_SubAssign = 315, + T_Equal = 316, + T_LeftAngle = 317, + T_RightAngle = 318, + T_Dash = 319, + T_Slash = 320, + T_Inc = 321, + T_Dec = 322, + T_Identifier = 323, + T_IntConstant = 324, + T_FloatConstant = 325, + T_BoolConstant = 326, + T_FieldSelection = 327, + LOWEST = 328, + LOWER_THAN_ELSE = 329 + }; +#endif +/* Tokens. */ +#define T_Void 258 +#define T_Bool 259 +#define T_Int 260 +#define T_Float 261 +#define T_Uint 262 +#define T_Bvec2 263 +#define T_Bvec3 264 +#define T_Bvec4 265 +#define T_Ivec2 266 +#define T_Ivec3 267 +#define T_Ivec4 268 +#define T_Uvec2 269 +#define T_Uvec3 270 +#define T_Uvec4 271 +#define T_Vec2 272 +#define T_Vec3 273 +#define T_Vec4 274 +#define T_Mat2 275 +#define T_Mat3 276 +#define T_Mat4 277 +#define T_While 278 +#define T_For 279 +#define T_If 280 +#define T_Else 281 +#define T_Return 282 +#define T_Break 283 +#define T_Continue 284 +#define T_Do 285 +#define T_Switch 286 +#define T_Case 287 +#define T_Default 288 +#define T_In 289 +#define T_Out 290 +#define T_Const 291 +#define T_Uniform 292 +#define T_LeftParen 293 +#define T_RightParen 294 +#define T_LeftBracket 295 +#define T_RightBracket 296 +#define T_LeftBrace 297 +#define T_RightBrace 298 +#define T_Dot 299 +#define T_Comma 300 +#define T_Colon 301 +#define T_Semicolon 302 +#define T_Question 303 +#define T_LessEqual 304 +#define T_GreaterEqual 305 +#define T_EQ 306 +#define T_NE 307 +#define T_And 308 +#define T_Or 309 +#define T_Plus 310 +#define T_Star 311 +#define T_MulAssign 312 +#define T_DivAssign 313 +#define T_AddAssign 314 +#define T_SubAssign 315 +#define T_Equal 316 +#define T_LeftAngle 317 +#define T_RightAngle 318 +#define T_Dash 319 +#define T_Slash 320 +#define T_Inc 321 +#define T_Dec 322 +#define T_Identifier 323 +#define T_IntConstant 324 +#define T_FloatConstant 325 +#define T_BoolConstant 326 +#define T_FieldSelection 327 +#define LOWEST 328 +#define LOWER_THAN_ELSE 329 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 41 "parser.y" +{ + int integerConstant; + bool boolConstant; + double floatConstant; + char identifier[MaxIdentLen+1]; // +1 for terminating null + Decl *decl; + FnDecl *funcDecl; + List *declList; + Type *typeDecl; + TypeQualifier *typeQualifier; + Expr *expression; + VarDecl *varDecl; + List *varDeclList; + List *stmtList; + Stmt *stmt; + Operator *ops; + Identifier *funcId; + List *argList; +} +/* Line 1529 of yacc.c. */ +#line 217 "y.tab.h" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + +extern YYSTYPE yylval; + +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +} YYLTYPE; +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + +extern YYLTYPE yylloc;