Merge branch 'master' of github.com:pascalabcnet/pascalabcnet
This commit is contained in:
commit
b71ca1e76b
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%MINOR%=2
|
||||
%REVISION%=1352
|
||||
%COREVERSION%=0
|
||||
%REVISION%=1355
|
||||
%MINOR%=2
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -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 <ABCPascal.lex>
|
||||
// GPLEX frame file <embedded resource>
|
||||
|
|
@ -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:
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
%start parse_goal
|
||||
|
||||
%token <ti> tkDirectiveName tkAmpersend tkColon tkDotDot tkPoint tkRoundOpen tkRoundClose tkSemiColon tkSquareOpen tkSquareClose tkQuestion tkMatching tkQuestionPoint
|
||||
%token <ti> tkDirectiveName tkAmpersend tkColon tkDotDot tkPoint tkRoundOpen tkRoundClose tkSemiColon tkSquareOpen tkSquareClose tkQuestion tkQuestionPoint
|
||||
%token <ti> tkSizeOf tkTypeOf tkWhere tkArray tkCase tkClass tkAuto tkConst tkConstructor tkDestructor tkElse tkExcept tkFile tkFor tkForeach tkFunction
|
||||
%token <ti> tkIf tkImplementation tkInherited tkInterface tkProcedure tkOperator tkProperty tkRaise tkRecord tkSet tkType tkThen tkUses tkVar tkWhile tkWith tkNil
|
||||
%token <ti> tkGoto tkOf tkLabel tkLock tkProgram tkEvent tkDefault tkTemplate tkPacked tkExports tkResourceString tkThreadvar tkSealed tkPartial tkTo tkDownto
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
%type <stn> 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 <stn> 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 <stn> method_decl_withattr method_or_property_decl property_definition fp_sect
|
||||
%type <ex> default_expr
|
||||
%type <ex> default_expr tuple
|
||||
%type <stn> expr_as_stmt
|
||||
%type <stn> exception_block
|
||||
%type <stn> external_block
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
%type <stn> 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 <stn> enumeration_id expr_l1_list
|
||||
%type <stn> enumeration_id_list
|
||||
%type <ex> 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 <ex> 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 <ex> external_directive_ident init_const_expr case_label variable var_reference simple_expr_or_nothing // var_question_colon
|
||||
%type <ob> for_cycle_type
|
||||
%type <ex> 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
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -17,7 +17,6 @@
|
|||
<name value="record_const" />
|
||||
<name value="const_term" />
|
||||
<name value="const_set" />
|
||||
<name value="typed_const_or_new" />
|
||||
<name value="allowable_expr_as_stmt" />
|
||||
<name value="expr_l1" />
|
||||
<name value="typeof_expr" />
|
||||
|
|
@ -28,18 +27,17 @@
|
|||
<name value="as_is_expr" />
|
||||
<name value="term" />
|
||||
<name value="default_expr" />
|
||||
<name value="factor" />
|
||||
<name value="literal_or_number" />
|
||||
<name value="one_literal" />
|
||||
<name value="literal" />
|
||||
<name value="literal_list" />
|
||||
<name value="expr" />
|
||||
<name value="expr_with_func_decl_lambda" />
|
||||
</tag>
|
||||
<tag value="Списки">
|
||||
<name value="decl_sect_list" />
|
||||
<name value="const_func_expr_list" />
|
||||
<name value="label_list" />
|
||||
<name value="typed_const_list" />
|
||||
<name value="const_field_list" />
|
||||
<name value="const_field_list_1" />
|
||||
<name value="attribute_declarations" />
|
||||
|
|
|
|||
|
|
@ -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=
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -837,7 +837,7 @@
|
|||
</Node>
|
||||
<Node Name="Преобразование синт дерева" NL="0" NG="0">
|
||||
<Items>
|
||||
<Node Name="Вызов Convert контроллера SyntaxTrees" NL="0" NG="0">
|
||||
<Node ID="CompileUnit" Name="Вызов Convert контроллера SyntaxTrees" NL="0,7451172" NG="0,5644531">
|
||||
<FileName>\Compiler\Compiler.cs</FileName>
|
||||
<Text>CurrentUnit.SyntaxTree = syntaxTreeConvertersController.Convert(CurrentUnit.SyntaxTree) as SyntaxTree.compilation_unit;</Text>
|
||||
<OCtx>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.2.0.1352'
|
||||
!define VERSION '3.2.0.1355'
|
||||
|
|
|
|||
|
|
@ -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<statement> 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<function_lambda_definition>().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<statement>();
|
||||
l.Add(ass);
|
||||
l.Add(fe);
|
||||
var l = new List<statement> { ass,fe };
|
||||
ReplaceStatement(fe, l);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
|
|
|
|||
|
|
@ -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<statement> 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<statement_list>();
|
||||
stl.ReplaceInList(from, to);
|
||||
}
|
||||
|
||||
public void ReplaceStatement(statement from, IEnumerable<statement> to)
|
||||
{
|
||||
foreach (var x in to)
|
||||
x.Parent = from.Parent;
|
||||
var stl = UpperNodeAs<statement_list>();
|
||||
stl.ReplaceInList(from, to);
|
||||
}
|
||||
|
||||
public T UpperNodeAs<T>(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<statement_list>();
|
||||
stl.ReplaceInList(from, to);
|
||||
}
|
||||
|
||||
public void ReplaceStatement(statement from, IEnumerable<statement> to)
|
||||
{
|
||||
var stl = UpperNodeAs<statement_list>();
|
||||
stl.ReplaceInList(from, to);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,T1>(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,T1>(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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1510,6 +1510,10 @@ procedure Sort<T>(l: List<T>; less: (T,T)->boolean);
|
|||
procedure Reverse<T>(a: array of T);
|
||||
/// Изменяет порядок элементов на противоположный в диапазоне динамического массива длины length начиная с индекса index
|
||||
procedure Reverse<T>(a: array of T; index,length: integer);
|
||||
/// Перемешивает динамический массив случайным образом
|
||||
procedure Shuffle<T>(a: array of T);
|
||||
/// Перемешивает список случайным образом
|
||||
procedure Shuffle<T>(l: List<T>);
|
||||
|
||||
// -----------------------------------------------------
|
||||
//>> Подпрограммы для генерации последовательностей # 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<T>(m,n: integer; x: T): array [,] of T;
|
||||
/// Возвращает двумерный массив размера m x n, заполненный элементами x
|
||||
function MatrGen<T>(m,n: integer; gen: (integer,integer)->T): array [,] of T;
|
||||
/// Транспонирует двумерный массив
|
||||
function Transpose<T>(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<T>(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<T>(l: List<T>);
|
||||
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<T>(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<T>(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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>PdbOnly</DebugType>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1510,6 +1510,10 @@ procedure Sort<T>(l: List<T>; less: (T,T)->boolean);
|
|||
procedure Reverse<T>(a: array of T);
|
||||
/// Изменяет порядок элементов на противоположный в диапазоне динамического массива длины length начиная с индекса index
|
||||
procedure Reverse<T>(a: array of T; index,length: integer);
|
||||
/// Перемешивает динамический массив случайным образом
|
||||
procedure Shuffle<T>(a: array of T);
|
||||
/// Перемешивает список случайным образом
|
||||
procedure Shuffle<T>(l: List<T>);
|
||||
|
||||
// -----------------------------------------------------
|
||||
//>> Подпрограммы для генерации последовательностей # 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<T>(m,n: integer; x: T): array [,] of T;
|
||||
/// Возвращает двумерный массив размера m x n, заполненный элементами x
|
||||
function MatrGen<T>(m,n: integer; gen: (integer,integer)->T): array [,] of T;
|
||||
/// Транспонирует двумерный массив
|
||||
function Transpose<T>(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<T>(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<T>(l: List<T>);
|
||||
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<T>(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<T>(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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue