Добавление кодировки к Reset Rewrite...
This commit is contained in:
parent
978d22acc0
commit
e8cf5f6274
|
|
@ -2,7 +2,7 @@
|
|||
// This CSharp output file generated by Gardens Point LEX
|
||||
// Version: 1.1.3.301
|
||||
// Machine: SSM
|
||||
// DateTime: 11.02.2016 15:50:10
|
||||
// DateTime: 11.02.2016 21:19:43
|
||||
// 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 = 62;
|
||||
const int initial = 63;
|
||||
const int maxAccept = 63;
|
||||
const int initial = 64;
|
||||
const int eofNum = 0;
|
||||
const int goStart = -1;
|
||||
const int INITIAL = 0;
|
||||
|
|
@ -177,7 +177,7 @@ public PT parsertools;
|
|||
}
|
||||
};
|
||||
|
||||
static int[] startState = new int[] {63, 97, 98, 99, 99, 100,
|
||||
static int[] startState = new int[] {64, 98, 99, 100, 100, 101,
|
||||
0};
|
||||
|
||||
#region TwoLevelCharacterMap
|
||||
|
|
@ -1177,52 +1177,52 @@ public PT parsertools;
|
|||
return MapC(code);
|
||||
}
|
||||
|
||||
static Table[] NxS = new Table[102] {
|
||||
static Table[] NxS = new Table[103] {
|
||||
/* NxS[ 0] */ new Table(0, 0, 0, null),
|
||||
/* NxS[ 1] */ new Table(1, 18, -1, new sbyte[] {51, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52}),
|
||||
/* 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[ 2] */ new Table(0, 0, -1, null),
|
||||
/* 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(18, 1, -1, new sbyte[] {47}),
|
||||
/* 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[ 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[] {46}),
|
||||
/* NxS[ 11] */ new Table(13, 1, -1, new sbyte[] {45}),
|
||||
/* NxS[ 10] */ new Table(18, 1, -1, new sbyte[] {47}),
|
||||
/* NxS[ 11] */ new Table(13, 1, -1, new sbyte[] {46}),
|
||||
/* 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(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, 69}),
|
||||
/* NxS[ 21] */ new Table(18, 6, -1, new sbyte[] {35, 36, -1, -1, -1, 70}),
|
||||
/* NxS[ 22] */ new Table(0, 0, -1, null),
|
||||
/* 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[ 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[ 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, 64, new sbyte[] {31, 64, 64, -1}),
|
||||
/* NxS[ 27] */ new Table(45, 4, 65, new sbyte[] {31, 65, 65, -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[] {64}),
|
||||
/* NxS[ 31] */ new Table(45, 1, -1, new sbyte[] {65}),
|
||||
/* 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, 66, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, 66}),
|
||||
/* 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[ 34] */ new Table(0, 0, -1, null),
|
||||
/* NxS[ 35] */ new Table(0, 0, -1, null),
|
||||
/* NxS[ 36] */ new Table(0, 0, -1, null),
|
||||
|
|
@ -1238,69 +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(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,
|
||||
/* 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,
|
||||
-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(9, 1, -1, new sbyte[] {57}),
|
||||
/* NxS[ 57] */ 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[ 58] */ new Table(0, 0, -1, null),
|
||||
/* 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,
|
||||
/* 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,
|
||||
-1}),
|
||||
/* NxS[ 63] */ new Table(40, 36, 25, new sbyte[] {26, 25, 24, 25, 25, 27,
|
||||
/* NxS[ 64] */ 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[ 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,
|
||||
/* 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,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33}),
|
||||
/* NxS[ 66] */ new Table(21, 22, -1, new sbyte[] {67, 67, -1, -1, -1, 32,
|
||||
/* 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[ 67] */ new Table(26, 17, -1, new sbyte[] {32, 32, -1, -1, -1, -1,
|
||||
/* NxS[ 68] */ 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[ 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(19, 1, -1, new sbyte[] {76}),
|
||||
/* NxS[ 76] */ new Table(19, 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(19, 1, -1, new sbyte[] {85}),
|
||||
/* NxS[ 85] */ new Table(19, 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[ 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[ 90] */ new Table(32, 1, -1, new sbyte[] {91}),
|
||||
/* 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(19, 1, -1, new sbyte[] {95}),
|
||||
/* NxS[ 95] */ new Table(19, 1, -1, new sbyte[] {39}),
|
||||
/* NxS[ 96] */ new Table(0, 7, 96, new sbyte[] {-1, 96, 50, 96, 96, 96,
|
||||
/* 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,
|
||||
-1}),
|
||||
/* 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,
|
||||
/* 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,
|
||||
-1}),
|
||||
};
|
||||
|
||||
|
|
@ -2063,24 +2064,27 @@ yylval = new Union(); yylval.op = new op_type_node(Operators.GreaterEqual); retu
|
|||
return (int)Tokens.tkMatching;
|
||||
break;
|
||||
case 45:
|
||||
return (int)Tokens.tkDotDot;
|
||||
return (int)Tokens.tkQuestionPoint;
|
||||
break;
|
||||
case 46:
|
||||
yylval = new Union(); yylval.op = new op_type_node(Operators.Assignment); return (int)Tokens.tkAssign;
|
||||
return (int)Tokens.tkDotDot;
|
||||
break;
|
||||
case 47:
|
||||
yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentMultiplication); return (int)Tokens.tkMultEqual;
|
||||
yylval = new Union(); yylval.op = new op_type_node(Operators.Assignment); return (int)Tokens.tkAssign;
|
||||
break;
|
||||
case 48:
|
||||
BEGIN(COMMENT1);
|
||||
yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentMultiplication); return (int)Tokens.tkMultEqual;
|
||||
break;
|
||||
case 49:
|
||||
BEGIN(COMMENT1);
|
||||
break;
|
||||
case 50:
|
||||
yylval = new Union();
|
||||
currentLexLocation = CurrentLexLocation;
|
||||
yylval.ex = parsertools.create_hex_const(yytext,currentLexLocation);
|
||||
return (int)Tokens.tkHex;
|
||||
break;
|
||||
case 50:
|
||||
case 51:
|
||||
if (parsertools.build_tree_for_formatter)
|
||||
break;
|
||||
|
||||
|
|
@ -2131,36 +2135,36 @@ if (parsertools.build_tree_for_formatter)
|
|||
Defines.Add(directiveparam);
|
||||
}
|
||||
break;
|
||||
case 51:
|
||||
case 52:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case 52:
|
||||
case 53:
|
||||
yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentDivision); return (int)Tokens.tkDivEqual;
|
||||
break;
|
||||
case 53:
|
||||
case 54:
|
||||
{
|
||||
}
|
||||
break;
|
||||
case 54:
|
||||
BEGIN(INITIAL);
|
||||
break;
|
||||
case 55:
|
||||
case 56:
|
||||
{
|
||||
}
|
||||
break;
|
||||
case 57:
|
||||
BEGIN(INITIAL);
|
||||
break;
|
||||
case 58:
|
||||
case 59:
|
||||
case 60:
|
||||
case 56:
|
||||
case 57:
|
||||
{
|
||||
}
|
||||
break;
|
||||
case 58:
|
||||
BEGIN(INITIAL);
|
||||
break;
|
||||
case 59:
|
||||
case 60:
|
||||
case 61:
|
||||
{
|
||||
}
|
||||
break;
|
||||
case 62:
|
||||
parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam);
|
||||
parsertools.CheckDirectiveParams(directivename,directiveparam); // directivename in UPPERCASE!
|
||||
if (directivename == "IFDEF")
|
||||
|
|
@ -2192,7 +2196,7 @@ parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam);
|
|||
BEGIN(INITIAL);
|
||||
}
|
||||
break;
|
||||
case 62:
|
||||
case 63:
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@ UNICODEARROW \x890
|
|||
"[" { return (int)Tokens.tkSquareOpen; }
|
||||
"]" { 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; }
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
%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 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
|
||||
%type <ex> external_directive_ident init_const_expr case_label variable var_reference // var_question_colon
|
||||
%type <ob> for_cycle_type
|
||||
%type <ex> format_expr
|
||||
%type <stn> foreach_stmt
|
||||
|
|
@ -2917,6 +2917,19 @@ literal_or_number
|
|||
{ $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
/*var_question_colon
|
||||
: variable tkQuestionPoint variable
|
||||
{
|
||||
$$ = new dot_question_node($1 as addressed_value,$3 as addressed_value,@$);
|
||||
}
|
||||
| variable tkQuestionPoint var_question_colon
|
||||
{
|
||||
$$ = new dot_question_node($1 as addressed_value,$3 as addressed_value,@$);
|
||||
}
|
||||
;
|
||||
*/
|
||||
|
||||
var_reference
|
||||
: var_address variable
|
||||
{
|
||||
|
|
@ -2924,6 +2937,8 @@ var_reference
|
|||
}
|
||||
| variable
|
||||
{ $$ = $1; }
|
||||
/*| var_question_colon
|
||||
{ $$ = $1; }*/
|
||||
;
|
||||
|
||||
var_address
|
||||
|
|
@ -2996,10 +3011,10 @@ variable
|
|||
{
|
||||
$$ = new dot_node($1 as addressed_value, $3 as addressed_value, @$);
|
||||
}
|
||||
| variable tkQuestionPoint identifier_keyword_operatorname
|
||||
/*| variable tkQuestionPoint identifier_keyword_operatorname
|
||||
{
|
||||
$$ = new dot_node($1 as addressed_value, $3 as addressed_value, @$);
|
||||
}
|
||||
}*/
|
||||
| variable tkDeref
|
||||
{
|
||||
$$ = new roof_dereference($1 as addressed_value,@$);
|
||||
|
|
@ -3007,7 +3022,6 @@ variable
|
|||
| variable tkAmpersend template_type_params
|
||||
{
|
||||
$$ = new ident_with_templateparams($1 as addressed_value, $3 as template_param_list, @$);
|
||||
//($$ as ident_with_templateparams).name = (addressed_value_funcname)$1;
|
||||
}
|
||||
;
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -36,7 +36,6 @@
|
|||
<name value="literal" />
|
||||
<name value="literal_list" />
|
||||
<name value="lambda_function_body" />
|
||||
<name value="var_reference" />
|
||||
</tag>
|
||||
<tag value="Списки">
|
||||
<name value="decl_sect_list" />
|
||||
|
|
@ -238,8 +237,6 @@
|
|||
<name value="exception_class_type_identifier" />
|
||||
<name value="exception_variable" />
|
||||
<name value="array_name_for_new_expr" />
|
||||
<name value="dotted_identifier" />
|
||||
<name value="variable_as_type" />
|
||||
<name value="identifier" />
|
||||
<name value="identifier_or_keyword" />
|
||||
<name value="identifier_keyword_operatorname" />
|
||||
|
|
|
|||
|
|
@ -1052,6 +1052,11 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
{
|
||||
DefaultVisit(_uses_closure);
|
||||
}
|
||||
|
||||
public virtual void visit(dot_question_node _dot_question_node)
|
||||
{
|
||||
DefaultVisit(_dot_question_node);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1677,6 +1677,14 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
{
|
||||
}
|
||||
|
||||
public virtual void pre_do_visit(dot_question_node _dot_question_node)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void post_do_visit(dot_question_node _dot_question_node)
|
||||
{
|
||||
}
|
||||
|
||||
public override void visit(syntax_tree_node _syntax_tree_node)
|
||||
{
|
||||
DefaultVisit(_syntax_tree_node);
|
||||
|
|
@ -3472,6 +3480,15 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
visit(uses_closure.listunitsections[i]);
|
||||
post_do_visit(_uses_closure);
|
||||
}
|
||||
|
||||
public override void visit(dot_question_node _dot_question_node)
|
||||
{
|
||||
DefaultVisit(_dot_question_node);
|
||||
pre_do_visit(_dot_question_node);
|
||||
visit(dot_question_node.left);
|
||||
visit(dot_question_node.right);
|
||||
post_do_visit(_dot_question_node);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -438,6 +438,8 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
return new tuple_node_for_formatter();
|
||||
case 208:
|
||||
return new uses_closure();
|
||||
case 209:
|
||||
return new dot_question_node();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -3718,6 +3720,19 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void visit(dot_question_node _dot_question_node)
|
||||
{
|
||||
read_dot_question_node(_dot_question_node);
|
||||
}
|
||||
|
||||
public void read_dot_question_node(dot_question_node _dot_question_node)
|
||||
{
|
||||
read_addressed_value_funcname(_dot_question_node);
|
||||
_dot_question_node.left = _read_node() as addressed_value;
|
||||
_dot_question_node.right = _read_node() as addressed_value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5830,6 +5830,36 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void visit(dot_question_node _dot_question_node)
|
||||
{
|
||||
bw.Write((Int16)209);
|
||||
write_dot_question_node(_dot_question_node);
|
||||
}
|
||||
|
||||
public void write_dot_question_node(dot_question_node _dot_question_node)
|
||||
{
|
||||
write_addressed_value_funcname(_dot_question_node);
|
||||
if (_dot_question_node.left == null)
|
||||
{
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
else
|
||||
{
|
||||
bw.Write((byte)1);
|
||||
_dot_question_node.left.visit(this);
|
||||
}
|
||||
if (_dot_question_node.right == null)
|
||||
{
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
else
|
||||
{
|
||||
bw.Write((byte)1);
|
||||
_dot_question_node.right.visit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -27541,6 +27541,140 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
}
|
||||
|
||||
|
||||
///<summary>
|
||||
///
|
||||
///</summary>
|
||||
[Serializable]
|
||||
public partial class dot_question_node : addressed_value_funcname
|
||||
{
|
||||
|
||||
///<summary>
|
||||
///Конструктор без параметров.
|
||||
///</summary>
|
||||
public dot_question_node()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Конструктор с параметрами.
|
||||
///</summary>
|
||||
public dot_question_node(addressed_value _left,addressed_value _right)
|
||||
{
|
||||
this._left=_left;
|
||||
this._right=_right;
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Конструктор с параметрами.
|
||||
///</summary>
|
||||
public dot_question_node(addressed_value _left,addressed_value _right,SourceContext sc)
|
||||
{
|
||||
this._left=_left;
|
||||
this._right=_right;
|
||||
source_context = sc;
|
||||
}
|
||||
|
||||
protected addressed_value _left;
|
||||
protected addressed_value _right;
|
||||
|
||||
///<summary>
|
||||
///
|
||||
///</summary>
|
||||
public addressed_value left
|
||||
{
|
||||
get
|
||||
{
|
||||
return _left;
|
||||
}
|
||||
set
|
||||
{
|
||||
_left=value;
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///
|
||||
///</summary>
|
||||
public addressed_value right
|
||||
{
|
||||
get
|
||||
{
|
||||
return _right;
|
||||
}
|
||||
set
|
||||
{
|
||||
_right=value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///<summary>
|
||||
///Свойство для получения количества всех подузлов без элементов поля типа List
|
||||
///</summary>
|
||||
public override Int32 subnodes_without_list_elements_count
|
||||
{
|
||||
get
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
///<summary>
|
||||
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
|
||||
///</summary>
|
||||
public override Int32 subnodes_count
|
||||
{
|
||||
get
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
///<summary>
|
||||
///Индексатор для получения всех подузлов
|
||||
///</summary>
|
||||
public override syntax_tree_node this[Int32 ind]
|
||||
{
|
||||
get
|
||||
{
|
||||
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
|
||||
throw new IndexOutOfRangeException();
|
||||
switch(ind)
|
||||
{
|
||||
case 0:
|
||||
return left;
|
||||
case 1:
|
||||
return right;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
|
||||
throw new IndexOutOfRangeException();
|
||||
switch(ind)
|
||||
{
|
||||
case 0:
|
||||
left = (addressed_value)value;
|
||||
break;
|
||||
case 1:
|
||||
right = (addressed_value)value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
///<summary>
|
||||
///Метод для обхода дерева посетителем
|
||||
///</summary>
|
||||
///<param name="visitor">Объект-посетитель.</param>
|
||||
///<returns>Return value is void</returns>
|
||||
public override void visit(IVisitor visitor)
|
||||
{
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1258,6 +1258,12 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
///<param name="_uses_closure">Node to visit</param>
|
||||
///<returns> Return value is void </returns>
|
||||
void visit(uses_closure _uses_closure);
|
||||
///<summary>
|
||||
///Method to visit dot_question_node.
|
||||
///</summary>
|
||||
///<param name="_dot_question_node">Node to visit</param>
|
||||
///<returns> Return value is void </returns>
|
||||
void visit(dot_question_node _dot_question_node);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -819,23 +819,23 @@ procedure Close(f: Text);
|
|||
/// Закрывает файл f
|
||||
procedure CloseFile(f: Text);
|
||||
/// Открывает текстовый файл f на чтение
|
||||
procedure Reset(f: Text);
|
||||
procedure Reset(f: Text; en: Encoding := Encoding.Default);
|
||||
/// Связывает файловую переменную f с именем файла name и открывает текстовый файл на чтение
|
||||
procedure Reset(f: Text; name: string);
|
||||
procedure Reset(f: Text; name: string; en: Encoding := Encoding.Default);
|
||||
/// Открывает текстовый файл f на запись, при этом обнуляя его содержимое. Если файл существовал, он обнуляется
|
||||
procedure Rewrite(f: Text);
|
||||
procedure Rewrite(f: Text; en: Encoding := Encoding.Default);
|
||||
/// Связывает файловую переменную f с именем файла name и открывает текстовый файл f на запись, при этом обнуляя его содержимое
|
||||
procedure Rewrite(f: Text; name: string);
|
||||
procedure Rewrite(f: Text; name: string; en: Encoding := Encoding.Default);
|
||||
/// Открывает текстовый f файл на дополнение
|
||||
procedure Append(f: Text);
|
||||
procedure Append(f: Text; en: Encoding := Encoding.Default);
|
||||
/// Связывает файловую переменную f с именем файла name и открывает текстовый файл на дополнение
|
||||
procedure Append(f: Text; name: string);
|
||||
procedure Append(f: Text; name: string; en: Encoding := Encoding.Default);
|
||||
/// Возвращает текстовый файл с именем fname, открытый на чтение
|
||||
function OpenRead(fname: string): Text;
|
||||
function OpenRead(fname: string; en: Encoding := Encoding.Default): Text;
|
||||
/// Возвращает текстовый файл с именем fname, открытый на запись
|
||||
function OpenWrite(fname: string): Text;
|
||||
function OpenWrite(fname: string; en: Encoding := Encoding.Default): Text;
|
||||
/// Возвращает текстовый файл с именем fname, открытый на дополнение
|
||||
function OpenAppend(fname: string): Text;
|
||||
function OpenAppend(fname: string; en: Encoding := Encoding.Default): Text;
|
||||
|
||||
/// Возвращает True, если достигнут конец файла f
|
||||
///!! Returns True if the file-pointer has reached the end of the file
|
||||
|
|
@ -5186,7 +5186,7 @@ begin
|
|||
if f = output then
|
||||
f.sw := new StreamWriter(f.fi.FullName);
|
||||
if f = input then
|
||||
f.sr := new StreamReader(f.fi.FullName, System.Text.Encoding.GetEncoding(1251));
|
||||
f.sr := new StreamReader(f.fi.FullName, Encoding.GetEncoding(1251));
|
||||
end;
|
||||
|
||||
procedure AssignFile(f: Text; name: string);
|
||||
|
|
@ -5197,7 +5197,7 @@ end;
|
|||
procedure Close(f: Text);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
if f.sr <> nil then
|
||||
begin
|
||||
f.sr.Close;
|
||||
|
|
@ -5212,7 +5212,7 @@ begin
|
|||
f.sw := nil;
|
||||
// f.fi := nil;
|
||||
end
|
||||
else raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
else raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
end;
|
||||
|
||||
procedure CloseFile(f: Text);
|
||||
|
|
@ -5220,13 +5220,13 @@ begin
|
|||
Close(f);
|
||||
end;
|
||||
|
||||
procedure Reset(f: Text);
|
||||
procedure Reset(f: Text; en: Encoding);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
if f.sr = nil then
|
||||
begin
|
||||
f.sr := System.IO.StreamReader.Create(f.fi.FullName, System.Text.Encoding.GetEncoding(1251));
|
||||
f.sr := new StreamReader(f.fi.FullName, en);
|
||||
if f.sw <> nil then
|
||||
begin
|
||||
f.sw.Close;
|
||||
|
|
@ -5240,19 +5240,19 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure Reset(f: Text; name: string);
|
||||
procedure Reset(f: Text; name: string; en: Encoding);
|
||||
begin
|
||||
assign(f, name);
|
||||
reset(f);
|
||||
reset(f,en);
|
||||
end;
|
||||
|
||||
procedure Rewrite(f: Text);
|
||||
procedure Rewrite(f: Text; en: Encoding);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
if f.sw = nil then
|
||||
begin
|
||||
f.sw := System.IO.StreamWriter.Create(f.fi.FullName, False, System.Text.Encoding.GetEncoding(1251));
|
||||
f.sw := new StreamWriter(f.fi.FullName, False, en);
|
||||
if f.sr <> nil then
|
||||
begin
|
||||
f.sr.Close;
|
||||
|
|
@ -5265,43 +5265,43 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure Rewrite(f: Text; name: string);
|
||||
procedure Rewrite(f: Text; name: string; en: Encoding);
|
||||
begin
|
||||
Assign(f, name);
|
||||
Rewrite(f);
|
||||
Rewrite(f,en);
|
||||
end;
|
||||
|
||||
procedure Append(f: Text);
|
||||
procedure Append(f: Text; en: Encoding);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
f.sw := System.IO.StreamWriter.Create(f.fi.FullName, True, System.Text.Encoding.GetEncoding(1251));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
f.sw := new StreamWriter(f.fi.FullName, True, en);
|
||||
end;
|
||||
|
||||
procedure Append(f: Text; name: string);
|
||||
procedure Append(f: Text; name: string; en: Encoding);
|
||||
begin
|
||||
Assign(f, name);
|
||||
Append(f);
|
||||
Append(f,en);
|
||||
end;
|
||||
|
||||
function OpenRead(fname: string): Text;
|
||||
function OpenRead(fname: string; en: Encoding): Text;
|
||||
begin
|
||||
var f: Text := new Text;
|
||||
Reset(f,fname);
|
||||
Reset(f,fname,en);
|
||||
Result := f;
|
||||
end;
|
||||
|
||||
function OpenWrite(fname: string): Text;
|
||||
function OpenWrite(fname: string; en: Encoding): Text;
|
||||
begin
|
||||
var f: Text := new Text;
|
||||
Rewrite(f,fname);
|
||||
Rewrite(f,fname,en);
|
||||
Result := f;
|
||||
end;
|
||||
|
||||
function OpenAppend(fname: string): Text;
|
||||
function OpenAppend(fname: string; en: Encoding): Text;
|
||||
begin
|
||||
var f: Text := new Text;
|
||||
Append(f,fname);
|
||||
Append(f,fname,en);
|
||||
Result := f;
|
||||
end;
|
||||
|
||||
|
|
@ -5310,8 +5310,8 @@ begin
|
|||
if f.sr <> nil then
|
||||
Result := f.sr.EndOfStream
|
||||
else if f.sw <> nil then
|
||||
raise new System.IO.IOException(GetTranslation(EOF_FOR_TEXT_WRITEOPENED))
|
||||
else raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
raise new IOException(GetTranslation(EOF_FOR_TEXT_WRITEOPENED))
|
||||
else raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
end;
|
||||
|
||||
function Eoln(f: Text): boolean;
|
||||
|
|
@ -5319,8 +5319,8 @@ begin
|
|||
if f.sr <> nil then
|
||||
Result := f.sr.EndOfStream or (f.sr.Peek = 13) or (f.sr.Peek = 10)
|
||||
else if f.sw <> nil then
|
||||
raise new System.IO.IOException(GetTranslation(EOLN_FOR_TEXT_WRITEOPENED))
|
||||
else raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
raise new IOException(GetTranslation(EOLN_FOR_TEXT_WRITEOPENED))
|
||||
else raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
end;
|
||||
|
||||
function SeekEof(f: Text): boolean;
|
||||
|
|
@ -5328,9 +5328,9 @@ var
|
|||
i: integer;
|
||||
begin
|
||||
if f.sw <> nil then
|
||||
raise new System.IO.IOException(GetTranslation(SEEKEOF_FOR_TEXT_WRITEOPENED));
|
||||
raise new IOException(GetTranslation(SEEKEOF_FOR_TEXT_WRITEOPENED));
|
||||
if f.sr = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
repeat
|
||||
if f.sr.EndOfStream then
|
||||
break;
|
||||
|
|
@ -5345,9 +5345,9 @@ end;
|
|||
function SeekEoln(f: Text): boolean;
|
||||
begin
|
||||
if f.sw <> nil then
|
||||
raise new System.IO.IOException(GetTranslation(SEEKEOLN_FOR_TEXT_WRITEOPENED));
|
||||
raise new IOException(GetTranslation(SEEKEOLN_FOR_TEXT_WRITEOPENED));
|
||||
if f.sr = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
repeat
|
||||
if f.sr.EndOfStream then
|
||||
break;
|
||||
|
|
@ -5369,14 +5369,14 @@ end;
|
|||
procedure Erase(f: Text);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
f.fi.Delete;
|
||||
end;
|
||||
|
||||
procedure Rename(f: Text; newname: string);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
System.IO.File.Move(f.fi.FullName, newname);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -14215,6 +14215,17 @@ namespace PascalABCCompiler.TreeConverter
|
|||
|
||||
public override void visit(SyntaxTree.indexer _indexer)
|
||||
{
|
||||
//SSM 11/02/16 - нет, это глупость
|
||||
/*if (_indexer.dereferencing_value is SyntaxTree.question_colon_expression) // то разбросать индекс по компонентам
|
||||
{
|
||||
var q = _indexer.dereferencing_value as SyntaxTree.question_colon_expression;
|
||||
var nodeToVisit = new SyntaxTree.question_colon_expression(q.condition, new indexer(q.ret_if_true as addressed_value, _indexer.indexes, _indexer.source_context),
|
||||
new indexer(q.ret_if_false as addressed_value, _indexer.indexes, _indexer.source_context), _indexer.source_context);
|
||||
visit(nodeToVisit);
|
||||
return;
|
||||
}*/
|
||||
//end SSM 11/02/16
|
||||
|
||||
//lroman
|
||||
if (_indexer.dereferencing_value is closure_substituting_node)
|
||||
{
|
||||
|
|
@ -18733,19 +18744,36 @@ namespace PascalABCCompiler.TreeConverter
|
|||
if (n > t.GetGenericArguments().Count())
|
||||
AddError(get_location(asstup.vars), "TOO_MANY_ELEMENTS_ON_LEFT_SIDE_OF_TUPLE_ASSIGNMRNT");
|
||||
|
||||
var tname = "#temp_var"+UniqueNumStr();
|
||||
var tname = "#temp_var" + UniqueNumStr();
|
||||
|
||||
|
||||
var tt = new var_statement(new ident(tname),new semantic_addr_value(expr)); // тут semantic_addr_value хранит на самом деле expr - просто неудачное название
|
||||
var tt = new var_statement(new ident(tname), new semantic_addr_value(expr)); // тут semantic_addr_value хранит на самом деле expr - просто неудачное название
|
||||
//visit(tt);
|
||||
|
||||
var st = new statement_list(tt);
|
||||
for (var i=0; i<n; i++)
|
||||
for (var i = 0; i < n; i++)
|
||||
{
|
||||
var a = new assign(asstup.vars.variables[i],new dot_node(new ident(tname), new ident("Item" +(i+1).ToString())), Operators.Assignment, asstup.vars.variables[i].source_context);
|
||||
var a = new assign(asstup.vars.variables[i], new dot_node(new ident(tname), new ident("Item" + (i + 1).ToString())), Operators.Assignment, asstup.vars.variables[i].source_context);
|
||||
st.Add(a);
|
||||
}
|
||||
visit(st);
|
||||
}
|
||||
|
||||
public SyntaxTree.question_colon_expression ConvertToQCE(dot_question_node dqn)
|
||||
{
|
||||
// Неверно работает. Пока не используется. Доделать
|
||||
addressed_value left = dqn.left;
|
||||
addressed_value right = dqn.right;
|
||||
var eq = new bin_expr(left, new nil_const(), Operators.Equal, left.source_context);
|
||||
var dn = new dot_node(left, right, dqn.source_context);
|
||||
var q = new SyntaxTree.question_colon_expression(eq, new nil_const(), dn, dqn.source_context);
|
||||
return q;
|
||||
}
|
||||
public override void visit(SyntaxTree.dot_question_node dqn)
|
||||
{
|
||||
// a?.b
|
||||
var q = ConvertToQCE(dqn);
|
||||
visit(q);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -819,23 +819,23 @@ procedure Close(f: Text);
|
|||
/// Закрывает файл f
|
||||
procedure CloseFile(f: Text);
|
||||
/// Открывает текстовый файл f на чтение
|
||||
procedure Reset(f: Text);
|
||||
procedure Reset(f: Text; en: Encoding := Encoding.Default);
|
||||
/// Связывает файловую переменную f с именем файла name и открывает текстовый файл на чтение
|
||||
procedure Reset(f: Text; name: string);
|
||||
procedure Reset(f: Text; name: string; en: Encoding := Encoding.Default);
|
||||
/// Открывает текстовый файл f на запись, при этом обнуляя его содержимое. Если файл существовал, он обнуляется
|
||||
procedure Rewrite(f: Text);
|
||||
procedure Rewrite(f: Text; en: Encoding := Encoding.Default);
|
||||
/// Связывает файловую переменную f с именем файла name и открывает текстовый файл f на запись, при этом обнуляя его содержимое
|
||||
procedure Rewrite(f: Text; name: string);
|
||||
procedure Rewrite(f: Text; name: string; en: Encoding := Encoding.Default);
|
||||
/// Открывает текстовый f файл на дополнение
|
||||
procedure Append(f: Text);
|
||||
procedure Append(f: Text; en: Encoding := Encoding.Default);
|
||||
/// Связывает файловую переменную f с именем файла name и открывает текстовый файл на дополнение
|
||||
procedure Append(f: Text; name: string);
|
||||
procedure Append(f: Text; name: string; en: Encoding := Encoding.Default);
|
||||
/// Возвращает текстовый файл с именем fname, открытый на чтение
|
||||
function OpenRead(fname: string): Text;
|
||||
function OpenRead(fname: string; en: Encoding := Encoding.Default): Text;
|
||||
/// Возвращает текстовый файл с именем fname, открытый на запись
|
||||
function OpenWrite(fname: string): Text;
|
||||
function OpenWrite(fname: string; en: Encoding := Encoding.Default): Text;
|
||||
/// Возвращает текстовый файл с именем fname, открытый на дополнение
|
||||
function OpenAppend(fname: string): Text;
|
||||
function OpenAppend(fname: string; en: Encoding := Encoding.Default): Text;
|
||||
|
||||
/// Возвращает True, если достигнут конец файла f
|
||||
///!! Returns True if the file-pointer has reached the end of the file
|
||||
|
|
@ -5186,7 +5186,7 @@ begin
|
|||
if f = output then
|
||||
f.sw := new StreamWriter(f.fi.FullName);
|
||||
if f = input then
|
||||
f.sr := new StreamReader(f.fi.FullName, System.Text.Encoding.GetEncoding(1251));
|
||||
f.sr := new StreamReader(f.fi.FullName, Encoding.GetEncoding(1251));
|
||||
end;
|
||||
|
||||
procedure AssignFile(f: Text; name: string);
|
||||
|
|
@ -5197,7 +5197,7 @@ end;
|
|||
procedure Close(f: Text);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
if f.sr <> nil then
|
||||
begin
|
||||
f.sr.Close;
|
||||
|
|
@ -5212,7 +5212,7 @@ begin
|
|||
f.sw := nil;
|
||||
// f.fi := nil;
|
||||
end
|
||||
else raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
else raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
end;
|
||||
|
||||
procedure CloseFile(f: Text);
|
||||
|
|
@ -5220,13 +5220,13 @@ begin
|
|||
Close(f);
|
||||
end;
|
||||
|
||||
procedure Reset(f: Text);
|
||||
procedure Reset(f: Text; en: Encoding);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
if f.sr = nil then
|
||||
begin
|
||||
f.sr := System.IO.StreamReader.Create(f.fi.FullName, System.Text.Encoding.GetEncoding(1251));
|
||||
f.sr := new StreamReader(f.fi.FullName, en);
|
||||
if f.sw <> nil then
|
||||
begin
|
||||
f.sw.Close;
|
||||
|
|
@ -5240,19 +5240,19 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure Reset(f: Text; name: string);
|
||||
procedure Reset(f: Text; name: string; en: Encoding);
|
||||
begin
|
||||
assign(f, name);
|
||||
reset(f);
|
||||
reset(f,en);
|
||||
end;
|
||||
|
||||
procedure Rewrite(f: Text);
|
||||
procedure Rewrite(f: Text; en: Encoding);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
if f.sw = nil then
|
||||
begin
|
||||
f.sw := System.IO.StreamWriter.Create(f.fi.FullName, False, System.Text.Encoding.GetEncoding(1251));
|
||||
f.sw := new StreamWriter(f.fi.FullName, False, en);
|
||||
if f.sr <> nil then
|
||||
begin
|
||||
f.sr.Close;
|
||||
|
|
@ -5265,43 +5265,43 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure Rewrite(f: Text; name: string);
|
||||
procedure Rewrite(f: Text; name: string; en: Encoding);
|
||||
begin
|
||||
Assign(f, name);
|
||||
Rewrite(f);
|
||||
Rewrite(f,en);
|
||||
end;
|
||||
|
||||
procedure Append(f: Text);
|
||||
procedure Append(f: Text; en: Encoding);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
f.sw := System.IO.StreamWriter.Create(f.fi.FullName, True, System.Text.Encoding.GetEncoding(1251));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
f.sw := new StreamWriter(f.fi.FullName, True, en);
|
||||
end;
|
||||
|
||||
procedure Append(f: Text; name: string);
|
||||
procedure Append(f: Text; name: string; en: Encoding);
|
||||
begin
|
||||
Assign(f, name);
|
||||
Append(f);
|
||||
Append(f,en);
|
||||
end;
|
||||
|
||||
function OpenRead(fname: string): Text;
|
||||
function OpenRead(fname: string; en: Encoding): Text;
|
||||
begin
|
||||
var f: Text := new Text;
|
||||
Reset(f,fname);
|
||||
Reset(f,fname,en);
|
||||
Result := f;
|
||||
end;
|
||||
|
||||
function OpenWrite(fname: string): Text;
|
||||
function OpenWrite(fname: string; en: Encoding): Text;
|
||||
begin
|
||||
var f: Text := new Text;
|
||||
Rewrite(f,fname);
|
||||
Rewrite(f,fname,en);
|
||||
Result := f;
|
||||
end;
|
||||
|
||||
function OpenAppend(fname: string): Text;
|
||||
function OpenAppend(fname: string; en: Encoding): Text;
|
||||
begin
|
||||
var f: Text := new Text;
|
||||
Append(f,fname);
|
||||
Append(f,fname,en);
|
||||
Result := f;
|
||||
end;
|
||||
|
||||
|
|
@ -5310,8 +5310,8 @@ begin
|
|||
if f.sr <> nil then
|
||||
Result := f.sr.EndOfStream
|
||||
else if f.sw <> nil then
|
||||
raise new System.IO.IOException(GetTranslation(EOF_FOR_TEXT_WRITEOPENED))
|
||||
else raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
raise new IOException(GetTranslation(EOF_FOR_TEXT_WRITEOPENED))
|
||||
else raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
end;
|
||||
|
||||
function Eoln(f: Text): boolean;
|
||||
|
|
@ -5319,8 +5319,8 @@ begin
|
|||
if f.sr <> nil then
|
||||
Result := f.sr.EndOfStream or (f.sr.Peek = 13) or (f.sr.Peek = 10)
|
||||
else if f.sw <> nil then
|
||||
raise new System.IO.IOException(GetTranslation(EOLN_FOR_TEXT_WRITEOPENED))
|
||||
else raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
raise new IOException(GetTranslation(EOLN_FOR_TEXT_WRITEOPENED))
|
||||
else raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
end;
|
||||
|
||||
function SeekEof(f: Text): boolean;
|
||||
|
|
@ -5328,9 +5328,9 @@ var
|
|||
i: integer;
|
||||
begin
|
||||
if f.sw <> nil then
|
||||
raise new System.IO.IOException(GetTranslation(SEEKEOF_FOR_TEXT_WRITEOPENED));
|
||||
raise new IOException(GetTranslation(SEEKEOF_FOR_TEXT_WRITEOPENED));
|
||||
if f.sr = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
repeat
|
||||
if f.sr.EndOfStream then
|
||||
break;
|
||||
|
|
@ -5345,9 +5345,9 @@ end;
|
|||
function SeekEoln(f: Text): boolean;
|
||||
begin
|
||||
if f.sw <> nil then
|
||||
raise new System.IO.IOException(GetTranslation(SEEKEOLN_FOR_TEXT_WRITEOPENED));
|
||||
raise new IOException(GetTranslation(SEEKEOLN_FOR_TEXT_WRITEOPENED));
|
||||
if f.sr = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_OPENED));
|
||||
repeat
|
||||
if f.sr.EndOfStream then
|
||||
break;
|
||||
|
|
@ -5369,14 +5369,14 @@ end;
|
|||
procedure Erase(f: Text);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
f.fi.Delete;
|
||||
end;
|
||||
|
||||
procedure Rename(f: Text; newname: string);
|
||||
begin
|
||||
if f.fi = nil then
|
||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||
System.IO.File.Move(f.fi.FullName, newname);
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue