From 291cf2ed3a00afba7d848d59bb045004347c98e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Sun, 30 Sep 2018 11:52:22 +0200 Subject: [PATCH] fixed reduce-reduce conflicts --- .../PascalABCParserNewSaushkin/ABCPascal.cs | 6 +- .../PascalABCParserNewSaushkin/ABCPascal.y | 2 - .../ABCPascalYacc.cs | 502 +++++++++--------- 3 files changed, 252 insertions(+), 258 deletions(-) diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index 3638c63d2..b733926e6 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -1,9 +1,9 @@ // // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 -// Machine: DESKTOP-A6LT9RI -// DateTime: 25.09.2018 22:16:16 -// UserName: ????????? +// Machine: IVAN-PC +// DateTime: 30.09.2018 11:51:35 +// UserName: Ivan // GPLEX input file // GPLEX frame file // diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index fdd510c17..873932071 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -4144,8 +4144,6 @@ keyword { $$ = $1; } | tkMatch { $$ = $1; } - | tkStatic - { $$ = $1; } | tkWhen { $$ = $1; }/* | tkInstance diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 1cca5cbd1..4b21fee0d 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -1,9 +1,9 @@ // (see accompanying GPPGcopyright.rtf) // GPPG version 1.3.6 -// Machine: DESKTOP-A6LT9RI -// DateTime: 25.09.2018 22:16:17 -// UserName: ????????? +// Machine: IVAN-PC +// DateTime: 30.09.2018 11:51:36 +// UserName: Ivan // Input file // options: no-lines gplex @@ -74,7 +74,7 @@ public partial class GPPGParser: ShiftReduceParser aliasses; #pragma warning restore 649 - private static Rule[] rules = new Rule[897]; + private static Rule[] rules = new Rule[896]; private static State[] states = new State[1471]; private static string[] nonTerms = new string[] { "parse_goal", "unit_key_word", "class_or_static", "assignment", "optional_array_initializer", @@ -265,10 +265,10 @@ public partial class GPPGParser: ShiftReduceParser tkMatch { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 818: // keyword -> tkStatic + case 818: // keyword -> tkWhen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 819: // keyword -> tkWhen + case 819: // reserved_keyword -> tkOperator { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 820: // reserved_keyword -> tkOperator + case 820: // reserved_keyword -> tkEnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 821: // reserved_keyword -> tkEnd -{ CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } - break; - case 822: // overload_operator -> tkMinus + case 821: // overload_operator -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 823: // overload_operator -> tkPlus + case 822: // overload_operator -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 824: // overload_operator -> tkSlash + case 823: // overload_operator -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 825: // overload_operator -> tkStar + case 824: // overload_operator -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 826: // overload_operator -> tkEqual + case 825: // overload_operator -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 827: // overload_operator -> tkGreater + case 826: // overload_operator -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 828: // overload_operator -> tkGreaterEqual + case 827: // overload_operator -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 829: // overload_operator -> tkLower + case 828: // overload_operator -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 830: // overload_operator -> tkLowerEqual + case 829: // overload_operator -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 831: // overload_operator -> tkNotEqual + case 830: // overload_operator -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 832: // overload_operator -> tkOr + case 831: // overload_operator -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 833: // overload_operator -> tkXor + case 832: // overload_operator -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 834: // overload_operator -> tkAnd + case 833: // overload_operator -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 835: // overload_operator -> tkDiv + case 834: // overload_operator -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 836: // overload_operator -> tkMod + case 835: // overload_operator -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 837: // overload_operator -> tkShl + case 836: // overload_operator -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 838: // overload_operator -> tkShr + case 837: // overload_operator -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 839: // overload_operator -> tkNot + case 838: // overload_operator -> tkNot { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 840: // overload_operator -> tkIn + case 839: // overload_operator -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 841: // overload_operator -> tkImplicit + case 840: // overload_operator -> tkImplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 842: // overload_operator -> tkExplicit + case 841: // overload_operator -> tkExplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 843: // overload_operator -> assign_operator + case 842: // overload_operator -> assign_operator { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 844: // overload_operator -> tkStarStar + case 843: // overload_operator -> tkStarStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 845: // assign_operator -> tkAssign + case 844: // assign_operator -> tkAssign { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 846: // assign_operator -> tkPlusEqual + case 845: // assign_operator -> tkPlusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 847: // assign_operator -> tkMinusEqual + case 846: // assign_operator -> tkMinusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 848: // assign_operator -> tkMultEqual + case 847: // assign_operator -> tkMultEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 849: // assign_operator -> tkDivEqual + case 848: // assign_operator -> tkDivEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 850: // func_decl_lambda -> identifier, tkArrow, lambda_function_body + case 849: // func_decl_lambda -> identifier, tkArrow, lambda_function_body { var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]); var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]); CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), LocationStack[LocationStack.Depth-3]), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan); } break; - case 851: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, + case 850: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, // tkArrow, lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan); } break; - case 852: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, + case 851: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { var idList = new ident_list(ValueStack[ValueStack.Depth-7].id, LocationStack[LocationStack.Depth-7]); @@ -6459,7 +6455,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, + case 852: // func_decl_lambda -> tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { @@ -6470,7 +6466,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, + case 853: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, // full_lambda_fp_list, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { @@ -6482,7 +6478,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, expr_l1, tkComma, expr_l1_list, + case 854: // func_decl_lambda -> tkRoundOpen, expr_l1, tkComma, expr_l1_list, // lambda_type_ref, optional_full_lambda_fp_list, // tkRoundClose, rem_lambda { @@ -6544,61 +6540,61 @@ public partial class GPPGParser: ShiftReduceParser expl_func_decl_lambda + case 855: // func_decl_lambda -> expl_func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 857: // optional_full_lambda_fp_list -> /* empty */ + case 856: // optional_full_lambda_fp_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 858: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list + case 857: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 859: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body + case 858: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body { CurrentSemanticValue.ob = new pair_type_stlist(ValueStack[ValueStack.Depth-3].td,ValueStack[ValueStack.Depth-1].stn as statement_list); } break; - case 860: // expl_func_decl_lambda -> tkFunction, lambda_type_ref, tkArrow, + case 859: // expl_func_decl_lambda -> tkFunction, lambda_type_ref, tkArrow, // lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, 1, CurrentLocationSpan); } break; - case 861: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, lambda_type_ref, + case 860: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, lambda_type_ref, // tkArrow, lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, 1, CurrentLocationSpan); } break; - case 862: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, + case 861: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, // tkRoundClose, lambda_type_ref, tkArrow, // lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), ValueStack[ValueStack.Depth-5].stn as formal_parameters, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, 1, CurrentLocationSpan); } break; - case 863: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body + case 862: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, null, ValueStack[ValueStack.Depth-1].stn as statement_list, 2, CurrentLocationSpan); } break; - case 864: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, + case 863: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, // lambda_procedure_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, null, ValueStack[ValueStack.Depth-1].stn as statement_list, 2, CurrentLocationSpan); } break; - case 865: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, + case 864: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, // tkRoundClose, tkArrow, lambda_procedure_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), ValueStack[ValueStack.Depth-4].stn as formal_parameters, null, ValueStack[ValueStack.Depth-1].stn as statement_list, 2, CurrentLocationSpan); } break; - case 866: // full_lambda_fp_list -> lambda_simple_fp_sect + case 865: // full_lambda_fp_list -> lambda_simple_fp_sect { var typed_pars = ValueStack[ValueStack.Depth-1].stn as typed_parameters; if (typed_pars.vars_type is lambda_inferred_type) @@ -6618,152 +6614,152 @@ public partial class GPPGParser: ShiftReduceParser full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect + case 866: // full_lambda_fp_list -> full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect { CurrentSemanticValue.stn =(ValueStack[ValueStack.Depth-3].stn as formal_parameters).Add(ValueStack[ValueStack.Depth-1].stn as typed_parameters, CurrentLocationSpan); } break; - case 868: // lambda_simple_fp_sect -> ident_list, lambda_type_ref + case 867: // lambda_simple_fp_sect -> ident_list, lambda_type_ref { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-2].stn as ident_list, ValueStack[ValueStack.Depth-1].td, parametr_kind.none, null, CurrentLocationSpan); } break; - case 869: // lambda_type_ref -> /* empty */ + case 868: // lambda_type_ref -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 870: // lambda_type_ref -> tkColon, fptype + case 869: // lambda_type_ref -> tkColon, fptype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 871: // lambda_type_ref_noproctype -> /* empty */ + case 870: // lambda_type_ref_noproctype -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 872: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype + case 871: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 873: // lambda_function_body -> expr_l1 + case 872: // lambda_function_body -> expr_l1 { CurrentSemanticValue.stn = NewLambdaBody(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 874: // lambda_function_body -> compound_stmt + case 873: // lambda_function_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 875: // lambda_function_body -> if_stmt + case 874: // lambda_function_body -> if_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 876: // lambda_function_body -> while_stmt + case 875: // lambda_function_body -> while_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 877: // lambda_function_body -> repeat_stmt + case 876: // lambda_function_body -> repeat_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 878: // lambda_function_body -> for_stmt + case 877: // lambda_function_body -> for_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 879: // lambda_function_body -> foreach_stmt + case 878: // lambda_function_body -> foreach_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 880: // lambda_function_body -> case_stmt + case 879: // lambda_function_body -> case_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 881: // lambda_function_body -> try_stmt + case 880: // lambda_function_body -> try_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 882: // lambda_function_body -> lock_stmt + case 881: // lambda_function_body -> lock_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 883: // lambda_function_body -> yield_stmt + case 882: // lambda_function_body -> yield_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 884: // lambda_procedure_body -> proc_call + case 883: // lambda_procedure_body -> proc_call { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 885: // lambda_procedure_body -> compound_stmt + case 884: // lambda_procedure_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 886: // lambda_procedure_body -> if_stmt + case 885: // lambda_procedure_body -> if_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 887: // lambda_procedure_body -> while_stmt + case 886: // lambda_procedure_body -> while_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 888: // lambda_procedure_body -> repeat_stmt + case 887: // lambda_procedure_body -> repeat_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 889: // lambda_procedure_body -> for_stmt + case 888: // lambda_procedure_body -> for_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 890: // lambda_procedure_body -> foreach_stmt + case 889: // lambda_procedure_body -> foreach_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 891: // lambda_procedure_body -> case_stmt + case 890: // lambda_procedure_body -> case_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 892: // lambda_procedure_body -> try_stmt + case 891: // lambda_procedure_body -> try_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 893: // lambda_procedure_body -> lock_stmt + case 892: // lambda_procedure_body -> lock_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 894: // lambda_procedure_body -> yield_stmt + case 893: // lambda_procedure_body -> yield_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 895: // lambda_procedure_body -> raise_stmt + case 894: // lambda_procedure_body -> raise_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 896: // lambda_procedure_body -> assignment + case 895: // lambda_procedure_body -> assignment { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); }