From fcf04d7c997ecfac2ea500c19193c162a7e2e34f Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Mon, 13 Apr 2020 23:33:20 +0300 Subject: [PATCH] =?UTF-8?q?fix=20#2223=20TryRead=20=D1=81=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=BF=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=BC=20-=20message=20GraphWPF=20-=20DrawGraph=20-=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=BF=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=20?= =?UTF-8?q?-=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- .../PascalABCParserNewSaushkin/ABCPascal.cs | 6 +- .../PascalABCParserNewSaushkin/ABCPascal.y | 10 + .../ABCPascalYacc.cs | 4395 +++++++++-------- Parsers/PascalABCParserNewSaushkin/PABC.ymc | 1 + Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- TestSuite/CompilationSamples/GraphWPF.pas | 231 +- TestSuite/CompilationSamples/PABCSystem.pas | 75 +- TestSuite/CompilationSamples/mouse2.pas | 10 - TestSuite/PlusIfOp.pas | 5 + bin/Lib/GraphWPF.pas | 72 +- 13 files changed, 2469 insertions(+), 2346 deletions(-) delete mode 100644 TestSuite/CompilationSamples/mouse2.pas create mode 100644 TestSuite/PlusIfOp.pas diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index abe10e429..e74c637f2 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 = "6"; public const string Build = "2"; - public const string Revision = "2392"; + public const string Revision = "2403"; 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 94408f748..4d5321a0d 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=2 -%REVISION%=2392 %MINOR%=6 +%REVISION%=2403 +%COREVERSION%=2 %MAJOR%=3 diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index 72f2ce267..fa4e82a05 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-P4NLNB1 -// DateTime: 3/9/2020 1:37:31 PM -// UserName: fatco +// Machine: DESKTOP-G8V08V4 +// DateTime: 13.04.2020 23:05:41 +// UserName: ????????? // GPLEX input file // GPLEX frame file // diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index 43400d7fa..ff9f57a7b 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -3335,6 +3335,10 @@ relop_expr { $$ = new bin_expr($1, $3, $2.type, @$); } + | relop_expr relop new_question_expr + { + $$ = new bin_expr($1, $3, $2.type, @$); + } | is_type_expr tkRoundOpen pattern_out_param_list tkRoundClose { var isTypeCheck = $1 as typecast_node; @@ -3727,6 +3731,10 @@ term1 { $$ = new bin_expr($1, $3, $2.type, @$); } + | term1 addop new_question_expr + { + $$ = new bin_expr($1, $3, $2.type, @$); + } ; addop @@ -3795,6 +3803,8 @@ term { $$ = new bin_expr($1,$3,($2).type, @$); } | term mulop power_expr { $$ = new bin_expr($1,$3,($2).type, @$); } + | term mulop new_question_expr + { $$ = new bin_expr($1,$3,($2).type, @$); } | as_is_expr { $$ = $1; } ; diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 19da4c35c..cca3eeb38 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-P4NLNB1 -// DateTime: 3/9/2020 1:37:31 PM -// UserName: fatco +// Machine: DESKTOP-G8V08V4 +// DateTime: 13.04.2020 23:05:42 +// UserName: ????????? // Input file // options: no-lines gplex @@ -76,8 +76,8 @@ public partial class GPPGParser: ShiftReduceParser aliasses; #pragma warning restore 649 - private static Rule[] rules = new Rule[954]; - private static State[] states = new State[1575]; + private static Rule[] rules = new Rule[957]; + private static State[] states = new State[1578]; 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", @@ -167,13 +167,13 @@ public partial class GPPGParser: ShiftReduceParser is_type_expr, tkRoundOpen, pattern_out_param_list, tkRoundClose + case 618: // relop_expr -> relop_expr, relop, new_question_expr +{ + CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); + } + break; + case 619: // relop_expr -> is_type_expr, tkRoundOpen, pattern_out_param_list, tkRoundClose { var isTypeCheck = ValueStack[ValueStack.Depth-4].ex as typecast_node; var deconstructorPattern = new deconstructor_pattern(ValueStack[ValueStack.Depth-2].ob as List, isTypeCheck.type_def, null, CurrentLocationSpan); CurrentSemanticValue.ex = new is_pattern_expr(isTypeCheck.expr, deconstructorPattern, CurrentLocationSpan); } break; - case 619: // relop_expr -> term, tkIs, collection_pattern + case 620: // relop_expr -> term, tkIs, collection_pattern { CurrentSemanticValue.ex = new is_pattern_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 620: // relop_expr -> term, tkIs, tuple_pattern + case 621: // relop_expr -> term, tkIs, tuple_pattern { CurrentSemanticValue.ex = new is_pattern_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 621: // pattern -> simple_or_template_type_reference, tkRoundOpen, + case 622: // pattern -> simple_or_template_type_reference, tkRoundOpen, // pattern_out_param_list, tkRoundClose { CurrentSemanticValue.stn = new deconstructor_pattern(ValueStack[ValueStack.Depth-2].ob as List, ValueStack[ValueStack.Depth-4].td, null, CurrentLocationSpan); } break; - case 622: // pattern_optional_var -> simple_or_template_type_reference, tkRoundOpen, + case 623: // pattern_optional_var -> simple_or_template_type_reference, tkRoundOpen, // pattern_out_param_list_optional_var, tkRoundClose { CurrentSemanticValue.stn = new deconstructor_pattern(ValueStack[ValueStack.Depth-2].ob as List, ValueStack[ValueStack.Depth-4].td, null, CurrentLocationSpan); } break; - case 623: // deconstruction_or_const_pattern -> simple_or_template_type_reference, + case 624: // deconstruction_or_const_pattern -> simple_or_template_type_reference, // tkRoundOpen, // pattern_out_param_list_optional_var, // tkRoundClose @@ -5706,18 +5717,18 @@ public partial class GPPGParser: ShiftReduceParser, ValueStack[ValueStack.Depth-4].td, null, CurrentLocationSpan); } break; - case 624: // deconstruction_or_const_pattern -> const_pattern_expr_list + case 625: // deconstruction_or_const_pattern -> const_pattern_expr_list { CurrentSemanticValue.stn = new const_pattern(ValueStack[ValueStack.Depth-1].ob as List, CurrentLocationSpan); } break; - case 625: // const_pattern_expr_list -> const_pattern_expression + case 626: // const_pattern_expr_list -> const_pattern_expression { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn); } break; - case 626: // const_pattern_expr_list -> const_pattern_expr_list, tkComma, + case 627: // const_pattern_expr_list -> const_pattern_expr_list, tkComma, // const_pattern_expression { var list = ValueStack[ValueStack.Depth-3].ob as List; @@ -5725,36 +5736,36 @@ public partial class GPPGParser: ShiftReduceParser literal_or_number + case 628: // const_pattern_expression -> literal_or_number { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].ex; } break; - case 628: // const_pattern_expression -> simple_or_template_type_reference + case 629: // const_pattern_expression -> simple_or_template_type_reference { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } break; - case 629: // const_pattern_expression -> tkNil + case 630: // const_pattern_expression -> tkNil { CurrentSemanticValue.stn = new nil_const(); CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 630: // const_pattern_expression -> sizeof_expr + case 631: // const_pattern_expression -> sizeof_expr { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].ex; } break; - case 631: // const_pattern_expression -> typeof_expr + case 632: // const_pattern_expression -> typeof_expr { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].ex; } break; - case 632: // collection_pattern -> tkSquareOpen, collection_pattern_expr_list, tkSquareClose + case 633: // collection_pattern -> tkSquareOpen, collection_pattern_expr_list, tkSquareClose { CurrentSemanticValue.stn = new collection_pattern(ValueStack[ValueStack.Depth-2].ob as List, CurrentLocationSpan); } break; - case 633: // collection_pattern_expr_list -> collection_pattern_list_item + case 634: // collection_pattern_expr_list -> collection_pattern_list_item { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 634: // collection_pattern_expr_list -> collection_pattern_expr_list, tkComma, + case 635: // collection_pattern_expr_list -> collection_pattern_expr_list, tkComma, // collection_pattern_list_item { var list = ValueStack[ValueStack.Depth-3].ob as List; @@ -5762,103 +5773,103 @@ public partial class GPPGParser: ShiftReduceParser literal_or_number + case 636: // collection_pattern_list_item -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 636: // collection_pattern_list_item -> collection_pattern_var_item + case 637: // collection_pattern_list_item -> collection_pattern_var_item { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 637: // collection_pattern_list_item -> tkUnderscore + case 638: // collection_pattern_list_item -> tkUnderscore { CurrentSemanticValue.stn = new collection_pattern_wild_card(CurrentLocationSpan); } break; - case 638: // collection_pattern_list_item -> pattern_optional_var + case 639: // collection_pattern_list_item -> pattern_optional_var { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 639: // collection_pattern_list_item -> collection_pattern + case 640: // collection_pattern_list_item -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 640: // collection_pattern_list_item -> tuple_pattern + case 641: // collection_pattern_list_item -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 641: // collection_pattern_list_item -> tkDotDot + case 642: // collection_pattern_list_item -> tkDotDot { CurrentSemanticValue.stn = new collection_pattern_gap_parameter(CurrentLocationSpan); } break; - case 642: // collection_pattern_var_item -> tkVar, identifier + case 643: // collection_pattern_var_item -> tkVar, identifier { CurrentSemanticValue.stn = new collection_pattern_var_parameter(ValueStack[ValueStack.Depth-1].id, null, CurrentLocationSpan); } break; - case 643: // tuple_pattern -> tkRoundOpen, tuple_pattern_item_list, tkRoundClose + case 644: // tuple_pattern -> tkRoundOpen, tuple_pattern_item_list, tkRoundClose { if ((ValueStack[ValueStack.Depth-2].ob as List).Count>6) parsertools.AddErrorFromResource("TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7",CurrentLocationSpan); CurrentSemanticValue.stn = new tuple_pattern(ValueStack[ValueStack.Depth-2].ob as List, CurrentLocationSpan); } break; - case 644: // tuple_pattern_item -> tkUnderscore + case 645: // tuple_pattern_item -> tkUnderscore { CurrentSemanticValue.stn = new tuple_pattern_wild_card(CurrentLocationSpan); } break; - case 645: // tuple_pattern_item -> literal_or_number + case 646: // tuple_pattern_item -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 646: // tuple_pattern_item -> tkVar, identifier + case 647: // tuple_pattern_item -> tkVar, identifier { CurrentSemanticValue.stn = new tuple_pattern_var_parameter(ValueStack[ValueStack.Depth-1].id, null, CurrentLocationSpan); } break; - case 647: // tuple_pattern_item -> pattern_optional_var + case 648: // tuple_pattern_item -> pattern_optional_var { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 648: // tuple_pattern_item -> collection_pattern + case 649: // tuple_pattern_item -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 649: // tuple_pattern_item -> tuple_pattern + case 650: // tuple_pattern_item -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 650: // tuple_pattern_item_list -> tuple_pattern_item + case 651: // tuple_pattern_item_list -> tuple_pattern_item { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 651: // tuple_pattern_item_list -> tuple_pattern_item_list, tkComma, tuple_pattern_item + case 652: // tuple_pattern_item_list -> tuple_pattern_item_list, tkComma, tuple_pattern_item { var list = ValueStack[ValueStack.Depth-3].ob as List; list.Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); CurrentSemanticValue.ob = list; } break; - case 652: // pattern_out_param_list_optional_var -> pattern_out_param_optional_var + case 653: // pattern_out_param_list_optional_var -> pattern_out_param_optional_var { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 653: // pattern_out_param_list_optional_var -> pattern_out_param_list_optional_var, + case 654: // pattern_out_param_list_optional_var -> pattern_out_param_list_optional_var, // tkSemiColon, // pattern_out_param_optional_var { @@ -5867,7 +5878,7 @@ public partial class GPPGParser: ShiftReduceParser pattern_out_param_list_optional_var, + case 655: // pattern_out_param_list_optional_var -> pattern_out_param_list_optional_var, // tkComma, // pattern_out_param_optional_var { @@ -5876,13 +5887,13 @@ public partial class GPPGParser: ShiftReduceParser pattern_out_param + case 656: // pattern_out_param_list -> pattern_out_param { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 656: // pattern_out_param_list -> pattern_out_param_list, tkSemiColon, + case 657: // pattern_out_param_list -> pattern_out_param_list, tkSemiColon, // pattern_out_param { var list = ValueStack[ValueStack.Depth-3].ob as List; @@ -5890,180 +5901,180 @@ public partial class GPPGParser: ShiftReduceParser pattern_out_param_list, tkComma, pattern_out_param + case 658: // pattern_out_param_list -> pattern_out_param_list, tkComma, pattern_out_param { var list = ValueStack[ValueStack.Depth-3].ob as List; list.Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); CurrentSemanticValue.ob = list; } break; - case 658: // pattern_out_param -> tkUnderscore + case 659: // pattern_out_param -> tkUnderscore { CurrentSemanticValue.stn = new wild_card_deconstructor_parameter(CurrentLocationSpan); } break; - case 659: // pattern_out_param -> literal_or_number + case 660: // pattern_out_param -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 660: // pattern_out_param -> tkVar, identifier, tkColon, type_ref + case 661: // pattern_out_param -> tkVar, identifier, tkColon, type_ref { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].td, true, CurrentLocationSpan); } break; - case 661: // pattern_out_param -> tkVar, identifier + case 662: // pattern_out_param -> tkVar, identifier { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-1].id, null, true, CurrentLocationSpan); } break; - case 662: // pattern_out_param -> pattern + case 663: // pattern_out_param -> pattern { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 663: // pattern_out_param -> collection_pattern + case 664: // pattern_out_param -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 664: // pattern_out_param -> tuple_pattern + case 665: // pattern_out_param -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 665: // pattern_out_param_optional_var -> tkUnderscore + case 666: // pattern_out_param_optional_var -> tkUnderscore { CurrentSemanticValue.stn = new wild_card_deconstructor_parameter(CurrentLocationSpan); } break; - case 666: // pattern_out_param_optional_var -> literal_or_number + case 667: // pattern_out_param_optional_var -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 667: // pattern_out_param_optional_var -> identifier, tkColon, type_ref + case 668: // pattern_out_param_optional_var -> identifier, tkColon, type_ref { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].td, false, CurrentLocationSpan); } break; - case 668: // pattern_out_param_optional_var -> identifier + case 669: // pattern_out_param_optional_var -> identifier { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-1].id, null, false, CurrentLocationSpan); } break; - case 669: // pattern_out_param_optional_var -> tkVar, identifier, tkColon, type_ref + case 670: // pattern_out_param_optional_var -> tkVar, identifier, tkColon, type_ref { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].td, true, CurrentLocationSpan); } break; - case 670: // pattern_out_param_optional_var -> tkVar, identifier + case 671: // pattern_out_param_optional_var -> tkVar, identifier { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-1].id, null, true, CurrentLocationSpan); } break; - case 671: // pattern_out_param_optional_var -> pattern_optional_var + case 672: // pattern_out_param_optional_var -> pattern_optional_var { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 672: // pattern_out_param_optional_var -> collection_pattern + case 673: // pattern_out_param_optional_var -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 673: // pattern_out_param_optional_var -> tuple_pattern + case 674: // pattern_out_param_optional_var -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 674: // simple_expr_or_nothing -> simple_expr + case 675: // simple_expr_or_nothing -> simple_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 675: // simple_expr_or_nothing -> /* empty */ + case 676: // simple_expr_or_nothing -> /* empty */ { CurrentSemanticValue.ex = null; } break; - case 676: // const_expr_or_nothing -> const_expr + case 677: // const_expr_or_nothing -> const_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 677: // const_expr_or_nothing -> /* empty */ + case 678: // const_expr_or_nothing -> /* empty */ { CurrentSemanticValue.ex = null; } break; - case 678: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing + case 679: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 679: // format_expr -> tkColon, simple_expr_or_nothing + case 680: // format_expr -> tkColon, simple_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 680: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing, tkColon, + case 681: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing, tkColon, // simple_expr { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 681: // format_expr -> tkColon, simple_expr_or_nothing, tkColon, simple_expr + case 682: // format_expr -> tkColon, simple_expr_or_nothing, tkColon, simple_expr { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 682: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing + case 683: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 683: // format_const_expr -> tkColon, const_expr_or_nothing + case 684: // format_const_expr -> tkColon, const_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 684: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing, tkColon, + case 685: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing, tkColon, // const_expr { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 685: // format_const_expr -> tkColon, const_expr_or_nothing, tkColon, const_expr + case 686: // format_const_expr -> tkColon, const_expr_or_nothing, tkColon, const_expr { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 686: // relop -> tkEqual + case 687: // relop -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 687: // relop -> tkNotEqual + case 688: // relop -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 688: // relop -> tkLower + case 689: // relop -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 689: // relop -> tkGreater + case 690: // relop -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 690: // relop -> tkLowerEqual + case 691: // relop -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 691: // relop -> tkGreaterEqual + case 692: // relop -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 692: // relop -> tkIn + case 693: // relop -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 693: // simple_expr -> term1 + case 694: // simple_expr -> term1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 694: // simple_expr -> simple_expr, tkDotDot, term1 + case 695: // simple_expr -> simple_expr, tkDotDot, term1 { if (parsertools.build_tree_for_formatter) CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,CurrentLocationSpan); @@ -6071,107 +6082,115 @@ public partial class GPPGParser: ShiftReduceParser term + case 696: // term1 -> term { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 696: // term1 -> term1, addop, term + case 697: // term1 -> term1, addop, term { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 697: // addop -> tkPlus + case 698: // term1 -> term1, addop, new_question_expr +{ + CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); + } + break; + case 699: // addop -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 698: // addop -> tkMinus + case 700: // addop -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 699: // addop -> tkOr + case 701: // addop -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 700: // addop -> tkXor + case 702: // addop -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 701: // addop -> tkCSharpStyleOr + case 703: // addop -> tkCSharpStyleOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 702: // typecast_op -> tkAs + case 704: // typecast_op -> tkAs { CurrentSemanticValue.ob = op_typecast.as_op; } break; - case 703: // typecast_op -> tkIs + case 705: // typecast_op -> tkIs { CurrentSemanticValue.ob = op_typecast.is_op; } break; - case 704: // as_is_expr -> is_type_expr + case 706: // as_is_expr -> is_type_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 705: // as_is_expr -> as_expr + case 707: // as_is_expr -> as_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 706: // as_expr -> term, tkAs, simple_or_template_type_reference + case 708: // as_expr -> term, tkAs, simple_or_template_type_reference { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.as_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 707: // is_type_expr -> term, tkIs, simple_or_template_type_reference + case 709: // is_type_expr -> term, tkIs, simple_or_template_type_reference { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.is_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 708: // simple_term -> factor + case 710: // simple_term -> factor { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 709: // power_expr -> simple_term, tkStarStar, factor + case 711: // power_expr -> simple_term, tkStarStar, factor { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 710: // term -> factor + case 712: // term -> factor { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 711: // term -> new_expr + case 713: // term -> new_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 712: // term -> power_expr + case 714: // term -> power_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 713: // term -> term, mulop, factor + case 715: // term -> term, mulop, factor { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 714: // term -> term, mulop, power_expr + case 716: // term -> term, mulop, power_expr { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 715: // term -> as_is_expr + case 717: // term -> term, mulop, new_question_expr +{ CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } + break; + case 718: // term -> as_is_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 716: // mulop -> tkStar + case 719: // mulop -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 717: // mulop -> tkSlash + case 720: // mulop -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 718: // mulop -> tkDiv + case 721: // mulop -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 719: // mulop -> tkMod + case 722: // mulop -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 720: // mulop -> tkShl + case 723: // mulop -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 721: // mulop -> tkShr + case 724: // mulop -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 722: // mulop -> tkAnd + case 725: // mulop -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 723: // default_expr -> tkDefault, tkRoundOpen, simple_or_template_type_reference, + case 726: // default_expr -> tkDefault, tkRoundOpen, simple_or_template_type_reference, // tkRoundClose { CurrentSemanticValue.ex = new default_operator(ValueStack[ValueStack.Depth-2].td as named_type_reference, CurrentLocationSpan); } break; - case 724: // tuple -> tkRoundOpen, expr_l1, tkComma, expr_l1_list, lambda_type_ref, + case 727: // tuple -> tkRoundOpen, expr_l1, tkComma, expr_l1_list, lambda_type_ref, // optional_full_lambda_fp_list, tkRoundClose { /*if ($5 != null) @@ -6185,29 +6204,29 @@ public partial class GPPGParser: ShiftReduceParser tkNil + case 728: // factor -> tkNil { CurrentSemanticValue.ex = new nil_const(); CurrentSemanticValue.ex.source_context = CurrentLocationSpan; } break; - case 726: // factor -> literal_or_number + case 729: // factor -> literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 727: // factor -> default_expr + case 730: // factor -> default_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 728: // factor -> tkSquareOpen, elem_list, tkSquareClose + case 731: // factor -> tkSquareOpen, elem_list, tkSquareClose { CurrentSemanticValue.ex = new pascal_set_constant(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 729: // factor -> tkNot, factor + case 732: // factor -> tkNot, factor { CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 730: // factor -> sign, factor + case 733: // factor -> sign, factor { if (ValueStack[ValueStack.Depth-2].op.type == Operators.Minus) { @@ -6234,91 +6253,91 @@ public partial class GPPGParser: ShiftReduceParser var_reference + case 734: // factor -> var_reference { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 732: // factor -> tuple + case 735: // factor -> tuple { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 733: // literal_or_number -> literal + case 736: // literal_or_number -> literal { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 734: // literal_or_number -> unsigned_number + case 737: // literal_or_number -> unsigned_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 735: // var_question_point -> variable, tkQuestionPoint, variable + case 738: // var_question_point -> variable, tkQuestionPoint, variable { CurrentSemanticValue.ex = new dot_question_node(ValueStack[ValueStack.Depth-3].ex as addressed_value,ValueStack[ValueStack.Depth-1].ex as addressed_value,CurrentLocationSpan); } break; - case 736: // var_question_point -> variable, tkQuestionPoint, var_question_point + case 739: // var_question_point -> variable, tkQuestionPoint, var_question_point { CurrentSemanticValue.ex = new dot_question_node(ValueStack[ValueStack.Depth-3].ex as addressed_value,ValueStack[ValueStack.Depth-1].ex as addressed_value,CurrentLocationSpan); } break; - case 737: // var_reference -> var_address, variable + case 740: // var_reference -> var_address, variable { CurrentSemanticValue.ex = NewVarReference(ValueStack[ValueStack.Depth-2].stn as get_address, ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); } break; - case 738: // var_reference -> variable + case 741: // var_reference -> variable { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 739: // var_reference -> var_question_point + case 742: // var_reference -> var_question_point { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 740: // var_address -> tkAddressOf + case 743: // var_address -> tkAddressOf { CurrentSemanticValue.stn = NewVarAddress(CurrentLocationSpan); } break; - case 741: // var_address -> var_address, tkAddressOf + case 744: // var_address -> var_address, tkAddressOf { CurrentSemanticValue.stn = NewVarAddress(ValueStack[ValueStack.Depth-2].stn as get_address, CurrentLocationSpan); } break; - case 742: // attribute_variable -> simple_type_identifier, optional_expr_list_with_bracket + case 745: // attribute_variable -> simple_type_identifier, optional_expr_list_with_bracket { CurrentSemanticValue.stn = new attribute(null, ValueStack[ValueStack.Depth-2].td as named_type_reference, ValueStack[ValueStack.Depth-1].stn as expression_list, CurrentLocationSpan); } break; - case 743: // attribute_variable -> template_type, optional_expr_list_with_bracket + case 746: // attribute_variable -> template_type, optional_expr_list_with_bracket { CurrentSemanticValue.stn = new attribute(null, ValueStack[ValueStack.Depth-2].td as named_type_reference, ValueStack[ValueStack.Depth-1].stn as expression_list, CurrentLocationSpan); } break; - case 744: // dotted_identifier -> identifier + case 747: // dotted_identifier -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 745: // dotted_identifier -> dotted_identifier, tkPoint, identifier_or_keyword + case 748: // dotted_identifier -> dotted_identifier, 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 746: // variable_as_type -> dotted_identifier + case 749: // variable_as_type -> dotted_identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex;} break; - case 747: // variable_as_type -> dotted_identifier, template_type_params + case 750: // variable_as_type -> dotted_identifier, template_type_params { CurrentSemanticValue.ex = new ident_with_templateparams(ValueStack[ValueStack.Depth-2].ex as addressed_value, ValueStack[ValueStack.Depth-1].stn as template_param_list, CurrentLocationSpan); } break; - case 748: // variable_or_literal_or_number -> variable + case 751: // variable_or_literal_or_number -> variable { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 749: // variable_or_literal_or_number -> literal_or_number + case 752: // variable_or_literal_or_number -> literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 750: // variable -> identifier + case 753: // variable -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 751: // variable -> operator_name_ident + case 754: // variable -> operator_name_ident { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 752: // variable -> tkInherited, identifier + case 755: // variable -> tkInherited, identifier { CurrentSemanticValue.ex = new inherited_ident(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 753: // variable -> tkRoundOpen, expr, tkRoundClose + case 756: // variable -> tkRoundOpen, expr, tkRoundClose { if (!parsertools.build_tree_for_formatter) { @@ -6328,18 +6347,18 @@ public partial class GPPGParser: ShiftReduceParser sizeof_expr + case 757: // variable -> sizeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 755: // variable -> typeof_expr + case 758: // variable -> typeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 756: // variable -> literal_or_number, tkPoint, identifier_or_keyword + case 759: // 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 757: // variable -> variable_or_literal_or_number, tkSquareOpen, expr_list, + case 760: // variable -> variable_or_literal_or_number, tkSquareOpen, expr_list, // tkSquareClose { var el = ValueStack[ValueStack.Depth-2].stn as expression_list; // SSM 10/03/16 @@ -6358,7 +6377,7 @@ public partial class GPPGParser: ShiftReduceParser variable, tkQuestionSquareOpen, format_expr, tkSquareClose + case 761: // variable -> variable, tkQuestionSquareOpen, format_expr, tkSquareClose { var fe = ValueStack[ValueStack.Depth-2].ex as format_expr; // SSM 9/01/17 if (!parsertools.build_tree_for_formatter) @@ -6371,71 +6390,71 @@ public partial class GPPGParser: ShiftReduceParser variable, tkRoundOpen, optional_expr_list, tkRoundClose + case 762: // 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 760: // variable -> variable, tkPoint, identifier_keyword_operatorname + case 763: // 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 761: // variable -> tuple, tkPoint, identifier_keyword_operatorname + case 764: // 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 762: // variable -> variable, tkDeref + case 765: // variable -> variable, tkDeref { CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-2].ex as addressed_value,CurrentLocationSpan); } break; - case 763: // variable -> variable, tkAmpersend, template_type_params + case 766: // 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 764: // optional_expr_list -> expr_list + case 767: // optional_expr_list -> expr_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 765: // optional_expr_list -> /* empty */ + case 768: // optional_expr_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 766: // elem_list -> elem_list1 + case 769: // elem_list -> elem_list1 { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 767: // elem_list -> /* empty */ + case 770: // elem_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 768: // elem_list1 -> elem + case 771: // elem_list1 -> elem { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 769: // elem_list1 -> elem_list1, tkComma, elem + case 772: // 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 770: // elem -> expr + case 773: // elem -> expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 771: // elem -> expr, tkDotDot, expr + case 774: // elem -> expr, tkDotDot, expr { CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 772: // one_literal -> tkStringLiteral + case 775: // one_literal -> tkStringLiteral { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 773: // one_literal -> tkAsciiChar + case 776: // one_literal -> tkAsciiChar { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 774: // literal -> literal_list + case 777: // literal -> literal_list { CurrentSemanticValue.ex = NewLiteral(ValueStack[ValueStack.Depth-1].stn as literal_const_line); } break; - case 775: // literal -> tkFormatStringLiteral + case 778: // literal -> tkFormatStringLiteral { if (parsertools.build_tree_for_formatter) { @@ -6447,12 +6466,12 @@ public partial class GPPGParser: ShiftReduceParser one_literal + case 779: // literal_list -> one_literal { CurrentSemanticValue.stn = new literal_const_line(ValueStack[ValueStack.Depth-1].ex as literal, CurrentLocationSpan); } break; - case 777: // literal_list -> literal_list, one_literal + case 780: // 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) @@ -6460,449 +6479,449 @@ public partial class GPPGParser: ShiftReduceParser tkOperator, overload_operator + case 781: // 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 779: // optional_method_modificators -> tkSemiColon + case 782: // optional_method_modificators -> tkSemiColon { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 780: // optional_method_modificators -> tkSemiColon, meth_modificators, tkSemiColon + case 783: // 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 781: // optional_method_modificators1 -> /* empty */ + case 784: // optional_method_modificators1 -> /* empty */ { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 782: // optional_method_modificators1 -> tkSemiColon, meth_modificators + case 785: // 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 783: // meth_modificators -> meth_modificator + case 786: // meth_modificators -> meth_modificator { CurrentSemanticValue.stn = new procedure_attributes_list(ValueStack[ValueStack.Depth-1].id as procedure_attribute, CurrentLocationSpan); } break; - case 784: // meth_modificators -> meth_modificators, tkSemiColon, meth_modificator + case 787: // 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 785: // identifier -> tkIdentifier + case 788: // identifier -> tkIdentifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 786: // identifier -> property_specifier_directives + case 789: // identifier -> property_specifier_directives { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 787: // identifier -> non_reserved + case 790: // identifier -> non_reserved { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 788: // identifier_or_keyword -> identifier + case 791: // identifier_or_keyword -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 789: // identifier_or_keyword -> keyword + case 792: // identifier_or_keyword -> keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 790: // identifier_or_keyword -> reserved_keyword + case 793: // identifier_or_keyword -> reserved_keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 791: // identifier_keyword_operatorname -> identifier + case 794: // identifier_keyword_operatorname -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 792: // identifier_keyword_operatorname -> keyword + case 795: // identifier_keyword_operatorname -> keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 793: // identifier_keyword_operatorname -> operator_name_ident + case 796: // identifier_keyword_operatorname -> operator_name_ident { CurrentSemanticValue.id = (ident)ValueStack[ValueStack.Depth-1].ex; } break; - case 794: // meth_modificator -> tkAbstract + case 797: // meth_modificator -> tkAbstract { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 795: // meth_modificator -> tkOverload + case 798: // 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 796: // meth_modificator -> tkReintroduce + case 799: // meth_modificator -> tkReintroduce { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 797: // meth_modificator -> tkOverride + case 800: // meth_modificator -> tkOverride { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 798: // meth_modificator -> tkExtensionMethod + case 801: // meth_modificator -> tkExtensionMethod { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 799: // meth_modificator -> tkVirtual + case 802: // meth_modificator -> tkVirtual { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 800: // property_modificator -> tkVirtual + case 803: // property_modificator -> tkVirtual { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 801: // property_modificator -> tkOverride + case 804: // property_modificator -> tkOverride { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 802: // property_modificator -> tkAbstract + case 805: // property_modificator -> tkAbstract { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 803: // property_modificator -> tkReintroduce + case 806: // property_modificator -> tkReintroduce { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 804: // property_specifier_directives -> tkRead + case 807: // property_specifier_directives -> tkRead { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 805: // property_specifier_directives -> tkWrite + case 808: // property_specifier_directives -> tkWrite { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 806: // non_reserved -> tkName + case 809: // non_reserved -> tkName { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 807: // non_reserved -> tkNew + case 810: // non_reserved -> tkNew { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 808: // visibility_specifier -> tkInternal + case 811: // visibility_specifier -> tkInternal { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 809: // visibility_specifier -> tkPublic + case 812: // visibility_specifier -> tkPublic { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 810: // visibility_specifier -> tkProtected + case 813: // visibility_specifier -> tkProtected { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 811: // visibility_specifier -> tkPrivate + case 814: // visibility_specifier -> tkPrivate { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 812: // keyword -> visibility_specifier + case 815: // keyword -> visibility_specifier { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 813: // keyword -> tkSealed + case 816: // keyword -> tkSealed { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 814: // keyword -> tkTemplate + case 817: // keyword -> tkTemplate { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 815: // keyword -> tkOr + case 818: // keyword -> tkOr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 816: // keyword -> tkTypeOf + case 819: // keyword -> tkTypeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 817: // keyword -> tkSizeOf + case 820: // keyword -> tkSizeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 818: // keyword -> tkDefault + case 821: // keyword -> tkDefault { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 819: // keyword -> tkWhere + case 822: // keyword -> tkWhere { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 820: // keyword -> tkXor + case 823: // keyword -> tkXor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 821: // keyword -> tkAnd + case 824: // keyword -> tkAnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 822: // keyword -> tkDiv + case 825: // keyword -> tkDiv { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 823: // keyword -> tkMod + case 826: // keyword -> tkMod { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 824: // keyword -> tkShl + case 827: // keyword -> tkShl { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 825: // keyword -> tkShr + case 828: // keyword -> tkShr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 826: // keyword -> tkNot + case 829: // keyword -> tkNot { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 827: // keyword -> tkAs + case 830: // keyword -> tkAs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 828: // keyword -> tkIn + case 831: // keyword -> tkIn { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 829: // keyword -> tkIs + case 832: // keyword -> tkIs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 830: // keyword -> tkArray + case 833: // keyword -> tkArray { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 831: // keyword -> tkSequence + case 834: // keyword -> tkSequence { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 832: // keyword -> tkBegin + case 835: // keyword -> tkBegin { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 833: // keyword -> tkCase + case 836: // keyword -> tkCase { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 834: // keyword -> tkClass + case 837: // keyword -> tkClass { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 835: // keyword -> tkConst + case 838: // keyword -> tkConst { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 836: // keyword -> tkConstructor + case 839: // keyword -> tkConstructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 837: // keyword -> tkDestructor + case 840: // keyword -> tkDestructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 838: // keyword -> tkDownto + case 841: // keyword -> tkDownto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 839: // keyword -> tkDo + case 842: // keyword -> tkDo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 840: // keyword -> tkElse + case 843: // keyword -> tkElse { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 841: // keyword -> tkEnd + case 844: // keyword -> tkEnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 842: // keyword -> tkExcept + case 845: // keyword -> tkExcept { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 843: // keyword -> tkFile + case 846: // keyword -> tkFile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 844: // keyword -> tkAuto + case 847: // keyword -> tkAuto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 845: // keyword -> tkFinalization + case 848: // keyword -> tkFinalization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 846: // keyword -> tkFinally + case 849: // keyword -> tkFinally { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 847: // keyword -> tkFor + case 850: // keyword -> tkFor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 848: // keyword -> tkForeach + case 851: // keyword -> tkForeach { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 849: // keyword -> tkFunction + case 852: // keyword -> tkFunction { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 850: // keyword -> tkIf + case 853: // keyword -> tkIf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 851: // keyword -> tkImplementation + case 854: // keyword -> tkImplementation { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 852: // keyword -> tkInherited + case 855: // keyword -> tkInherited { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 853: // keyword -> tkInitialization + case 856: // keyword -> tkInitialization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 854: // keyword -> tkInterface + case 857: // keyword -> tkInterface { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 855: // keyword -> tkProcedure + case 858: // keyword -> tkProcedure { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 856: // keyword -> tkProperty + case 859: // keyword -> tkProperty { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 857: // keyword -> tkRaise + case 860: // keyword -> tkRaise { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 858: // keyword -> tkRecord + case 861: // keyword -> tkRecord { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 859: // keyword -> tkRepeat + case 862: // keyword -> tkRepeat { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 860: // keyword -> tkSet + case 863: // keyword -> tkSet { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 861: // keyword -> tkTry + case 864: // keyword -> tkTry { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 862: // keyword -> tkType + case 865: // keyword -> tkType { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 863: // keyword -> tkStatic + case 866: // keyword -> tkStatic { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 864: // keyword -> tkThen + case 867: // keyword -> tkThen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 865: // keyword -> tkTo + case 868: // keyword -> tkTo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 866: // keyword -> tkUntil + case 869: // keyword -> tkUntil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 867: // keyword -> tkUses + case 870: // keyword -> tkUses { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 868: // keyword -> tkVar + case 871: // keyword -> tkVar { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 869: // keyword -> tkWhile + case 872: // keyword -> tkWhile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 870: // keyword -> tkWith + case 873: // keyword -> tkWith { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 871: // keyword -> tkNil + case 874: // keyword -> tkNil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 872: // keyword -> tkGoto + case 875: // keyword -> tkGoto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 873: // keyword -> tkOf + case 876: // keyword -> tkOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 874: // keyword -> tkLabel + case 877: // keyword -> tkLabel { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 875: // keyword -> tkProgram + case 878: // keyword -> tkProgram { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 876: // keyword -> tkUnit + case 879: // keyword -> tkUnit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 877: // keyword -> tkLibrary + case 880: // keyword -> tkLibrary { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 878: // keyword -> tkNamespace + case 881: // keyword -> tkNamespace { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 879: // keyword -> tkExternal + case 882: // keyword -> tkExternal { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 880: // keyword -> tkParams + case 883: // keyword -> tkParams { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 881: // keyword -> tkEvent + case 884: // keyword -> tkEvent { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 882: // keyword -> tkYield + case 885: // keyword -> tkYield { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 883: // keyword -> tkMatch + case 886: // keyword -> tkMatch { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 884: // keyword -> tkWhen + case 887: // keyword -> tkWhen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 885: // reserved_keyword -> tkOperator + case 888: // reserved_keyword -> tkOperator { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 886: // overload_operator -> tkMinus + case 889: // overload_operator -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 887: // overload_operator -> tkPlus + case 890: // overload_operator -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 888: // overload_operator -> tkSlash + case 891: // overload_operator -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 889: // overload_operator -> tkStar + case 892: // overload_operator -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 890: // overload_operator -> tkEqual + case 893: // overload_operator -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 891: // overload_operator -> tkGreater + case 894: // overload_operator -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 892: // overload_operator -> tkGreaterEqual + case 895: // overload_operator -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 893: // overload_operator -> tkLower + case 896: // overload_operator -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 894: // overload_operator -> tkLowerEqual + case 897: // overload_operator -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 895: // overload_operator -> tkNotEqual + case 898: // overload_operator -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 896: // overload_operator -> tkOr + case 899: // overload_operator -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 897: // overload_operator -> tkXor + case 900: // overload_operator -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 898: // overload_operator -> tkAnd + case 901: // overload_operator -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 899: // overload_operator -> tkDiv + case 902: // overload_operator -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 900: // overload_operator -> tkMod + case 903: // overload_operator -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 901: // overload_operator -> tkShl + case 904: // overload_operator -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 902: // overload_operator -> tkShr + case 905: // overload_operator -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 903: // overload_operator -> tkNot + case 906: // overload_operator -> tkNot { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 904: // overload_operator -> tkIn + case 907: // overload_operator -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 905: // overload_operator -> tkImplicit + case 908: // overload_operator -> tkImplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 906: // overload_operator -> tkExplicit + case 909: // overload_operator -> tkExplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 907: // overload_operator -> assign_operator + case 910: // overload_operator -> assign_operator { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 908: // overload_operator -> tkStarStar + case 911: // overload_operator -> tkStarStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 909: // assign_operator -> tkAssign + case 912: // assign_operator -> tkAssign { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 910: // assign_operator -> tkPlusEqual + case 913: // assign_operator -> tkPlusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 911: // assign_operator -> tkMinusEqual + case 914: // assign_operator -> tkMinusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 912: // assign_operator -> tkMultEqual + case 915: // assign_operator -> tkMultEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 913: // assign_operator -> tkDivEqual + case 916: // assign_operator -> tkDivEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 914: // func_decl_lambda -> identifier, tkArrow, lambda_function_body + case 917: // 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 915: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, + case 918: // 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 916: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, + case 919: // 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]); @@ -6911,7 +6930,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, + case 920: // func_decl_lambda -> tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { @@ -6922,7 +6941,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, + case 921: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, // full_lambda_fp_list, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { @@ -6934,7 +6953,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, expr_l1, tkComma, expr_l1_list, + case 922: // func_decl_lambda -> tkRoundOpen, expr_l1, tkComma, expr_l1_list, // lambda_type_ref, optional_full_lambda_fp_list, // tkRoundClose, rem_lambda { @@ -6996,61 +7015,61 @@ public partial class GPPGParser: ShiftReduceParser expl_func_decl_lambda + case 923: // func_decl_lambda -> expl_func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 921: // optional_full_lambda_fp_list -> /* empty */ + case 924: // optional_full_lambda_fp_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 922: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list + case 925: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 923: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body + case 926: // 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 924: // expl_func_decl_lambda -> tkFunction, lambda_type_ref, tkArrow, + case 927: // 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 925: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, lambda_type_ref, + case 928: // 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 926: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, + case 929: // 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 927: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body + case 930: // 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 928: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, + case 931: // 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 929: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, + case 932: // 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 930: // full_lambda_fp_list -> lambda_simple_fp_sect + case 933: // 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) @@ -7070,97 +7089,97 @@ public partial class GPPGParser: ShiftReduceParser full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect + case 934: // 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 932: // lambda_simple_fp_sect -> ident_list, lambda_type_ref + case 935: // 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 933: // lambda_type_ref -> /* empty */ + case 936: // lambda_type_ref -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 934: // lambda_type_ref -> tkColon, fptype + case 937: // lambda_type_ref -> tkColon, fptype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 935: // lambda_type_ref_noproctype -> /* empty */ + case 938: // lambda_type_ref_noproctype -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 936: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype + case 939: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 937: // common_lambda_body -> compound_stmt + case 940: // common_lambda_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 938: // common_lambda_body -> if_stmt + case 941: // common_lambda_body -> if_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 939: // common_lambda_body -> while_stmt + case 942: // common_lambda_body -> while_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 940: // common_lambda_body -> repeat_stmt + case 943: // common_lambda_body -> repeat_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 941: // common_lambda_body -> for_stmt + case 944: // common_lambda_body -> for_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 942: // common_lambda_body -> foreach_stmt + case 945: // common_lambda_body -> foreach_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 943: // common_lambda_body -> loop_stmt + case 946: // common_lambda_body -> loop_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 944: // common_lambda_body -> case_stmt + case 947: // common_lambda_body -> case_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 945: // common_lambda_body -> try_stmt + case 948: // common_lambda_body -> try_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 946: // common_lambda_body -> lock_stmt + case 949: // common_lambda_body -> lock_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 947: // common_lambda_body -> raise_stmt + case 950: // common_lambda_body -> raise_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 948: // common_lambda_body -> yield_stmt + case 951: // common_lambda_body -> yield_stmt { parsertools.AddErrorFromResource("YIELD_STATEMENT_CANNOT_BE_USED_IN_LAMBDA_BODY", CurrentLocationSpan); } break; - case 949: // lambda_function_body -> expr_l1_for_lambda + case 952: // lambda_function_body -> expr_l1_for_lambda { var id = SyntaxVisitors.ExprHasNameVisitor.HasName(ValueStack[ValueStack.Depth-1].ex, "Result"); if (id != null) @@ -7172,22 +7191,22 @@ public partial class GPPGParser: ShiftReduceParser common_lambda_body + case 953: // lambda_function_body -> common_lambda_body { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 951: // lambda_procedure_body -> proc_call + case 954: // lambda_procedure_body -> proc_call { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 952: // lambda_procedure_body -> assignment + case 955: // lambda_procedure_body -> assignment { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 953: // lambda_procedure_body -> common_lambda_body + case 956: // 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 754eb08bd..11fca10d0 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -264,5 +264,6 @@ script= + diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 9d526150b..95713ea0b 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.6.2.2392 +3.6.2.2403 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index da1dd9419..b9544234a 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.6.2.2392' +!define VERSION '3.6.2.2403' diff --git a/TestSuite/CompilationSamples/GraphWPF.pas b/TestSuite/CompilationSamples/GraphWPF.pas index 9b357f6ae..6a7ad2570 100644 --- a/TestSuite/CompilationSamples/GraphWPF.pas +++ b/TestSuite/CompilationSamples/GraphWPF.pas @@ -415,21 +415,25 @@ function TextSize(text: string): Size; //>> Функции для вывода графиков # GraphWPF graph functions // ----------------------------------------------------- /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом координатами x1,y1,x2,y2, -procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real); +procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real; title: string := ''); +/// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом параметрами x,y,w,h. Два последних параметра задают шаг сетки по OX и OY +procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real; XTicks: real; YTicks: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике r -procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect); +procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; title: string := ''); +/// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике r. Два последних параметра задают шаг сетки по OX и OY +procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; XTicks, YTicks: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, на полное графическое окно -procedure DrawGraph(f: real -> real; a, b, min, max: real); +procedure DrawGraph(f: real -> real; a, b, min, max: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b], в прямоугольнике, задаваемом координатами x1,y1,x2,y2, -procedure DrawGraph(f: real -> real; a, b: real; x, y, w, h: real); +procedure DrawGraph(f: real -> real; a, b: real; x, y, w, h: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b], в прямоугольнике r -procedure DrawGraph(f: real -> real; a, b: real; r: GRect); +procedure DrawGraph(f: real -> real; a, b: real; r: GRect; title: string := ''); /// Рисует график функции f, заданной на отрезке [-5,5], в прямоугольнике r -procedure DrawGraph(f: real -> real; r: GRect); +procedure DrawGraph(f: real -> real; r: GRect; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b], на полное графическое окно -procedure DrawGraph(f: real -> real; a, b: real); +procedure DrawGraph(f: real -> real; a, b: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [-5,5], на полное графическое окно -procedure DrawGraph(f: real -> real); +procedure DrawGraph(f: real -> real; title: string := ''); // ----------------------------------------------------- //>> Функции для настройки системы координат # GraphWPF coordinate system functions @@ -1168,97 +1172,152 @@ procedure TextOut(x, y: real; text: real; c: GColor; align: Alignment; angle: re type FS = auto class - mx, my, a, min, max: real; - x1, y1: real; - f: real-> real; + mx, my, a, b, min, max: real; + x, y, w, h, XTicks, YTicks: real; + f: real -> real; + title: string; + marginY := 6; + marginX := 6; + spaceBetweenTextAndGraph := 4; - function Apply(x: real) := Pnt(x1 + mx * (x - a), y1 + my * (max - f(x))); - function RealToScreenX(x: real) := x1 + mx * (x - a); - function RealToScreenY(y: real) := y1 - my * (y + min); + constructor (a, b, min, max, x, y, w, h: real; f: real -> real; XTicks: real := 1; YTicks: real := 1; title: string := ''); + begin + Self.a := a.Round(5); Self.b := b.Round(5); + Self.min := min.Round(5); Self.max := max.Round(5); + Self.x := x; Self.y := y; Self.w := w; Self.h := h; + Self.f := f; Self.XTicks := XTicks; Self.YTicks := YTicks; + Self.title := title; + end; + + function Ticks(d: real): real; + begin + var n := floor(log10(d)); + var p := Power(10,n); + var r := d / p; + // r = 1 .. 10 + if r >= 5 then + Result := p + else if r >= 2 then + Result := p/2 + else Result := p/5 + end; + + procedure CorrectBounds; + begin + //var digits := 5; + var tw := TextWidth('-99.9'); + var th := TextHeight('0'); + w -= marginX * 2 + spaceBetweenTextAndGraph + tw; + h -= marginY * 2 + spaceBetweenTextAndGraph + th; + x += marginX + spaceBetweenTextAndGraph + tw; + y += marginY; + if title<>'' then + begin + y += spaceBetweenTextAndGraph + th; + h -= spaceBetweenTextAndGraph + th; + end; + mx := w / (b - a); + my := h / (max - min); + if real.IsNaN(XTicks) then + XTicks := Ticks(b-a); + if real.IsNaN(YTicks) then + YTicks := Ticks(max-min); + end; + + function Apply(xx: real) := Pnt(x + mx * (xx - a), y + my * (max - f(xx))); + function RealToScreenX(xx: real) := x + mx * (xx - a); + function RealToScreenY(yy: real) := y + h - my * (yy - min); // ? + function ScreenToRealX(xx: real) := (xx - x) / mx + a; + function ScreenToRealY(yy: real) := (y + h - yy) / my + min; + + procedure Draw; + var AxisColor := GrayColor(112); + begin + FillRectangle(x, y, w, h, Colors.White); + CorrectBounds; + Pen.Color := Colors.LightGray; + var sx := mx * XTicks; + var xt := XTicks * Trunc(Abs(a)/XTicks); + var rx0: real; + if a <= 0 then + rx0 := -xt + else rx0 := xt + XTicks; + //var rx0 := a; + var x0 := RealToScreenX(rx0); + while x0<=x+w+0.000001 do + begin + if Abs(rx0)<0.000001 then + Line(x0,y,x0,y+h,AxisColor) + else Line(x0,y,x0,y+h); + TextOut(x0,y+h+4,rx0.Round(3),Alignment.CenterTop); + x0 += sx; + rx0 += XTicks; + end; + + var sy := my * YTicks; + var yt := YTicks * Trunc(Abs(min)/YTicks); + var ry0: real; + if min <= 0 then + ry0 := -yt + else ry0 := yt + YTicks; + //var ry0 := min; + //var y0 := y + h; + if title<>'' then + TextOut(x+w/2,y-spaceBetweenTextAndGraph,Title,Alignment.CenterBottom); + var y0 := RealToScreenY(ry0); + while y0>=y-0.000001 do + begin + if Abs(ry0)<0.000001 then + Line(x,y0,x+w,y0,AxisColor) + else Line(x,y0,x+w,y0); + TextOut(x-4,y0,ry0.Round(5),Alignment.RightCenter); + y0 -= sy; + ry0 += YTicks; + end; + + DrawRectangle(x, y, w, h,Colors.Black); + + Pen.Color := Colors.Black; + var n := Round(w / 1); + var pp := PartitionPoints(a, b, n); + var fff: real -> Point := xx -> Pnt(x + mx * (xx - a), y + my * (max - f(xx).Clamp(min,max))); + Polyline(pp.Select(fff).ToArray); + end; end; -/// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом параметрами x,y,w,h, -procedure DrawGraph(f: real-> real; a, b, min, max, x, y, w, h: real); +/// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом параметрами x,y,w,h +procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real; title: string); begin - var coefx := w / (b - a); - var coefy := h / (max - min); - - var fso := new FS(coefx, coefy, a, min, max, x, y, f); - - // Линии - {Pen.Color := Color.LightGray; - - var hx := 1.0; - var xx := hx; - while xxa do - begin - var x0 := fso.RealToScreenX(xx); - Line(x0,y1,x0,y2); - xx -= hx - end; - - var hy := 1.0; - var yy := hy; - while yymin do - begin - var y0 := fso.RealToScreenY(yy); - Line(x1,y0,x2,y0); - yy -= hy - end; - - // Оси - Pen.Color := Color.Blue; - - var x0 := fso.RealToScreenX(0); - var y0 := fso.RealToScreenY(0); - - Line(x0,y1,x0,y2); - Line(x1,y0,x2,y0);} - - // График - - Pen.Color := Colors.Black; - Rectangle(x, y, w, h); - - Pen.Color := Colors.Black; - var n := Round(w / 3); - Polyline(PartitionPoints(a, b, n).Select(fso.Apply).ToArray); + DrawGraph(f,a,b,min,max,x,y,w,h,real.NaN,real.NaN,title); end; -procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect) := DrawGraph(f, a, b, min, max, r.X, r.Y, r.Width, r.Height); - -procedure DrawGraph(f: real -> real; a, b, min, max: real) := DrawGraph(f, a, b, min, max, Window.ClientRect); - -procedure DrawGraph(f: real -> real; a, b: real; x, y, w, h: real); +/// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом параметрами x,y,w,h. Два последних параметра задают шаг сетки по OX и OY +procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h, XTicks, YTicks: real; title: string); begin - var n := Round(w / 3); + var fso := new FS(a,b,min,max,x,y,w,h,f,XTicks,YTicks,title); + fso.Draw; +end; + +procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; title: string) := DrawGraph(f, a, b, min, max, r.X, r.Y, r.Width, r.Height, title); + +procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; XTicks, YTicks: real; title: string) := DrawGraph(f, a, b, min, max, r.X, r.Y, r.Width, r.Height, XTicks, YTicks, title); + +procedure DrawGraph(f: real -> real; a, b, min, max: real; title: string) := DrawGraph(f, a, b, min, max, Window.ClientRect, title); + +procedure DrawGraph(f: real -> real; a, b: real; x, y, w, h: real; title: string); +begin + var n := Round(w / 1); var q := PartitionPoints(a, b, n); - DrawGraph(f, a, b, q.Min(f), q.Max(f), x, y, w, h) + DrawGraph(f, a, b, q.Min(f), q.Max(f), x, y, w, h, title) end; -procedure DrawGraph(f: real -> real; a, b: real; r: GRect) := DrawGraph(f, a, b, r.X, r.Y, r.Width, r.Height); +procedure DrawGraph(f: real -> real; a, b: real; r: GRect; title: string) := DrawGraph(f, a, b, r.X, r.Y, r.Width, r.Height, title); -procedure DrawGraph(f: real -> real; r: GRect) := DrawGraph(f, -5, 5, r); +procedure DrawGraph(f: real -> real; r: GRect; title: string) := DrawGraph(f, -5, 5, r, title); -procedure DrawGraph(f: real -> real; a, b: real) := DrawGraph(f, a, b, 0, 0, Window.Width - 1, Window.Height - 1); +procedure DrawGraph(f: real -> real; a, b: real; title: string) := DrawGraph(f, a, b, 0, 0, Window.Width - 1, Window.Height - 1, title); -procedure DrawGraph(f: real -> real) := DrawGraph(f, -5, 5); +procedure DrawGraph(f: real -> real; title: string) := DrawGraph(f, -5, 5, title); function GraphWindowTypeGetLeftP: real; begin diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index 841087676..4f45dfd32 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -771,30 +771,31 @@ procedure Readln; ///- function TryRead(var x: число): boolean; /// Вводит числовое значение x с клавиатуры. Возвращает False если при вводе произошла ошибка -function TryRead(var x: integer): boolean; +function TryRead(var x: integer; message: string := ''): boolean; +///- function TryRead(var x: число; message: string): boolean; +/// Выводит приглашение к вводу и вводит числовое значение x с клавиатуры. Возвращает False если при вводе произошла ошибка +function TryRead(var x: real; message: string := ''): boolean; ///-- -function TryRead(var x: real): boolean; +function TryRead(var x: byte; message: string := ''): boolean; ///-- -function TryRead(var x: byte): boolean; +function TryRead(var x: shortint; message: string := ''): boolean; ///-- -function TryRead(var x: shortint): boolean; +function TryRead(var x: smallint; message: string := ''): boolean; ///-- -function TryRead(var x: smallint): boolean; +function TryRead(var x: word; message: string := ''): boolean; ///-- -function TryRead(var x: word): boolean; +function TryRead(var x: longword; message: string := ''): boolean; ///-- -function TryRead(var x: longword): boolean; +function TryRead(var x: int64; message: string := ''): boolean; ///-- -function TryRead(var x: int64): boolean; +function TryRead(var x: uint64; message: string := ''): boolean; ///-- -function TryRead(var x: uint64): boolean; +function TryRead(var x: single; message: string := ''): boolean; ///-- -function TryRead(var x: single): boolean; -///-- -function TryRead(var x: BigInteger): boolean; +function TryRead(var x: BigInteger; message: string := ''): boolean; /// Вводит логическое значение x с клавиатуры. Возвращает False если при вводе произошла ошибка -function TryRead(var x: boolean): boolean; +function TryRead(var x: boolean; message: string := ''): boolean; /// Возвращает значение типа integer, введенное с клавиатуры function ReadInteger: integer; @@ -5578,120 +5579,144 @@ begin CurrentIOSystem.read(x) end; -function TryRead(var x: integer): boolean; +function TryRead(var x: integer; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: BigInteger): boolean; +function TryRead(var x: BigInteger; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: real): boolean; +function TryRead(var x: real; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: byte): boolean; +function TryRead(var x: byte; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: shortint): boolean; +function TryRead(var x: shortint; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: smallint): boolean; +function TryRead(var x: smallint; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: word): boolean; +function TryRead(var x: word; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: longword): boolean; +function TryRead(var x: longword; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: int64): boolean; +function TryRead(var x: int64; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: uint64): boolean; +function TryRead(var x: uint64; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: single): boolean; +function TryRead(var x: single; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; end end; -function TryRead(var x: boolean): boolean; +function TryRead(var x: boolean; message: string): boolean; begin Result := True; try + if message<>'' then + Print(message); Read(x) except Result := False; diff --git a/TestSuite/CompilationSamples/mouse2.pas b/TestSuite/CompilationSamples/mouse2.pas deleted file mode 100644 index af3d6a87c..000000000 --- a/TestSuite/CompilationSamples/mouse2.pas +++ /dev/null @@ -1,10 +0,0 @@ -uses GraphWPF; - -begin - Window.Title := 'Рисование мышью'; - Pen.Color := Colors.Blue; - Pen.Width := 3; - OnMouseDown := (x,y,mb) -> MoveTo(x,y); - OnMouseMove := (x,y,mb) -> if mb=1 then LineTo(x,y); - OnKeyDown := k -> if k = Key.Space then Window.Save('a.png'); -end. \ No newline at end of file diff --git a/TestSuite/PlusIfOp.pas b/TestSuite/PlusIfOp.pas new file mode 100644 index 000000000..08557bdb4 --- /dev/null +++ b/TestSuite/PlusIfOp.pas @@ -0,0 +1,5 @@ +begin + var a := 2 + if true then 2 else 3; + var b := 2 * if true then 2 else 3; + var c := 2 < if true then 2 else 3; +end. \ No newline at end of file diff --git a/bin/Lib/GraphWPF.pas b/bin/Lib/GraphWPF.pas index bd0a22ae2..ae65b4ad0 100644 --- a/bin/Lib/GraphWPF.pas +++ b/bin/Lib/GraphWPF.pas @@ -415,25 +415,25 @@ function TextSize(text: string): Size; //>> Функции для вывода графиков # GraphWPF graph functions // ----------------------------------------------------- /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом координатами x1,y1,x2,y2, -procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real); +procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом параметрами x,y,w,h. Два последних параметра задают шаг сетки по OX и OY -procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real; XTicks: real; YTicks: real); +procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real; XTicks: real; YTicks: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике r -procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect); +procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике r. Два последних параметра задают шаг сетки по OX и OY -procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; XTicks, YTicks: real); +procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; XTicks, YTicks: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, на полное графическое окно -procedure DrawGraph(f: real -> real; a, b, min, max: real); +procedure DrawGraph(f: real -> real; a, b, min, max: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b], в прямоугольнике, задаваемом координатами x1,y1,x2,y2, -procedure DrawGraph(f: real -> real; a, b: real; x, y, w, h: real); +procedure DrawGraph(f: real -> real; a, b: real; x, y, w, h: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b], в прямоугольнике r -procedure DrawGraph(f: real -> real; a, b: real; r: GRect); +procedure DrawGraph(f: real -> real; a, b: real; r: GRect; title: string := ''); /// Рисует график функции f, заданной на отрезке [-5,5], в прямоугольнике r -procedure DrawGraph(f: real -> real; r: GRect); +procedure DrawGraph(f: real -> real; r: GRect; title: string := ''); /// Рисует график функции f, заданной на отрезке [a,b], на полное графическое окно -procedure DrawGraph(f: real -> real; a, b: real); +procedure DrawGraph(f: real -> real; a, b: real; title: string := ''); /// Рисует график функции f, заданной на отрезке [-5,5], на полное графическое окно -procedure DrawGraph(f: real -> real); +procedure DrawGraph(f: real -> real; title: string := ''); // ----------------------------------------------------- //>> Функции для настройки системы координат # GraphWPF coordinate system functions @@ -1175,16 +1175,18 @@ type mx, my, a, b, min, max: real; x, y, w, h, XTicks, YTicks: real; f: real -> real; + title: string; marginY := 6; marginX := 6; spaceBetweenTextAndGraph := 4; - constructor (a, b, min, max, x, y, w, h: real; f: real -> real; XTicks: real := 1; YTicks: real := 1); + constructor (a, b, min, max, x, y, w, h: real; f: real -> real; XTicks: real := 1; YTicks: real := 1; title: string := ''); begin Self.a := a.Round(5); Self.b := b.Round(5); Self.min := min.Round(5); Self.max := max.Round(5); Self.x := x; Self.y := y; Self.w := w; Self.h := h; Self.f := f; Self.XTicks := XTicks; Self.YTicks := YTicks; + Self.title := title; end; function Ticks(d: real): real; @@ -1202,12 +1204,18 @@ type procedure CorrectBounds; begin - var digits := 5; + //var digits := 5; var tw := TextWidth('-99.9'); + var th := TextHeight('0'); w -= marginX * 2 + spaceBetweenTextAndGraph + tw; - h -= marginY * 2 + spaceBetweenTextAndGraph + TextHeight('0'); + h -= marginY * 2 + spaceBetweenTextAndGraph + th; x += marginX + spaceBetweenTextAndGraph + tw; y += marginY; + if title<>'' then + begin + y += spaceBetweenTextAndGraph + th; + h -= spaceBetweenTextAndGraph + th; + end; mx := w / (b - a); my := h / (max - min); if real.IsNaN(XTicks) then @@ -1223,6 +1231,7 @@ type function ScreenToRealY(yy: real) := (y + h - yy) / my + min; procedure Draw; + var AxisColor := GrayColor(112); begin FillRectangle(x, y, w, h, Colors.White); CorrectBounds; @@ -1237,7 +1246,9 @@ type var x0 := RealToScreenX(rx0); while x0<=x+w+0.000001 do begin - Line(x0,y,x0,y+h); + if Abs(rx0)<0.000001 then + Line(x0,y,x0,y+h,AxisColor) + else Line(x0,y,x0,y+h); TextOut(x0,y+h+4,rx0.Round(3),Alignment.CenterTop); x0 += sx; rx0 += XTicks; @@ -1251,10 +1262,14 @@ type else ry0 := yt + YTicks; //var ry0 := min; //var y0 := y + h; + if title<>'' then + TextOut(x+w/2,y-spaceBetweenTextAndGraph,Title,Alignment.CenterBottom); var y0 := RealToScreenY(ry0); while y0>=y-0.000001 do begin - Line(x,y0,x+w,y0); + if Abs(ry0)<0.000001 then + Line(x,y0,x+w,y0,AxisColor) + else Line(x,y0,x+w,y0); TextOut(x-4,y0,ry0.Round(5),Alignment.RightCenter); y0 -= sy; ry0 += YTicks; @@ -1271,39 +1286,38 @@ type end; /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом параметрами x,y,w,h -procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real); +procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h: real; title: string); begin - var fso := new FS(a,b,min,max,x,y,w,h,f,real.NaN,real.NaN); - fso.Draw; + DrawGraph(f,a,b,min,max,x,y,w,h,real.NaN,real.NaN,title); end; /// Рисует график функции f, заданной на отрезке [a,b] по оси абсцисс и на отрезке [min,max] по оси ординат, в прямоугольнике, задаваемом параметрами x,y,w,h. Два последних параметра задают шаг сетки по OX и OY -procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h, XTicks, YTicks: real); +procedure DrawGraph(f: real -> real; a, b, min, max, x, y, w, h, XTicks, YTicks: real; title: string); begin - var fso := new FS(a,b,min,max,x,y,w,h,f,XTicks,YTicks); + var fso := new FS(a,b,min,max,x,y,w,h,f,XTicks,YTicks,title); fso.Draw; end; -procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect) := DrawGraph(f, a, b, min, max, r.X, r.Y, r.Width, r.Height); +procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; title: string) := DrawGraph(f, a, b, min, max, r.X, r.Y, r.Width, r.Height, title); -procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; XTicks, YTicks: real) := DrawGraph(f, a, b, min, max, r.X, r.Y, r.Width, r.Height, XTicks, YTicks); +procedure DrawGraph(f: real -> real; a, b, min, max: real; r: GRect; XTicks, YTicks: real; title: string) := DrawGraph(f, a, b, min, max, r.X, r.Y, r.Width, r.Height, XTicks, YTicks, title); -procedure DrawGraph(f: real -> real; a, b, min, max: real) := DrawGraph(f, a, b, min, max, Window.ClientRect); +procedure DrawGraph(f: real -> real; a, b, min, max: real; title: string) := DrawGraph(f, a, b, min, max, Window.ClientRect, title); -procedure DrawGraph(f: real -> real; a, b: real; x, y, w, h: real); +procedure DrawGraph(f: real -> real; a, b: real; x, y, w, h: real; title: string); begin var n := Round(w / 1); var q := PartitionPoints(a, b, n); - DrawGraph(f, a, b, q.Min(f), q.Max(f), x, y, w, h) + DrawGraph(f, a, b, q.Min(f), q.Max(f), x, y, w, h, title) end; -procedure DrawGraph(f: real -> real; a, b: real; r: GRect) := DrawGraph(f, a, b, r.X, r.Y, r.Width, r.Height); +procedure DrawGraph(f: real -> real; a, b: real; r: GRect; title: string) := DrawGraph(f, a, b, r.X, r.Y, r.Width, r.Height, title); -procedure DrawGraph(f: real -> real; r: GRect) := DrawGraph(f, -5, 5, r); +procedure DrawGraph(f: real -> real; r: GRect; title: string) := DrawGraph(f, -5, 5, r, title); -procedure DrawGraph(f: real -> real; a, b: real) := DrawGraph(f, a, b, 0, 0, Window.Width - 1, Window.Height - 1); +procedure DrawGraph(f: real -> real; a, b: real; title: string) := DrawGraph(f, a, b, 0, 0, Window.Width - 1, Window.Height - 1, title); -procedure DrawGraph(f: real -> real) := DrawGraph(f, -5, 5); +procedure DrawGraph(f: real -> real; title: string) := DrawGraph(f, -5, 5, title); function GraphWindowTypeGetLeftP: real; begin