From 1438b620abf428405c3fe00bc4c1784e2f32c7d1 Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Tue, 29 Jun 2021 12:02:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2s=D0=B9=20=D1=83=D0=B7=D0=B5?= =?UTF-8?q?=D0=BB=20expression=5Fwith=5Flet=5Fsemantic,=20expression=5Fwit?= =?UTF-8?q?h=5Flet=5Fsemantic=20=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=86=D0=B8=D0=B8=20=D0=B2=D0=B8?= =?UTF-8?q?=D0=B4=D0=B0=20procedure=20p(b:=20integer=20:=3D=20(var=20x=20:?= =?UTF-8?q?=3D=20b*b;=20x*x+x-1));?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 2 +- .../PascalABCParserNewSaushkin/ABCPascal.cs | 2 +- .../PascalABCParserNewSaushkin/ABCPascal.y | 37 +- .../ABCPascalYacc.cs | 3864 +++++++++-------- Parsers/PascalABCParserNewSaushkin/PABC.ymc | 5 + Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- SyntaxTree/tree/AbstractVisitor.cs | 5 + SyntaxTree/tree/HierarchyVisitor.cs | 17 + SyntaxTree/tree/SyntaxTreeStreamReader.cs | 15 + SyntaxTree/tree/SyntaxTreeStreamWriter.cs | 30 + SyntaxTree/tree/Tree.cs | 190 + SyntaxTree/tree/Visitor.cs | 6 + SyntaxTree/tree/tree.xml | 16 + .../TreeConversion/syntax_tree_visitor.cs | 6 + TreeConverter/TreeRealization/base_nodes.cs | 19 + 17 files changed, 2297 insertions(+), 1923 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index d6ff95eb1..fe462b418 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "8"; public const string Build = "0"; - public const string Revision = "2901"; + public const string Revision = "2903"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index bb40dfdc4..262f39c06 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=8 -%REVISION%=2901 +%REVISION%=2903 %COREVERSION%=0 %MAJOR%=3 diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index 249e4186e..cfd241de1 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -2,7 +2,7 @@ // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 // Machine: DESKTOP-G8V08V4 -// DateTime: 28.05.2021 19:30:50 +// DateTime: 29.06.2021 9:47:21 // UserName: ????????? // GPLEX input file // GPLEX frame file diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index 99a0fa551..96daf84c8 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -183,6 +183,7 @@ %type tkAssignOrEqual %type const_pattern_expression pattern deconstruction_or_const_pattern pattern_optional_var collection_pattern tuple_pattern collection_pattern_list_item tuple_pattern_item collection_pattern_var_item match_with pattern_case pattern_cases pattern_out_param pattern_out_param_optional_var %type pattern_out_param_list pattern_out_param_list_optional_var collection_pattern_expr_list tuple_pattern_item_list const_pattern_expr_list +%type var_with_init_for_expr_with_let var_with_init_for_expr_with_let_list %% @@ -3238,13 +3239,6 @@ expr | format_expr { $$ = $1; } ; - /* -expr_l1_for_indexer - : expr_l1 - { $$ = $1; } - | format_expr - { $$ = $1; } - ;*/ expr_l1 : expr_dq @@ -4168,6 +4162,25 @@ variable_or_literal_or_number { $$ = $1; } ; +var_with_init_for_expr_with_let + : tkVar identifier tkAssign expr tkSemiColon + { + $$ = new assign($2 as addressed_value, $4, Operators.Assignment, @$); + } + ; + +var_with_init_for_expr_with_let_list + : var_with_init_for_expr_with_let + { + $$ = new statement_list($1 as statement, @$); + } + | var_with_init_for_expr_with_let_list var_with_init_for_expr_with_let + { + $1 = new statement_list($2 as statement, @$); + $$ = $1; + } + ; + variable : identifier { $$ = $1; } @@ -4177,7 +4190,6 @@ variable { $$ = new inherited_ident($2.name, @$); } - | tkRoundOpen expr tkRoundClose { if (!parsertools.build_tree_for_formatter) @@ -4187,6 +4199,15 @@ variable } else $$ = new bracket_expr($2, @$); } + | tkRoundOpen var_with_init_for_expr_with_let_list expr tkRoundClose + { + if (!parsertools.build_tree_for_formatter) + { + $3.source_context = @$; + $$ = $3; + } + else $$ = new expression_with_let($2 as statement_list, $2 as expression, @$); + } | sizeof_expr { $$ = $1; } | typeof_expr diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index f36c31eaa..a37b2f53d 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -2,7 +2,7 @@ // GPPG version 1.3.6 // Machine: DESKTOP-G8V08V4 -// DateTime: 28.05.2021 19:30:51 +// DateTime: 29.06.2021 9:47:21 // UserName: ????????? // Input file @@ -76,8 +76,8 @@ public partial class GPPGParser: ShiftReduceParser aliasses; #pragma warning restore 649 - private static Rule[] rules = new Rule[1000]; - private static State[] states = new State[1654]; + private static Rule[] rules = new Rule[1004]; + private static State[] states = new State[1664]; private static string[] nonTerms = new string[] { "parse_goal", "unit_key_word", "class_or_static", "assignment", "optional_array_initializer", "attribute_declarations", "ot_visibility_specifier", "one_attribute", "attribute_variable", @@ -168,16 +168,17 @@ public partial class GPPGParser: ShiftReduceParser literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 772: // variable -> identifier + case 772: // var_with_init_for_expr_with_let -> tkVar, identifier, tkAssign, expr, + // tkSemiColon +{ + CurrentSemanticValue.stn = new assign(ValueStack[ValueStack.Depth-4].id as addressed_value, ValueStack[ValueStack.Depth-2].ex, Operators.Assignment, CurrentLocationSpan); + } + break; + case 773: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let +{ + CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); + } + break; + case 774: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let_list, + // var_with_init_for_expr_with_let +{ + ValueStack[ValueStack.Depth-2].stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; + } + break; + case 775: // variable -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 773: // variable -> operator_name_ident + case 776: // variable -> operator_name_ident { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 774: // variable -> tkInherited, identifier + case 777: // variable -> tkInherited, identifier { CurrentSemanticValue.ex = new inherited_ident(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 775: // variable -> tkRoundOpen, expr, tkRoundClose + case 778: // variable -> tkRoundOpen, expr, tkRoundClose { if (!parsertools.build_tree_for_formatter) { @@ -6615,18 +6648,29 @@ public partial class GPPGParser: ShiftReduceParser sizeof_expr + case 779: // variable -> tkRoundOpen, var_with_init_for_expr_with_let_list, expr, + // tkRoundClose +{ + if (!parsertools.build_tree_for_formatter) + { + ValueStack[ValueStack.Depth-2].ex.source_context = CurrentLocationSpan; + CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; + } + else CurrentSemanticValue.ex = new expression_with_let(ValueStack[ValueStack.Depth-3].stn as statement_list, ValueStack[ValueStack.Depth-3].stn as expression, CurrentLocationSpan); + } + break; + case 780: // variable -> sizeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 777: // variable -> typeof_expr + case 781: // variable -> typeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 778: // variable -> literal_or_number, tkPoint, identifier_or_keyword + case 782: // variable -> literal_or_number, tkPoint, identifier_or_keyword { CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 779: // variable -> variable_or_literal_or_number, tkSquareOpen, expr_list, + case 783: // variable -> variable_or_literal_or_number, tkSquareOpen, expr_list, // tkSquareClose { var el = ValueStack[ValueStack.Depth-2].stn as expression_list; // SSM 10/03/16 @@ -6672,7 +6716,7 @@ public partial class GPPGParser: ShiftReduceParser variable_or_literal_or_number, tkQuestionSquareOpen, format_expr, + case 784: // variable -> variable_or_literal_or_number, tkQuestionSquareOpen, format_expr, // tkSquareClose { var fe = ValueStack[ValueStack.Depth-2].ex as format_expr; // SSM 9/01/17 @@ -6686,76 +6730,76 @@ public partial class GPPGParser: ShiftReduceParser tkVertParen, elem_list, tkVertParen + case 785: // variable -> tkVertParen, elem_list, tkVertParen { CurrentSemanticValue.ex = new array_const_new(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 782: // variable -> variable, tkRoundOpen, optional_expr_list, tkRoundClose + case 786: // variable -> variable, tkRoundOpen, optional_expr_list, tkRoundClose { CurrentSemanticValue.ex = new method_call(ValueStack[ValueStack.Depth-4].ex as addressed_value,ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 783: // variable -> variable, tkPoint, identifier_keyword_operatorname + case 787: // variable -> variable, tkPoint, identifier_keyword_operatorname { CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 784: // variable -> tuple, tkPoint, identifier_keyword_operatorname + case 788: // variable -> tuple, tkPoint, identifier_keyword_operatorname { CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 785: // variable -> variable, tkDeref + case 789: // variable -> variable, tkDeref { CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-2].ex as addressed_value,CurrentLocationSpan); } break; - case 786: // variable -> variable, tkAmpersend, template_type_params + case 790: // variable -> variable, tkAmpersend, template_type_params { CurrentSemanticValue.ex = new ident_with_templateparams(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].stn as template_param_list, CurrentLocationSpan); } break; - case 787: // optional_expr_list -> expr_list + case 791: // optional_expr_list -> expr_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 788: // optional_expr_list -> /* empty */ + case 792: // optional_expr_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 789: // elem_list -> elem_list1 + case 793: // elem_list -> elem_list1 { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 790: // elem_list -> /* empty */ + case 794: // elem_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 791: // elem_list1 -> elem + case 795: // elem_list1 -> elem { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 792: // elem_list1 -> elem_list1, tkComma, elem + case 796: // elem_list1 -> elem_list1, tkComma, elem { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 793: // elem -> expr + case 797: // elem -> expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 794: // elem -> expr, tkDotDot, expr + case 798: // elem -> expr, tkDotDot, expr { CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 795: // one_literal -> tkStringLiteral + case 799: // one_literal -> tkStringLiteral { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 796: // one_literal -> tkAsciiChar + case 800: // one_literal -> tkAsciiChar { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 797: // literal -> literal_list + case 801: // literal -> literal_list { CurrentSemanticValue.ex = NewLiteral(ValueStack[ValueStack.Depth-1].stn as literal_const_line); } break; - case 798: // literal -> tkFormatStringLiteral + case 802: // literal -> tkFormatStringLiteral { if (parsertools.build_tree_for_formatter) { @@ -6767,12 +6811,12 @@ public partial class GPPGParser: ShiftReduceParser one_literal + case 803: // literal_list -> one_literal { CurrentSemanticValue.stn = new literal_const_line(ValueStack[ValueStack.Depth-1].ex as literal, CurrentLocationSpan); } break; - case 800: // literal_list -> literal_list, one_literal + case 804: // literal_list -> literal_list, one_literal { var line = ValueStack[ValueStack.Depth-2].stn as literal_const_line; if (line.literals.Last() is string_const && ValueStack[ValueStack.Depth-1].ex is string_const) @@ -6780,475 +6824,475 @@ public partial class GPPGParser: ShiftReduceParser tkOperator, overload_operator + case 805: // operator_name_ident -> tkOperator, overload_operator { CurrentSemanticValue.ex = new operator_name_ident((ValueStack[ValueStack.Depth-1].op as op_type_node).text, (ValueStack[ValueStack.Depth-1].op as op_type_node).type, CurrentLocationSpan); } break; - case 802: // optional_method_modificators -> tkSemiColon + case 806: // optional_method_modificators -> tkSemiColon { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 803: // optional_method_modificators -> tkSemiColon, meth_modificators, tkSemiColon + case 807: // optional_method_modificators -> tkSemiColon, meth_modificators, tkSemiColon { //parsertools.AddModifier((procedure_attributes_list)$2, proc_attribute.attr_overload); CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 804: // optional_method_modificators1 -> /* empty */ + case 808: // optional_method_modificators1 -> /* empty */ { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 805: // optional_method_modificators1 -> tkSemiColon, meth_modificators + case 809: // optional_method_modificators1 -> tkSemiColon, meth_modificators { //parsertools.AddModifier((procedure_attributes_list)$2, proc_attribute.attr_overload); CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 806: // meth_modificators -> meth_modificator + case 810: // meth_modificators -> meth_modificator { CurrentSemanticValue.stn = new procedure_attributes_list(ValueStack[ValueStack.Depth-1].id as procedure_attribute, CurrentLocationSpan); } break; - case 807: // meth_modificators -> meth_modificators, tkSemiColon, meth_modificator + case 811: // meth_modificators -> meth_modificators, tkSemiColon, meth_modificator { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as procedure_attributes_list).Add(ValueStack[ValueStack.Depth-1].id as procedure_attribute, CurrentLocationSpan); } break; - case 808: // identifier -> tkIdentifier + case 812: // identifier -> tkIdentifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 809: // identifier -> property_specifier_directives + case 813: // identifier -> property_specifier_directives { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 810: // identifier -> non_reserved + case 814: // identifier -> non_reserved { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 811: // identifier_or_keyword -> identifier + case 815: // identifier_or_keyword -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 812: // identifier_or_keyword -> keyword + case 816: // identifier_or_keyword -> keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 813: // identifier_or_keyword -> reserved_keyword + case 817: // identifier_or_keyword -> reserved_keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 814: // identifier_keyword_operatorname -> identifier + case 818: // identifier_keyword_operatorname -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 815: // identifier_keyword_operatorname -> keyword + case 819: // identifier_keyword_operatorname -> keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 816: // identifier_keyword_operatorname -> operator_name_ident + case 820: // identifier_keyword_operatorname -> operator_name_ident { CurrentSemanticValue.id = (ident)ValueStack[ValueStack.Depth-1].ex; } break; - case 817: // meth_modificator -> tkAbstract + case 821: // meth_modificator -> tkAbstract { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 818: // meth_modificator -> tkOverload + case 822: // meth_modificator -> tkOverload { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; parsertools.AddWarningFromResource("OVERLOAD_IS_NOT_USED", ValueStack[ValueStack.Depth-1].id.source_context); } break; - case 819: // meth_modificator -> tkReintroduce + case 823: // meth_modificator -> tkReintroduce { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 820: // meth_modificator -> tkOverride + case 824: // meth_modificator -> tkOverride { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 821: // meth_modificator -> tkExtensionMethod + case 825: // meth_modificator -> tkExtensionMethod { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 822: // meth_modificator -> tkVirtual + case 826: // meth_modificator -> tkVirtual { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 823: // property_modificator -> tkVirtual + case 827: // property_modificator -> tkVirtual { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 824: // property_modificator -> tkOverride + case 828: // property_modificator -> tkOverride { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 825: // property_modificator -> tkAbstract + case 829: // property_modificator -> tkAbstract { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 826: // property_modificator -> tkReintroduce + case 830: // property_modificator -> tkReintroduce { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 827: // property_specifier_directives -> tkRead + case 831: // property_specifier_directives -> tkRead { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 828: // property_specifier_directives -> tkWrite + case 832: // property_specifier_directives -> tkWrite { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 829: // non_reserved -> tkName + case 833: // non_reserved -> tkName { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 830: // non_reserved -> tkNew + case 834: // non_reserved -> tkNew { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 831: // visibility_specifier -> tkInternal + case 835: // visibility_specifier -> tkInternal { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 832: // visibility_specifier -> tkPublic + case 836: // visibility_specifier -> tkPublic { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 833: // visibility_specifier -> tkProtected + case 837: // visibility_specifier -> tkProtected { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 834: // visibility_specifier -> tkPrivate + case 838: // visibility_specifier -> tkPrivate { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 835: // keyword -> visibility_specifier + case 839: // keyword -> visibility_specifier { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 836: // keyword -> tkSealed + case 840: // keyword -> tkSealed { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 837: // keyword -> tkTemplate + case 841: // keyword -> tkTemplate { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 838: // keyword -> tkOr + case 842: // keyword -> tkOr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 839: // keyword -> tkTypeOf + case 843: // keyword -> tkTypeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 840: // keyword -> tkSizeOf + case 844: // keyword -> tkSizeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 841: // keyword -> tkDefault + case 845: // keyword -> tkDefault { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 842: // keyword -> tkWhere + case 846: // keyword -> tkWhere { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 843: // keyword -> tkXor + case 847: // keyword -> tkXor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 844: // keyword -> tkAnd + case 848: // keyword -> tkAnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 845: // keyword -> tkDiv + case 849: // keyword -> tkDiv { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 846: // keyword -> tkMod + case 850: // keyword -> tkMod { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 847: // keyword -> tkShl + case 851: // keyword -> tkShl { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 848: // keyword -> tkShr + case 852: // keyword -> tkShr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 849: // keyword -> tkNot + case 853: // keyword -> tkNot { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 850: // keyword -> tkAs + case 854: // keyword -> tkAs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 851: // keyword -> tkIn + case 855: // keyword -> tkIn { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 852: // keyword -> tkIs + case 856: // keyword -> tkIs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 853: // keyword -> tkArray + case 857: // keyword -> tkArray { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 854: // keyword -> tkSequence + case 858: // keyword -> tkSequence { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 855: // keyword -> tkBegin + case 859: // keyword -> tkBegin { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 856: // keyword -> tkCase + case 860: // keyword -> tkCase { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 857: // keyword -> tkClass + case 861: // keyword -> tkClass { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 858: // keyword -> tkConst + case 862: // keyword -> tkConst { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 859: // keyword -> tkConstructor + case 863: // keyword -> tkConstructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 860: // keyword -> tkDestructor + case 864: // keyword -> tkDestructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 861: // keyword -> tkDownto + case 865: // keyword -> tkDownto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 862: // keyword -> tkDo + case 866: // keyword -> tkDo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 863: // keyword -> tkElse + case 867: // keyword -> tkElse { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 864: // keyword -> tkEnd + case 868: // keyword -> tkEnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 865: // keyword -> tkExcept + case 869: // keyword -> tkExcept { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 866: // keyword -> tkFile + case 870: // keyword -> tkFile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 867: // keyword -> tkAuto + case 871: // keyword -> tkAuto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 868: // keyword -> tkFinalization + case 872: // keyword -> tkFinalization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 869: // keyword -> tkFinally + case 873: // keyword -> tkFinally { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 870: // keyword -> tkFor + case 874: // keyword -> tkFor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 871: // keyword -> tkForeach + case 875: // keyword -> tkForeach { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 872: // keyword -> tkFunction + case 876: // keyword -> tkFunction { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 873: // keyword -> tkIf + case 877: // keyword -> tkIf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 874: // keyword -> tkImplementation + case 878: // keyword -> tkImplementation { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 875: // keyword -> tkInherited + case 879: // keyword -> tkInherited { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 876: // keyword -> tkInitialization + case 880: // keyword -> tkInitialization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 877: // keyword -> tkInterface + case 881: // keyword -> tkInterface { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 878: // keyword -> tkProcedure + case 882: // keyword -> tkProcedure { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 879: // keyword -> tkProperty + case 883: // keyword -> tkProperty { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 880: // keyword -> tkRaise + case 884: // keyword -> tkRaise { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 881: // keyword -> tkRecord + case 885: // keyword -> tkRecord { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 882: // keyword -> tkRepeat + case 886: // keyword -> tkRepeat { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 883: // keyword -> tkSet + case 887: // keyword -> tkSet { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 884: // keyword -> tkTry + case 888: // keyword -> tkTry { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 885: // keyword -> tkType + case 889: // keyword -> tkType { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 886: // keyword -> tkStatic + case 890: // keyword -> tkStatic { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 887: // keyword -> tkThen + case 891: // keyword -> tkThen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 888: // keyword -> tkTo + case 892: // keyword -> tkTo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 889: // keyword -> tkUntil + case 893: // keyword -> tkUntil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 890: // keyword -> tkUses + case 894: // keyword -> tkUses { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 891: // keyword -> tkVar + case 895: // keyword -> tkVar { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 892: // keyword -> tkWhile + case 896: // keyword -> tkWhile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 893: // keyword -> tkWith + case 897: // keyword -> tkWith { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 894: // keyword -> tkNil + case 898: // keyword -> tkNil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 895: // keyword -> tkGoto + case 899: // keyword -> tkGoto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 896: // keyword -> tkOf + case 900: // keyword -> tkOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 897: // keyword -> tkLabel + case 901: // keyword -> tkLabel { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 898: // keyword -> tkProgram + case 902: // keyword -> tkProgram { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 899: // keyword -> tkUnit + case 903: // keyword -> tkUnit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 900: // keyword -> tkLibrary + case 904: // keyword -> tkLibrary { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 901: // keyword -> tkNamespace + case 905: // keyword -> tkNamespace { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 902: // keyword -> tkExternal + case 906: // keyword -> tkExternal { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 903: // keyword -> tkParams + case 907: // keyword -> tkParams { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 904: // keyword -> tkEvent + case 908: // keyword -> tkEvent { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 905: // keyword -> tkYield + case 909: // keyword -> tkYield { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 906: // keyword -> tkMatch + case 910: // keyword -> tkMatch { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 907: // keyword -> tkWhen + case 911: // keyword -> tkWhen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 908: // keyword -> tkPartial + case 912: // keyword -> tkPartial { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 909: // keyword -> tkAbstract + case 913: // keyword -> tkAbstract { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 910: // keyword -> tkLock + case 914: // keyword -> tkLock { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 911: // keyword -> tkImplicit + case 915: // keyword -> tkImplicit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 912: // keyword -> tkExplicit + case 916: // keyword -> tkExplicit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 913: // keyword -> tkOn + case 917: // keyword -> tkOn { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 914: // keyword -> tkVirtual + case 918: // keyword -> tkVirtual { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 915: // keyword -> tkOverride + case 919: // keyword -> tkOverride { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 916: // keyword -> tkLoop + case 920: // keyword -> tkLoop { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 917: // keyword -> tkExtensionMethod + case 921: // keyword -> tkExtensionMethod { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 918: // keyword -> tkOverload + case 922: // keyword -> tkOverload { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 919: // keyword -> tkReintroduce + case 923: // keyword -> tkReintroduce { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 920: // keyword -> tkForward + case 924: // keyword -> tkForward { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 921: // reserved_keyword -> tkOperator + case 925: // reserved_keyword -> tkOperator { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 922: // overload_operator -> tkMinus + case 926: // overload_operator -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 923: // overload_operator -> tkPlus + case 927: // overload_operator -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 924: // overload_operator -> tkSlash + case 928: // overload_operator -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 925: // overload_operator -> tkStar + case 929: // overload_operator -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 926: // overload_operator -> tkEqual + case 930: // overload_operator -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 927: // overload_operator -> tkGreater + case 931: // overload_operator -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 928: // overload_operator -> tkGreaterEqual + case 932: // overload_operator -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 929: // overload_operator -> tkLower + case 933: // overload_operator -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 930: // overload_operator -> tkLowerEqual + case 934: // overload_operator -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 931: // overload_operator -> tkNotEqual + case 935: // overload_operator -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 932: // overload_operator -> tkOr + case 936: // overload_operator -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 933: // overload_operator -> tkXor + case 937: // overload_operator -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 934: // overload_operator -> tkAnd + case 938: // overload_operator -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 935: // overload_operator -> tkDiv + case 939: // overload_operator -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 936: // overload_operator -> tkMod + case 940: // overload_operator -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 937: // overload_operator -> tkShl + case 941: // overload_operator -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 938: // overload_operator -> tkShr + case 942: // overload_operator -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 939: // overload_operator -> tkNot + case 943: // overload_operator -> tkNot { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 940: // overload_operator -> tkIn + case 944: // overload_operator -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 941: // overload_operator -> tkImplicit + case 945: // overload_operator -> tkImplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 942: // overload_operator -> tkExplicit + case 946: // overload_operator -> tkExplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 943: // overload_operator -> assign_operator + case 947: // overload_operator -> assign_operator { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 944: // overload_operator -> tkStarStar + case 948: // overload_operator -> tkStarStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 945: // assign_operator -> tkAssign + case 949: // assign_operator -> tkAssign { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 946: // assign_operator -> tkPlusEqual + case 950: // assign_operator -> tkPlusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 947: // assign_operator -> tkMinusEqual + case 951: // assign_operator -> tkMinusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 948: // assign_operator -> tkMultEqual + case 952: // assign_operator -> tkMultEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 949: // assign_operator -> tkDivEqual + case 953: // assign_operator -> tkDivEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 950: // lambda_unpacked_params -> tkBackSlashRoundOpen, + case 954: // lambda_unpacked_params -> tkBackSlashRoundOpen, // lambda_list_of_unpacked_params_or_id, tkComma, // lambda_unpacked_params_or_id, tkRoundClose { @@ -7257,24 +7301,24 @@ public partial class GPPGParser: ShiftReduceParser lambda_unpacked_params + case 955: // lambda_unpacked_params_or_id -> lambda_unpacked_params { CurrentSemanticValue.ob = new ident_or_list(ValueStack[ValueStack.Depth-1].ex as unpacked_list_of_ident_or_list); } break; - case 952: // lambda_unpacked_params_or_id -> identifier + case 956: // lambda_unpacked_params_or_id -> identifier { CurrentSemanticValue.ob = new ident_or_list(ValueStack[ValueStack.Depth-1].id as ident); } break; - case 953: // lambda_list_of_unpacked_params_or_id -> lambda_unpacked_params_or_id + case 957: // lambda_list_of_unpacked_params_or_id -> lambda_unpacked_params_or_id { CurrentSemanticValue.ob = new unpacked_list_of_ident_or_list(); (CurrentSemanticValue.ob as unpacked_list_of_ident_or_list).Add(ValueStack[ValueStack.Depth-1].ob as ident_or_list); (CurrentSemanticValue.ob as unpacked_list_of_ident_or_list).source_context = LocationStack[LocationStack.Depth-1]; } break; - case 954: // lambda_list_of_unpacked_params_or_id -> lambda_list_of_unpacked_params_or_id, + case 958: // lambda_list_of_unpacked_params_or_id -> lambda_list_of_unpacked_params_or_id, // tkComma, lambda_unpacked_params_or_id { CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-3].ob; @@ -7282,24 +7326,24 @@ public partial class GPPGParser: ShiftReduceParser expr_l1 + case 959: // expr_l1_or_unpacked -> expr_l1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 956: // expr_l1_or_unpacked -> lambda_unpacked_params + case 960: // expr_l1_or_unpacked -> lambda_unpacked_params { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 957: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked + case 961: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 958: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked_list, tkComma, + case 962: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked_list, tkComma, // expr_l1_or_unpacked { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 959: // func_decl_lambda -> identifier, tkArrow, lambda_function_body + case 963: // 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]); @@ -7310,7 +7354,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, + case 964: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, // tkArrow, lambda_function_body { // ����� ���� ������������� �� ���� � ���� ��������� lambda_inferred_type, ���� ������ ��� null! @@ -7320,7 +7364,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, + case 965: // 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]); @@ -7332,7 +7376,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, + case 966: // func_decl_lambda -> tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { @@ -7346,7 +7390,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, + case 967: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, // full_lambda_fp_list, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { @@ -7361,7 +7405,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, expr_l1_or_unpacked, tkComma, + case 968: // func_decl_lambda -> tkRoundOpen, expr_l1_or_unpacked, tkComma, // expr_l1_or_unpacked_list, lambda_type_ref, // optional_full_lambda_fp_list, tkRoundClose, rem_lambda { @@ -7471,7 +7515,7 @@ public partial class GPPGParser: ShiftReduceParser lambda_unpacked_params, rem_lambda + case 969: // func_decl_lambda -> lambda_unpacked_params, rem_lambda { var pair = ValueStack[ValueStack.Depth-1].ob as pair_type_stlist; // ���� ���������� ��������� - null. �������� �� �������� ��������� @@ -7483,62 +7527,62 @@ public partial class GPPGParser: ShiftReduceParser expl_func_decl_lambda + case 970: // func_decl_lambda -> expl_func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 967: // optional_full_lambda_fp_list -> /* empty */ + case 971: // optional_full_lambda_fp_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 968: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list + case 972: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 969: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body + case 973: // 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 970: // expl_func_decl_lambda -> tkFunction, lambda_type_ref_noproctype, tkArrow, + case 974: // expl_func_decl_lambda -> tkFunction, 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, 1, CurrentLocationSpan); } break; - case 971: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, + case 975: // expl_func_decl_lambda -> tkFunction, 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, 1, CurrentLocationSpan); } break; - case 972: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, + case 976: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, 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 973: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body + case 977: // 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 974: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, + case 978: // 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 975: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, + case 979: // 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 976: // full_lambda_fp_list -> lambda_simple_fp_sect + case 980: // 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) @@ -7558,97 +7602,97 @@ public partial class GPPGParser: ShiftReduceParser full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect + case 981: // 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 978: // lambda_simple_fp_sect -> ident_list, lambda_type_ref + case 982: // 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 979: // lambda_type_ref -> /* empty */ + case 983: // lambda_type_ref -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 980: // lambda_type_ref -> tkColon, fptype + case 984: // lambda_type_ref -> tkColon, fptype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 981: // lambda_type_ref_noproctype -> /* empty */ + case 985: // lambda_type_ref_noproctype -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 982: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype + case 986: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 983: // common_lambda_body -> compound_stmt + case 987: // common_lambda_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 984: // common_lambda_body -> if_stmt + case 988: // common_lambda_body -> if_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 985: // common_lambda_body -> while_stmt + case 989: // common_lambda_body -> while_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 986: // common_lambda_body -> repeat_stmt + case 990: // common_lambda_body -> repeat_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 987: // common_lambda_body -> for_stmt + case 991: // common_lambda_body -> for_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 988: // common_lambda_body -> foreach_stmt + case 992: // common_lambda_body -> foreach_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 989: // common_lambda_body -> loop_stmt + case 993: // common_lambda_body -> loop_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 990: // common_lambda_body -> case_stmt + case 994: // common_lambda_body -> case_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 991: // common_lambda_body -> try_stmt + case 995: // common_lambda_body -> try_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 992: // common_lambda_body -> lock_stmt + case 996: // common_lambda_body -> lock_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 993: // common_lambda_body -> raise_stmt + case 997: // common_lambda_body -> raise_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 994: // common_lambda_body -> yield_stmt + case 998: // common_lambda_body -> yield_stmt { parsertools.AddErrorFromResource("YIELD_STATEMENT_CANNOT_BE_USED_IN_LAMBDA_BODY", CurrentLocationSpan); } break; - case 995: // lambda_function_body -> expr_l1_for_lambda + case 999: // lambda_function_body -> expr_l1_for_lambda { var id = SyntaxVisitors.HasNameVisitor.HasName(ValueStack[ValueStack.Depth-1].ex, "Result"); if (id != null) @@ -7660,22 +7704,22 @@ public partial class GPPGParser: ShiftReduceParser common_lambda_body + case 1000: // lambda_function_body -> common_lambda_body { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 997: // lambda_procedure_body -> proc_call + case 1001: // lambda_procedure_body -> proc_call { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 998: // lambda_procedure_body -> assignment + case 1002: // lambda_procedure_body -> assignment { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 999: // lambda_procedure_body -> common_lambda_body + case 1003: // lambda_procedure_body -> common_lambda_body { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index 4f086e912..2c1ffd863 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -330,6 +330,11 @@ script= + + + + + diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 19d97cbcd..37cb71f51 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.0.2901 +3.8.0.2903 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 0f2576390..cb6995e90 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.0.2901' +!define VERSION '3.8.0.2903' diff --git a/SyntaxTree/tree/AbstractVisitor.cs b/SyntaxTree/tree/AbstractVisitor.cs index 9b3de33fa..26302f093 100644 --- a/SyntaxTree/tree/AbstractVisitor.cs +++ b/SyntaxTree/tree/AbstractVisitor.cs @@ -1297,6 +1297,11 @@ namespace PascalABCCompiler.SyntaxTree { DefaultVisit(_property_ident); } + + public virtual void visit(expression_with_let _expression_with_let) + { + DefaultVisit(_expression_with_let); + } } diff --git a/SyntaxTree/tree/HierarchyVisitor.cs b/SyntaxTree/tree/HierarchyVisitor.cs index 151658719..f6f572b83 100644 --- a/SyntaxTree/tree/HierarchyVisitor.cs +++ b/SyntaxTree/tree/HierarchyVisitor.cs @@ -2069,6 +2069,14 @@ namespace PascalABCCompiler.SyntaxTree { } + public virtual void pre_do_visit(expression_with_let _expression_with_let) + { + } + + public virtual void post_do_visit(expression_with_let _expression_with_let) + { + } + public override void visit(expression _expression) { DefaultVisit(_expression); @@ -4273,6 +4281,15 @@ namespace PascalABCCompiler.SyntaxTree visit(property_ident.ln[i]); post_do_visit(_property_ident); } + + public override void visit(expression_with_let _expression_with_let) + { + DefaultVisit(_expression_with_let); + pre_do_visit(_expression_with_let); + visit(expression_with_let.stat); + visit(expression_with_let.expr); + post_do_visit(_expression_with_let); + } } diff --git a/SyntaxTree/tree/SyntaxTreeStreamReader.cs b/SyntaxTree/tree/SyntaxTreeStreamReader.cs index 66244297b..2e6a9c0c3 100644 --- a/SyntaxTree/tree/SyntaxTreeStreamReader.cs +++ b/SyntaxTree/tree/SyntaxTreeStreamReader.cs @@ -536,6 +536,8 @@ namespace PascalABCCompiler.SyntaxTree return new foreach_stmt_formatting(); case 257: return new property_ident(); + case 258: + return new expression_with_let(); } return null; } @@ -4501,6 +4503,19 @@ namespace PascalABCCompiler.SyntaxTree } } + + public void visit(expression_with_let _expression_with_let) + { + read_expression_with_let(_expression_with_let); + } + + public void read_expression_with_let(expression_with_let _expression_with_let) + { + read_addressed_value(_expression_with_let); + _expression_with_let.stat = _read_node() as statement_list; + _expression_with_let.expr = _read_node() as expression; + } + } diff --git a/SyntaxTree/tree/SyntaxTreeStreamWriter.cs b/SyntaxTree/tree/SyntaxTreeStreamWriter.cs index f5302a663..5e99c1e22 100644 --- a/SyntaxTree/tree/SyntaxTreeStreamWriter.cs +++ b/SyntaxTree/tree/SyntaxTreeStreamWriter.cs @@ -7044,6 +7044,36 @@ namespace PascalABCCompiler.SyntaxTree } } + + public void visit(expression_with_let _expression_with_let) + { + bw.Write((Int16)258); + write_expression_with_let(_expression_with_let); + } + + public void write_expression_with_let(expression_with_let _expression_with_let) + { + write_addressed_value(_expression_with_let); + if (_expression_with_let.stat == null) + { + bw.Write((byte)0); + } + else + { + bw.Write((byte)1); + _expression_with_let.stat.visit(this); + } + if (_expression_with_let.expr == null) + { + bw.Write((byte)0); + } + else + { + bw.Write((byte)1); + _expression_with_let.expr.visit(this); + } + } + } diff --git a/SyntaxTree/tree/Tree.cs b/SyntaxTree/tree/Tree.cs index 472957b4b..9cc12e4ca 100644 --- a/SyntaxTree/tree/Tree.cs +++ b/SyntaxTree/tree/Tree.cs @@ -55093,6 +55093,196 @@ namespace PascalABCCompiler.SyntaxTree } + /// + /// + /// + [Serializable] + public partial class expression_with_let : addressed_value + { + + /// + ///Конструктор без параметров. + /// + public expression_with_let() + { + + } + + /// + ///Конструктор с параметрами. + /// + public expression_with_let(statement_list _stat,expression _expr) + { + this._stat=_stat; + this._expr=_expr; + FillParentsInDirectChilds(); + } + + /// + ///Конструктор с параметрами. + /// + public expression_with_let(statement_list _stat,expression _expr,SourceContext sc) + { + this._stat=_stat; + this._expr=_expr; + source_context = sc; + FillParentsInDirectChilds(); + } + protected statement_list _stat; + protected expression _expr; + + /// + /// + /// + public statement_list stat + { + get + { + return _stat; + } + set + { + _stat=value; + if (_stat != null) + _stat.Parent = this; + } + } + + /// + /// + /// + public expression expr + { + get + { + return _expr; + } + set + { + _expr=value; + if (_expr != null) + _expr.Parent = this; + } + } + + + /// Создает копию узла + public override syntax_tree_node Clone() + { + expression_with_let copy = new expression_with_let(); + copy.Parent = this.Parent; + if (source_context != null) + copy.source_context = new SourceContext(source_context); + if (attributes != null) + { + copy.attributes = (attribute_list)attributes.Clone(); + copy.attributes.Parent = copy; + } + if (stat != null) + { + copy.stat = (statement_list)stat.Clone(); + copy.stat.Parent = copy; + } + if (expr != null) + { + copy.expr = (expression)expr.Clone(); + copy.expr.Parent = copy; + } + return copy; + } + + /// Получает копию данного узла корректного типа + public new expression_with_let TypedClone() + { + return Clone() as expression_with_let; + } + + /// Заполняет поля Parent в непосредственных дочерних узлах + public override void FillParentsInDirectChilds() + { + if (attributes != null) + attributes.Parent = this; + if (stat != null) + stat.Parent = this; + if (expr != null) + expr.Parent = this; + } + + /// Заполняет поля Parent во всем поддереве + public override void FillParentsInAllChilds() + { + FillParentsInDirectChilds(); + attributes?.FillParentsInAllChilds(); + stat?.FillParentsInAllChilds(); + expr?.FillParentsInAllChilds(); + } + + /// + ///Свойство для получения количества всех подузлов без элементов поля типа List + /// + public override Int32 subnodes_without_list_elements_count + { + get + { + return 2; + } + } + /// + ///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List + /// + public override Int32 subnodes_count + { + get + { + return 2; + } + } + /// + ///Индексатор для получения всех подузлов + /// + public override syntax_tree_node this[Int32 ind] + { + get + { + if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1) + throw new IndexOutOfRangeException(); + switch(ind) + { + case 0: + return stat; + case 1: + return expr; + } + return null; + } + set + { + if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1) + throw new IndexOutOfRangeException(); + switch(ind) + { + case 0: + stat = (statement_list)value; + break; + case 1: + expr = (expression)value; + break; + } + } + } + /// + ///Метод для обхода дерева посетителем + /// + ///Объект-посетитель. + ///Return value is void + public override void visit(IVisitor visitor) + { + visitor.visit(this); + } + + } + + } diff --git a/SyntaxTree/tree/Visitor.cs b/SyntaxTree/tree/Visitor.cs index 28bf29f6c..fa702c711 100644 --- a/SyntaxTree/tree/Visitor.cs +++ b/SyntaxTree/tree/Visitor.cs @@ -1552,6 +1552,12 @@ namespace PascalABCCompiler.SyntaxTree ///Node to visit /// Return value is void void visit(property_ident _property_ident); + /// + ///Method to visit expression_with_let. + /// + ///Node to visit + /// Return value is void + void visit(expression_with_let _expression_with_let); } diff --git a/SyntaxTree/tree/tree.xml b/SyntaxTree/tree/tree.xml index 77fc94f2b..1d5660798 100644 --- a/SyntaxTree/tree/tree.xml +++ b/SyntaxTree/tree/tree.xml @@ -3323,6 +3323,17 @@ + + + + + + + + + + + Tree.cs @@ -3422,6 +3433,7 @@ + @@ -3827,6 +3839,7 @@ + @@ -3844,6 +3857,9 @@ + + + diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 6fa28f860..a1e66ae73 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -21406,5 +21406,11 @@ namespace PascalABCCompiler.TreeConverter visit(mc);*/ } + + public override void visit(SyntaxTree.expression_with_let _ex_with_let) + { + + } + } } \ No newline at end of file diff --git a/TreeConverter/TreeRealization/base_nodes.cs b/TreeConverter/TreeRealization/base_nodes.cs index 4d4c8923e..92645b927 100644 --- a/TreeConverter/TreeRealization/base_nodes.cs +++ b/TreeConverter/TreeRealization/base_nodes.cs @@ -577,4 +577,23 @@ namespace PascalABCCompiler.TreeRealization visitor.visit(this); } } + + [Serializable] + public class expression_with_let_semantic : expression_node + { + public expression_with_let_semantic(type_node type, location loc) + : base(type, loc) + { + } + + public override semantic_node_type semantic_node_type + { + get + { + return semantic_node_type.typed_expression; + } + } + public override string ToString() => type.ToString(); + } + }