diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index b5e32faea..c4003385a 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 = "2"; public const string Build = "0"; - public const string Revision = "1352"; + public const string Revision = "1355"; 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 918f0fa26..c8b8289b2 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=2 -%REVISION%=1352 %COREVERSION%=0 +%REVISION%=1355 +%MINOR%=2 %MAJOR%=3 diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index f0c9d12f2..226674168 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -2,7 +2,7 @@ // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 // Machine: DESKTOP-8EAQPI9 -// DateTime: 21.11.2016 15:52:41 +// DateTime: 01.12.2016 23:40:27 // UserName: ????????? // GPLEX input file // GPLEX frame file @@ -124,8 +124,8 @@ namespace GPPGParserScanner enum Result {accept, noMatch, contextFound}; - const int maxAccept = 63; - const int initial = 64; + const int maxAccept = 62; + const int initial = 63; const int eofNum = 0; const int goStart = -1; const int INITIAL = 0; @@ -177,7 +177,7 @@ public PT parsertools; } }; - static int[] startState = new int[] {64, 98, 99, 100, 100, 101, + static int[] startState = new int[] {63, 97, 98, 99, 99, 100, 0}; #region TwoLevelCharacterMap @@ -189,9 +189,9 @@ public PT parsertools; static sbyte[] mLo0 = new sbyte[256] { /* '\0' */ 47, 40, 47, 47, 47, 47, 47, 47, 47, 5, 0, 47, 47, 6, 47, 47, /* '\x10' */ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, -/* '\x20' */ 5, 25, 47, 46, 4, 47, 10, 45, 7, 9, 8, 21, 11, 22, 13, 1, -/* '0' */ 42, 42, 27, 42, 42, 42, 42, 42, 42, 26, 12, 14, 23, 18, 19, 17, -/* '@' */ 20, 43, 43, 43, 43, 44, 43, 41, 41, 41, 41, 41, 41, 41, 41, 41, +/* '\x20' */ 5, 25, 47, 46, 4, 47, 10, 45, 7, 9, 8, 20, 11, 21, 13, 1, +/* '0' */ 42, 42, 27, 42, 42, 42, 42, 42, 42, 26, 12, 14, 23, 19, 22, 17, +/* '@' */ 18, 43, 43, 43, 43, 44, 43, 41, 41, 41, 41, 41, 41, 41, 41, 41, /* 'P' */ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 15, 47, 16, 24, 41, /* '`' */ 47, 37, 43, 43, 43, 28, 43, 41, 41, 33, 41, 41, 41, 38, 35, 34, /* 'p' */ 30, 41, 31, 32, 36, 41, 41, 41, 29, 39, 41, 3, 47, 2, 47, 47, @@ -1177,52 +1177,52 @@ public PT parsertools; return MapC(code); } - static Table[] NxS = new Table[103] { + static Table[] NxS = new Table[102] { /* NxS[ 0] */ new Table(0, 0, 0, null), -/* NxS[ 1] */ new Table(1, 18, -1, new sbyte[] {52, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53}), +/* NxS[ 1] */ new Table(1, 19, -1, new sbyte[] {51, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52}), /* NxS[ 2] */ new Table(0, 0, -1, null), -/* NxS[ 3] */ new Table(4, 1, -1, new sbyte[] {97}), -/* NxS[ 4] */ new Table(26, 19, -1, new sbyte[] {50, 50, 50, -1, -1, -1, - -1, -1, -1, -1, -1, 50, -1, -1, -1, -1, 50, 50, 50}), -/* NxS[ 5] */ new Table(8, 1, -1, new sbyte[] {49}), -/* NxS[ 6] */ new Table(18, 1, -1, new sbyte[] {48}), +/* NxS[ 3] */ new Table(4, 1, -1, new sbyte[] {96}), +/* NxS[ 4] */ new Table(26, 19, -1, new sbyte[] {49, 49, 49, -1, -1, -1, + -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, 49, 49, 49}), +/* NxS[ 5] */ new Table(8, 1, -1, new sbyte[] {48}), +/* NxS[ 6] */ new Table(19, 1, -1, new sbyte[] {47}), /* NxS[ 7] */ new Table(0, 0, -1, null), /* NxS[ 8] */ new Table(28, 17, -1, new sbyte[] {25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -1, 25, -1, 25, 25}), /* NxS[ 9] */ new Table(0, 0, -1, null), -/* NxS[ 10] */ new Table(18, 1, -1, new sbyte[] {47}), -/* NxS[ 11] */ new Table(13, 1, -1, new sbyte[] {46}), +/* NxS[ 10] */ new Table(19, 1, -1, new sbyte[] {46}), +/* NxS[ 11] */ new Table(13, 1, -1, new sbyte[] {45}), /* NxS[ 12] */ new Table(0, 0, -1, null), /* NxS[ 13] */ new Table(0, 0, -1, null), /* NxS[ 14] */ new Table(0, 0, -1, null), -/* NxS[ 15] */ new Table(13, 1, -1, new sbyte[] {45}), -/* NxS[ 16] */ new Table(19, 1, -1, new sbyte[] {44}), -/* NxS[ 17] */ new Table(18, 1, -1, new sbyte[] {43}), -/* NxS[ 18] */ new Table(0, 0, -1, null), -/* NxS[ 19] */ new Table(18, 1, -1, new sbyte[] {42}), -/* NxS[ 20] */ new Table(18, 2, -1, new sbyte[] {40, 41}), -/* NxS[ 21] */ new Table(18, 6, -1, new sbyte[] {35, 36, -1, -1, -1, 70}), +/* NxS[ 15] */ new Table(13, 1, -1, new sbyte[] {44}), +/* NxS[ 16] */ new Table(0, 0, -1, null), +/* NxS[ 17] */ new Table(0, 0, -1, null), +/* NxS[ 18] */ new Table(19, 1, -1, new sbyte[] {43}), +/* NxS[ 19] */ new Table(19, 4, -1, new sbyte[] {41, -1, -1, 42}), +/* NxS[ 20] */ new Table(19, 1, -1, new sbyte[] {40}), +/* NxS[ 21] */ new Table(19, 5, -1, new sbyte[] {35, -1, -1, 36, 69}), /* NxS[ 22] */ new Table(0, 0, -1, null), -/* NxS[ 23] */ new Table(26, 1, -1, new sbyte[] {69}), -/* NxS[ 24] */ new Table(13, 32, -1, new sbyte[] {66, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 24, 24, 67, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 24, -1, 67}), +/* NxS[ 23] */ new Table(26, 1, -1, new sbyte[] {68}), +/* NxS[ 24] */ new Table(13, 32, -1, new sbyte[] {65, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 24, 24, 66, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 24, -1, 66}), /* NxS[ 25] */ new Table(26, 19, -1, new sbyte[] {25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -1, 25, 25, 25, 25}), /* NxS[ 26] */ new Table(0, 0, -1, null), -/* NxS[ 27] */ new Table(45, 4, 65, new sbyte[] {31, 65, 65, -1}), +/* NxS[ 27] */ new Table(45, 4, 64, new sbyte[] {31, 64, 64, -1}), /* NxS[ 28] */ new Table(26, 19, -1, new sbyte[] {29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, -1, 30, 29, 30, 30}), /* NxS[ 29] */ new Table(26, 17, -1, new sbyte[] {29, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 29}), /* NxS[ 30] */ new Table(26, 19, -1, new sbyte[] {30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, -1, 30, 30, 30, 30}), -/* NxS[ 31] */ new Table(45, 1, -1, new sbyte[] {65}), +/* NxS[ 31] */ new Table(45, 1, -1, new sbyte[] {64}), /* NxS[ 32] */ new Table(26, 17, -1, new sbyte[] {32, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32}), -/* NxS[ 33] */ new Table(26, 19, -1, new sbyte[] {33, 33, 67, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, 67}), +/* NxS[ 33] */ new Table(26, 19, -1, new sbyte[] {33, 33, 66, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, 66}), /* NxS[ 34] */ new Table(0, 0, -1, null), /* NxS[ 35] */ new Table(0, 0, -1, null), /* NxS[ 36] */ new Table(0, 0, -1, null), @@ -1238,70 +1238,70 @@ public PT parsertools; /* NxS[ 46] */ new Table(0, 0, -1, null), /* NxS[ 47] */ new Table(0, 0, -1, null), /* NxS[ 48] */ new Table(0, 0, -1, null), -/* NxS[ 49] */ new Table(0, 0, -1, null), -/* NxS[ 50] */ new Table(26, 19, -1, new sbyte[] {50, 50, 50, -1, -1, -1, - -1, -1, -1, -1, -1, 50, -1, -1, -1, -1, 50, 50, 50}), -/* NxS[ 51] */ new Table(0, 0, -1, null), -/* NxS[ 52] */ new Table(0, 7, 52, new sbyte[] {-1, 52, 52, 52, 52, 52, +/* NxS[ 49] */ new Table(26, 19, -1, new sbyte[] {49, 49, 49, -1, -1, -1, + -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, 49, 49, 49}), +/* NxS[ 50] */ new Table(0, 0, -1, null), +/* NxS[ 51] */ new Table(0, 7, 51, new sbyte[] {-1, 51, 51, 51, 51, 51, -1}), +/* NxS[ 52] */ new Table(0, 0, -1, null), /* NxS[ 53] */ new Table(0, 0, -1, null), /* NxS[ 54] */ new Table(0, 0, -1, null), /* NxS[ 55] */ new Table(0, 0, -1, null), -/* NxS[ 56] */ new Table(0, 0, -1, null), -/* NxS[ 57] */ new Table(9, 1, -1, new sbyte[] {58}), +/* NxS[ 56] */ new Table(9, 1, -1, new sbyte[] {57}), +/* NxS[ 57] */ new Table(0, 0, -1, null), /* NxS[ 58] */ new Table(0, 0, -1, null), -/* NxS[ 59] */ new Table(0, 0, -1, null), -/* NxS[ 60] */ new Table(1, 1, -1, new sbyte[] {63}), -/* NxS[ 61] */ new Table(4, 1, -1, new sbyte[] {102}), -/* NxS[ 62] */ new Table(0, 0, -1, null), -/* NxS[ 63] */ new Table(0, 7, 63, new sbyte[] {-1, 63, 63, 63, 63, 63, +/* NxS[ 59] */ new Table(1, 1, -1, new sbyte[] {62}), +/* NxS[ 60] */ new Table(4, 1, -1, new sbyte[] {101}), +/* NxS[ 61] */ new Table(0, 0, -1, null), +/* NxS[ 62] */ new Table(0, 7, 62, new sbyte[] {-1, 62, 62, 62, 62, 62, -1}), -/* NxS[ 64] */ new Table(40, 36, 25, new sbyte[] {26, 25, 24, 25, 25, 27, +/* NxS[ 63] */ new Table(40, 36, 25, new sbyte[] {26, 25, 24, 25, 25, 27, 28, 2, -1, 1, 2, 3, 4, -1, -1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 24}), -/* NxS[ 65] */ new Table(45, 4, 65, new sbyte[] {31, 65, 65, -1}), -/* NxS[ 66] */ new Table(26, 17, -1, new sbyte[] {33, 33, -1, -1, -1, -1, +/* NxS[ 64] */ new Table(45, 4, 64, new sbyte[] {31, 64, 64, -1}), +/* NxS[ 65] */ new Table(26, 17, -1, new sbyte[] {33, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33}), -/* NxS[ 67] */ new Table(21, 22, -1, new sbyte[] {68, 68, -1, -1, -1, 32, - 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32}), -/* NxS[ 68] */ new Table(26, 17, -1, new sbyte[] {32, 32, -1, -1, -1, -1, +/* NxS[ 66] */ new Table(20, 23, -1, new sbyte[] {67, 67, -1, -1, -1, -1, + 32, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 32}), +/* NxS[ 67] */ new Table(26, 17, -1, new sbyte[] {32, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32}), -/* NxS[ 69] */ new Table(27, 1, -1, new sbyte[] {34}), -/* NxS[ 70] */ new Table(28, 9, -1, new sbyte[] {71, -1, -1, -1, 72, -1, - -1, -1, 73}), -/* NxS[ 71] */ new Table(29, 1, -1, new sbyte[] {87}), -/* NxS[ 72] */ new Table(36, 1, -1, new sbyte[] {78}), -/* NxS[ 73] */ new Table(39, 1, -1, new sbyte[] {74}), -/* NxS[ 74] */ new Table(30, 1, -1, new sbyte[] {75}), -/* NxS[ 75] */ new Table(28, 1, -1, new sbyte[] {76}), -/* NxS[ 76] */ new Table(19, 1, -1, new sbyte[] {77}), -/* NxS[ 77] */ new Table(19, 1, -1, new sbyte[] {37}), -/* NxS[ 78] */ new Table(37, 1, -1, new sbyte[] {79}), -/* NxS[ 79] */ new Table(36, 1, -1, new sbyte[] {80}), -/* NxS[ 80] */ new Table(28, 1, -1, new sbyte[] {81}), -/* NxS[ 81] */ new Table(38, 1, -1, new sbyte[] {82}), -/* NxS[ 82] */ new Table(28, 1, -1, new sbyte[] {83}), -/* NxS[ 83] */ new Table(35, 1, -1, new sbyte[] {84}), -/* NxS[ 84] */ new Table(36, 1, -1, new sbyte[] {85}), -/* NxS[ 85] */ new Table(19, 1, -1, new sbyte[] {86}), -/* NxS[ 86] */ new Table(19, 1, -1, new sbyte[] {38}), -/* NxS[ 87] */ new Table(30, 1, -1, new sbyte[] {88}), -/* NxS[ 88] */ new Table(31, 1, -1, new sbyte[] {89}), -/* NxS[ 89] */ new Table(28, 1, -1, new sbyte[] {90}), +/* NxS[ 68] */ new Table(27, 1, -1, new sbyte[] {34}), +/* NxS[ 69] */ new Table(28, 9, -1, new sbyte[] {70, -1, -1, -1, 71, -1, + -1, -1, 72}), +/* NxS[ 70] */ new Table(29, 1, -1, new sbyte[] {86}), +/* NxS[ 71] */ new Table(36, 1, -1, new sbyte[] {77}), +/* NxS[ 72] */ new Table(39, 1, -1, new sbyte[] {73}), +/* NxS[ 73] */ new Table(30, 1, -1, new sbyte[] {74}), +/* NxS[ 74] */ new Table(28, 1, -1, new sbyte[] {75}), +/* NxS[ 75] */ new Table(22, 1, -1, new sbyte[] {76}), +/* NxS[ 76] */ new Table(22, 1, -1, new sbyte[] {37}), +/* NxS[ 77] */ new Table(37, 1, -1, new sbyte[] {78}), +/* NxS[ 78] */ new Table(36, 1, -1, new sbyte[] {79}), +/* NxS[ 79] */ new Table(28, 1, -1, new sbyte[] {80}), +/* NxS[ 80] */ new Table(38, 1, -1, new sbyte[] {81}), +/* NxS[ 81] */ new Table(28, 1, -1, new sbyte[] {82}), +/* NxS[ 82] */ new Table(35, 1, -1, new sbyte[] {83}), +/* NxS[ 83] */ new Table(36, 1, -1, new sbyte[] {84}), +/* NxS[ 84] */ new Table(22, 1, -1, new sbyte[] {85}), +/* NxS[ 85] */ new Table(22, 1, -1, new sbyte[] {38}), +/* NxS[ 86] */ new Table(30, 1, -1, new sbyte[] {87}), +/* NxS[ 87] */ new Table(31, 1, -1, new sbyte[] {88}), +/* NxS[ 88] */ new Table(28, 1, -1, new sbyte[] {89}), +/* NxS[ 89] */ new Table(32, 1, -1, new sbyte[] {90}), /* NxS[ 90] */ new Table(32, 1, -1, new sbyte[] {91}), -/* NxS[ 91] */ new Table(32, 1, -1, new sbyte[] {92}), -/* NxS[ 92] */ new Table(33, 1, -1, new sbyte[] {93}), -/* NxS[ 93] */ new Table(34, 1, -1, new sbyte[] {94}), -/* NxS[ 94] */ new Table(35, 1, -1, new sbyte[] {95}), -/* NxS[ 95] */ new Table(19, 1, -1, new sbyte[] {96}), -/* NxS[ 96] */ new Table(19, 1, -1, new sbyte[] {39}), -/* NxS[ 97] */ new Table(0, 7, 97, new sbyte[] {-1, 97, 51, 97, 97, 97, +/* NxS[ 91] */ new Table(33, 1, -1, new sbyte[] {92}), +/* NxS[ 92] */ new Table(34, 1, -1, new sbyte[] {93}), +/* NxS[ 93] */ new Table(35, 1, -1, new sbyte[] {94}), +/* NxS[ 94] */ new Table(22, 1, -1, new sbyte[] {95}), +/* NxS[ 95] */ new Table(22, 1, -1, new sbyte[] {39}), +/* NxS[ 96] */ new Table(0, 7, 96, new sbyte[] {-1, 96, 50, 96, 96, 96, -1}), -/* NxS[ 98] */ new Table(2, 1, 54, new sbyte[] {55}), -/* NxS[ 99] */ new Table(8, 1, 56, new sbyte[] {57}), -/* NxS[ 100] */ new Table(0, 0, -1, null), -/* NxS[ 101] */ new Table(1, 3, 59, new sbyte[] {60, 59, 61}), -/* NxS[ 102] */ new Table(0, 7, 102, new sbyte[] {-1, 102, 62, 102, 102, 102, +/* NxS[ 97] */ new Table(2, 1, 53, new sbyte[] {54}), +/* NxS[ 98] */ new Table(8, 1, 55, new sbyte[] {56}), +/* NxS[ 99] */ new Table(0, 0, -1, null), +/* NxS[ 100] */ new Table(1, 3, 58, new sbyte[] {59, 58, 60}), +/* NxS[ 101] */ new Table(0, 7, 101, new sbyte[] {-1, 101, 61, 101, 101, 101, -1}), }; @@ -1780,20 +1780,20 @@ return (int)Tokens.tkSquareClose; return (int)Tokens.tkQuestion; break; case 16: -yylval = new Union(); yylval.op = new op_type_node(Operators.Equal); return (int)Tokens.tkEqual; - break; - case 17: -yylval = new Union(); yylval.op = new op_type_node(Operators.Greater); return (int)Tokens.tkGreater; - break; - case 18: yylval = new Union(); yylval.op = new op_type_node(Operators.AddressOf); return (int)Tokens.tkAddressOf; break; - case 19: + case 17: +yylval = new Union(); yylval.op = new op_type_node(Operators.Equal); return (int)Tokens.tkEqual; + break; + case 18: yylval = new Union(); yylval.op = new op_type_node(Operators.Plus); return (int)Tokens.tkPlus; break; - case 20: + case 19: yylval = new Union(); yylval.op = new op_type_node(Operators.Minus); return (int)Tokens.tkMinus; break; + case 20: +yylval = new Union(); yylval.op = new op_type_node(Operators.Greater); return (int)Tokens.tkGreater; + break; case 21: yylval = new Union(); yylval.op = new op_type_node(Operators.Less); return (int)Tokens.tkLower; break; @@ -2049,42 +2049,39 @@ return (int)Tokens.tkParseModeStatement; return (int)Tokens.tkParseModeExpression; break; case 40: -yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentSubtraction); return (int)Tokens.tkMinusEqual; - break; - case 41: -yylval = new Union(); yylval.ti = new token_info(yytext); return (int)Tokens.tkArrow; - break; - case 42: -yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentAddition); return (int)Tokens.tkPlusEqual; - break; - case 43: yylval = new Union(); yylval.op = new op_type_node(Operators.GreaterEqual); return (int)Tokens.tkGreaterEqual; break; - case 44: -return (int)Tokens.tkMatching; + case 41: +yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentSubtraction); return (int)Tokens.tkMinusEqual; break; - case 45: + case 42: +yylval = new Union(); yylval.ti = new token_info(yytext); return (int)Tokens.tkArrow; + break; + case 43: +yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentAddition); return (int)Tokens.tkPlusEqual; + break; + case 44: return (int)Tokens.tkQuestionPoint; break; - case 46: + case 45: return (int)Tokens.tkDotDot; break; - case 47: + case 46: yylval = new Union(); yylval.op = new op_type_node(Operators.Assignment); return (int)Tokens.tkAssign; break; - case 48: + case 47: yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentMultiplication); return (int)Tokens.tkMultEqual; break; - case 49: + case 48: BEGIN(COMMENT1); break; - case 50: + case 49: yylval = new Union(); currentLexLocation = CurrentLexLocation; yylval.ex = parsertools.create_hex_const(yytext,currentLexLocation); return (int)Tokens.tkHex; break; - case 51: + case 50: if (parsertools.build_tree_for_formatter) break; @@ -2135,36 +2132,36 @@ if (parsertools.build_tree_for_formatter) Defines.Add(directiveparam); } break; - case 52: + case 51: { } break; - case 53: + case 52: yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentDivision); return (int)Tokens.tkDivEqual; break; - case 54: + case 53: { } break; + case 54: +BEGIN(INITIAL); + break; case 55: -BEGIN(INITIAL); - break; case 56: - case 57: { } break; + case 57: +BEGIN(INITIAL); + break; case 58: -BEGIN(INITIAL); - break; case 59: case 60: - case 61: { } break; - case 62: + case 61: parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam); parsertools.CheckDirectiveParams(directivename,directiveparam); // directivename in UPPERCASE! if (directivename == "IFDEF") @@ -2196,7 +2193,7 @@ parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam); BEGIN(INITIAL); } break; - case 63: + case 62: { } diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex index 8b1e05e95..622772b4a 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex @@ -186,7 +186,6 @@ UNICODEARROW \x890 "]" { return (int)Tokens.tkSquareClose; } "?" { return (int)Tokens.tkQuestion; } "?." { return (int)Tokens.tkQuestionPoint; } -"=>" { return (int)Tokens.tkMatching; } "@" { yylval = new Union(); yylval.op = new op_type_node(Operators.AddressOf); return (int)Tokens.tkAddressOf; } ":=" { yylval = new Union(); yylval.op = new op_type_node(Operators.Assignment); return (int)Tokens.tkAssign; } "+=" { yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentAddition); return (int)Tokens.tkPlusEqual; } diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index 9777c474d..7459d5fe9 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -29,7 +29,7 @@ %start parse_goal -%token tkDirectiveName tkAmpersend tkColon tkDotDot tkPoint tkRoundOpen tkRoundClose tkSemiColon tkSquareOpen tkSquareClose tkQuestion tkMatching tkQuestionPoint +%token tkDirectiveName tkAmpersend tkColon tkDotDot tkPoint tkRoundOpen tkRoundClose tkSemiColon tkSquareOpen tkSquareClose tkQuestion tkQuestionPoint %token tkSizeOf tkTypeOf tkWhere tkArray tkCase tkClass tkAuto tkConst tkConstructor tkDestructor tkElse tkExcept tkFile tkFor tkForeach tkFunction %token tkIf tkImplementation tkInherited tkInterface tkProcedure tkOperator tkProperty tkRaise tkRecord tkSet tkType tkThen tkUses tkVar tkWhile tkWith tkNil %token tkGoto tkOf tkLabel tkLock tkProgram tkEvent tkDefault tkTemplate tkPacked tkExports tkResourceString tkThreadvar tkSealed tkPartial tkTo tkDownto @@ -67,7 +67,7 @@ %type program_decl_sect_list int_decl_sect_list1 inclass_decl_sect_list1 interface_decl_sect_list decl_sect_list decl_sect_list1 inclass_decl_sect_list %type field_or_const_definition abc_decl_sect decl_sect int_decl_sect type_decl simple_type_decl simple_field_or_const_definition res_str_decl_sect %type method_decl_withattr method_or_property_decl property_definition fp_sect -%type default_expr +%type default_expr tuple %type expr_as_stmt %type exception_block %type external_block @@ -77,7 +77,7 @@ %type typed_const_list1 typed_const_list optional_expr_list elem_list optional_expr_list_with_bracket expr_list const_elem_list1 const_func_expr_list case_label_list const_elem_list optional_const_func_expr_list elem_list1 %type enumeration_id expr_l1_list %type enumeration_id_list -%type const_simple_expr term typed_const typed_const_or_new expr expr_with_func_decl_lambda const_expr elem range_expr const_elem array_const factor relop_expr expr_l1 simple_expr range_term range_factor +%type const_simple_expr term typed_const typed_const_plus typed_var_init_expression expr expr_with_func_decl_lambda const_expr elem range_expr const_elem array_const factor relop_expr expr_l1 simple_expr range_term range_factor %type external_directive_ident init_const_expr case_label variable var_reference simple_expr_or_nothing // var_question_colon %type for_cycle_type %type format_expr @@ -689,36 +689,6 @@ const_expr { $$ = $1; } - | identifier tkArrow lambda_function_body - { - var idList = new ident_list($1, @1); - var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), parametr_kind.none, null, @1), @1); - $$ = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), $3 as statement_list, @$); - } - | tkRoundOpen tkRoundClose lambda_type_ref tkArrow lambda_function_body - { - $$ = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, $3, $5 as statement_list, @$); - } - | tkRoundOpen typed_const_list tkRoundClose tkArrow lambda_function_body - { - var el = $2 as expression_list; - var cnt = el.expressions.Count; - - var idList = new ident_list(); - idList.source_context = @2; - - for (int j = 0; j < cnt; j++) - { - if (!(el.expressions[j] is ident)) - parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",el.expressions[j].source_context); - idList.idents.Add(el.expressions[j] as ident); - } - - var any = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); - - var formalPars = new formal_parameters(new typed_parameters(idList, any, parametr_kind.none, null, @2), @2); - $$ = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, any, $5 as statement_list, @$); - } | const_simple_expr const_relop const_simple_expr { $$ = new bin_expr($1, $3, $2.type, @$); @@ -967,11 +937,11 @@ typed_const_list ; typed_const_list1 - : typed_const_or_new + : typed_const_plus { $$ = new expression_list($1, @$); } - | typed_const_list1 tkComma typed_const_or_new + | typed_const_list1 tkComma typed_const_plus { $$ = ($1 as expression_list).Add($3, @$); } @@ -1879,17 +1849,50 @@ var_decl_part { $$ = new var_def_statement($1 as ident_list, null, $3, definition_attribute.None, false, @$); } - | ident_list tkColon type_ref tkAssignOrEqual typed_const_or_new + | ident_list tkColon type_ref tkAssignOrEqual typed_var_init_expression // typed_const_plus óæå äàâíî íå êîíñòàíòà :) Íî ñþäà íå ïîïàëè Tuples, ïîñêîëüêó îíè êîíêóðèðóþò ñ äóðàöêèìè ñòàðûìè èíèöèàëèçàòîðàìè ìàññèâîâ { $$ = new var_def_statement($1 as ident_list, $3, $5, definition_attribute.None, false, @$); } - | ident_list tkColon type_ref tkAssignOrEqual expl_func_decl_lambda - { - $$ = new var_def_statement($1 as ident_list, $3, $5, definition_attribute.None, false, @$); - } ; -typed_const_or_new +typed_var_init_expression + : typed_const_plus + { $$ = $1; } + | expl_func_decl_lambda + { $$ = $1; } + | identifier tkArrow lambda_function_body + { + var idList = new ident_list($1, @1); + var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), parametr_kind.none, null, @1), @1); + $$ = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), $3 as statement_list, @$); + } + | tkRoundOpen tkRoundClose lambda_type_ref tkArrow lambda_function_body + { + $$ = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, $3, $5 as statement_list, @$); + } + | tkRoundOpen typed_const_list tkRoundClose tkArrow lambda_function_body + { + var el = $2 as expression_list; + var cnt = el.expressions.Count; + + var idList = new ident_list(); + idList.source_context = @2; + + for (int j = 0; j < cnt; j++) + { + if (!(el.expressions[j] is ident)) + parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",el.expressions[j].source_context); + idList.idents.Add(el.expressions[j] as ident); + } + + var any = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); + + var formalPars = new formal_parameters(new typed_parameters(idList, any, parametr_kind.none, null, @2), @2); + $$ = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, any, $5 as statement_list, @$); + } + ; + +typed_const_plus : typed_const { $$ = $1; } | new_expr @@ -2815,10 +2818,6 @@ relop_expr { $$ = new bin_expr($1, $3, $2.type, @$); } - | relop_expr tkMatching simple_expr - { - $$ = new matching_expression($1, $3, @$); - } ; simple_expr_or_nothing @@ -2943,6 +2942,23 @@ default_expr } ; +tuple + : tkRoundOpen expr_l1 tkComma expr_l1_list lambda_type_ref optional_full_lambda_fp_list tkRoundClose // lambda_type_ref optional_full_lambda_fp_list íóæíî îñòàâèòü ÷òîáû íå áûëî êîíôëèêòîâ ñ ãðàììàòèêîé ëÿìáä + { + ($4 as expression_list).expressions.Insert(0,$2); + if (($4 as expression_list).expressions.Count>7) + parsertools.AddErrorFromResource("TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7",@5); + + if (parsertools.build_tree_for_formatter) + $$ = new tuple_node_for_formatter($4 as expression_list,@$); + else + { + var dn = new dot_node(new dot_node(new ident("?System"),new ident("Tuple")),new ident("Create",@$)); + $$ = new method_call(dn,$4 as expression_list,@$); + } + } + ; + factor : tkNil { @@ -2971,21 +2987,9 @@ factor } | var_reference { $$ = $1; } - | tkRoundOpen expr_l1 tkComma expr_l1_list lambda_type_ref optional_full_lambda_fp_list tkRoundClose - { - ($4 as expression_list).expressions.Insert(0,$2); - if (($4 as expression_list).expressions.Count>7) - parsertools.AddErrorFromResource("TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7",@5); - - if (parsertools.build_tree_for_formatter) - $$ = new tuple_node_for_formatter($4 as expression_list,@$); - else - { - var dn = new dot_node(new dot_node(new ident("?System"),new ident("Tuple")),new ident("Create",@$)); - $$ = new method_call(dn,$4 as expression_list,@$); - } - } - ; + | tuple + { $$ = $1; } + ; literal_or_number : literal diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 30a4aa272..7e9395e93 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -2,9 +2,9 @@ // GPPG version 1.3.6 // Machine: DESKTOP-8EAQPI9 -// DateTime: 21.11.2016 15:52:42 +// DateTime: 01.12.2016 23:40:28 // UserName: ????????? -// Input file +// Input file // options: no-lines gplex @@ -24,28 +24,28 @@ namespace GPPGParserScanner public enum Tokens { error=1,EOF=2,tkDirectiveName=3,tkAmpersend=4,tkColon=5,tkDotDot=6, tkPoint=7,tkRoundOpen=8,tkRoundClose=9,tkSemiColon=10,tkSquareOpen=11,tkSquareClose=12, - tkQuestion=13,tkMatching=14,tkQuestionPoint=15,tkSizeOf=16,tkTypeOf=17,tkWhere=18, - tkArray=19,tkCase=20,tkClass=21,tkAuto=22,tkConst=23,tkConstructor=24, - tkDestructor=25,tkElse=26,tkExcept=27,tkFile=28,tkFor=29,tkForeach=30, - tkFunction=31,tkIf=32,tkImplementation=33,tkInherited=34,tkInterface=35,tkProcedure=36, - tkOperator=37,tkProperty=38,tkRaise=39,tkRecord=40,tkSet=41,tkType=42, - tkThen=43,tkUses=44,tkVar=45,tkWhile=46,tkWith=47,tkNil=48, - tkGoto=49,tkOf=50,tkLabel=51,tkLock=52,tkProgram=53,tkEvent=54, - tkDefault=55,tkTemplate=56,tkPacked=57,tkExports=58,tkResourceString=59,tkThreadvar=60, - tkSealed=61,tkPartial=62,tkTo=63,tkDownto=64,tkCycle=65,tkSequence=66, - tkYield=67,tkNew=68,tkOn=69,tkName=70,tkPrivate=71,tkProtected=72, - tkPublic=73,tkInternal=74,tkRead=75,tkWrite=76,tkParseModeExpression=77,tkParseModeStatement=78, - tkParseModeType=79,tkBegin=80,tkEnd=81,tkAsmBody=82,tkILCode=83,tkError=84, - INVISIBLE=85,tkRepeat=86,tkUntil=87,tkDo=88,tkComma=89,tkFinally=90, - tkTry=91,tkInitialization=92,tkFinalization=93,tkUnit=94,tkLibrary=95,tkExternal=96, - tkParams=97,tkAssign=98,tkPlusEqual=99,tkMinusEqual=100,tkMultEqual=101,tkDivEqual=102, - tkMinus=103,tkPlus=104,tkSlash=105,tkStar=106,tkEqual=107,tkGreater=108, - tkGreaterEqual=109,tkLower=110,tkLowerEqual=111,tkNotEqual=112,tkCSharpStyleOr=113,tkArrow=114, - tkOr=115,tkXor=116,tkAnd=117,tkDiv=118,tkMod=119,tkShl=120, - tkShr=121,tkNot=122,tkAs=123,tkIn=124,tkIs=125,tkImplicit=126, - tkExplicit=127,tkAddressOf=128,tkDeref=129,tkIdentifier=130,tkStringLiteral=131,tkAsciiChar=132, - tkAbstract=133,tkForward=134,tkOverload=135,tkReintroduce=136,tkOverride=137,tkVirtual=138, - tkExtensionMethod=139,tkInteger=140,tkFloat=141,tkHex=142}; + tkQuestion=13,tkQuestionPoint=14,tkSizeOf=15,tkTypeOf=16,tkWhere=17,tkArray=18, + tkCase=19,tkClass=20,tkAuto=21,tkConst=22,tkConstructor=23,tkDestructor=24, + tkElse=25,tkExcept=26,tkFile=27,tkFor=28,tkForeach=29,tkFunction=30, + tkIf=31,tkImplementation=32,tkInherited=33,tkInterface=34,tkProcedure=35,tkOperator=36, + tkProperty=37,tkRaise=38,tkRecord=39,tkSet=40,tkType=41,tkThen=42, + tkUses=43,tkVar=44,tkWhile=45,tkWith=46,tkNil=47,tkGoto=48, + tkOf=49,tkLabel=50,tkLock=51,tkProgram=52,tkEvent=53,tkDefault=54, + tkTemplate=55,tkPacked=56,tkExports=57,tkResourceString=58,tkThreadvar=59,tkSealed=60, + tkPartial=61,tkTo=62,tkDownto=63,tkCycle=64,tkSequence=65,tkYield=66, + tkNew=67,tkOn=68,tkName=69,tkPrivate=70,tkProtected=71,tkPublic=72, + tkInternal=73,tkRead=74,tkWrite=75,tkParseModeExpression=76,tkParseModeStatement=77,tkParseModeType=78, + tkBegin=79,tkEnd=80,tkAsmBody=81,tkILCode=82,tkError=83,INVISIBLE=84, + tkRepeat=85,tkUntil=86,tkDo=87,tkComma=88,tkFinally=89,tkTry=90, + tkInitialization=91,tkFinalization=92,tkUnit=93,tkLibrary=94,tkExternal=95,tkParams=96, + tkAssign=97,tkPlusEqual=98,tkMinusEqual=99,tkMultEqual=100,tkDivEqual=101,tkMinus=102, + tkPlus=103,tkSlash=104,tkStar=105,tkEqual=106,tkGreater=107,tkGreaterEqual=108, + tkLower=109,tkLowerEqual=110,tkNotEqual=111,tkCSharpStyleOr=112,tkArrow=113,tkOr=114, + tkXor=115,tkAnd=116,tkDiv=117,tkMod=118,tkShl=119,tkShr=120, + tkNot=121,tkAs=122,tkIn=123,tkIs=124,tkImplicit=125,tkExplicit=126, + tkAddressOf=127,tkDeref=128,tkIdentifier=129,tkStringLiteral=130,tkAsciiChar=131,tkAbstract=132, + tkForward=133,tkOverload=134,tkReintroduce=135,tkOverride=136,tkVirtual=137,tkExtensionMethod=138, + tkInteger=139,tkFloat=140,tkHex=141}; // Abstract base class for GPLEX scanners public abstract class ScanBase : AbstractScanner { @@ -56,7 +56,7 @@ public abstract class ScanBase : AbstractScanner { - // Verbatim content from ABCPascal.y + // Verbatim content from J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y // ��� ���������� ����������� � ����� GPPGParser, �������������� ����� ������, ������������ �������� gppg public syntax_tree_node root; // �������� ���� ��������������� ������ @@ -68,12 +68,12 @@ public partial class GPPGParser: ShiftReduceParser scanner) : base(scanner) { } - // End verbatim content from ABCPascal.y + // End verbatim content from J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y #pragma warning disable 649 private static Dictionary aliasses; #pragma warning restore 649 - private static Rule[] rules = new Rule[813]; + private static Rule[] rules = new Rule[814]; private static State[] states = new State[1302]; private static string[] nonTerms = new string[] { "parse_goal", "unit_key_word", "assignment", "optional_array_initializer", @@ -88,17 +88,17 @@ public partial class GPPGParser: ShiftReduceParser identifier, tkArrow, lambda_function_body + case 111: // const_expr -> const_simple_expr, const_relop, const_simple_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 112: // const_expr -> question_constexpr +{ + CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; + } + break; + case 113: // question_constexpr -> const_expr, tkQuestion, const_expr, tkColon, const_expr +{ CurrentSemanticValue.ex = new question_colon_expression(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } + break; + case 114: // const_relop -> tkEqual +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 115: // const_relop -> tkNotEqual +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 116: // const_relop -> tkLower +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 117: // const_relop -> tkGreater +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 118: // const_relop -> tkLowerEqual +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 119: // const_relop -> tkGreaterEqual +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 120: // const_relop -> tkIn +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 121: // const_simple_expr -> const_term +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 122: // const_simple_expr -> const_simple_expr, const_addop, const_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 123: // const_addop -> tkPlus +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 124: // const_addop -> tkMinus +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 125: // const_addop -> tkOr +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 126: // const_addop -> tkXor +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 127: // as_is_constexpr -> const_term, typecast_op, simple_or_template_type_reference +{ + CurrentSemanticValue.ex = NewAsIsConstexpr(ValueStack[ValueStack.Depth-3].ex, (op_typecast)ValueStack[ValueStack.Depth-2].ob, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 128: // const_term -> const_factor +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 129: // const_term -> as_is_constexpr +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 130: // const_term -> const_term, const_mulop, const_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 131: // const_mulop -> tkStar +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 132: // const_mulop -> tkSlash +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 133: // const_mulop -> tkDiv +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 134: // const_mulop -> tkMod +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 135: // const_mulop -> tkShl +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 136: // const_mulop -> tkShr +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 137: // const_mulop -> tkAnd +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 138: // const_factor -> const_variable +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 139: // const_factor -> const_set +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 140: // const_factor -> unsigned_number +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 141: // const_factor -> literal +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 142: // const_factor -> tkNil +{ + CurrentSemanticValue.ex = new nil_const(); + CurrentSemanticValue.ex.source_context = CurrentLocationSpan; + } + break; + case 143: // const_factor -> tkAddressOf, const_factor +{ + CurrentSemanticValue.ex = new get_address(ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); + } + break; + case 144: // const_factor -> tkRoundOpen, const_expr, tkRoundClose +{ + CurrentSemanticValue.ex = new bracket_expr(ValueStack[ValueStack.Depth-2].ex, CurrentLocationSpan); + } + break; + case 145: // const_factor -> tkNot, const_factor +{ + CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); + } + break; + case 146: // const_factor -> sign, const_factor +{ + CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); + } + break; + case 147: // const_factor -> tkDeref, const_factor +{ + CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); + } + break; + case 148: // const_set -> tkSquareOpen, const_elem_list, tkSquareClose +{ + CurrentSemanticValue.ex = new pascal_set_constant(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); + } + break; + case 149: // sign -> tkPlus +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 150: // sign -> tkMinus +{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } + break; + case 151: // const_variable -> identifier +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } + break; + case 152: // const_variable -> sizeof_expr +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 153: // const_variable -> typeof_expr +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 154: // const_variable -> const_variable, const_variable_2 +{ + CurrentSemanticValue.ex = NewConstVariable(ValueStack[ValueStack.Depth-2].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 155: // const_variable_2 -> tkPoint, identifier_or_keyword +{ + CurrentSemanticValue.ex = new dot_node(null, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); + } + break; + case 156: // const_variable_2 -> tkDeref +{ + CurrentSemanticValue.ex = new roof_dereference(); + CurrentSemanticValue.ex.source_context = CurrentLocationSpan; + } + break; + case 157: // const_variable_2 -> tkRoundOpen, optional_const_func_expr_list, tkRoundClose +{ + CurrentSemanticValue.ex = new method_call(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); + } + break; + case 158: // const_variable_2 -> tkSquareOpen, const_elem_list, tkSquareClose +{ + CurrentSemanticValue.ex = new indexer(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); + } + break; + case 159: // optional_const_func_expr_list -> const_func_expr_list +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 160: // optional_const_func_expr_list -> /* empty */ +{ CurrentSemanticValue.stn = null; } + break; + case 161: // const_func_expr_list -> const_expr +{ + CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 162: // const_func_expr_list -> const_func_expr_list, tkComma, const_expr +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 163: // const_elem_list -> const_elem_list1 +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 165: // const_elem_list1 -> const_elem +{ + CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 166: // const_elem_list1 -> const_elem_list1, tkComma, const_elem +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 167: // const_elem -> const_expr +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 168: // const_elem -> const_expr, tkDotDot, const_expr +{ + CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 169: // unsigned_number -> tkInteger +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 170: // unsigned_number -> tkHex +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 171: // unsigned_number -> tkFloat +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 172: // typed_const -> const_expr +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 173: // typed_const -> array_const +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 174: // typed_const -> record_const +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 175: // array_const -> tkRoundOpen, typed_const_list, tkRoundClose +{ + CurrentSemanticValue.ex = new array_const(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); + } + break; + case 176: // array_const -> tkRoundOpen, record_const, tkRoundClose +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; } + break; + case 177: // array_const -> tkRoundOpen, array_const, tkRoundClose +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; } + break; + case 179: // typed_const_list -> typed_const_list1 +{ + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; + } + break; + case 180: // typed_const_list1 -> typed_const_plus +{ + CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 181: // typed_const_list1 -> typed_const_list1, tkComma, typed_const_plus +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 182: // record_const -> tkRoundOpen, const_field_list, tkRoundClose +{ + CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; + CurrentSemanticValue.ex.source_context = CurrentLocationSpan; + } + break; + case 183: // const_field_list -> const_field_list_1 +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 184: // const_field_list -> const_field_list_1, tkSemiColon +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; } + break; + case 185: // const_field_list_1 -> const_field +{ + CurrentSemanticValue.ex = new record_const(ValueStack[ValueStack.Depth-1].stn as record_const_definition, CurrentLocationSpan); + } + break; + case 186: // const_field_list_1 -> const_field_list_1, tkSemiColon, const_field +{ + CurrentSemanticValue.ex = (ValueStack[ValueStack.Depth-3].ex as record_const).Add(ValueStack[ValueStack.Depth-1].stn as record_const_definition, CurrentLocationSpan); + } + break; + case 187: // const_field -> const_field_name, tkColon, typed_const +{ + CurrentSemanticValue.stn = new record_const_definition(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 188: // const_field_name -> identifier +{ CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } + break; + case 189: // type_decl -> attribute_declarations, simple_type_decl +{ + (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; + CurrentSemanticValue.stn.source_context = LocationStack[LocationStack.Depth-1]; + } + break; + case 190: // attribute_declarations -> attribute_declaration +{ + CurrentSemanticValue.stn = new attribute_list(ValueStack[ValueStack.Depth-1].stn as simple_attribute_list, CurrentLocationSpan); + } + break; + case 191: // attribute_declarations -> attribute_declarations, attribute_declaration +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as attribute_list).Add(ValueStack[ValueStack.Depth-1].stn as simple_attribute_list, CurrentLocationSpan); + } + break; + case 192: // attribute_declarations -> /* empty */ +{ CurrentSemanticValue.stn = null; } + break; + case 193: // attribute_declaration -> tkSquareOpen, one_or_some_attribute, tkSquareClose +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } + break; + case 194: // one_or_some_attribute -> one_attribute +{ + CurrentSemanticValue.stn = new simple_attribute_list(ValueStack[ValueStack.Depth-1].stn as attribute, CurrentLocationSpan); + } + break; + case 195: // one_or_some_attribute -> one_or_some_attribute, tkComma, one_attribute +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as simple_attribute_list).Add(ValueStack[ValueStack.Depth-1].stn as attribute, CurrentLocationSpan); + } + break; + case 196: // one_attribute -> attribute_variable +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 197: // one_attribute -> identifier, tkColon, attribute_variable +{ + (ValueStack[ValueStack.Depth-1].stn as attribute).qualifier = ValueStack[ValueStack.Depth-3].id; + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; + CurrentSemanticValue.stn.source_context = CurrentLocationSpan; + } + break; + case 198: // simple_type_decl -> type_decl_identifier, tkEqual, type_decl_type, tkSemiColon +{ + CurrentSemanticValue.stn = new type_declaration(ValueStack[ValueStack.Depth-4].id, ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); + } + break; + case 199: // simple_type_decl -> template_identifier_with_equal, type_decl_type, tkSemiColon +{ + CurrentSemanticValue.stn = new type_declaration(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); + } + break; + case 200: // type_decl_identifier -> identifier +{ CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } + break; + case 201: // type_decl_identifier -> identifier, template_arguments +{ + CurrentSemanticValue.id = new template_type_name(ValueStack[ValueStack.Depth-2].id.name, ValueStack[ValueStack.Depth-1].stn as ident_list, CurrentLocationSpan); + } + break; + case 202: // template_identifier_with_equal -> identifier, tkLower, ident_list, + // tkGreaterEqual +{ + CurrentSemanticValue.id = new template_type_name(ValueStack[ValueStack.Depth-4].id.name, ValueStack[ValueStack.Depth-2].stn as ident_list, CurrentLocationSpan); + } + break; + case 203: // type_decl_type -> type_ref +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 204: // type_decl_type -> object_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 205: // type_ref -> simple_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 206: // type_ref -> string_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 207: // type_ref -> pointer_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 208: // type_ref -> structured_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 209: // type_ref -> procedural_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 210: // type_ref -> template_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 211: // template_type -> simple_type_identifier, template_type_params +{ + CurrentSemanticValue.td = new template_type_reference(ValueStack[ValueStack.Depth-2].td as named_type_reference, ValueStack[ValueStack.Depth-1].stn as template_param_list, CurrentLocationSpan); + } + break; + case 212: // template_type_params -> tkLower, template_param_list, tkGreater +{ + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; + CurrentSemanticValue.stn.source_context = CurrentLocationSpan; + } + break; + case 213: // template_param_list -> template_param +{ + CurrentSemanticValue.stn = new template_param_list(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 214: // template_param_list -> template_param_list, tkComma, template_param +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as template_param_list).Add(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 215: // template_param -> simple_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 216: // template_param -> structured_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 217: // template_param -> procedural_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 218: // template_param -> template_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 219: // simple_type -> range_expr +{ + CurrentSemanticValue.td = parsertools.ConvertDotNodeOrIdentToNamedTypeReference(ValueStack[ValueStack.Depth-1].ex); + } + break; + case 220: // simple_type -> range_expr, tkDotDot, range_expr +{ + CurrentSemanticValue.td = new diapason(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 221: // simple_type -> tkRoundOpen, enumeration_id_list, tkRoundClose +{ + CurrentSemanticValue.td = new enum_type_definition(ValueStack[ValueStack.Depth-2].stn as enumerator_list, CurrentLocationSpan); + } + break; + case 222: // range_expr -> range_term +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 223: // range_expr -> range_expr, const_addop, range_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 224: // range_term -> range_factor +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 225: // range_term -> range_term, const_mulop, range_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 226: // range_factor -> simple_type_identifier +{ + CurrentSemanticValue.ex = parsertools.ConvertNamedTypeReferenceToDotNodeOrIdent(ValueStack[ValueStack.Depth-1].td as named_type_reference); + } + break; + case 227: // range_factor -> unsigned_number +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 228: // range_factor -> sign, range_factor +{ + CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); + } + break; + case 229: // range_factor -> literal +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 230: // range_factor -> range_factor, tkRoundOpen, const_elem_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 231: // simple_type_identifier -> identifier +{ + CurrentSemanticValue.td = new named_type_reference(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); + } + break; + case 232: // simple_type_identifier -> simple_type_identifier, tkPoint, + // identifier_or_keyword +{ + CurrentSemanticValue.td = (ValueStack[ValueStack.Depth-3].td as named_type_reference).Add(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); + } + break; + case 233: // enumeration_id_list -> enumeration_id, tkComma, enumeration_id +{ + CurrentSemanticValue.stn = new enumerator_list(ValueStack[ValueStack.Depth-3].stn as enumerator, CurrentLocationSpan); + (CurrentSemanticValue.stn as enumerator_list).Add(ValueStack[ValueStack.Depth-1].stn as enumerator, CurrentLocationSpan); + } + break; + case 234: // enumeration_id_list -> enumeration_id_list, tkComma, enumeration_id +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as enumerator_list).Add(ValueStack[ValueStack.Depth-1].stn as enumerator, CurrentLocationSpan); + } + break; + case 235: // enumeration_id -> type_ref +{ + CurrentSemanticValue.stn = new enumerator(ValueStack[ValueStack.Depth-1].td, null, CurrentLocationSpan); + } + break; + case 236: // enumeration_id -> type_ref, tkEqual, expr +{ + CurrentSemanticValue.stn = new enumerator(ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); + } + break; + case 237: // pointer_type -> tkDeref, fptype +{ + CurrentSemanticValue.td = new ref_type(ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); + } + break; + case 238: // structured_type -> unpacked_structured_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 239: // structured_type -> tkPacked, unpacked_structured_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 240: // unpacked_structured_type -> array_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 241: // unpacked_structured_type -> record_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 242: // unpacked_structured_type -> set_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 243: // unpacked_structured_type -> file_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 244: // unpacked_structured_type -> sequence_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 245: // sequence_type -> tkSequence, tkOf, type_ref +{ + CurrentSemanticValue.td = new sequence_type(ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); + } + break; + case 246: // array_type -> tkArray, tkSquareOpen, simple_type_list, tkSquareClose, tkOf, + // type_ref +{ + CurrentSemanticValue.td = new array_type(ValueStack[ValueStack.Depth-4].stn as indexers_types, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 247: // array_type -> unsized_array_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 248: // unsized_array_type -> tkArray, tkOf, type_ref +{ + CurrentSemanticValue.td = new array_type(null, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 249: // simple_type_list -> simple_type_or_ +{ + CurrentSemanticValue.stn = new indexers_types(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 250: // simple_type_list -> simple_type_list, tkComma, simple_type_or_ +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as indexers_types).Add(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 251: // simple_type_or_ -> simple_type +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 252: // simple_type_or_ -> /* empty */ +{ CurrentSemanticValue.td = null; } + break; + case 253: // set_type -> tkSet, tkOf, simple_type +{ + CurrentSemanticValue.td = new set_type_definition(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 254: // file_type -> tkFile, tkOf, type_ref +{ + CurrentSemanticValue.td = new file_type(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 255: // file_type -> tkFile +{ + CurrentSemanticValue.td = new file_type(); + CurrentSemanticValue.td.source_context = CurrentLocationSpan; + } + break; + case 256: // string_type -> tkIdentifier, tkSquareOpen, const_expr, tkSquareClose +{ + CurrentSemanticValue.td = new string_num_definition(ValueStack[ValueStack.Depth-2].ex, ValueStack[ValueStack.Depth-4].id, CurrentLocationSpan); + } + break; + case 257: // procedural_type -> procedural_type_kind +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 258: // procedural_type_kind -> proc_type_decl +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 259: // proc_type_decl -> tkProcedure, fp_list +{ + CurrentSemanticValue.td = new procedure_header(ValueStack[ValueStack.Depth-1].stn as formal_parameters,null,null,false,false,null,null,CurrentLocationSpan); + } + break; + case 260: // proc_type_decl -> tkFunction, fp_list +{ + CurrentSemanticValue.td = new function_header(ValueStack[ValueStack.Depth-1].stn as formal_parameters, null, null, null, null, CurrentLocationSpan); + } + break; + case 261: // proc_type_decl -> tkFunction, fp_list, tkColon, fptype +{ + CurrentSemanticValue.td = new function_header(ValueStack[ValueStack.Depth-3].stn as formal_parameters, null, null, null, ValueStack[ValueStack.Depth-1].td as type_definition, CurrentLocationSpan); + } + break; + case 262: // proc_type_decl -> simple_type_identifier, tkArrow, template_param +{ + CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-3].td,null,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); + } + break; + case 263: // proc_type_decl -> template_type, tkArrow, template_param +{ + CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-3].td,null,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); + } + break; + case 264: // proc_type_decl -> tkRoundOpen, tkRoundClose, tkArrow, template_param +{ + CurrentSemanticValue.td = new modern_proc_type(null,null,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); + } + break; + case 265: // proc_type_decl -> tkRoundOpen, enumeration_id_list, tkRoundClose, tkArrow, + // template_param +{ + CurrentSemanticValue.td = new modern_proc_type(null,ValueStack[ValueStack.Depth-4].stn as enumerator_list,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); + } + break; + case 266: // proc_type_decl -> simple_type_identifier, tkArrow, tkRoundOpen, tkRoundClose +{ + CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-4].td,null,null,CurrentLocationSpan); + } + break; + case 267: // proc_type_decl -> template_type, tkArrow, tkRoundOpen, tkRoundClose +{ + CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-4].td,null,null,CurrentLocationSpan); + } + break; + case 268: // proc_type_decl -> tkRoundOpen, tkRoundClose, tkArrow, tkRoundOpen, tkRoundClose +{ + CurrentSemanticValue.td = new modern_proc_type(null,null,null,CurrentLocationSpan); + } + break; + case 269: // proc_type_decl -> tkRoundOpen, enumeration_id_list, tkRoundClose, tkArrow, + // tkRoundOpen, tkRoundClose +{ + CurrentSemanticValue.td = new modern_proc_type(null,ValueStack[ValueStack.Depth-5].stn as enumerator_list,null,CurrentLocationSpan); + } + break; + case 270: // object_type -> class_attributes, class_or_interface_keyword, + // optional_base_classes, optional_where_section, + // optional_component_list_seq_end +{ + CurrentSemanticValue.td = NewObjectType((class_attribute)ValueStack[ValueStack.Depth-5].ob, ValueStack[ValueStack.Depth-4].ti, ValueStack[ValueStack.Depth-3].stn as named_type_reference_list, ValueStack[ValueStack.Depth-2].stn as where_definition_list, ValueStack[ValueStack.Depth-1].stn as class_body, CurrentLocationSpan); + } + break; + case 271: // record_type -> tkRecord, optional_base_classes, optional_where_section, + // member_list_section, tkEnd +{ + CurrentSemanticValue.td = NewRecordType(ValueStack[ValueStack.Depth-4].stn as named_type_reference_list, ValueStack[ValueStack.Depth-3].stn as where_definition_list, ValueStack[ValueStack.Depth-2].stn as class_body, CurrentLocationSpan); + } + break; + case 272: // class_attribute -> tkSealed +{ CurrentSemanticValue.ob = class_attribute.Sealed; } + break; + case 273: // class_attribute -> tkPartial +{ CurrentSemanticValue.ob = class_attribute.Partial; } + break; + case 274: // class_attribute -> tkAbstract +{ CurrentSemanticValue.ob = class_attribute.Abstract; } + break; + case 275: // class_attribute -> tkAuto +{ CurrentSemanticValue.ob = class_attribute.Auto; } + break; + case 276: // class_attributes -> /* empty */ +{ + CurrentSemanticValue.ob = class_attribute.None; + } + break; + case 277: // class_attributes -> class_attributes1 +{ + CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-1].ob; + } + break; + case 278: // class_attributes1 -> class_attribute +{ + CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-1].ob; + } + break; + case 279: // class_attributes1 -> class_attributes1, class_attribute +{ + ValueStack[ValueStack.Depth-2].ob = ((class_attribute)ValueStack[ValueStack.Depth-2].ob) | ((class_attribute)ValueStack[ValueStack.Depth-1].ob); + CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-2].ob; + } + break; + case 280: // class_or_interface_keyword -> tkClass +{ CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } + break; + case 281: // class_or_interface_keyword -> tkInterface +{ CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } + break; + case 282: // class_or_interface_keyword -> tkTemplate +{ + CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-1].ti); + } + break; + case 283: // class_or_interface_keyword -> tkTemplate, tkClass +{ + CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-2].ti, "c", CurrentLocationSpan); + } + break; + case 284: // class_or_interface_keyword -> tkTemplate, tkRecord +{ + CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-2].ti, "r", CurrentLocationSpan); + } + break; + case 285: // class_or_interface_keyword -> tkTemplate, tkInterface +{ + CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-2].ti, "i", CurrentLocationSpan); + } + break; + case 286: // optional_component_list_seq_end -> /* empty */ +{ CurrentSemanticValue.stn = null; } + break; + case 287: // optional_component_list_seq_end -> member_list_section, tkEnd +{ + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; + CurrentSemanticValue.stn.source_context = CurrentLocationSpan; + } + break; + case 289: // optional_base_classes -> tkRoundOpen, base_classes_names_list, tkRoundClose +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } + break; + case 290: // base_classes_names_list -> base_class_name +{ + CurrentSemanticValue.stn = new named_type_reference_list(ValueStack[ValueStack.Depth-1].stn as named_type_reference, CurrentLocationSpan); + } + break; + case 291: // base_classes_names_list -> base_classes_names_list, tkComma, base_class_name +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as named_type_reference_list).Add(ValueStack[ValueStack.Depth-1].stn as named_type_reference, CurrentLocationSpan); + } + break; + case 292: // base_class_name -> simple_type_identifier +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } + break; + case 293: // base_class_name -> template_type +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } + break; + case 294: // template_arguments -> tkLower, ident_list, tkGreater +{ + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; + CurrentSemanticValue.stn.source_context = CurrentLocationSpan; + } + break; + case 295: // optional_where_section -> /* empty */ +{ CurrentSemanticValue.stn = null; } + break; + case 296: // optional_where_section -> where_part_list +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 297: // where_part_list -> where_part +{ + CurrentSemanticValue.stn = new where_definition_list(ValueStack[ValueStack.Depth-1].stn as where_definition, CurrentLocationSpan); + } + break; + case 298: // where_part_list -> where_part_list, where_part +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as where_definition_list).Add(ValueStack[ValueStack.Depth-1].stn as where_definition, CurrentLocationSpan); + } + break; + case 299: // where_part -> tkWhere, ident_list, tkColon, type_ref_and_secific_list, + // tkSemiColon +{ + CurrentSemanticValue.stn = new where_definition(ValueStack[ValueStack.Depth-4].stn as ident_list, ValueStack[ValueStack.Depth-2].stn as where_type_specificator_list, CurrentLocationSpan); + } + break; + case 300: // type_ref_and_secific_list -> type_ref_or_secific +{ + CurrentSemanticValue.stn = new where_type_specificator_list(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 301: // type_ref_and_secific_list -> type_ref_and_secific_list, tkComma, + // type_ref_or_secific +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as where_type_specificator_list).Add(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 302: // type_ref_or_secific -> type_ref +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 303: // type_ref_or_secific -> tkClass +{ + CurrentSemanticValue.td = new declaration_specificator(DeclarationSpecificator.WhereDefClass, ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); + } + break; + case 304: // type_ref_or_secific -> tkRecord +{ + CurrentSemanticValue.td = new declaration_specificator(DeclarationSpecificator.WhereDefValueType, ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); + } + break; + case 305: // type_ref_or_secific -> tkConstructor +{ + CurrentSemanticValue.td = new declaration_specificator(DeclarationSpecificator.WhereDefConstructor, ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); + } + break; + case 306: // member_list_section -> member_list +{ + CurrentSemanticValue.stn = new class_body(ValueStack[ValueStack.Depth-1].stn as class_members, CurrentLocationSpan); + } + break; + case 307: // member_list_section -> member_list_section, ot_visibility_specifier, + // member_list +{ + (ValueStack[ValueStack.Depth-1].stn as class_members).access_mod = ValueStack[ValueStack.Depth-2].stn as access_modifer_node; + (ValueStack[ValueStack.Depth-3].stn as class_body).Add(ValueStack[ValueStack.Depth-1].stn as class_members,CurrentLocationSpan); + + if ((ValueStack[ValueStack.Depth-3].stn as class_body).class_def_blocks[0].members.Count == 0) + (ValueStack[ValueStack.Depth-3].stn as class_body).class_def_blocks.RemoveAt(0); + + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-3].stn; + } + break; + case 308: // ot_visibility_specifier -> tkInternal +{ CurrentSemanticValue.stn = new access_modifer_node(access_modifer.internal_modifer, CurrentLocationSpan); } + break; + case 309: // ot_visibility_specifier -> tkPublic +{ CurrentSemanticValue.stn = new access_modifer_node(access_modifer.public_modifer, CurrentLocationSpan); } + break; + case 310: // ot_visibility_specifier -> tkProtected +{ CurrentSemanticValue.stn = new access_modifer_node(access_modifer.protected_modifer, CurrentLocationSpan); } + break; + case 311: // ot_visibility_specifier -> tkPrivate +{ CurrentSemanticValue.stn = new access_modifer_node(access_modifer.private_modifer, CurrentLocationSpan); } + break; + case 312: // member_list -> /* empty */ +{ CurrentSemanticValue.stn = new class_members(); } + break; + case 313: // member_list -> field_or_const_definition_list, optional_semicolon +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } + break; + case 314: // member_list -> method_decl_list +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 315: // member_list -> field_or_const_definition_list, tkSemiColon, method_decl_list +{ + (ValueStack[ValueStack.Depth-3].stn as class_members).members.AddRange((ValueStack[ValueStack.Depth-1].stn as class_members).members); + (ValueStack[ValueStack.Depth-3].stn as class_members).source_context = CurrentLocationSpan; + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-3].stn; + } + break; + case 316: // ident_list -> identifier +{ + CurrentSemanticValue.stn = new ident_list(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); + } + break; + case 317: // ident_list -> ident_list, tkComma, identifier +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as ident_list).Add(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); + } + break; + case 318: // optional_semicolon -> /* empty */ +{ CurrentSemanticValue.ob = null; } + break; + case 319: // optional_semicolon -> tkSemiColon +{ CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-1].ti; } + break; + case 320: // field_or_const_definition_list -> field_or_const_definition +{ + CurrentSemanticValue.stn = new class_members(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); + } + break; + case 321: // field_or_const_definition_list -> field_or_const_definition_list, tkSemiColon, + // field_or_const_definition +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as class_members).Add(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); + } + break; + case 322: // field_or_const_definition -> attribute_declarations, + // simple_field_or_const_definition +{ + (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; + } + break; + case 323: // method_decl_list -> method_or_property_decl +{ + CurrentSemanticValue.stn = new class_members(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); + } + break; + case 324: // method_decl_list -> method_decl_list, method_or_property_decl +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as class_members).Add(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); + } + break; + case 325: // method_or_property_decl -> method_decl_withattr +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 326: // method_or_property_decl -> property_definition +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 327: // simple_field_or_const_definition -> tkConst, only_const_decl +{ + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; + CurrentSemanticValue.stn.source_context = CurrentLocationSpan; + } + break; + case 328: // simple_field_or_const_definition -> field_definition +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 329: // simple_field_or_const_definition -> tkClass, field_definition +{ + (ValueStack[ValueStack.Depth-1].stn as var_def_statement).var_attr = definition_attribute.Static; + (ValueStack[ValueStack.Depth-1].stn as var_def_statement).source_context = CurrentLocationSpan; + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; + } + break; + case 330: // field_definition -> var_decl_part +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 331: // field_definition -> tkEvent, ident_list, tkColon, type_ref +{ + CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, null, definition_attribute.None, true, CurrentLocationSpan); + } + break; + case 332: // method_decl_withattr -> attribute_declarations, method_header +{ + (ValueStack[ValueStack.Depth-1].td as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; + } + break; + case 333: // method_decl_withattr -> attribute_declarations, method_decl +{ + (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; + CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; + } + break; + case 334: // method_decl -> inclass_proc_func_decl +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 335: // method_decl -> inclass_constr_destr_decl +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 336: // method_header -> tkClass, method_procfunc_header +{ + (ValueStack[ValueStack.Depth-1].td as procedure_header).class_keyword = true; + CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; + } + break; + case 337: // method_header -> method_procfunc_header +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 338: // method_header -> constr_destr_header +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 339: // method_procfunc_header -> proc_func_header +{ + CurrentSemanticValue.td = NewProcfuncHeading(ValueStack[ValueStack.Depth-1].td as procedure_header); + } + break; + case 340: // proc_func_header -> proc_header +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 341: // proc_func_header -> func_header +{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } + break; + case 342: // constr_destr_header -> tkConstructor, optional_proc_name, fp_list, + // optional_method_modificators +{ + CurrentSemanticValue.td = new constructor(null,ValueStack[ValueStack.Depth-2].stn as formal_parameters,ValueStack[ValueStack.Depth-1].stn as procedure_attributes_list,ValueStack[ValueStack.Depth-3].stn as method_name,false,false,null,null,CurrentLocationSpan); + } + break; + case 343: // constr_destr_header -> tkClass, tkConstructor, optional_proc_name, fp_list, + // optional_method_modificators +{ + CurrentSemanticValue.td = new constructor(null,ValueStack[ValueStack.Depth-2].stn as formal_parameters,ValueStack[ValueStack.Depth-1].stn as procedure_attributes_list,ValueStack[ValueStack.Depth-3].stn as method_name,false,true,null,null,CurrentLocationSpan); + } + break; + case 344: // constr_destr_header -> tkDestructor, optional_proc_name, fp_list, + // optional_method_modificators +{ + CurrentSemanticValue.td = new destructor(null,ValueStack[ValueStack.Depth-2].stn as formal_parameters,ValueStack[ValueStack.Depth-1].stn as procedure_attributes_list,ValueStack[ValueStack.Depth-3].stn as method_name, false,false,null,null,CurrentLocationSpan); + } + break; + case 345: // optional_proc_name -> proc_name +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 346: // optional_proc_name -> /* empty */ +{ CurrentSemanticValue.stn = null; } + break; + case 347: // qualified_identifier -> identifier +{ CurrentSemanticValue.stn = new method_name(null,null,ValueStack[ValueStack.Depth-1].id,null,CurrentLocationSpan); } + break; + case 348: // qualified_identifier -> visibility_specifier +{ CurrentSemanticValue.stn = new method_name(null,null,ValueStack[ValueStack.Depth-1].id,null,CurrentLocationSpan); } + break; + case 349: // qualified_identifier -> qualified_identifier, tkPoint, identifier +{ + CurrentSemanticValue.stn = NewQualifiedIdentifier(ValueStack[ValueStack.Depth-3].stn as method_name, ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); + } + break; + case 350: // qualified_identifier -> qualified_identifier, tkPoint, visibility_specifier +{ + CurrentSemanticValue.stn = NewQualifiedIdentifier(ValueStack[ValueStack.Depth-3].stn as method_name, ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); + } + break; + case 351: // property_definition -> attribute_declarations, simple_prim_property_definition +{ + CurrentSemanticValue.stn = NewPropertyDefinition(ValueStack[ValueStack.Depth-2].stn as attribute_list, ValueStack[ValueStack.Depth-1].stn as declaration, LocationStack[LocationStack.Depth-1]); + } + break; + case 352: // simple_prim_property_definition -> simple_property_definition +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } + break; + case 353: // simple_prim_property_definition -> tkClass, simple_property_definition +{ + CurrentSemanticValue.stn = NewSimplePrimPropertyDefinition(ValueStack[ValueStack.Depth-1].stn as simple_property, CurrentLocationSpan); + } + break; + case 354: // simple_property_definition -> tkProperty, qualified_identifier, + // property_interface, property_specifiers, + // tkSemiColon, array_defaultproperty +{ + CurrentSemanticValue.stn = NewSimplePropertyDefinition(ValueStack[ValueStack.Depth-5].stn as method_name, ValueStack[ValueStack.Depth-4].stn as property_interface, ValueStack[ValueStack.Depth-3].stn as property_accessors, ValueStack[ValueStack.Depth-1].stn as property_array_default, CurrentLocationSpan); + } + break; + case 355: // array_defaultproperty -> /* empty */ +{ CurrentSemanticValue.stn = null; } + break; + case 356: // array_defaultproperty -> tkDefault, tkSemiColon +{ + CurrentSemanticValue.stn = new property_array_default(); + CurrentSemanticValue.stn.source_context = CurrentLocationSpan; + } + break; + case 357: // property_interface -> /* empty */ +{ CurrentSemanticValue.stn = null; } + break; + case 358: // property_interface -> property_parameter_list, tkColon, fptype +{ + CurrentSemanticValue.stn = new property_interface(ValueStack[ValueStack.Depth-3].stn as property_parameter_list, ValueStack[ValueStack.Depth-1].td, null, CurrentLocationSpan); + } + break; + case 359: // property_parameter_list -> /* empty */ +{ CurrentSemanticValue.stn = null; } + break; + case 360: // property_parameter_list -> tkSquareOpen, parameter_decl_list, tkSquareClose +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } + break; + case 361: // parameter_decl_list -> parameter_decl +{ + CurrentSemanticValue.stn = new property_parameter_list(ValueStack[ValueStack.Depth-1].stn as property_parameter, CurrentLocationSpan); + } + break; + case 362: // parameter_decl_list -> parameter_decl_list, tkSemiColon, parameter_decl +{ + CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as property_parameter_list).Add(ValueStack[ValueStack.Depth-1].stn as property_parameter, CurrentLocationSpan); + } + break; + case 363: // parameter_decl -> ident_list, tkColon, fptype +{ + CurrentSemanticValue.stn = new property_parameter(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); + } + break; + case 364: // optional_identifier -> identifier +{ CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } + break; + case 365: // optional_identifier -> /* empty */ +{ CurrentSemanticValue.id = null; } + break; + case 367: // property_specifiers -> tkRead, optional_identifier, property_specifiers +{ + CurrentSemanticValue.stn = NewPropertySpecifiersRead(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-2].id, ValueStack[ValueStack.Depth-1].stn as property_accessors, CurrentLocationSpan); + } + break; + case 368: // property_specifiers -> tkWrite, optional_identifier, property_specifiers +{ + CurrentSemanticValue.stn = NewPropertySpecifiersWrite(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-2].id, ValueStack[ValueStack.Depth-1].stn as property_accessors, CurrentLocationSpan); + } + break; + case 369: // var_decl -> var_decl_part, tkSemiColon +{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } + break; + case 372: // var_decl_part -> ident_list, tkColon, type_ref +{ + CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, null, definition_attribute.None, false, CurrentLocationSpan); + } + break; + case 373: // var_decl_part -> ident_list, tkAssign, expr +{ + CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-3].stn as ident_list, null, ValueStack[ValueStack.Depth-1].ex, definition_attribute.None, false, CurrentLocationSpan); + } + break; + case 374: // var_decl_part -> ident_list, tkColon, type_ref, tkAssignOrEqual, + // typed_var_init_expression +{ + CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-5].stn as ident_list, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].ex, definition_attribute.None, false, CurrentLocationSpan); + } + break; + case 375: // typed_var_init_expression -> typed_const_plus +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 376: // typed_var_init_expression -> expl_func_decl_lambda +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 377: // typed_var_init_expression -> 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(), null), 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(), null), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan); } break; - case 112: // const_expr -> tkRoundOpen, tkRoundClose, lambda_type_ref, tkArrow, - // lambda_function_body + case 378: // typed_var_init_expression -> 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, CurrentLocationSpan); } break; - case 113: // const_expr -> tkRoundOpen, typed_const_list, tkRoundClose, tkArrow, - // lambda_function_body + case 379: // typed_var_init_expression -> tkRoundOpen, typed_const_list, tkRoundClose, + // tkArrow, lambda_function_body { var el = ValueStack[ValueStack.Depth-4].stn as expression_list; var cnt = el.expressions.Count; @@ -2793,1150 +3890,54 @@ public partial class GPPGParser: ShiftReduceParser const_simple_expr, const_relop, const_simple_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 115: // const_expr -> question_constexpr -{ - CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; - } - break; - case 116: // question_constexpr -> const_expr, tkQuestion, const_expr, tkColon, const_expr -{ CurrentSemanticValue.ex = new question_colon_expression(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } - break; - case 117: // const_relop -> tkEqual -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 118: // const_relop -> tkNotEqual -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 119: // const_relop -> tkLower -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 120: // const_relop -> tkGreater -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 121: // const_relop -> tkLowerEqual -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 122: // const_relop -> tkGreaterEqual -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 123: // const_relop -> tkIn -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 124: // const_simple_expr -> const_term + case 380: // typed_const_plus -> typed_const { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 125: // const_simple_expr -> const_simple_expr, const_addop, const_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 126: // const_addop -> tkPlus -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 127: // const_addop -> tkMinus -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 128: // const_addop -> tkOr -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 129: // const_addop -> tkXor -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 130: // as_is_constexpr -> const_term, typecast_op, simple_or_template_type_reference -{ - CurrentSemanticValue.ex = NewAsIsConstexpr(ValueStack[ValueStack.Depth-3].ex, (op_typecast)ValueStack[ValueStack.Depth-2].ob, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 131: // const_term -> const_factor + case 381: // typed_const_plus -> new_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 132: // const_term -> as_is_constexpr + case 382: // typed_const_plus -> default_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 133: // const_term -> const_term, const_mulop, const_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 134: // const_mulop -> tkStar -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 135: // const_mulop -> tkSlash -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 136: // const_mulop -> tkDiv -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 137: // const_mulop -> tkMod -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 138: // const_mulop -> tkShl -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 139: // const_mulop -> tkShr -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 140: // const_mulop -> tkAnd -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 141: // const_factor -> const_variable -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 142: // const_factor -> const_set -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 143: // const_factor -> unsigned_number -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 144: // const_factor -> literal -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 145: // const_factor -> tkNil -{ - CurrentSemanticValue.ex = new nil_const(); - CurrentSemanticValue.ex.source_context = CurrentLocationSpan; - } - break; - case 146: // const_factor -> tkAddressOf, const_factor -{ - CurrentSemanticValue.ex = new get_address(ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); - } - break; - case 147: // const_factor -> tkRoundOpen, const_expr, tkRoundClose -{ - CurrentSemanticValue.ex = new bracket_expr(ValueStack[ValueStack.Depth-2].ex, CurrentLocationSpan); - } - break; - case 148: // const_factor -> tkNot, const_factor -{ - CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); - } - break; - case 149: // const_factor -> sign, const_factor -{ - CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); - } - break; - case 150: // const_factor -> tkDeref, const_factor -{ - CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); - } - break; - case 151: // const_set -> tkSquareOpen, const_elem_list, tkSquareClose -{ - CurrentSemanticValue.ex = new pascal_set_constant(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); - } - break; - case 152: // sign -> tkPlus -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 153: // sign -> tkMinus -{ CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } - break; - case 154: // const_variable -> identifier -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } - break; - case 155: // const_variable -> sizeof_expr -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 156: // const_variable -> typeof_expr -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 157: // const_variable -> const_variable, const_variable_2 -{ - CurrentSemanticValue.ex = NewConstVariable(ValueStack[ValueStack.Depth-2].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 158: // const_variable_2 -> tkPoint, identifier_or_keyword -{ - CurrentSemanticValue.ex = new dot_node(null, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); - } - break; - case 159: // const_variable_2 -> tkDeref -{ - CurrentSemanticValue.ex = new roof_dereference(); - CurrentSemanticValue.ex.source_context = CurrentLocationSpan; - } - break; - case 160: // const_variable_2 -> tkRoundOpen, optional_const_func_expr_list, tkRoundClose -{ - CurrentSemanticValue.ex = new method_call(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); - } - break; - case 161: // const_variable_2 -> tkSquareOpen, const_elem_list, tkSquareClose -{ - CurrentSemanticValue.ex = new indexer(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); - } - break; - case 162: // optional_const_func_expr_list -> const_func_expr_list -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 163: // optional_const_func_expr_list -> /* empty */ -{ CurrentSemanticValue.stn = null; } - break; - case 164: // const_func_expr_list -> const_expr -{ - CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 165: // const_func_expr_list -> const_func_expr_list, tkComma, const_expr -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 166: // const_elem_list -> const_elem_list1 -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 168: // const_elem_list1 -> const_elem -{ - CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 169: // const_elem_list1 -> const_elem_list1, tkComma, const_elem -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 170: // const_elem -> const_expr -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 171: // const_elem -> const_expr, tkDotDot, const_expr -{ - CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 172: // unsigned_number -> tkInteger -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 173: // unsigned_number -> tkHex -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 174: // unsigned_number -> tkFloat -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 175: // typed_const -> const_expr -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 176: // typed_const -> array_const -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 177: // typed_const -> record_const -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 178: // array_const -> tkRoundOpen, typed_const_list, tkRoundClose -{ - CurrentSemanticValue.ex = new array_const(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); - } - break; - case 179: // array_const -> tkRoundOpen, record_const, tkRoundClose -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; } - break; - case 180: // array_const -> tkRoundOpen, array_const, tkRoundClose -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; } - break; - case 182: // typed_const_list -> typed_const_list1 -{ - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; - } - break; - case 183: // typed_const_list1 -> typed_const_or_new -{ - CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 184: // typed_const_list1 -> typed_const_list1, tkComma, typed_const_or_new -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 185: // record_const -> tkRoundOpen, const_field_list, tkRoundClose -{ - CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; - CurrentSemanticValue.ex.source_context = CurrentLocationSpan; - } - break; - case 186: // const_field_list -> const_field_list_1 -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 187: // const_field_list -> const_field_list_1, tkSemiColon -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; } - break; - case 188: // const_field_list_1 -> const_field -{ - CurrentSemanticValue.ex = new record_const(ValueStack[ValueStack.Depth-1].stn as record_const_definition, CurrentLocationSpan); - } - break; - case 189: // const_field_list_1 -> const_field_list_1, tkSemiColon, const_field -{ - CurrentSemanticValue.ex = (ValueStack[ValueStack.Depth-3].ex as record_const).Add(ValueStack[ValueStack.Depth-1].stn as record_const_definition, CurrentLocationSpan); - } - break; - case 190: // const_field -> const_field_name, tkColon, typed_const -{ - CurrentSemanticValue.stn = new record_const_definition(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 191: // const_field_name -> identifier -{ CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } - break; - case 192: // type_decl -> attribute_declarations, simple_type_decl -{ - (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; - CurrentSemanticValue.stn.source_context = LocationStack[LocationStack.Depth-1]; - } - break; - case 193: // attribute_declarations -> attribute_declaration -{ - CurrentSemanticValue.stn = new attribute_list(ValueStack[ValueStack.Depth-1].stn as simple_attribute_list, CurrentLocationSpan); - } - break; - case 194: // attribute_declarations -> attribute_declarations, attribute_declaration -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as attribute_list).Add(ValueStack[ValueStack.Depth-1].stn as simple_attribute_list, CurrentLocationSpan); - } - break; - case 195: // attribute_declarations -> /* empty */ -{ CurrentSemanticValue.stn = null; } - break; - case 196: // attribute_declaration -> tkSquareOpen, one_or_some_attribute, tkSquareClose -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } - break; - case 197: // one_or_some_attribute -> one_attribute -{ - CurrentSemanticValue.stn = new simple_attribute_list(ValueStack[ValueStack.Depth-1].stn as attribute, CurrentLocationSpan); - } - break; - case 198: // one_or_some_attribute -> one_or_some_attribute, tkComma, one_attribute -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as simple_attribute_list).Add(ValueStack[ValueStack.Depth-1].stn as attribute, CurrentLocationSpan); - } - break; - case 199: // one_attribute -> attribute_variable -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 200: // one_attribute -> identifier, tkColon, attribute_variable -{ - (ValueStack[ValueStack.Depth-1].stn as attribute).qualifier = ValueStack[ValueStack.Depth-3].id; - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; - CurrentSemanticValue.stn.source_context = CurrentLocationSpan; - } - break; - case 201: // simple_type_decl -> type_decl_identifier, tkEqual, type_decl_type, tkSemiColon -{ - CurrentSemanticValue.stn = new type_declaration(ValueStack[ValueStack.Depth-4].id, ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); - } - break; - case 202: // simple_type_decl -> template_identifier_with_equal, type_decl_type, tkSemiColon -{ - CurrentSemanticValue.stn = new type_declaration(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); - } - break; - case 203: // type_decl_identifier -> identifier -{ CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } - break; - case 204: // type_decl_identifier -> identifier, template_arguments -{ - CurrentSemanticValue.id = new template_type_name(ValueStack[ValueStack.Depth-2].id.name, ValueStack[ValueStack.Depth-1].stn as ident_list, CurrentLocationSpan); - } - break; - case 205: // template_identifier_with_equal -> identifier, tkLower, ident_list, - // tkGreaterEqual -{ - CurrentSemanticValue.id = new template_type_name(ValueStack[ValueStack.Depth-4].id.name, ValueStack[ValueStack.Depth-2].stn as ident_list, CurrentLocationSpan); - } - break; - case 206: // type_decl_type -> type_ref -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 207: // type_decl_type -> object_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 208: // type_ref -> simple_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 209: // type_ref -> string_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 210: // type_ref -> pointer_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 211: // type_ref -> structured_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 212: // type_ref -> procedural_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 213: // type_ref -> template_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 214: // template_type -> simple_type_identifier, template_type_params -{ - CurrentSemanticValue.td = new template_type_reference(ValueStack[ValueStack.Depth-2].td as named_type_reference, ValueStack[ValueStack.Depth-1].stn as template_param_list, CurrentLocationSpan); - } - break; - case 215: // template_type_params -> tkLower, template_param_list, tkGreater -{ - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; - CurrentSemanticValue.stn.source_context = CurrentLocationSpan; - } - break; - case 216: // template_param_list -> template_param -{ - CurrentSemanticValue.stn = new template_param_list(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 217: // template_param_list -> template_param_list, tkComma, template_param -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as template_param_list).Add(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 218: // template_param -> simple_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 219: // template_param -> structured_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 220: // template_param -> procedural_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 221: // template_param -> template_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 222: // simple_type -> range_expr -{ - CurrentSemanticValue.td = parsertools.ConvertDotNodeOrIdentToNamedTypeReference(ValueStack[ValueStack.Depth-1].ex); - } - break; - case 223: // simple_type -> range_expr, tkDotDot, range_expr -{ - CurrentSemanticValue.td = new diapason(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 224: // simple_type -> tkRoundOpen, enumeration_id_list, tkRoundClose -{ - CurrentSemanticValue.td = new enum_type_definition(ValueStack[ValueStack.Depth-2].stn as enumerator_list, CurrentLocationSpan); - } - break; - case 225: // range_expr -> range_term -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 226: // range_expr -> range_expr, const_addop, range_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 227: // range_term -> range_factor -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 228: // range_term -> range_term, const_mulop, range_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 229: // range_factor -> simple_type_identifier -{ - CurrentSemanticValue.ex = parsertools.ConvertNamedTypeReferenceToDotNodeOrIdent(ValueStack[ValueStack.Depth-1].td as named_type_reference); - } - break; - case 230: // range_factor -> unsigned_number -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 231: // range_factor -> sign, range_factor -{ - CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); - } - break; - case 232: // range_factor -> literal -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 233: // range_factor -> range_factor, tkRoundOpen, const_elem_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 234: // simple_type_identifier -> identifier -{ - CurrentSemanticValue.td = new named_type_reference(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); - } - break; - case 235: // simple_type_identifier -> simple_type_identifier, tkPoint, - // identifier_or_keyword -{ - CurrentSemanticValue.td = (ValueStack[ValueStack.Depth-3].td as named_type_reference).Add(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); - } - break; - case 236: // enumeration_id_list -> enumeration_id, tkComma, enumeration_id -{ - CurrentSemanticValue.stn = new enumerator_list(ValueStack[ValueStack.Depth-3].stn as enumerator, CurrentLocationSpan); - (CurrentSemanticValue.stn as enumerator_list).Add(ValueStack[ValueStack.Depth-1].stn as enumerator, CurrentLocationSpan); - } - break; - case 237: // enumeration_id_list -> enumeration_id_list, tkComma, enumeration_id -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as enumerator_list).Add(ValueStack[ValueStack.Depth-1].stn as enumerator, CurrentLocationSpan); - } - break; - case 238: // enumeration_id -> type_ref -{ - CurrentSemanticValue.stn = new enumerator(ValueStack[ValueStack.Depth-1].td, null, CurrentLocationSpan); - } - break; - case 239: // enumeration_id -> type_ref, tkEqual, expr -{ - CurrentSemanticValue.stn = new enumerator(ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; - case 240: // pointer_type -> tkDeref, fptype -{ - CurrentSemanticValue.td = new ref_type(ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); - } - break; - case 241: // structured_type -> unpacked_structured_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 242: // structured_type -> tkPacked, unpacked_structured_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 243: // unpacked_structured_type -> array_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 244: // unpacked_structured_type -> record_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 245: // unpacked_structured_type -> set_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 246: // unpacked_structured_type -> file_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 247: // unpacked_structured_type -> sequence_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 248: // sequence_type -> tkSequence, tkOf, type_ref -{ - CurrentSemanticValue.td = new sequence_type(ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); - } - break; - case 249: // array_type -> tkArray, tkSquareOpen, simple_type_list, tkSquareClose, tkOf, - // type_ref -{ - CurrentSemanticValue.td = new array_type(ValueStack[ValueStack.Depth-4].stn as indexers_types, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 250: // array_type -> unsized_array_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 251: // unsized_array_type -> tkArray, tkOf, type_ref -{ - CurrentSemanticValue.td = new array_type(null, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 252: // simple_type_list -> simple_type_or_ -{ - CurrentSemanticValue.stn = new indexers_types(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 253: // simple_type_list -> simple_type_list, tkComma, simple_type_or_ -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as indexers_types).Add(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 254: // simple_type_or_ -> simple_type -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 255: // simple_type_or_ -> /* empty */ -{ CurrentSemanticValue.td = null; } - break; - case 256: // set_type -> tkSet, tkOf, simple_type -{ - CurrentSemanticValue.td = new set_type_definition(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 257: // file_type -> tkFile, tkOf, type_ref -{ - CurrentSemanticValue.td = new file_type(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 258: // file_type -> tkFile -{ - CurrentSemanticValue.td = new file_type(); - CurrentSemanticValue.td.source_context = CurrentLocationSpan; - } - break; - case 259: // string_type -> tkIdentifier, tkSquareOpen, const_expr, tkSquareClose -{ - CurrentSemanticValue.td = new string_num_definition(ValueStack[ValueStack.Depth-2].ex, ValueStack[ValueStack.Depth-4].id, CurrentLocationSpan); - } - break; - case 260: // procedural_type -> procedural_type_kind -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 261: // procedural_type_kind -> proc_type_decl -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 262: // proc_type_decl -> tkProcedure, fp_list -{ - CurrentSemanticValue.td = new procedure_header(ValueStack[ValueStack.Depth-1].stn as formal_parameters,null,null,false,false,null,null,CurrentLocationSpan); - } - break; - case 263: // proc_type_decl -> tkFunction, fp_list -{ - CurrentSemanticValue.td = new function_header(ValueStack[ValueStack.Depth-1].stn as formal_parameters, null, null, null, null, CurrentLocationSpan); - } - break; - case 264: // proc_type_decl -> tkFunction, fp_list, tkColon, fptype -{ - CurrentSemanticValue.td = new function_header(ValueStack[ValueStack.Depth-3].stn as formal_parameters, null, null, null, ValueStack[ValueStack.Depth-1].td as type_definition, CurrentLocationSpan); - } - break; - case 265: // proc_type_decl -> simple_type_identifier, tkArrow, template_param -{ - CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-3].td,null,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); - } - break; - case 266: // proc_type_decl -> template_type, tkArrow, template_param -{ - CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-3].td,null,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); - } - break; - case 267: // proc_type_decl -> tkRoundOpen, tkRoundClose, tkArrow, template_param -{ - CurrentSemanticValue.td = new modern_proc_type(null,null,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); - } - break; - case 268: // proc_type_decl -> tkRoundOpen, enumeration_id_list, tkRoundClose, tkArrow, - // template_param -{ - CurrentSemanticValue.td = new modern_proc_type(null,ValueStack[ValueStack.Depth-4].stn as enumerator_list,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); - } - break; - case 269: // proc_type_decl -> simple_type_identifier, tkArrow, tkRoundOpen, tkRoundClose -{ - CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-4].td,null,null,CurrentLocationSpan); - } - break; - case 270: // proc_type_decl -> template_type, tkArrow, tkRoundOpen, tkRoundClose -{ - CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-4].td,null,null,CurrentLocationSpan); - } - break; - case 271: // proc_type_decl -> tkRoundOpen, tkRoundClose, tkArrow, tkRoundOpen, tkRoundClose -{ - CurrentSemanticValue.td = new modern_proc_type(null,null,null,CurrentLocationSpan); - } - break; - case 272: // proc_type_decl -> tkRoundOpen, enumeration_id_list, tkRoundClose, tkArrow, - // tkRoundOpen, tkRoundClose -{ - CurrentSemanticValue.td = new modern_proc_type(null,ValueStack[ValueStack.Depth-5].stn as enumerator_list,null,CurrentLocationSpan); - } - break; - case 273: // object_type -> class_attributes, class_or_interface_keyword, - // optional_base_classes, optional_where_section, - // optional_component_list_seq_end -{ - CurrentSemanticValue.td = NewObjectType((class_attribute)ValueStack[ValueStack.Depth-5].ob, ValueStack[ValueStack.Depth-4].ti, ValueStack[ValueStack.Depth-3].stn as named_type_reference_list, ValueStack[ValueStack.Depth-2].stn as where_definition_list, ValueStack[ValueStack.Depth-1].stn as class_body, CurrentLocationSpan); - } - break; - case 274: // record_type -> tkRecord, optional_base_classes, optional_where_section, - // member_list_section, tkEnd -{ - CurrentSemanticValue.td = NewRecordType(ValueStack[ValueStack.Depth-4].stn as named_type_reference_list, ValueStack[ValueStack.Depth-3].stn as where_definition_list, ValueStack[ValueStack.Depth-2].stn as class_body, CurrentLocationSpan); - } - break; - case 275: // class_attribute -> tkSealed -{ CurrentSemanticValue.ob = class_attribute.Sealed; } - break; - case 276: // class_attribute -> tkPartial -{ CurrentSemanticValue.ob = class_attribute.Partial; } - break; - case 277: // class_attribute -> tkAbstract -{ CurrentSemanticValue.ob = class_attribute.Abstract; } - break; - case 278: // class_attribute -> tkAuto -{ CurrentSemanticValue.ob = class_attribute.Auto; } - break; - case 279: // class_attributes -> /* empty */ -{ - CurrentSemanticValue.ob = class_attribute.None; - } - break; - case 280: // class_attributes -> class_attributes1 -{ - CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-1].ob; - } - break; - case 281: // class_attributes1 -> class_attribute -{ - CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-1].ob; - } - break; - case 282: // class_attributes1 -> class_attributes1, class_attribute -{ - ValueStack[ValueStack.Depth-2].ob = ((class_attribute)ValueStack[ValueStack.Depth-2].ob) | ((class_attribute)ValueStack[ValueStack.Depth-1].ob); - CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-2].ob; - } - break; - case 283: // class_or_interface_keyword -> tkClass -{ CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } - break; - case 284: // class_or_interface_keyword -> tkInterface -{ CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } - break; - case 285: // class_or_interface_keyword -> tkTemplate -{ - CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-1].ti); - } - break; - case 286: // class_or_interface_keyword -> tkTemplate, tkClass -{ - CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-2].ti, "c", CurrentLocationSpan); - } - break; - case 287: // class_or_interface_keyword -> tkTemplate, tkRecord -{ - CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-2].ti, "r", CurrentLocationSpan); - } - break; - case 288: // class_or_interface_keyword -> tkTemplate, tkInterface -{ - CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-2].ti, "i", CurrentLocationSpan); - } - break; - case 289: // optional_component_list_seq_end -> /* empty */ -{ CurrentSemanticValue.stn = null; } - break; - case 290: // optional_component_list_seq_end -> member_list_section, tkEnd -{ - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; - CurrentSemanticValue.stn.source_context = CurrentLocationSpan; - } - break; - case 292: // optional_base_classes -> tkRoundOpen, base_classes_names_list, tkRoundClose -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } - break; - case 293: // base_classes_names_list -> base_class_name -{ - CurrentSemanticValue.stn = new named_type_reference_list(ValueStack[ValueStack.Depth-1].stn as named_type_reference, CurrentLocationSpan); - } - break; - case 294: // base_classes_names_list -> base_classes_names_list, tkComma, base_class_name -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as named_type_reference_list).Add(ValueStack[ValueStack.Depth-1].stn as named_type_reference, CurrentLocationSpan); - } - break; - case 295: // base_class_name -> simple_type_identifier -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } - break; - case 296: // base_class_name -> template_type -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } - break; - case 297: // template_arguments -> tkLower, ident_list, tkGreater -{ - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; - CurrentSemanticValue.stn.source_context = CurrentLocationSpan; - } - break; - case 298: // optional_where_section -> /* empty */ -{ CurrentSemanticValue.stn = null; } - break; - case 299: // optional_where_section -> where_part_list -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 300: // where_part_list -> where_part -{ - CurrentSemanticValue.stn = new where_definition_list(ValueStack[ValueStack.Depth-1].stn as where_definition, CurrentLocationSpan); - } - break; - case 301: // where_part_list -> where_part_list, where_part -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as where_definition_list).Add(ValueStack[ValueStack.Depth-1].stn as where_definition, CurrentLocationSpan); - } - break; - case 302: // where_part -> tkWhere, ident_list, tkColon, type_ref_and_secific_list, - // tkSemiColon -{ - CurrentSemanticValue.stn = new where_definition(ValueStack[ValueStack.Depth-4].stn as ident_list, ValueStack[ValueStack.Depth-2].stn as where_type_specificator_list, CurrentLocationSpan); - } - break; - case 303: // type_ref_and_secific_list -> type_ref_or_secific -{ - CurrentSemanticValue.stn = new where_type_specificator_list(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 304: // type_ref_and_secific_list -> type_ref_and_secific_list, tkComma, - // type_ref_or_secific -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as where_type_specificator_list).Add(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 305: // type_ref_or_secific -> type_ref -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 306: // type_ref_or_secific -> tkClass -{ - CurrentSemanticValue.td = new declaration_specificator(DeclarationSpecificator.WhereDefClass, ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); - } - break; - case 307: // type_ref_or_secific -> tkRecord -{ - CurrentSemanticValue.td = new declaration_specificator(DeclarationSpecificator.WhereDefValueType, ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); - } - break; - case 308: // type_ref_or_secific -> tkConstructor -{ - CurrentSemanticValue.td = new declaration_specificator(DeclarationSpecificator.WhereDefConstructor, ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); - } - break; - case 309: // member_list_section -> member_list -{ - CurrentSemanticValue.stn = new class_body(ValueStack[ValueStack.Depth-1].stn as class_members, CurrentLocationSpan); - } - break; - case 310: // member_list_section -> member_list_section, ot_visibility_specifier, - // member_list -{ - (ValueStack[ValueStack.Depth-1].stn as class_members).access_mod = ValueStack[ValueStack.Depth-2].stn as access_modifer_node; - (ValueStack[ValueStack.Depth-3].stn as class_body).Add(ValueStack[ValueStack.Depth-1].stn as class_members,CurrentLocationSpan); - - if ((ValueStack[ValueStack.Depth-3].stn as class_body).class_def_blocks[0].members.Count == 0) - (ValueStack[ValueStack.Depth-3].stn as class_body).class_def_blocks.RemoveAt(0); - - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-3].stn; - } - break; - case 311: // ot_visibility_specifier -> tkInternal -{ CurrentSemanticValue.stn = new access_modifer_node(access_modifer.internal_modifer, CurrentLocationSpan); } - break; - case 312: // ot_visibility_specifier -> tkPublic -{ CurrentSemanticValue.stn = new access_modifer_node(access_modifer.public_modifer, CurrentLocationSpan); } - break; - case 313: // ot_visibility_specifier -> tkProtected -{ CurrentSemanticValue.stn = new access_modifer_node(access_modifer.protected_modifer, CurrentLocationSpan); } - break; - case 314: // ot_visibility_specifier -> tkPrivate -{ CurrentSemanticValue.stn = new access_modifer_node(access_modifer.private_modifer, CurrentLocationSpan); } - break; - case 315: // member_list -> /* empty */ -{ CurrentSemanticValue.stn = new class_members(); } - break; - case 316: // member_list -> field_or_const_definition_list, optional_semicolon -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } - break; - case 317: // member_list -> method_decl_list -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 318: // member_list -> field_or_const_definition_list, tkSemiColon, method_decl_list -{ - (ValueStack[ValueStack.Depth-3].stn as class_members).members.AddRange((ValueStack[ValueStack.Depth-1].stn as class_members).members); - (ValueStack[ValueStack.Depth-3].stn as class_members).source_context = CurrentLocationSpan; - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-3].stn; - } - break; - case 319: // ident_list -> identifier -{ - CurrentSemanticValue.stn = new ident_list(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); - } - break; - case 320: // ident_list -> ident_list, tkComma, identifier -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as ident_list).Add(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); - } - break; - case 321: // optional_semicolon -> /* empty */ -{ CurrentSemanticValue.ob = null; } - break; - case 322: // optional_semicolon -> tkSemiColon -{ CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-1].ti; } - break; - case 323: // field_or_const_definition_list -> field_or_const_definition -{ - CurrentSemanticValue.stn = new class_members(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); - } - break; - case 324: // field_or_const_definition_list -> field_or_const_definition_list, tkSemiColon, - // field_or_const_definition -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as class_members).Add(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); - } - break; - case 325: // field_or_const_definition -> attribute_declarations, - // simple_field_or_const_definition -{ - (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; - } - break; - case 326: // method_decl_list -> method_or_property_decl -{ - CurrentSemanticValue.stn = new class_members(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); - } - break; - case 327: // method_decl_list -> method_decl_list, method_or_property_decl -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as class_members).Add(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); - } - break; - case 328: // method_or_property_decl -> method_decl_withattr -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 329: // method_or_property_decl -> property_definition -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 330: // simple_field_or_const_definition -> tkConst, only_const_decl -{ - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; - CurrentSemanticValue.stn.source_context = CurrentLocationSpan; - } - break; - case 331: // simple_field_or_const_definition -> field_definition -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 332: // simple_field_or_const_definition -> tkClass, field_definition -{ - (ValueStack[ValueStack.Depth-1].stn as var_def_statement).var_attr = definition_attribute.Static; - (ValueStack[ValueStack.Depth-1].stn as var_def_statement).source_context = CurrentLocationSpan; - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; - } - break; - case 333: // field_definition -> var_decl_part -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 334: // field_definition -> tkEvent, ident_list, tkColon, type_ref -{ - CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, null, definition_attribute.None, true, CurrentLocationSpan); - } - break; - case 335: // method_decl_withattr -> attribute_declarations, method_header -{ - (ValueStack[ValueStack.Depth-1].td as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; - } - break; - case 336: // method_decl_withattr -> attribute_declarations, method_decl -{ - (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; - CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; - } - break; - case 337: // method_decl -> inclass_proc_func_decl -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 338: // method_decl -> inclass_constr_destr_decl -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 339: // method_header -> tkClass, method_procfunc_header -{ - (ValueStack[ValueStack.Depth-1].td as procedure_header).class_keyword = true; - CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; - } - break; - case 340: // method_header -> method_procfunc_header -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 341: // method_header -> constr_destr_header -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 342: // method_procfunc_header -> proc_func_header -{ - CurrentSemanticValue.td = NewProcfuncHeading(ValueStack[ValueStack.Depth-1].td as procedure_header); - } - break; - case 343: // proc_func_header -> proc_header -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 344: // proc_func_header -> func_header -{ CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } - break; - case 345: // constr_destr_header -> tkConstructor, optional_proc_name, fp_list, - // optional_method_modificators -{ - CurrentSemanticValue.td = new constructor(null,ValueStack[ValueStack.Depth-2].stn as formal_parameters,ValueStack[ValueStack.Depth-1].stn as procedure_attributes_list,ValueStack[ValueStack.Depth-3].stn as method_name,false,false,null,null,CurrentLocationSpan); - } - break; - case 346: // constr_destr_header -> tkClass, tkConstructor, optional_proc_name, fp_list, - // optional_method_modificators -{ - CurrentSemanticValue.td = new constructor(null,ValueStack[ValueStack.Depth-2].stn as formal_parameters,ValueStack[ValueStack.Depth-1].stn as procedure_attributes_list,ValueStack[ValueStack.Depth-3].stn as method_name,false,true,null,null,CurrentLocationSpan); - } - break; - case 347: // constr_destr_header -> tkDestructor, optional_proc_name, fp_list, - // optional_method_modificators -{ - CurrentSemanticValue.td = new destructor(null,ValueStack[ValueStack.Depth-2].stn as formal_parameters,ValueStack[ValueStack.Depth-1].stn as procedure_attributes_list,ValueStack[ValueStack.Depth-3].stn as method_name, false,false,null,null,CurrentLocationSpan); - } - break; - case 348: // optional_proc_name -> proc_name -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 349: // optional_proc_name -> /* empty */ -{ CurrentSemanticValue.stn = null; } - break; - case 350: // qualified_identifier -> identifier -{ CurrentSemanticValue.stn = new method_name(null,null,ValueStack[ValueStack.Depth-1].id,null,CurrentLocationSpan); } - break; - case 351: // qualified_identifier -> visibility_specifier -{ CurrentSemanticValue.stn = new method_name(null,null,ValueStack[ValueStack.Depth-1].id,null,CurrentLocationSpan); } - break; - case 352: // qualified_identifier -> qualified_identifier, tkPoint, identifier -{ - CurrentSemanticValue.stn = NewQualifiedIdentifier(ValueStack[ValueStack.Depth-3].stn as method_name, ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); - } - break; - case 353: // qualified_identifier -> qualified_identifier, tkPoint, visibility_specifier -{ - CurrentSemanticValue.stn = NewQualifiedIdentifier(ValueStack[ValueStack.Depth-3].stn as method_name, ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); - } - break; - case 354: // property_definition -> attribute_declarations, simple_prim_property_definition -{ - CurrentSemanticValue.stn = NewPropertyDefinition(ValueStack[ValueStack.Depth-2].stn as attribute_list, ValueStack[ValueStack.Depth-1].stn as declaration, LocationStack[LocationStack.Depth-1]); - } - break; - case 355: // simple_prim_property_definition -> simple_property_definition -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } - break; - case 356: // simple_prim_property_definition -> tkClass, simple_property_definition -{ - CurrentSemanticValue.stn = NewSimplePrimPropertyDefinition(ValueStack[ValueStack.Depth-1].stn as simple_property, CurrentLocationSpan); - } - break; - case 357: // simple_property_definition -> tkProperty, qualified_identifier, - // property_interface, property_specifiers, - // tkSemiColon, array_defaultproperty -{ - CurrentSemanticValue.stn = NewSimplePropertyDefinition(ValueStack[ValueStack.Depth-5].stn as method_name, ValueStack[ValueStack.Depth-4].stn as property_interface, ValueStack[ValueStack.Depth-3].stn as property_accessors, ValueStack[ValueStack.Depth-1].stn as property_array_default, CurrentLocationSpan); - } - break; - case 358: // array_defaultproperty -> /* empty */ -{ CurrentSemanticValue.stn = null; } - break; - case 359: // array_defaultproperty -> tkDefault, tkSemiColon -{ - CurrentSemanticValue.stn = new property_array_default(); - CurrentSemanticValue.stn.source_context = CurrentLocationSpan; - } - break; - case 360: // property_interface -> /* empty */ -{ CurrentSemanticValue.stn = null; } - break; - case 361: // property_interface -> property_parameter_list, tkColon, fptype -{ - CurrentSemanticValue.stn = new property_interface(ValueStack[ValueStack.Depth-3].stn as property_parameter_list, ValueStack[ValueStack.Depth-1].td, null, CurrentLocationSpan); - } - break; - case 362: // property_parameter_list -> /* empty */ -{ CurrentSemanticValue.stn = null; } - break; - case 363: // property_parameter_list -> tkSquareOpen, parameter_decl_list, tkSquareClose -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } - break; - case 364: // parameter_decl_list -> parameter_decl -{ - CurrentSemanticValue.stn = new property_parameter_list(ValueStack[ValueStack.Depth-1].stn as property_parameter, CurrentLocationSpan); - } - break; - case 365: // parameter_decl_list -> parameter_decl_list, tkSemiColon, parameter_decl -{ - CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as property_parameter_list).Add(ValueStack[ValueStack.Depth-1].stn as property_parameter, CurrentLocationSpan); - } - break; - case 366: // parameter_decl -> ident_list, tkColon, fptype -{ - CurrentSemanticValue.stn = new property_parameter(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); - } - break; - case 367: // optional_identifier -> identifier -{ CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } - break; - case 368: // optional_identifier -> /* empty */ -{ CurrentSemanticValue.id = null; } - break; - case 370: // property_specifiers -> tkRead, optional_identifier, property_specifiers -{ - CurrentSemanticValue.stn = NewPropertySpecifiersRead(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-2].id, ValueStack[ValueStack.Depth-1].stn as property_accessors, CurrentLocationSpan); - } - break; - case 371: // property_specifiers -> tkWrite, optional_identifier, property_specifiers -{ - CurrentSemanticValue.stn = NewPropertySpecifiersWrite(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-2].id, ValueStack[ValueStack.Depth-1].stn as property_accessors, CurrentLocationSpan); - } - break; - case 372: // var_decl -> var_decl_part, tkSemiColon -{ CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } - break; - case 375: // var_decl_part -> ident_list, tkColon, type_ref -{ - CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, null, definition_attribute.None, false, CurrentLocationSpan); - } - break; - case 376: // var_decl_part -> ident_list, tkAssign, expr -{ - CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-3].stn as ident_list, null, ValueStack[ValueStack.Depth-1].ex, definition_attribute.None, false, CurrentLocationSpan); - } - break; - case 377: // var_decl_part -> ident_list, tkColon, type_ref, tkAssignOrEqual, - // typed_const_or_new -{ - CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-5].stn as ident_list, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].ex, definition_attribute.None, false, CurrentLocationSpan); - } - break; - case 378: // var_decl_part -> ident_list, tkColon, type_ref, tkAssignOrEqual, - // expl_func_decl_lambda -{ - CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-5].stn as ident_list, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].ex, definition_attribute.None, false, CurrentLocationSpan); - } - break; - case 379: // typed_const_or_new -> typed_const -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 380: // typed_const_or_new -> new_expr -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 381: // typed_const_or_new -> default_expr -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 382: // constr_destr_decl -> constr_destr_header, block + case 383: // constr_destr_decl -> constr_destr_header, block { CurrentSemanticValue.stn = new procedure_definition(ValueStack[ValueStack.Depth-2].td as procedure_header, ValueStack[ValueStack.Depth-1].stn as block, CurrentLocationSpan); } break; - case 383: // inclass_constr_destr_decl -> constr_destr_header, inclass_block + case 384: // inclass_constr_destr_decl -> constr_destr_header, inclass_block { CurrentSemanticValue.stn = new procedure_definition(ValueStack[ValueStack.Depth-2].td as procedure_header, ValueStack[ValueStack.Depth-1].stn as block, CurrentLocationSpan); } break; - case 384: // proc_func_decl -> proc_func_decl_noclass + case 385: // proc_func_decl -> proc_func_decl_noclass { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 385: // proc_func_decl -> tkClass, proc_func_decl_noclass + case 386: // proc_func_decl -> tkClass, proc_func_decl_noclass { (ValueStack[ValueStack.Depth-1].stn as procedure_definition).proc_header.class_keyword = true; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 386: // proc_func_decl_noclass -> proc_func_header, proc_func_external_block + case 387: // proc_func_decl_noclass -> proc_func_header, proc_func_external_block { CurrentSemanticValue.stn = new procedure_definition(ValueStack[ValueStack.Depth-2].td as procedure_header, ValueStack[ValueStack.Depth-1].stn as proc_block, CurrentLocationSpan); } break; - case 387: // proc_func_decl_noclass -> tkFunction, func_name, fp_list, tkColon, fptype, + case 388: // proc_func_decl_noclass -> tkFunction, func_name, fp_list, tkColon, fptype, // optional_method_modificators1, tkAssign, relop_expr, // tkSemiColon { CurrentSemanticValue.stn = SyntaxTreeBuilder.BuildShortFuncDefinition(ValueStack[ValueStack.Depth-7].stn as formal_parameters, ValueStack[ValueStack.Depth-4].stn as procedure_attributes_list, ValueStack[ValueStack.Depth-8].stn as method_name, ValueStack[ValueStack.Depth-5].td as type_definition, ValueStack[ValueStack.Depth-2].ex, LocationStack[LocationStack.Depth-9].Merge(LocationStack[LocationStack.Depth-5])); } break; - case 388: // proc_func_decl_noclass -> tkFunction, func_name, fp_list, + case 389: // proc_func_decl_noclass -> tkFunction, func_name, fp_list, // optional_method_modificators1, tkAssign, relop_expr, // tkSemiColon { CurrentSemanticValue.stn = SyntaxTreeBuilder.BuildShortFuncDefinition(ValueStack[ValueStack.Depth-5].stn as formal_parameters, ValueStack[ValueStack.Depth-4].stn as procedure_attributes_list, ValueStack[ValueStack.Depth-6].stn as method_name, null, ValueStack[ValueStack.Depth-2].ex, LocationStack[LocationStack.Depth-7].Merge(LocationStack[LocationStack.Depth-5])); } break; - case 389: // proc_func_decl_noclass -> tkProcedure, proc_name, fp_list, + case 390: // proc_func_decl_noclass -> tkProcedure, proc_name, fp_list, // optional_method_modificators1, tkAssign, // unlabelled_stmt, tkSemiColon { @@ -3945,28 +3946,28 @@ public partial class GPPGParser: ShiftReduceParser proc_func_header, tkForward, tkSemiColon + case 391: // proc_func_decl_noclass -> proc_func_header, tkForward, tkSemiColon { CurrentSemanticValue.stn = new procedure_definition(ValueStack[ValueStack.Depth-3].td as procedure_header, null, CurrentLocationSpan); (CurrentSemanticValue.stn as procedure_definition).proc_header.proc_attributes.Add((procedure_attribute)ValueStack[ValueStack.Depth-2].id, ValueStack[ValueStack.Depth-2].id.source_context); } break; - case 391: // inclass_proc_func_decl -> inclass_proc_func_decl_noclass + case 392: // inclass_proc_func_decl -> inclass_proc_func_decl_noclass { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 392: // inclass_proc_func_decl -> tkClass, inclass_proc_func_decl_noclass + case 393: // inclass_proc_func_decl -> tkClass, inclass_proc_func_decl_noclass { if ((ValueStack[ValueStack.Depth-1].stn as procedure_definition).proc_header != null) (ValueStack[ValueStack.Depth-1].stn as procedure_definition).proc_header.class_keyword = true; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 393: // inclass_proc_func_decl_noclass -> proc_func_header, inclass_block + case 394: // inclass_proc_func_decl_noclass -> proc_func_header, inclass_block { CurrentSemanticValue.stn = new procedure_definition(ValueStack[ValueStack.Depth-2].td as procedure_header, ValueStack[ValueStack.Depth-1].stn as proc_block, CurrentLocationSpan); } break; - case 394: // inclass_proc_func_decl_noclass -> tkFunction, func_name, fp_list, tkColon, + case 395: // inclass_proc_func_decl_noclass -> tkFunction, func_name, fp_list, tkColon, // fptype, optional_method_modificators1, // tkAssign, relop_expr, tkSemiColon { @@ -3975,7 +3976,7 @@ public partial class GPPGParser: ShiftReduceParser tkFunction, func_name, fp_list, + case 396: // inclass_proc_func_decl_noclass -> tkFunction, func_name, fp_list, // optional_method_modificators1, tkAssign, // relop_expr, tkSemiColon { @@ -3984,7 +3985,7 @@ public partial class GPPGParser: ShiftReduceParser tkProcedure, proc_name, fp_list, + case 397: // inclass_proc_func_decl_noclass -> tkProcedure, proc_name, fp_list, // optional_method_modificators1, tkAssign, // unlabelled_stmt, tkSemiColon { @@ -3993,21 +3994,21 @@ public partial class GPPGParser: ShiftReduceParser block + case 398: // proc_func_external_block -> block { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 398: // proc_func_external_block -> external_block + case 399: // proc_func_external_block -> external_block { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 399: // proc_name -> func_name + case 400: // proc_name -> func_name { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 400: // func_name -> func_meth_name_ident + case 401: // func_name -> func_meth_name_ident { CurrentSemanticValue.stn = new method_name(null,null, ValueStack[ValueStack.Depth-1].id, null, CurrentLocationSpan); } break; - case 401: // func_name -> func_class_name_ident_list, tkPoint, func_meth_name_ident + case 402: // func_name -> func_class_name_ident_list, tkPoint, func_meth_name_ident { var ln = ValueStack[ValueStack.Depth-3].ob as List; var cnt = (ValueStack[ValueStack.Depth-3].ob as List).Count; @@ -4017,282 +4018,282 @@ public partial class GPPGParser: ShiftReduceParser func_name_with_template_args + case 403: // func_class_name_ident -> func_name_with_template_args { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 403: // func_class_name_ident_list -> func_class_name_ident + case 404: // func_class_name_ident_list -> func_class_name_ident { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].id); } break; - case 404: // func_class_name_ident_list -> func_class_name_ident_list, tkPoint, + case 405: // func_class_name_ident_list -> func_class_name_ident_list, tkPoint, // func_class_name_ident { (ValueStack[ValueStack.Depth-3].ob as List).Add(ValueStack[ValueStack.Depth-1].id); CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-3].ob; } break; - case 405: // func_meth_name_ident -> func_name_with_template_args + case 406: // func_meth_name_ident -> func_name_with_template_args { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 406: // func_meth_name_ident -> operator_name_ident + case 407: // func_meth_name_ident -> operator_name_ident { CurrentSemanticValue.id = (ident)ValueStack[ValueStack.Depth-1].ex; } break; - case 407: // func_meth_name_ident -> operator_name_ident, template_arguments + case 408: // func_meth_name_ident -> operator_name_ident, template_arguments { CurrentSemanticValue.id = new template_operator_name(null, ValueStack[ValueStack.Depth-1].stn as ident_list, ValueStack[ValueStack.Depth-2].ex as operator_name_ident, CurrentLocationSpan); } break; - case 408: // func_name_with_template_args -> func_name_ident + case 409: // func_name_with_template_args -> func_name_ident { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 409: // func_name_with_template_args -> func_name_ident, template_arguments + case 410: // func_name_with_template_args -> func_name_ident, template_arguments { CurrentSemanticValue.id = new template_type_name(ValueStack[ValueStack.Depth-2].id.name, ValueStack[ValueStack.Depth-1].stn as ident_list, CurrentLocationSpan); } break; - case 410: // func_name_ident -> identifier + case 411: // func_name_ident -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 411: // proc_header -> tkProcedure, proc_name, fp_list, optional_method_modificators, + case 412: // proc_header -> tkProcedure, proc_name, fp_list, optional_method_modificators, // optional_where_section { CurrentSemanticValue.td = new procedure_header(ValueStack[ValueStack.Depth-3].stn as formal_parameters, ValueStack[ValueStack.Depth-2].stn as procedure_attributes_list, ValueStack[ValueStack.Depth-4].stn as method_name, ValueStack[ValueStack.Depth-1].stn as where_definition_list, CurrentLocationSpan); } break; - case 412: // func_header -> tkFunction, func_name, fp_list, optional_method_modificators, + case 413: // func_header -> tkFunction, func_name, fp_list, optional_method_modificators, // optional_where_section { CurrentSemanticValue.td = new function_header(ValueStack[ValueStack.Depth-3].stn as formal_parameters, ValueStack[ValueStack.Depth-2].stn as procedure_attributes_list, ValueStack[ValueStack.Depth-4].stn as method_name, ValueStack[ValueStack.Depth-1].stn as where_definition_list, null, CurrentLocationSpan); } break; - case 413: // func_header -> tkFunction, func_name, fp_list, tkColon, fptype, + case 414: // func_header -> tkFunction, func_name, fp_list, tkColon, fptype, // optional_method_modificators, optional_where_section { CurrentSemanticValue.td = new function_header(ValueStack[ValueStack.Depth-5].stn as formal_parameters, ValueStack[ValueStack.Depth-2].stn as procedure_attributes_list, ValueStack[ValueStack.Depth-6].stn as method_name, ValueStack[ValueStack.Depth-1].stn as where_definition_list, ValueStack[ValueStack.Depth-3].td as type_definition, CurrentLocationSpan); } break; - case 414: // external_block -> tkExternal, external_directive_ident, tkName, + case 415: // external_block -> tkExternal, external_directive_ident, tkName, // external_directive_ident, tkSemiColon { CurrentSemanticValue.stn = new external_directive(ValueStack[ValueStack.Depth-4].ex, ValueStack[ValueStack.Depth-2].ex, CurrentLocationSpan); } break; - case 415: // external_block -> tkExternal, external_directive_ident, tkSemiColon + case 416: // external_block -> tkExternal, external_directive_ident, tkSemiColon { CurrentSemanticValue.stn = new external_directive(ValueStack[ValueStack.Depth-2].ex, null, CurrentLocationSpan); } break; - case 416: // external_block -> tkExternal, tkSemiColon + case 417: // external_block -> tkExternal, tkSemiColon { CurrentSemanticValue.stn = new external_directive(null, null, CurrentLocationSpan); } break; - case 417: // external_directive_ident -> identifier + case 418: // external_directive_ident -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 418: // external_directive_ident -> literal + case 419: // external_directive_ident -> literal { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 419: // block -> decl_sect_list, compound_stmt, tkSemiColon + case 420: // block -> decl_sect_list, compound_stmt, tkSemiColon { CurrentSemanticValue.stn = new block(ValueStack[ValueStack.Depth-3].stn as declarations, ValueStack[ValueStack.Depth-2].stn as statement_list, CurrentLocationSpan); } break; - case 420: // inclass_block -> inclass_decl_sect_list, compound_stmt, tkSemiColon + case 421: // inclass_block -> inclass_decl_sect_list, compound_stmt, tkSemiColon { CurrentSemanticValue.stn = new block(ValueStack[ValueStack.Depth-3].stn as declarations, ValueStack[ValueStack.Depth-2].stn as statement_list, CurrentLocationSpan); } break; - case 421: // fp_list -> /* empty */ + case 422: // fp_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 422: // fp_list -> tkRoundOpen, tkRoundClose + case 423: // fp_list -> tkRoundOpen, tkRoundClose { CurrentSemanticValue.stn = null; } break; - case 423: // fp_list -> tkRoundOpen, fp_sect_list, tkRoundClose + case 424: // fp_list -> tkRoundOpen, fp_sect_list, tkRoundClose { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; if (CurrentSemanticValue.stn != null) CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 424: // fp_sect_list -> fp_sect + case 425: // fp_sect_list -> fp_sect { CurrentSemanticValue.stn = new formal_parameters(ValueStack[ValueStack.Depth-1].stn as typed_parameters, CurrentLocationSpan); } break; - case 425: // fp_sect_list -> fp_sect_list, tkSemiColon, fp_sect + case 426: // fp_sect_list -> fp_sect_list, tkSemiColon, fp_sect { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as formal_parameters).Add(ValueStack[ValueStack.Depth-1].stn as typed_parameters, CurrentLocationSpan); } break; - case 426: // fp_sect -> attribute_declarations, simple_fp_sect + case 427: // fp_sect -> attribute_declarations, simple_fp_sect { (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 427: // simple_fp_sect -> param_name_list, tkColon, fptype + case 428: // simple_fp_sect -> param_name_list, tkColon, fptype { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, parametr_kind.none, null, CurrentLocationSpan); } break; - case 428: // simple_fp_sect -> tkVar, param_name_list, tkColon, fptype + case 429: // simple_fp_sect -> tkVar, param_name_list, tkColon, fptype { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, parametr_kind.var_parametr, null, CurrentLocationSpan); } break; - case 429: // simple_fp_sect -> tkConst, param_name_list, tkColon, fptype + case 430: // simple_fp_sect -> tkConst, param_name_list, tkColon, fptype { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, parametr_kind.const_parametr, null, CurrentLocationSpan); } break; - case 430: // simple_fp_sect -> tkParams, param_name_list, tkColon, fptype + case 431: // simple_fp_sect -> tkParams, param_name_list, tkColon, fptype { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td,parametr_kind.params_parametr,null, CurrentLocationSpan); } break; - case 431: // simple_fp_sect -> param_name_list, tkColon, fptype, tkAssign, const_expr + case 432: // simple_fp_sect -> param_name_list, tkColon, fptype, tkAssign, const_expr { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-5].stn as ident_list, ValueStack[ValueStack.Depth-3].td, parametr_kind.none, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 432: // simple_fp_sect -> tkVar, param_name_list, tkColon, fptype, tkAssign, const_expr + case 433: // simple_fp_sect -> tkVar, param_name_list, tkColon, fptype, tkAssign, const_expr { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-5].stn as ident_list, ValueStack[ValueStack.Depth-3].td, parametr_kind.var_parametr, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 433: // simple_fp_sect -> tkConst, param_name_list, tkColon, fptype, tkAssign, + case 434: // simple_fp_sect -> tkConst, param_name_list, tkColon, fptype, tkAssign, // const_expr { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-5].stn as ident_list, ValueStack[ValueStack.Depth-3].td, parametr_kind.const_parametr, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 434: // param_name_list -> param_name + case 435: // param_name_list -> param_name { CurrentSemanticValue.stn = new ident_list(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); } break; - case 435: // param_name_list -> param_name_list, tkComma, param_name + case 436: // param_name_list -> param_name_list, tkComma, param_name { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as ident_list).Add(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); } break; - case 436: // param_name -> identifier + case 437: // param_name -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 437: // fptype -> type_ref + case 438: // fptype -> type_ref { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 438: // fptype_noproctype -> simple_type + case 439: // fptype_noproctype -> simple_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 439: // fptype_noproctype -> string_type + case 440: // fptype_noproctype -> string_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 440: // fptype_noproctype -> pointer_type + case 441: // fptype_noproctype -> pointer_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 441: // fptype_noproctype -> structured_type + case 442: // fptype_noproctype -> structured_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 442: // fptype_noproctype -> template_type + case 443: // fptype_noproctype -> template_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 443: // stmt -> unlabelled_stmt + case 444: // stmt -> unlabelled_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 444: // stmt -> label_name, tkColon, stmt + case 445: // stmt -> label_name, tkColon, stmt { CurrentSemanticValue.stn = new labeled_statement(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 445: // unlabelled_stmt -> /* empty */ + case 446: // unlabelled_stmt -> /* empty */ { CurrentSemanticValue.stn = new empty_statement(); CurrentSemanticValue.stn.source_context = null; } break; - case 446: // unlabelled_stmt -> assignment + case 447: // unlabelled_stmt -> assignment { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 447: // unlabelled_stmt -> proc_call + case 448: // unlabelled_stmt -> proc_call { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 448: // unlabelled_stmt -> goto_stmt + case 449: // unlabelled_stmt -> goto_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 449: // unlabelled_stmt -> compound_stmt + case 450: // unlabelled_stmt -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 450: // unlabelled_stmt -> if_stmt + case 451: // unlabelled_stmt -> if_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 451: // unlabelled_stmt -> case_stmt + case 452: // unlabelled_stmt -> case_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 452: // unlabelled_stmt -> repeat_stmt + case 453: // unlabelled_stmt -> repeat_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 453: // unlabelled_stmt -> while_stmt + case 454: // unlabelled_stmt -> while_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 454: // unlabelled_stmt -> for_stmt + case 455: // unlabelled_stmt -> for_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 455: // unlabelled_stmt -> with_stmt + case 456: // unlabelled_stmt -> with_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 456: // unlabelled_stmt -> inherited_message + case 457: // unlabelled_stmt -> inherited_message { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 457: // unlabelled_stmt -> try_stmt + case 458: // unlabelled_stmt -> try_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 458: // unlabelled_stmt -> raise_stmt + case 459: // unlabelled_stmt -> raise_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 459: // unlabelled_stmt -> foreach_stmt + case 460: // unlabelled_stmt -> foreach_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 460: // unlabelled_stmt -> var_stmt + case 461: // unlabelled_stmt -> var_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 461: // unlabelled_stmt -> expr_as_stmt + case 462: // unlabelled_stmt -> expr_as_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 462: // unlabelled_stmt -> lock_stmt + case 463: // unlabelled_stmt -> lock_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 463: // unlabelled_stmt -> yield_stmt + case 464: // unlabelled_stmt -> yield_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 464: // unlabelled_stmt -> yield_sequence_stmt + case 465: // unlabelled_stmt -> yield_sequence_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 465: // yield_stmt -> tkYield, expr_l1 + case 466: // yield_stmt -> tkYield, expr_l1 { CurrentSemanticValue.stn = new yield_node(ValueStack[ValueStack.Depth-1].ex,CurrentLocationSpan); } break; - case 466: // yield_sequence_stmt -> tkYield, tkSequence, expr_l1 + case 467: // yield_sequence_stmt -> tkYield, tkSequence, expr_l1 { CurrentSemanticValue.stn = new yield_sequence_node(ValueStack[ValueStack.Depth-1].ex,CurrentLocationSpan); } break; - case 467: // var_stmt -> tkVar, var_decl_part + case 468: // var_stmt -> tkVar, var_decl_part { CurrentSemanticValue.stn = new var_statement(ValueStack[ValueStack.Depth-1].stn as var_def_statement, CurrentLocationSpan); } break; - case 468: // assignment -> var_reference, assign_operator, expr_with_func_decl_lambda + case 469: // assignment -> var_reference, assign_operator, expr_with_func_decl_lambda { CurrentSemanticValue.stn = new assign(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 469: // assignment -> tkRoundOpen, variable, tkComma, variable_list, tkRoundClose, + case 470: // assignment -> tkRoundOpen, variable, tkComma, variable_list, tkRoundClose, // assign_operator, expr { if (ValueStack[ValueStack.Depth-2].op.type != Operators.Assignment) @@ -4302,7 +4303,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, tkVar, variable, tkComma, var_variable_list, + case 471: // assignment -> tkRoundOpen, tkVar, variable, tkComma, var_variable_list, // tkRoundClose, assign_operator, expr { if (ValueStack[ValueStack.Depth-2].op.type != Operators.Assignment) @@ -4312,41 +4313,41 @@ public partial class GPPGParser: ShiftReduceParser variable + case 472: // variable_list -> variable { CurrentSemanticValue.ob = new addressed_value_list(ValueStack[ValueStack.Depth-1].ex as addressed_value,LocationStack[LocationStack.Depth-1]); } break; - case 472: // variable_list -> variable_list, tkComma, variable + case 473: // variable_list -> variable_list, tkComma, variable { (ValueStack[ValueStack.Depth-3].ob as addressed_value_list).Add(ValueStack[ValueStack.Depth-1].ex as addressed_value); (ValueStack[ValueStack.Depth-3].ob as addressed_value_list).source_context = LexLocation.MergeAll(LocationStack[LocationStack.Depth-3],LocationStack[LocationStack.Depth-2],LocationStack[LocationStack.Depth-1]); CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-3].ob; } break; - case 473: // var_variable_list -> tkVar, variable + case 474: // var_variable_list -> tkVar, variable { CurrentSemanticValue.ob = new addressed_value_list(ValueStack[ValueStack.Depth-1].ex as addressed_value,CurrentLocationSpan); } break; - case 474: // var_variable_list -> var_variable_list, tkComma, tkVar, variable + case 475: // var_variable_list -> var_variable_list, tkComma, tkVar, variable { (ValueStack[ValueStack.Depth-4].ob as addressed_value_list).Add(ValueStack[ValueStack.Depth-1].ex as addressed_value); (ValueStack[ValueStack.Depth-4].ob as addressed_value_list).source_context = LexLocation.MergeAll(LocationStack[LocationStack.Depth-4],LocationStack[LocationStack.Depth-3],LocationStack[LocationStack.Depth-2],LocationStack[LocationStack.Depth-1]); CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-4].ob; } break; - case 475: // proc_call -> var_reference + case 476: // proc_call -> var_reference { CurrentSemanticValue.stn = new procedure_call(ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); } break; - case 476: // goto_stmt -> tkGoto, label_name + case 477: // goto_stmt -> tkGoto, label_name { CurrentSemanticValue.stn = new goto_statement(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); } break; - case 477: // compound_stmt -> tkBegin, stmt_list, tkEnd + case 478: // compound_stmt -> tkBegin, stmt_list, tkEnd { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; (CurrentSemanticValue.stn as statement_list).left_logical_bracket = ValueStack[ValueStack.Depth-3].ti; @@ -4354,73 +4355,73 @@ public partial class GPPGParser: ShiftReduceParser stmt + case 479: // stmt_list -> stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, LocationStack[LocationStack.Depth-1]); } break; - case 479: // stmt_list -> stmt_list, tkSemiColon, stmt + case 480: // stmt_list -> stmt_list, tkSemiColon, stmt { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as statement_list).Add(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 480: // if_stmt -> tkIf, expr_l1, tkThen, unlabelled_stmt + case 481: // if_stmt -> tkIf, expr_l1, tkThen, unlabelled_stmt { CurrentSemanticValue.stn = new if_node(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].stn as statement, null, CurrentLocationSpan); } break; - case 481: // if_stmt -> tkIf, expr_l1, tkThen, unlabelled_stmt, tkElse, unlabelled_stmt + case 482: // if_stmt -> tkIf, expr_l1, tkThen, unlabelled_stmt, tkElse, unlabelled_stmt { CurrentSemanticValue.stn = new if_node(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].stn as statement, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 482: // case_stmt -> tkCase, expr_l1, tkOf, case_list, else_case, tkEnd + case 483: // case_stmt -> tkCase, expr_l1, tkOf, case_list, else_case, tkEnd { CurrentSemanticValue.stn = new case_node(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].stn as case_variants, ValueStack[ValueStack.Depth-2].stn as statement, CurrentLocationSpan); } break; - case 483: // case_list -> case_item + case 484: // case_list -> case_item { if (ValueStack[ValueStack.Depth-1].stn is empty_statement) CurrentSemanticValue.stn = NewCaseItem(ValueStack[ValueStack.Depth-1].stn, null); else CurrentSemanticValue.stn = NewCaseItem(ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 484: // case_list -> case_list, tkSemiColon, case_item + case 485: // case_list -> case_list, tkSemiColon, case_item { CurrentSemanticValue.stn = AddCaseItem(ValueStack[ValueStack.Depth-3].stn as case_variants, ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 485: // case_item -> /* empty */ + case 486: // case_item -> /* empty */ { CurrentSemanticValue.stn = new empty_statement(); } break; - case 486: // case_item -> case_label_list, tkColon, unlabelled_stmt + case 487: // case_item -> case_label_list, tkColon, unlabelled_stmt { CurrentSemanticValue.stn = new case_variant(ValueStack[ValueStack.Depth-3].stn as expression_list, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 487: // case_label_list -> case_label + case 488: // case_label_list -> case_label { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 488: // case_label_list -> case_label_list, tkComma, case_label + case 489: // case_label_list -> case_label_list, tkComma, case_label { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 489: // case_label -> const_elem + case 490: // case_label -> const_elem { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 490: // else_case -> /* empty */ + case 491: // else_case -> /* empty */ { CurrentSemanticValue.stn = null;} break; - case 491: // else_case -> tkElse, stmt_list + case 492: // else_case -> tkElse, stmt_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 492: // repeat_stmt -> tkRepeat, stmt_list, tkUntil, expr + case 493: // repeat_stmt -> tkRepeat, stmt_list, tkUntil, expr { CurrentSemanticValue.stn = new repeat_node(ValueStack[ValueStack.Depth-3].stn as statement_list, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); (ValueStack[ValueStack.Depth-3].stn as statement_list).left_logical_bracket = ValueStack[ValueStack.Depth-4].ti; @@ -4428,23 +4429,23 @@ public partial class GPPGParser: ShiftReduceParser tkWhile, expr_l1, optional_tk_do, unlabelled_stmt + case 494: // while_stmt -> tkWhile, expr_l1, optional_tk_do, unlabelled_stmt { CurrentSemanticValue.stn = NewWhileStmt(ValueStack[ValueStack.Depth-4].ti, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-2].ti, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 494: // optional_tk_do -> tkDo + case 495: // optional_tk_do -> tkDo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 495: // optional_tk_do -> /* empty */ + case 496: // optional_tk_do -> /* empty */ { CurrentSemanticValue.ti = null; } break; - case 496: // lock_stmt -> tkLock, expr_l1, tkDo, unlabelled_stmt + case 497: // lock_stmt -> tkLock, expr_l1, tkDo, unlabelled_stmt { CurrentSemanticValue.stn = new lock_stmt(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 497: // foreach_stmt -> tkForeach, identifier, foreach_stmt_ident_dype_opt, tkIn, + case 498: // foreach_stmt -> tkForeach, identifier, foreach_stmt_ident_dype_opt, tkIn, // expr_l1, tkDo, unlabelled_stmt { CurrentSemanticValue.stn = new foreach_stmt(ValueStack[ValueStack.Depth-6].id, ValueStack[ValueStack.Depth-5].td, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); @@ -4452,68 +4453,68 @@ public partial class GPPGParser: ShiftReduceParser tkForeach, tkVar, identifier, tkColon, type_ref, tkIn, expr_l1, + case 499: // foreach_stmt -> tkForeach, tkVar, identifier, tkColon, type_ref, tkIn, expr_l1, // tkDo, unlabelled_stmt { CurrentSemanticValue.stn = new foreach_stmt(ValueStack[ValueStack.Depth-7].id, ValueStack[ValueStack.Depth-5].td, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 499: // foreach_stmt -> tkForeach, tkVar, identifier, tkIn, expr_l1, tkDo, + case 500: // foreach_stmt -> tkForeach, tkVar, identifier, tkIn, expr_l1, tkDo, // unlabelled_stmt { CurrentSemanticValue.stn = new foreach_stmt(ValueStack[ValueStack.Depth-5].id, new no_type_foreach(), ValueStack[ValueStack.Depth-3].ex, (statement)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 500: // foreach_stmt_ident_dype_opt -> tkColon, type_ref + case 501: // foreach_stmt_ident_dype_opt -> tkColon, type_ref { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 502: // for_stmt -> tkFor, optional_var, identifier, for_stmt_decl_or_assign, expr_l1, + case 503: // for_stmt -> tkFor, optional_var, identifier, for_stmt_decl_or_assign, expr_l1, // for_cycle_type, expr_l1, optional_tk_do, unlabelled_stmt { CurrentSemanticValue.stn = NewForStmt((bool)ValueStack[ValueStack.Depth-8].ob, ValueStack[ValueStack.Depth-7].id, ValueStack[ValueStack.Depth-6].td, ValueStack[ValueStack.Depth-5].ex, (for_cycle_type)ValueStack[ValueStack.Depth-4].ob, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-2].ti, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 503: // optional_var -> tkVar + case 504: // optional_var -> tkVar { CurrentSemanticValue.ob = true; } break; - case 504: // optional_var -> /* empty */ + case 505: // optional_var -> /* empty */ { CurrentSemanticValue.ob = false; } break; - case 506: // for_stmt_decl_or_assign -> tkColon, simple_type_identifier, tkAssign + case 507: // for_stmt_decl_or_assign -> tkColon, simple_type_identifier, tkAssign { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-2].td; } break; - case 507: // for_cycle_type -> tkTo + case 508: // for_cycle_type -> tkTo { CurrentSemanticValue.ob = for_cycle_type.to; } break; - case 508: // for_cycle_type -> tkDownto + case 509: // for_cycle_type -> tkDownto { CurrentSemanticValue.ob = for_cycle_type.downto; } break; - case 509: // with_stmt -> tkWith, expr_list, tkDo, unlabelled_stmt + case 510: // with_stmt -> tkWith, expr_list, tkDo, unlabelled_stmt { CurrentSemanticValue.stn = new with_statement(ValueStack[ValueStack.Depth-1].stn as statement, ValueStack[ValueStack.Depth-3].stn as expression_list, CurrentLocationSpan); } break; - case 510: // inherited_message -> tkInherited + case 511: // inherited_message -> tkInherited { CurrentSemanticValue.stn = new inherited_message(); CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 511: // try_stmt -> tkTry, stmt_list, try_handler + case 512: // try_stmt -> tkTry, stmt_list, try_handler { CurrentSemanticValue.stn = new try_stmt(ValueStack[ValueStack.Depth-2].stn as statement_list, ValueStack[ValueStack.Depth-1].stn as try_handler, CurrentLocationSpan); (ValueStack[ValueStack.Depth-2].stn as statement_list).left_logical_bracket = ValueStack[ValueStack.Depth-3].ti; ValueStack[ValueStack.Depth-2].stn.source_context = LocationStack[LocationStack.Depth-3].Merge(LocationStack[LocationStack.Depth-2]); } break; - case 512: // try_handler -> tkFinally, stmt_list, tkEnd + case 513: // try_handler -> tkFinally, stmt_list, tkEnd { CurrentSemanticValue.stn = new try_handler_finally(ValueStack[ValueStack.Depth-2].stn as statement_list, CurrentLocationSpan); (ValueStack[ValueStack.Depth-2].stn as statement_list).left_logical_bracket = ValueStack[ValueStack.Depth-3].ti; (ValueStack[ValueStack.Depth-2].stn as statement_list).right_logical_bracket = ValueStack[ValueStack.Depth-1].ti; } break; - case 513: // try_handler -> tkExcept, exception_block, tkEnd + case 514: // try_handler -> tkExcept, exception_block, tkEnd { CurrentSemanticValue.stn = new try_handler_except((exception_block)ValueStack[ValueStack.Depth-2].stn, CurrentLocationSpan); if ((ValueStack[ValueStack.Depth-2].stn as exception_block).stmt_list != null) @@ -4523,154 +4524,154 @@ public partial class GPPGParser: ShiftReduceParser exception_handler_list, exception_block_else_branch + case 515: // exception_block -> exception_handler_list, exception_block_else_branch { CurrentSemanticValue.stn = new exception_block(null, (exception_handler_list)ValueStack[ValueStack.Depth-2].stn, (statement_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 515: // exception_block -> exception_handler_list, tkSemiColon, + case 516: // exception_block -> exception_handler_list, tkSemiColon, // exception_block_else_branch { CurrentSemanticValue.stn = new exception_block(null, (exception_handler_list)ValueStack[ValueStack.Depth-3].stn, (statement_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 516: // exception_block -> stmt_list + case 517: // exception_block -> stmt_list { CurrentSemanticValue.stn = new exception_block(ValueStack[ValueStack.Depth-1].stn as statement_list, null, null, LocationStack[LocationStack.Depth-1]); } break; - case 517: // exception_handler_list -> exception_handler + case 518: // exception_handler_list -> exception_handler { CurrentSemanticValue.stn = new exception_handler_list(ValueStack[ValueStack.Depth-1].stn as exception_handler, CurrentLocationSpan); } break; - case 518: // exception_handler_list -> exception_handler_list, tkSemiColon, + case 519: // exception_handler_list -> exception_handler_list, tkSemiColon, // exception_handler { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as exception_handler_list).Add(ValueStack[ValueStack.Depth-1].stn as exception_handler, CurrentLocationSpan); } break; - case 519: // exception_block_else_branch -> /* empty */ + case 520: // exception_block_else_branch -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 520: // exception_block_else_branch -> tkElse, stmt_list + case 521: // exception_block_else_branch -> tkElse, stmt_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 521: // exception_handler -> tkOn, exception_identifier, tkDo, unlabelled_stmt + case 522: // exception_handler -> tkOn, exception_identifier, tkDo, unlabelled_stmt { CurrentSemanticValue.stn = new exception_handler((ValueStack[ValueStack.Depth-3].stn as exception_ident).variable, (ValueStack[ValueStack.Depth-3].stn as exception_ident).type_name, ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 522: // exception_identifier -> exception_class_type_identifier + case 523: // exception_identifier -> exception_class_type_identifier { CurrentSemanticValue.stn = new exception_ident(null, (named_type_reference)ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 523: // exception_identifier -> exception_variable, tkColon, + case 524: // exception_identifier -> exception_variable, tkColon, // exception_class_type_identifier { CurrentSemanticValue.stn = new exception_ident(ValueStack[ValueStack.Depth-3].id, (named_type_reference)ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 524: // exception_class_type_identifier -> simple_type_identifier + case 525: // exception_class_type_identifier -> simple_type_identifier { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 525: // exception_variable -> identifier + case 526: // exception_variable -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 526: // raise_stmt -> tkRaise + case 527: // raise_stmt -> tkRaise { CurrentSemanticValue.stn = new raise_stmt(); CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 527: // raise_stmt -> tkRaise, expr + case 528: // raise_stmt -> tkRaise, expr { CurrentSemanticValue.stn = new raise_stmt(ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 528: // expr_list -> expr_with_func_decl_lambda + case 529: // expr_list -> expr_with_func_decl_lambda { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 529: // expr_list -> expr_list, tkComma, expr_with_func_decl_lambda + case 530: // expr_list -> expr_list, tkComma, expr_with_func_decl_lambda { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 530: // expr_as_stmt -> allowable_expr_as_stmt + case 531: // expr_as_stmt -> allowable_expr_as_stmt { CurrentSemanticValue.stn = new expression_as_statement(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 531: // allowable_expr_as_stmt -> new_expr + case 532: // allowable_expr_as_stmt -> new_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 532: // expr_with_func_decl_lambda -> expr + case 533: // expr_with_func_decl_lambda -> expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 533: // expr_with_func_decl_lambda -> func_decl_lambda + case 534: // expr_with_func_decl_lambda -> func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 534: // expr -> expr_l1 + case 535: // expr -> expr_l1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 535: // expr -> format_expr + case 536: // expr -> format_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 536: // expr_l1 -> relop_expr + case 537: // expr_l1 -> relop_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 537: // expr_l1 -> question_expr + case 538: // expr_l1 -> question_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 538: // sizeof_expr -> tkSizeOf, tkRoundOpen, simple_or_template_type_reference, + case 539: // sizeof_expr -> tkSizeOf, tkRoundOpen, simple_or_template_type_reference, // tkRoundClose { CurrentSemanticValue.ex = new sizeof_operator((named_type_reference)ValueStack[ValueStack.Depth-2].td, null, CurrentLocationSpan); } break; - case 539: // typeof_expr -> tkTypeOf, tkRoundOpen, simple_or_template_type_reference, + case 540: // typeof_expr -> tkTypeOf, tkRoundOpen, simple_or_template_type_reference, // tkRoundClose { CurrentSemanticValue.ex = new typeof_operator((named_type_reference)ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); } break; - case 540: // question_expr -> expr_l1, tkQuestion, expr_l1, tkColon, expr_l1 + case 541: // question_expr -> expr_l1, tkQuestion, expr_l1, tkColon, expr_l1 { CurrentSemanticValue.ex = new question_colon_expression(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 541: // simple_or_template_type_reference -> simple_type_identifier + case 542: // simple_or_template_type_reference -> simple_type_identifier { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 542: // simple_or_template_type_reference -> simple_type_identifier, + case 543: // simple_or_template_type_reference -> simple_type_identifier, // template_type_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-2].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 543: // simple_or_template_type_reference -> simple_type_identifier, tkAmpersend, + case 544: // simple_or_template_type_reference -> simple_type_identifier, tkAmpersend, // template_type_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-3].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 544: // optional_array_initializer -> tkRoundOpen, typed_const_list, tkRoundClose + case 545: // optional_array_initializer -> tkRoundOpen, typed_const_list, tkRoundClose { CurrentSemanticValue.stn = new array_const((expression_list)ValueStack[ValueStack.Depth-2].stn, CurrentLocationSpan); } break; - case 546: // new_expr -> tkNew, simple_or_template_type_reference, + case 547: // new_expr -> tkNew, simple_or_template_type_reference, // optional_expr_list_with_bracket { CurrentSemanticValue.ex = new new_expr(ValueStack[ValueStack.Depth-2].td, ValueStack[ValueStack.Depth-1].stn as expression_list, false, null, CurrentLocationSpan); } break; - case 547: // new_expr -> tkNew, array_name_for_new_expr, tkSquareOpen, optional_expr_list, + case 548: // new_expr -> tkNew, array_name_for_new_expr, tkSquareOpen, optional_expr_list, // tkSquareClose, optional_array_initializer { var el = ValueStack[ValueStack.Depth-3].stn as expression_list; @@ -4686,7 +4687,7 @@ public partial class GPPGParser: ShiftReduceParser tkNew, tkClass, tkRoundOpen, list_fields_in_unnamed_object, + case 549: // new_expr -> tkNew, tkClass, tkRoundOpen, list_fields_in_unnamed_object, // tkRoundClose { // sugared node @@ -4701,12 +4702,12 @@ public partial class GPPGParser: ShiftReduceParser identifier, tkAssign, relop_expr + case 550: // field_in_unnamed_object -> identifier, tkAssign, relop_expr { CurrentSemanticValue.ob = new name_assign_expr(ValueStack[ValueStack.Depth-3].id,ValueStack[ValueStack.Depth-1].ex,CurrentLocationSpan); } break; - case 550: // field_in_unnamed_object -> relop_expr + case 551: // field_in_unnamed_object -> relop_expr { ident name = null; var id = ValueStack[ValueStack.Depth-1].ex as ident; @@ -4726,13 +4727,13 @@ public partial class GPPGParser: ShiftReduceParser field_in_unnamed_object + case 552: // list_fields_in_unnamed_object -> field_in_unnamed_object { var l = new name_assign_expr_list(); CurrentSemanticValue.ob = l.Add(ValueStack[ValueStack.Depth-1].ob as name_assign_expr); } break; - case 552: // list_fields_in_unnamed_object -> list_fields_in_unnamed_object, tkComma, + case 553: // list_fields_in_unnamed_object -> list_fields_in_unnamed_object, tkComma, // field_in_unnamed_object { var nel = ValueStack[ValueStack.Depth-3].ob as name_assign_expr_list; @@ -4743,32 +4744,27 @@ public partial class GPPGParser: ShiftReduceParser simple_type_identifier + case 554: // array_name_for_new_expr -> simple_type_identifier { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 554: // array_name_for_new_expr -> unsized_array_type + case 555: // array_name_for_new_expr -> unsized_array_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 555: // optional_expr_list_with_bracket -> /* empty */ + case 556: // optional_expr_list_with_bracket -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 556: // optional_expr_list_with_bracket -> tkRoundOpen, optional_expr_list, + case 557: // optional_expr_list_with_bracket -> tkRoundOpen, optional_expr_list, // tkRoundClose { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 557: // relop_expr -> simple_expr + case 558: // relop_expr -> simple_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 558: // relop_expr -> relop_expr, relop, simple_expr + case 559: // relop_expr -> relop_expr, relop, simple_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 559: // relop_expr -> relop_expr, tkMatching, simple_expr -{ - CurrentSemanticValue.ex = new matching_expression(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); - } - break; case 560: // simple_expr_or_nothing -> simple_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; @@ -4898,43 +4894,8 @@ public partial class GPPGParser: ShiftReduceParser tkNil -{ - CurrentSemanticValue.ex = new nil_const(); - CurrentSemanticValue.ex.source_context = CurrentLocationSpan; - } - break; - case 596: // factor -> literal_or_number -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 597: // factor -> default_expr -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 598: // factor -> tkSquareOpen, elem_list, tkSquareClose -{ - CurrentSemanticValue.ex = new pascal_set_constant(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); - } - break; - case 599: // factor -> tkNot, factor -{ - CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); - } - break; - case 600: // factor -> sign, factor -{ - CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); - } - break; - case 601: // factor -> tkDeref, factor -{ - CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); - } - break; - case 602: // factor -> var_reference -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 603: // factor -> tkRoundOpen, expr_l1, tkComma, expr_l1_list, lambda_type_ref, - // optional_full_lambda_fp_list, tkRoundClose + case 595: // tuple -> tkRoundOpen, expr_l1, tkComma, expr_l1_list, lambda_type_ref, + // optional_full_lambda_fp_list, tkRoundClose { (ValueStack[ValueStack.Depth-4].stn as expression_list).expressions.Insert(0,ValueStack[ValueStack.Depth-6].ex); if ((ValueStack[ValueStack.Depth-4].stn as expression_list).expressions.Count>7) @@ -4949,61 +4910,99 @@ public partial class GPPGParser: ShiftReduceParser literal + case 596: // factor -> tkNil +{ + CurrentSemanticValue.ex = new nil_const(); + CurrentSemanticValue.ex.source_context = CurrentLocationSpan; + } + break; + case 597: // factor -> literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 605: // literal_or_number -> unsigned_number + case 598: // factor -> default_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 606: // var_reference -> var_address, variable + case 599: // factor -> tkSquareOpen, elem_list, tkSquareClose +{ + CurrentSemanticValue.ex = new pascal_set_constant(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); + } + break; + case 600: // factor -> tkNot, factor +{ + CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); + } + break; + case 601: // factor -> sign, factor +{ + CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); + } + break; + case 602: // factor -> tkDeref, factor +{ + CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); + } + break; + case 603: // factor -> var_reference +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 604: // factor -> tuple +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 605: // literal_or_number -> literal +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 606: // literal_or_number -> unsigned_number +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 607: // 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 607: // var_reference -> variable + case 608: // var_reference -> variable { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 608: // var_address -> tkAddressOf + case 609: // var_address -> tkAddressOf { CurrentSemanticValue.stn = NewVarAddress(CurrentLocationSpan); } break; - case 609: // var_address -> var_address, tkAddressOf + case 610: // var_address -> var_address, tkAddressOf { CurrentSemanticValue.stn = NewVarAddress(ValueStack[ValueStack.Depth-2].stn as get_address, CurrentLocationSpan); } break; - case 610: // attribute_variable -> simple_type_identifier, optional_expr_list_with_bracket + case 611: // 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 611: // dotted_identifier -> identifier + case 612: // dotted_identifier -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 612: // dotted_identifier -> dotted_identifier, tkPoint, identifier_or_keyword + case 613: // 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 613: // variable_as_type -> dotted_identifier + case 614: // variable_as_type -> dotted_identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex;} break; - case 614: // variable_as_type -> dotted_identifier, template_type_params + case 615: // 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 615: // variable -> identifier + case 616: // variable -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 616: // variable -> operator_name_ident + case 617: // variable -> operator_name_ident { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 617: // variable -> tkInherited, identifier + case 618: // variable -> tkInherited, identifier { CurrentSemanticValue.ex = new inherited_ident(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 618: // variable -> tkRoundOpen, expr, tkRoundClose + case 619: // variable -> tkRoundOpen, expr, tkRoundClose { if (!parsertools.build_tree_for_formatter) { @@ -5013,18 +5012,18 @@ public partial class GPPGParser: ShiftReduceParser sizeof_expr + case 620: // variable -> sizeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 620: // variable -> typeof_expr + case 621: // variable -> typeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 621: // variable -> literal_or_number, tkPoint, identifier_or_keyword + case 622: // 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 622: // variable -> variable, tkSquareOpen, expr_list, tkSquareClose + case 623: // variable -> variable, tkSquareOpen, expr_list, tkSquareClose { var el = ValueStack[ValueStack.Depth-2].stn as expression_list; // SSM 10/03/16 if (el.expressions.Count==1 && el.expressions[0] is format_expr) @@ -5035,491 +5034,491 @@ public partial class GPPGParser: ShiftReduceParser variable, tkRoundOpen, optional_expr_list, tkRoundClose + case 624: // 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 624: // variable -> variable, tkPoint, identifier_keyword_operatorname + case 625: // 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 625: // variable -> variable, tkDeref + case 626: // variable -> variable, tkDeref { CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-2].ex as addressed_value,CurrentLocationSpan); } break; - case 626: // variable -> variable, tkAmpersend, template_type_params + case 627: // 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 627: // optional_expr_list -> expr_list + case 628: // optional_expr_list -> expr_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 628: // optional_expr_list -> /* empty */ + case 629: // optional_expr_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 629: // elem_list -> elem_list1 + case 630: // elem_list -> elem_list1 { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 630: // elem_list -> /* empty */ + case 631: // elem_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 631: // elem_list1 -> elem + case 632: // elem_list1 -> elem { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 632: // elem_list1 -> elem_list1, tkComma, elem + case 633: // 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 633: // elem -> expr + case 634: // elem -> expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 634: // elem -> expr, tkDotDot, expr + case 635: // elem -> expr, tkDotDot, expr { CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 635: // one_literal -> tkStringLiteral + case 636: // one_literal -> tkStringLiteral { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 636: // one_literal -> tkAsciiChar + case 637: // one_literal -> tkAsciiChar { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 637: // literal -> literal_list + case 638: // literal -> literal_list { CurrentSemanticValue.ex = NewLiteral(ValueStack[ValueStack.Depth-1].stn as literal_const_line); } break; - case 638: // literal_list -> one_literal + case 639: // literal_list -> one_literal { CurrentSemanticValue.stn = new literal_const_line(ValueStack[ValueStack.Depth-1].ex as literal, CurrentLocationSpan); } break; - case 639: // literal_list -> literal_list, one_literal + case 640: // literal_list -> literal_list, one_literal { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as literal_const_line).Add(ValueStack[ValueStack.Depth-1].ex as literal, CurrentLocationSpan); } break; - case 640: // operator_name_ident -> tkOperator, overload_operator + case 641: // 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 641: // optional_method_modificators -> tkSemiColon + case 642: // optional_method_modificators -> tkSemiColon { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 642: // optional_method_modificators -> tkSemiColon, meth_modificators, tkSemiColon + case 643: // 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 643: // optional_method_modificators1 -> /* empty */ + case 644: // optional_method_modificators1 -> /* empty */ { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 644: // optional_method_modificators1 -> tkSemiColon, meth_modificators + case 645: // 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 645: // meth_modificators -> meth_modificator + case 646: // meth_modificators -> meth_modificator { CurrentSemanticValue.stn = new procedure_attributes_list(ValueStack[ValueStack.Depth-1].id as procedure_attribute, CurrentLocationSpan); } break; - case 646: // meth_modificators -> meth_modificators, tkSemiColon, meth_modificator + case 647: // 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 647: // identifier -> tkIdentifier + case 648: // identifier -> tkIdentifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 648: // identifier -> property_specifier_directives + case 649: // identifier -> property_specifier_directives { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 649: // identifier -> non_reserved + case 650: // identifier -> non_reserved { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 650: // identifier_or_keyword -> identifier + case 651: // identifier_or_keyword -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 651: // identifier_or_keyword -> keyword + case 652: // identifier_or_keyword -> keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 652: // identifier_or_keyword -> reserved_keyword + case 653: // identifier_or_keyword -> reserved_keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 653: // identifier_keyword_operatorname -> identifier + case 654: // identifier_keyword_operatorname -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 654: // identifier_keyword_operatorname -> keyword + case 655: // identifier_keyword_operatorname -> keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 655: // identifier_keyword_operatorname -> operator_name_ident + case 656: // identifier_keyword_operatorname -> operator_name_ident { CurrentSemanticValue.id = (ident)ValueStack[ValueStack.Depth-1].ex; } break; - case 656: // meth_modificator -> tkAbstract + case 657: // meth_modificator -> tkAbstract { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 657: // meth_modificator -> tkOverload + case 658: // 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 658: // meth_modificator -> tkReintroduce + case 659: // meth_modificator -> tkReintroduce { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 659: // meth_modificator -> tkOverride + case 660: // meth_modificator -> tkOverride { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 660: // meth_modificator -> tkExtensionMethod + case 661: // meth_modificator -> tkExtensionMethod { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 661: // meth_modificator -> tkVirtual + case 662: // meth_modificator -> tkVirtual { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 662: // property_specifier_directives -> tkRead + case 663: // property_specifier_directives -> tkRead { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 663: // property_specifier_directives -> tkWrite + case 664: // property_specifier_directives -> tkWrite { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 664: // non_reserved -> tkName + case 665: // non_reserved -> tkName { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 665: // non_reserved -> tkNew + case 666: // non_reserved -> tkNew { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 666: // visibility_specifier -> tkInternal + case 667: // visibility_specifier -> tkInternal { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 667: // visibility_specifier -> tkPublic + case 668: // visibility_specifier -> tkPublic { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 668: // visibility_specifier -> tkProtected + case 669: // visibility_specifier -> tkProtected { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 669: // visibility_specifier -> tkPrivate + case 670: // visibility_specifier -> tkPrivate { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 670: // keyword -> visibility_specifier + case 671: // keyword -> visibility_specifier { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 671: // keyword -> tkSealed + case 672: // keyword -> tkSealed { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 672: // keyword -> tkTemplate + case 673: // keyword -> tkTemplate { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 673: // keyword -> tkOr + case 674: // keyword -> tkOr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 674: // keyword -> tkTypeOf + case 675: // keyword -> tkTypeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 675: // keyword -> tkSizeOf + case 676: // keyword -> tkSizeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 676: // keyword -> tkDefault + case 677: // keyword -> tkDefault { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 677: // keyword -> tkWhere + case 678: // keyword -> tkWhere { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 678: // keyword -> tkXor + case 679: // keyword -> tkXor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 679: // keyword -> tkAnd + case 680: // keyword -> tkAnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 680: // keyword -> tkDiv + case 681: // keyword -> tkDiv { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 681: // keyword -> tkMod + case 682: // keyword -> tkMod { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 682: // keyword -> tkShl + case 683: // keyword -> tkShl { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 683: // keyword -> tkShr + case 684: // keyword -> tkShr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 684: // keyword -> tkNot + case 685: // keyword -> tkNot { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 685: // keyword -> tkAs + case 686: // keyword -> tkAs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 686: // keyword -> tkIn + case 687: // keyword -> tkIn { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 687: // keyword -> tkIs + case 688: // keyword -> tkIs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 688: // keyword -> tkArray + case 689: // keyword -> tkArray { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 689: // keyword -> tkSequence + case 690: // keyword -> tkSequence { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 690: // keyword -> tkBegin + case 691: // keyword -> tkBegin { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 691: // keyword -> tkCase + case 692: // keyword -> tkCase { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 692: // keyword -> tkClass + case 693: // keyword -> tkClass { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 693: // keyword -> tkConst + case 694: // keyword -> tkConst { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 694: // keyword -> tkConstructor + case 695: // keyword -> tkConstructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 695: // keyword -> tkDestructor + case 696: // keyword -> tkDestructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 696: // keyword -> tkDownto + case 697: // keyword -> tkDownto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 697: // keyword -> tkDo + case 698: // keyword -> tkDo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 698: // keyword -> tkElse + case 699: // keyword -> tkElse { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 699: // keyword -> tkExcept + case 700: // keyword -> tkExcept { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 700: // keyword -> tkFile + case 701: // keyword -> tkFile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 701: // keyword -> tkAuto + case 702: // keyword -> tkAuto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 702: // keyword -> tkFinalization + case 703: // keyword -> tkFinalization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 703: // keyword -> tkFinally + case 704: // keyword -> tkFinally { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 704: // keyword -> tkFor + case 705: // keyword -> tkFor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 705: // keyword -> tkForeach + case 706: // keyword -> tkForeach { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 706: // keyword -> tkFunction + case 707: // keyword -> tkFunction { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 707: // keyword -> tkIf + case 708: // keyword -> tkIf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 708: // keyword -> tkImplementation + case 709: // keyword -> tkImplementation { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 709: // keyword -> tkInherited + case 710: // keyword -> tkInherited { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 710: // keyword -> tkInitialization + case 711: // keyword -> tkInitialization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 711: // keyword -> tkInterface + case 712: // keyword -> tkInterface { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 712: // keyword -> tkProcedure + case 713: // keyword -> tkProcedure { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 713: // keyword -> tkProperty + case 714: // keyword -> tkProperty { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 714: // keyword -> tkRaise + case 715: // keyword -> tkRaise { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 715: // keyword -> tkRecord + case 716: // keyword -> tkRecord { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 716: // keyword -> tkRepeat + case 717: // keyword -> tkRepeat { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 717: // keyword -> tkSet + case 718: // keyword -> tkSet { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 718: // keyword -> tkTry + case 719: // keyword -> tkTry { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 719: // keyword -> tkType + case 720: // keyword -> tkType { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 720: // keyword -> tkThen + case 721: // keyword -> tkThen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 721: // keyword -> tkTo + case 722: // keyword -> tkTo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 722: // keyword -> tkUntil + case 723: // keyword -> tkUntil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 723: // keyword -> tkUses + case 724: // keyword -> tkUses { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 724: // keyword -> tkVar + case 725: // keyword -> tkVar { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 725: // keyword -> tkWhile + case 726: // keyword -> tkWhile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 726: // keyword -> tkWith + case 727: // keyword -> tkWith { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 727: // keyword -> tkNil + case 728: // keyword -> tkNil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 728: // keyword -> tkGoto + case 729: // keyword -> tkGoto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 729: // keyword -> tkOf + case 730: // keyword -> tkOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 730: // keyword -> tkLabel + case 731: // keyword -> tkLabel { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 731: // keyword -> tkProgram + case 732: // keyword -> tkProgram { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 732: // keyword -> tkUnit + case 733: // keyword -> tkUnit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 733: // keyword -> tkLibrary + case 734: // keyword -> tkLibrary { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 734: // keyword -> tkExternal + case 735: // keyword -> tkExternal { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 735: // keyword -> tkParams + case 736: // keyword -> tkParams { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 736: // keyword -> tkEvent + case 737: // keyword -> tkEvent { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 737: // keyword -> tkYield + case 738: // keyword -> tkYield { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 738: // reserved_keyword -> tkOperator + case 739: // reserved_keyword -> tkOperator { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 739: // reserved_keyword -> tkEnd + case 740: // reserved_keyword -> tkEnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 740: // overload_operator -> tkMinus + case 741: // overload_operator -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 741: // overload_operator -> tkPlus + case 742: // overload_operator -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 742: // overload_operator -> tkSlash + case 743: // overload_operator -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 743: // overload_operator -> tkStar + case 744: // overload_operator -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 744: // overload_operator -> tkEqual + case 745: // overload_operator -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 745: // overload_operator -> tkGreater + case 746: // overload_operator -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 746: // overload_operator -> tkGreaterEqual + case 747: // overload_operator -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 747: // overload_operator -> tkLower + case 748: // overload_operator -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 748: // overload_operator -> tkLowerEqual + case 749: // overload_operator -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 749: // overload_operator -> tkNotEqual + case 750: // overload_operator -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 750: // overload_operator -> tkOr + case 751: // overload_operator -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 751: // overload_operator -> tkXor + case 752: // overload_operator -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 752: // overload_operator -> tkAnd + case 753: // overload_operator -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 753: // overload_operator -> tkDiv + case 754: // overload_operator -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 754: // overload_operator -> tkMod + case 755: // overload_operator -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 755: // overload_operator -> tkShl + case 756: // overload_operator -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 756: // overload_operator -> tkShr + case 757: // overload_operator -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 757: // overload_operator -> tkNot + case 758: // overload_operator -> tkNot { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 758: // overload_operator -> tkIn + case 759: // overload_operator -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 759: // overload_operator -> tkImplicit + case 760: // overload_operator -> tkImplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 760: // overload_operator -> tkExplicit + case 761: // overload_operator -> tkExplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 761: // overload_operator -> assign_operator + case 762: // overload_operator -> assign_operator { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 762: // assign_operator -> tkAssign + case 763: // assign_operator -> tkAssign { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 763: // assign_operator -> tkPlusEqual + case 764: // assign_operator -> tkPlusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 764: // assign_operator -> tkMinusEqual + case 765: // assign_operator -> tkMinusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 765: // assign_operator -> tkMultEqual + case 766: // assign_operator -> tkMultEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 766: // assign_operator -> tkDivEqual + case 767: // assign_operator -> tkDivEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 767: // func_decl_lambda -> identifier, tkArrow, lambda_function_body + case 768: // 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(), null), 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(), null), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan); } break; - case 768: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, + case 769: // 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 769: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, + case 770: // 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]); @@ -5528,7 +5527,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, + case 771: // func_decl_lambda -> tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { @@ -5539,7 +5538,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, + case 772: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, // full_lambda_fp_list, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { @@ -5551,144 +5550,123 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, expr_l1, tkComma, expr_l1_list, + case 773: // func_decl_lambda -> tkRoundOpen, expr_l1, tkComma, expr_l1_list, // lambda_type_ref, optional_full_lambda_fp_list, // tkRoundClose, rem_lambda { - if (ValueStack[ValueStack.Depth-1].ob==null) // It is a tuple - check for nothing except expr_list is in parentheses + var pair = ValueStack[ValueStack.Depth-1].ob as pair_type_stlist; + + if (ValueStack[ValueStack.Depth-4].td is lambda_inferred_type) { - if (!(ValueStack[ValueStack.Depth-4].td is lambda_inferred_type)) - parsertools.AddErrorFromResource("BAD_TUPLE",LocationStack[LocationStack.Depth-4]); - if (ValueStack[ValueStack.Depth-3].stn != null) - parsertools.AddErrorFromResource("BAD_TUPLE",LocationStack[LocationStack.Depth-4]); - (ValueStack[ValueStack.Depth-5].stn as expression_list).expressions.Insert(0,ValueStack[ValueStack.Depth-7].ex); - if ((ValueStack[ValueStack.Depth-5].stn as expression_list).expressions.Count>7) - parsertools.AddErrorFromResource("TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7",LocationStack[LocationStack.Depth-4]); - - if (parsertools.build_tree_for_formatter) - CurrentSemanticValue.ex = new tuple_node_for_formatter(ValueStack[ValueStack.Depth-5].stn as expression_list,CurrentLocationSpan); - else + var formal_pars = new formal_parameters(); + var idd = ValueStack[ValueStack.Depth-7].ex as ident; + if (idd==null) + parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",LocationStack[LocationStack.Depth-7]); + var lambda_inf_type = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); + var new_typed_pars = new typed_parameters(new ident_list(idd, idd.source_context), lambda_inf_type, parametr_kind.none, null, idd.source_context); + formal_pars.Add(new_typed_pars); + foreach (var id in (ValueStack[ValueStack.Depth-5].stn as expression_list).expressions) { - var dn = new dot_node(new dot_node(new ident("?System"),new ident("Tuple")),new ident("Create",CurrentLocationSpan)); - CurrentSemanticValue.ex = new method_call(dn,ValueStack[ValueStack.Depth-5].stn as expression_list,CurrentLocationSpan); - } - } - else // It is a lambda-expression. Expressions in parameters must be identifiers. - { - var pair = ValueStack[ValueStack.Depth-1].ob as pair_type_stlist; - - if (ValueStack[ValueStack.Depth-4].td is lambda_inferred_type) - { - var formal_pars = new formal_parameters(); - var idd = ValueStack[ValueStack.Depth-7].ex as ident; - if (idd==null) - parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",LocationStack[LocationStack.Depth-7]); - var lambda_inf_type = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); - var new_typed_pars = new typed_parameters(new ident_list(idd, idd.source_context), lambda_inf_type, parametr_kind.none, null, idd.source_context); + var idd1 = id as ident; + if (idd1==null) + parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",id.source_context); + + lambda_inf_type = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); + new_typed_pars = new typed_parameters(new ident_list(idd1, idd1.source_context), lambda_inf_type, parametr_kind.none, null, idd1.source_context); formal_pars.Add(new_typed_pars); - foreach (var id in (ValueStack[ValueStack.Depth-5].stn as expression_list).expressions) - { - var idd1 = id as ident; - if (idd1==null) - parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",id.source_context); - - lambda_inf_type = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); - new_typed_pars = new typed_parameters(new ident_list(idd1, idd1.source_context), lambda_inf_type, parametr_kind.none, null, idd1.source_context); - formal_pars.Add(new_typed_pars); - } - - if (ValueStack[ValueStack.Depth-3].stn != null) - for (int i = 0; i < (ValueStack[ValueStack.Depth-3].stn as formal_parameters).params_list.Count; i++) - formal_pars.Add((ValueStack[ValueStack.Depth-3].stn as formal_parameters).params_list[i]); - - formal_pars.source_context = LexLocation.MergeAll(LocationStack[LocationStack.Depth-7],LocationStack[LocationStack.Depth-6],LocationStack[LocationStack.Depth-5],LocationStack[LocationStack.Depth-4]); - CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formal_pars, pair.tn, pair.exprs, CurrentLocationSpan); } - else - { - var loc = LexLocation.MergeAll(LocationStack[LocationStack.Depth-7],LocationStack[LocationStack.Depth-6],LocationStack[LocationStack.Depth-5]); - var idd = ValueStack[ValueStack.Depth-7].ex as ident; - if (idd==null) - parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",LocationStack[LocationStack.Depth-7]); + + if (ValueStack[ValueStack.Depth-3].stn != null) + for (int i = 0; i < (ValueStack[ValueStack.Depth-3].stn as formal_parameters).params_list.Count; i++) + formal_pars.Add((ValueStack[ValueStack.Depth-3].stn as formal_parameters).params_list[i]); - var idList = new ident_list(idd, loc); + formal_pars.source_context = LexLocation.MergeAll(LocationStack[LocationStack.Depth-7],LocationStack[LocationStack.Depth-6],LocationStack[LocationStack.Depth-5],LocationStack[LocationStack.Depth-4]); + CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formal_pars, pair.tn, pair.exprs, CurrentLocationSpan); + } + else + { + var loc = LexLocation.MergeAll(LocationStack[LocationStack.Depth-7],LocationStack[LocationStack.Depth-6],LocationStack[LocationStack.Depth-5]); + var idd = ValueStack[ValueStack.Depth-7].ex as ident; + if (idd==null) + parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",LocationStack[LocationStack.Depth-7]); + + var idList = new ident_list(idd, loc); + + var iddlist = (ValueStack[ValueStack.Depth-5].stn as expression_list).expressions; + + for (int j = 0; j < iddlist.Count; j++) + { + var idd2 = iddlist[j] as ident; + if (idd2==null) + parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",idd2.source_context); + idList.idents.Add(idd2); + } + var parsType = ValueStack[ValueStack.Depth-4].td; + var formalPars = new formal_parameters(new typed_parameters(idList, parsType, parametr_kind.none, null, loc), LexLocation.MergeAll(LocationStack[LocationStack.Depth-7],LocationStack[LocationStack.Depth-6],LocationStack[LocationStack.Depth-5],LocationStack[LocationStack.Depth-4],LocationStack[LocationStack.Depth-3])); + + if (ValueStack[ValueStack.Depth-3].stn != null) + for (int i = 0; i < (ValueStack[ValueStack.Depth-3].stn as formal_parameters).params_list.Count; i++) + formalPars.Add((ValueStack[ValueStack.Depth-3].stn as formal_parameters).params_list[i]); - var iddlist = (ValueStack[ValueStack.Depth-5].stn as expression_list).expressions; - - for (int j = 0; j < iddlist.Count; j++) - { - var idd2 = iddlist[j] as ident; - if (idd2==null) - parsertools.AddErrorFromResource("ONE_TKIDENTIFIER",idd2.source_context); - idList.idents.Add(idd2); - } - var parsType = ValueStack[ValueStack.Depth-4].td; - var formalPars = new formal_parameters(new typed_parameters(idList, parsType, parametr_kind.none, null, loc), LexLocation.MergeAll(LocationStack[LocationStack.Depth-7],LocationStack[LocationStack.Depth-6],LocationStack[LocationStack.Depth-5],LocationStack[LocationStack.Depth-4],LocationStack[LocationStack.Depth-3])); - - if (ValueStack[ValueStack.Depth-3].stn != null) - for (int i = 0; i < (ValueStack[ValueStack.Depth-3].stn as formal_parameters).params_list.Count; i++) - formalPars.Add((ValueStack[ValueStack.Depth-3].stn as formal_parameters).params_list[i]); - - CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, pair.tn, pair.exprs, CurrentLocationSpan); - } - } + CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, pair.tn, pair.exprs, CurrentLocationSpan); + } } break; - case 773: // func_decl_lambda -> expl_func_decl_lambda + case 774: // func_decl_lambda -> expl_func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 774: // optional_full_lambda_fp_list -> /* empty */ + case 775: // optional_full_lambda_fp_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 775: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list + case 776: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 776: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body + case 777: // 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 777: // expl_func_decl_lambda -> tkFunction, lambda_type_ref, tkArrow, + case 778: // 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 778: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, lambda_type_ref, + case 779: // 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 779: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, + case 780: // 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 780: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body + case 781: // 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 781: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, + case 782: // 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 782: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, + case 783: // 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 783: // full_lambda_fp_list -> lambda_simple_fp_sect + case 784: // 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) @@ -5708,147 +5686,147 @@ public partial class GPPGParser: ShiftReduceParser full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect + case 785: // 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 785: // lambda_simple_fp_sect -> ident_list, lambda_type_ref + case 786: // 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 786: // lambda_type_ref -> /* empty */ + case 787: // lambda_type_ref -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 787: // lambda_type_ref -> tkColon, fptype + case 788: // lambda_type_ref -> tkColon, fptype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 788: // lambda_type_ref_noproctype -> /* empty */ + case 789: // lambda_type_ref_noproctype -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 789: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype + case 790: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 790: // lambda_function_body -> expr_l1 + case 791: // lambda_function_body -> expr_l1 { CurrentSemanticValue.stn = NewLambdaBody(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 791: // lambda_function_body -> compound_stmt + case 792: // lambda_function_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 792: // lambda_function_body -> if_stmt + case 793: // lambda_function_body -> if_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 793: // lambda_function_body -> while_stmt + case 794: // lambda_function_body -> while_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 794: // lambda_function_body -> repeat_stmt + case 795: // lambda_function_body -> repeat_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 795: // lambda_function_body -> for_stmt + case 796: // lambda_function_body -> for_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 796: // lambda_function_body -> foreach_stmt + case 797: // lambda_function_body -> foreach_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 797: // lambda_function_body -> case_stmt + case 798: // lambda_function_body -> case_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 798: // lambda_function_body -> try_stmt + case 799: // lambda_function_body -> try_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 799: // lambda_function_body -> lock_stmt + case 800: // lambda_function_body -> lock_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 800: // lambda_function_body -> yield_stmt + case 801: // lambda_function_body -> yield_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 801: // lambda_procedure_body -> proc_call + case 802: // lambda_procedure_body -> proc_call { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 802: // lambda_procedure_body -> compound_stmt + case 803: // lambda_procedure_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 803: // lambda_procedure_body -> if_stmt + case 804: // lambda_procedure_body -> if_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 804: // lambda_procedure_body -> while_stmt + case 805: // lambda_procedure_body -> while_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 805: // lambda_procedure_body -> repeat_stmt + case 806: // lambda_procedure_body -> repeat_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 806: // lambda_procedure_body -> for_stmt + case 807: // lambda_procedure_body -> for_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 807: // lambda_procedure_body -> foreach_stmt + case 808: // lambda_procedure_body -> foreach_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 808: // lambda_procedure_body -> case_stmt + case 809: // lambda_procedure_body -> case_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 809: // lambda_procedure_body -> try_stmt + case 810: // lambda_procedure_body -> try_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 810: // lambda_procedure_body -> lock_stmt + case 811: // lambda_procedure_body -> lock_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 811: // lambda_procedure_body -> yield_stmt + case 812: // lambda_procedure_body -> yield_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 812: // lambda_procedure_body -> assignment + case 813: // lambda_procedure_body -> assignment { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.tags b/Parsers/PascalABCParserNewSaushkin/PABC.tags index 760bba25e..c69384e54 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.tags +++ b/Parsers/PascalABCParserNewSaushkin/PABC.tags @@ -17,7 +17,6 @@ - @@ -28,18 +27,17 @@ - + - diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index b025afa15..29f95060c 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -4,9 +4,12 @@ lexGen=J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\GPLex_GPPG\ yaccGen=J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\GPLex_GPPG\gppg.exe lexGenOpt=/unicode yaccGenOpt=/gplex +useCustomScript script= -"J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\GPLex_GPPG\gplex.exe" /unicode "D:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.lex" -"J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\GPLex_GPPG\gppg.exe" /no-lines /gplex "D:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y" +"J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\GPLex_GPPG\gplex.exe" /unicode "J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.lex" + +"J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\GPLex_GPPG\gppg.exe" /no-lines /gplex "J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y" + "J:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\convert4.exe" @@ -141,6 +144,10 @@ script= + + + + diff --git a/PascalABCNET.axml b/PascalABCNET.axml index 75b45f82d..160c84409 100644 --- a/PascalABCNET.axml +++ b/PascalABCNET.axml @@ -837,7 +837,7 @@ - + \Compiler\Compiler.cs CurrentUnit.SyntaxTree = syntaxTreeConvertersController.Convert(CurrentUnit.SyntaxTree) as SyntaxTree.compilation_unit; diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 6afc6fa93..0ec390ace 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.2.0.1352' +!define VERSION '3.2.0.1355' diff --git a/StandardSyntaxTreeConverter/StandOutExprWithLambdaInForeachSequenceConverter.cs b/StandardSyntaxTreeConverter/StandOutExprWithLambdaInForeachSequenceConverter.cs index 6f814ae47..b8acd68fc 100644 --- a/StandardSyntaxTreeConverter/StandOutExprWithLambdaInForeachSequenceConverter.cs +++ b/StandardSyntaxTreeConverter/StandOutExprWithLambdaInForeachSequenceConverter.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using PascalABCCompiler.SyntaxTree; -public class StandOutExprWithLambdaInForeachSequenceVisitor : BaseEnterExitVisitor +public class StandOutExprWithLambdaInForeachSequenceVisitor : BaseChangeVisitor { public static StandOutExprWithLambdaInForeachSequenceVisitor New { @@ -20,25 +20,6 @@ public class StandOutExprWithLambdaInForeachSequenceVisitor : BaseEnterExitVisit return new ident("$GenContFE" + GenIdNum.ToString()); } - public void ReplaceStatement(statement from, IEnumerable to, Desc d = Desc.DirectDescendants) - { - foreach (var x in to) - x.Parent = from.Parent; - var sl = from.Parent as statement_list; - if (sl != null) - { - sl.ReplaceInList(from, to); - } - else - { - var l = new statement_list(); - l.AddMany(to); - l.source_context = from.source_context; - from.Parent.Replace(from, l, d); - } - } - - public override void visit(foreach_stmt fe) { if (fe.in_what.DescendantNodes().OfType().Count()>0) @@ -47,9 +28,7 @@ public class StandOutExprWithLambdaInForeachSequenceVisitor : BaseEnterExitVisit id.Parent = fe; var ass = new var_statement(id, fe.in_what, fe.in_what.source_context); fe.in_what = id; - var l = new List(); - l.Add(ass); - l.Add(fe); + var l = new List { ass,fe }; ReplaceStatement(fe, l); } diff --git a/SyntaxTree/SyntaxTree.csproj b/SyntaxTree/SyntaxTree.csproj index f74abb921..91058aa20 100644 --- a/SyntaxTree/SyntaxTree.csproj +++ b/SyntaxTree/SyntaxTree.csproj @@ -70,6 +70,7 @@ prompt AllRules.ruleset false + false ..\bin\ diff --git a/SyntaxTree/tree/BaseChangeVisitor.cs b/SyntaxTree/tree/BaseChangeVisitor.cs index dbaee1eb9..4b42995fc 100644 --- a/SyntaxTree/tree/BaseChangeVisitor.cs +++ b/SyntaxTree/tree/BaseChangeVisitor.cs @@ -13,13 +13,6 @@ namespace PascalABCCompiler.SyntaxTree { public override void DefaultVisit(syntax_tree_node n) { - // frninja 07/12/15 - // SSM - это - идиотский код, приводивший к двойному обходу визитором всех узлов - /*if (!_rootAdded) - { - _rootAdded = true; - ProcessNode(n); - }*/ - // Элементы списков - с конца в начало чтобы можно было эти элементы изменять по ходу (удалять/вставлять/заменять один несколькими) var Сount = n.subnodes_count; var СountWithoutListElements = n.subnodes_without_list_elements_count; @@ -36,7 +29,41 @@ namespace PascalABCCompiler.SyntaxTree var upper = UpperNode(); if (upper == null) throw new Exception("У корневого элемента нельзя получить UpperNode"); - upper.Replace(from, to); + upper.ReplaceDescendant(from, to); + } + + public void ReplaceStatement(statement from, IEnumerable to, Desc d = Desc.DirectDescendants) + { + foreach (var x in to) + x.Parent = from.Parent; + var sl = from.Parent as statement_list; + if (sl != null) + { + sl.ReplaceInList(from, to); + } + else + { + var l = new statement_list(); + l.AddMany(to); + l.source_context = from.source_context; + from.Parent.ReplaceDescendant(from, l, d); + } + } + + + public void ReplaceStatement(statement from, statement to) + { + to.Parent = from.Parent; + var stl = UpperNodeAs(); + stl.ReplaceInList(from, to); + } + + public void ReplaceStatement(statement from, IEnumerable to) + { + foreach (var x in to) + x.Parent = from.Parent; + var stl = UpperNodeAs(); + stl.ReplaceInList(from, to); } public T UpperNodeAs(int up = 1) where T : syntax_tree_node @@ -84,18 +111,6 @@ namespace PascalABCCompiler.SyntaxTree else l.Add(st); return l; } - - public void ReplaceStatement(statement from, statement to) - { - var stl = UpperNodeAs(); - stl.ReplaceInList(from, to); - } - - public void ReplaceStatement(statement from, IEnumerable to) - { - var stl = UpperNodeAs(); - stl.ReplaceInList(from, to); - } } } diff --git a/SyntaxTree/tree/TreeHelper.cs b/SyntaxTree/tree/TreeHelper.cs index 20c6a705e..fc19ca77f 100644 --- a/SyntaxTree/tree/TreeHelper.cs +++ b/SyntaxTree/tree/TreeHelper.cs @@ -52,17 +52,18 @@ namespace PascalABCCompiler.SyntaxTree return ind; } - /*public void Replace(syntax_tree_node from, syntax_tree_node to, Desc d = Desc.All) // есть риск, что типы не совпадут + /*public void ReplaceDescendant(syntax_tree_node from, syntax_tree_node to, Desc d = Desc.All) // есть риск, что типы не совпадут { var ind = FindIndex(from,d); this[ind] = to; }*/ - // Безопасная версия Replace - public void Replace(T from, T1 to, Desc d = Desc.All) where T: syntax_tree_node where T1 : T + // Безопасная версия Replace - не сработает если менять foreach_node на if_node. Плохо + public void ReplaceDescendant(T from, T1 to, Desc d = Desc.All) where T: syntax_tree_node where T1 : T { var ind = FindIndex(from,d); this[ind] = to; + to.Parent = from.Parent; } /// diff --git a/SyntaxTree/tree/WalkingVisitorNew.cs b/SyntaxTree/tree/WalkingVisitorNew.cs index 531d42160..dee9e8eea 100644 --- a/SyntaxTree/tree/WalkingVisitorNew.cs +++ b/SyntaxTree/tree/WalkingVisitorNew.cs @@ -44,6 +44,14 @@ namespace PascalABCCompiler.SyntaxTree for (var i = 0; i < count; i++) ProcessNode(n[i]); } + + // Можно перенести сюда поскольку замена 1 на 1 позволяет пользоваться текущим DefaultVisit + public void ReplaceByVisitor(syntax_tree_node from, syntax_tree_node to) + { + if (from.Parent == null) + throw new Exception("У корневого элемента нельзя получить Parent"); + from.Parent.ReplaceDescendant(from, to); + } } - + } \ No newline at end of file diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index 3ae68eb24..54aca3abf 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -1510,6 +1510,10 @@ procedure Sort(l: List; less: (T,T)->boolean); procedure Reverse(a: array of T); /// Изменяет порядок элементов на противоположный в диапазоне динамического массива длины length начиная с индекса index procedure Reverse(a: array of T; index,length: integer); +/// Перемешивает динамический массив случайным образом +procedure Shuffle(a: array of T); +/// Перемешивает список случайным образом +procedure Shuffle(l: List); // ----------------------------------------------------- //>> Подпрограммы для генерации последовательностей # Subroutines for sequence generation @@ -1617,7 +1621,7 @@ function ReadArrReal(const prompt: string; n: integer): array of real; function ReadArrString(const prompt: string; n: integer): array of string; // ----------------------------------------------------- -//>> Подпрограммы для генерации случайных матриц # Subroutines for matrix generation +//>> Подпрограммы для матриц # Subroutines for matrixes // ----------------------------------------------------- /// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями function MatrRandom(m: integer := 5; n: integer := 5; a: integer := 0; b: integer := 100): array [,] of integer; @@ -1629,6 +1633,8 @@ function MatrRandomReal(m: integer := 5; n: integer := 5; a: real := 0; b: real function MatrFill(m,n: integer; x: T): array [,] of T; /// Возвращает двумерный массив размера m x n, заполненный элементами x function MatrGen(m,n: integer; gen: (integer,integer)->T): array [,] of T; +/// Транспонирует двумерный массив +function Transpose(a: array [,] of T): array [,] of T; // ----------------------------------------------------- //>> Подпрограммы для создания кортежей # Subroutines for tuple generation @@ -7008,6 +7014,24 @@ begin System.Array.Reverse(a,index,length); end; +procedure Shuffle(a: array of T); +begin + var n := a.Length; + for var i:=0 to n-1 do + Swap(a[i],a[Random(n)]); +end; + +procedure Shuffle(l: List); +begin + var n := l.Count; + for var i:=0 to n-1 do + begin + var v := l[i]; + l[i] := l[Random(n)]; + l[Random(n)] := v; + end; +end; + // ----------------------------------------------------- // Char and String: implementation // ----------------------------------------------------- @@ -8759,6 +8783,16 @@ begin Result[i,j] := gen(i,j); end; +function Transpose(a: array [,] of T): array [,] of T; +begin + var m := a.RowCount; + var n := a.ColCount; + Result := new T[n,m]; + for var i:=0 to Result.RowCount-1 do + for var j:=0 to Result.ColCount-1 do + Result[i,j] := a[j,i] +end; + // ----------------------------------------------------- //>> Методы расширения типа array of T # Extension methods for array of T // ----------------------------------------------------- @@ -8772,7 +8806,7 @@ function Shuffle(Self: array of T): array of T; extensionmethod; begin var n := Self.Length; for var i:=0 to n-1 do - Swap(Self[i],Self[PABCSystem.Random(n)]); + Swap(Self[i],Self[Random(n)]); Result := Self; end; @@ -9271,16 +9305,16 @@ end; /// Предыдущий символ function Pred(Self: char): char; extensionmethod; begin - Result := PABCSystem.pred(Self); + Result := PABCSystem.Pred(Self); end; /// Следующий символ function Succ(Self: char): char; extensionmethod; begin - Result := PABCSystem.succ(Self); + Result := PABCSystem.Succ(Self); end; -/// Код символа +/// Код символа в кодировке Unicode function Code(Self: char): integer; extensionmethod; begin Result := word(Self); diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index c794db939..40d8a1bfb 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -38,7 +38,7 @@ namespace PascalABCCompiler.TreeConverter } }*/ - public class syntax_tree_visitor : SyntaxTree.WalkingVisitorNew + public class syntax_tree_visitor : SyntaxTree.BaseChangeVisitor { public convertion_data_and_alghoritms convertion_data_and_alghoritms; @@ -16606,12 +16606,6 @@ namespace PascalABCCompiler.TreeConverter return new ident("$GenId" + GenIdNum.ToString()); } - public void ReplaceSTV(syntax_tree_node from, syntax_tree_node to) - { - from.Parent.Replace(from, to); - to.Parent = from.Parent; - } - public override void visit(SyntaxTree.foreach_stmt _foreach_stmt) { var lambdaSearcher = new LambdaSearcher(_foreach_stmt.in_what); @@ -16673,7 +16667,7 @@ namespace PascalABCCompiler.TreeConverter var fornode = new SyntaxTree.for_node(i, 0, high, newbody, for_cycle_type.to, null, null, true); var stl = new SyntaxTree.statement_list(vdarr, fornode); - ReplaceSTV(_foreach_stmt, stl); + ReplaceByVisitor(_foreach_stmt, stl); visit(stl); //visit(vdarr); diff --git a/VisualPascalABCNET/VisualPascalABCNET.csproj b/VisualPascalABCNET/VisualPascalABCNET.csproj index ed6291cfd..8270c1714 100644 --- a/VisualPascalABCNET/VisualPascalABCNET.csproj +++ b/VisualPascalABCNET/VisualPascalABCNET.csproj @@ -49,6 +49,7 @@ 4 AllRules.ruleset false + false PdbOnly diff --git a/bin/Lib/PABCRtl.dll b/bin/Lib/PABCRtl.dll index da55c30bc..4297d733b 100644 Binary files a/bin/Lib/PABCRtl.dll and b/bin/Lib/PABCRtl.dll differ diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index 3ae68eb24..54aca3abf 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -1510,6 +1510,10 @@ procedure Sort(l: List; less: (T,T)->boolean); procedure Reverse(a: array of T); /// Изменяет порядок элементов на противоположный в диапазоне динамического массива длины length начиная с индекса index procedure Reverse(a: array of T; index,length: integer); +/// Перемешивает динамический массив случайным образом +procedure Shuffle(a: array of T); +/// Перемешивает список случайным образом +procedure Shuffle(l: List); // ----------------------------------------------------- //>> Подпрограммы для генерации последовательностей # Subroutines for sequence generation @@ -1617,7 +1621,7 @@ function ReadArrReal(const prompt: string; n: integer): array of real; function ReadArrString(const prompt: string; n: integer): array of string; // ----------------------------------------------------- -//>> Подпрограммы для генерации случайных матриц # Subroutines for matrix generation +//>> Подпрограммы для матриц # Subroutines for matrixes // ----------------------------------------------------- /// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями function MatrRandom(m: integer := 5; n: integer := 5; a: integer := 0; b: integer := 100): array [,] of integer; @@ -1629,6 +1633,8 @@ function MatrRandomReal(m: integer := 5; n: integer := 5; a: real := 0; b: real function MatrFill(m,n: integer; x: T): array [,] of T; /// Возвращает двумерный массив размера m x n, заполненный элементами x function MatrGen(m,n: integer; gen: (integer,integer)->T): array [,] of T; +/// Транспонирует двумерный массив +function Transpose(a: array [,] of T): array [,] of T; // ----------------------------------------------------- //>> Подпрограммы для создания кортежей # Subroutines for tuple generation @@ -7008,6 +7014,24 @@ begin System.Array.Reverse(a,index,length); end; +procedure Shuffle(a: array of T); +begin + var n := a.Length; + for var i:=0 to n-1 do + Swap(a[i],a[Random(n)]); +end; + +procedure Shuffle(l: List); +begin + var n := l.Count; + for var i:=0 to n-1 do + begin + var v := l[i]; + l[i] := l[Random(n)]; + l[Random(n)] := v; + end; +end; + // ----------------------------------------------------- // Char and String: implementation // ----------------------------------------------------- @@ -8759,6 +8783,16 @@ begin Result[i,j] := gen(i,j); end; +function Transpose(a: array [,] of T): array [,] of T; +begin + var m := a.RowCount; + var n := a.ColCount; + Result := new T[n,m]; + for var i:=0 to Result.RowCount-1 do + for var j:=0 to Result.ColCount-1 do + Result[i,j] := a[j,i] +end; + // ----------------------------------------------------- //>> Методы расширения типа array of T # Extension methods for array of T // ----------------------------------------------------- @@ -8772,7 +8806,7 @@ function Shuffle(Self: array of T): array of T; extensionmethod; begin var n := Self.Length; for var i:=0 to n-1 do - Swap(Self[i],Self[PABCSystem.Random(n)]); + Swap(Self[i],Self[Random(n)]); Result := Self; end; @@ -9271,16 +9305,16 @@ end; /// Предыдущий символ function Pred(Self: char): char; extensionmethod; begin - Result := PABCSystem.pred(Self); + Result := PABCSystem.Pred(Self); end; /// Следующий символ function Succ(Self: char): char; extensionmethod; begin - Result := PABCSystem.succ(Self); + Result := PABCSystem.Succ(Self); end; -/// Код символа +/// Код символа в кодировке Unicode function Code(Self: char): integer; extensionmethod; begin Result := word(Self);