Константы 123bi

В модуле School - ToBase(BigInteger)
This commit is contained in:
Mikhalkovich Stanislav 2020-11-20 14:23:49 +03:00
parent 562699d3fa
commit e3b59ae5a1
23 changed files with 3536 additions and 3254 deletions

View file

@ -3439,6 +3439,11 @@ namespace CodeFormatters
visit_node(dn.left);
visit_node(dn.right);
}
public override void visit(bigint_const bi)
{
visit(new uint64_const(bi.val,bi.source_context));
//sb.Append("bi");
}
#endregion
}
}

View file

@ -5612,6 +5612,18 @@ namespace CodeCompletion
cnst_val.prim_val = null;
}
public override void visit(bigint_const bi)
{
/*method_call mc = new method_call();
mc.parameters = new expression_list(new uint64_const(bi.val, bi.source_context),bi.source_context);
mc.dereferencing_value = new dot_node(new ident("System"), new ident("Numerics"), new ident("BigInteger"), new ident("Create"));
mc.visit(this);*/
var names = new List<ident> { new ident("System"), new ident("Numerics"), new ident("BigInteger") };
var ntr = new named_type_reference(names, bi.source_context);
var ne = new new_expr(ntr, new expression_list(new uint64_const(bi.val)), bi.source_context);
ne.visit(this);
}
}
}

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "7";
public const string Build = "1";
public const string Revision = "2744";
public const string Revision = "2746";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=1
%REVISION%=2744
%REVISION%=2746
%MINOR%=7
%MAJOR%=3

View file

@ -2,7 +2,7 @@
// This CSharp output file generated by Gardens Point LEX
// Version: 1.1.3.301
// Machine: DESKTOP-G8V08V4
// DateTime: 16.11.2020 0:01:38
// DateTime: 19.11.2020 11:17:32
// 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 = 69;
const int initial = 70;
const int maxAccept = 70;
const int initial = 71;
const int eofNum = 0;
const int goStart = -1;
const int INITIAL = 0;
@ -177,23 +177,23 @@ public PT parsertools;
}
};
static int[] startState = new int[] {70, 106, 107, 108, 108, 109,
static int[] startState = new int[] {71, 108, 109, 110, 110, 111,
0};
#region TwoLevelCharacterMap
//
// There are 48 equivalence classes
// There are 50 equivalence classes
// There are 256 character sequence regions
// There are 47 tables, 12032 entries
//
static sbyte[] mLo0 = new sbyte[256] {
/* '\0' */ 5, 42, 5, 5, 5, 5, 5, 5, 5, 12, 0, 5, 5, 6, 5, 5,
/* '\x10' */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
/* '\x20' */ 12, 5, 5, 11, 4, 5, 13, 47, 7, 9, 8, 24, 14, 25, 16, 1,
/* '\x20' */ 12, 5, 5, 11, 4, 5, 13, 49, 7, 9, 8, 24, 14, 25, 16, 1,
/* '0' */ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 15, 17, 27, 23, 26, 20,
/* '@' */ 22, 45, 45, 45, 45, 46, 45, 43, 43, 43, 43, 43, 43, 43, 43, 43,
/* '@' */ 22, 47, 45, 47, 47, 48, 47, 43, 43, 46, 43, 43, 43, 43, 43, 43,
/* 'P' */ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 18, 5, 19, 28, 21,
/* '`' */ 5, 39, 45, 45, 45, 30, 45, 43, 43, 35, 43, 43, 43, 40, 37, 36,
/* '`' */ 5, 39, 45, 47, 47, 30, 47, 43, 43, 35, 43, 43, 43, 40, 37, 36,
/* 'p' */ 32, 43, 33, 34, 38, 43, 43, 43, 31, 41, 43, 3, 10, 2, 5, 5,
/* '\x80' */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
/* '\x90' */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
@ -1008,7 +1008,7 @@ public PT parsertools;
#region CompressedCharacterMap
//
// There are 48 equivalence classes
// There are 50 equivalence classes
// There are 21 character sequence regions
// There are 6 tables, 1255 entries
// There are 15 runs, 0 singletons
@ -1177,57 +1177,57 @@ public PT parsertools;
return MapC(code);
}
static Table[] NxS = new Table[111] {
static Table[] NxS = new Table[113] {
/* NxS[ 0] */ new Table(0, 0, 0, null),
/* NxS[ 1] */ new Table(1, 23, -1, new sbyte[] {58, -1, -1, -1, -1, -1,
/* NxS[ 1] */ new Table(1, 23, -1, new sbyte[] {59, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
59}),
60}),
/* NxS[ 2] */ new Table(0, 0, -1, null),
/* NxS[ 3] */ new Table(4, 1, -1, new sbyte[] {105}),
/* NxS[ 4] */ new Table(30, 18, -1, new sbyte[] {55, -1, -1, -1, -1, -1,
-1, -1, -1, 55, -1, -1, -1, -1, 55, 55, 55, 104}),
/* NxS[ 5] */ new Table(8, 1, -1, new sbyte[] {54}),
/* NxS[ 6] */ new Table(8, 16, -1, new sbyte[] {52, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 53}),
/* NxS[ 3] */ new Table(4, 1, -1, new sbyte[] {107}),
/* NxS[ 4] */ new Table(30, 20, -1, new sbyte[] {56, -1, -1, -1, -1, -1,
-1, -1, -1, 56, -1, -1, -1, -1, 56, 56, -1, 56, 56, 106}),
/* NxS[ 5] */ new Table(8, 1, -1, new sbyte[] {55}),
/* NxS[ 6] */ new Table(8, 16, -1, new sbyte[] {53, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 54}),
/* NxS[ 7] */ new Table(0, 0, -1, null),
/* NxS[ 8] */ new Table(0, 0, -1, null),
/* NxS[ 9] */ new Table(42, 36, 48, new sbyte[] {-1, 48, 49, 48, 48, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1}),
/* NxS[ 10] */ new Table(21, 26, -1, new sbyte[] {27, -1, -1, -1, -1, -1,
/* NxS[ 9] */ new Table(42, 38, 49, new sbyte[] {-1, 49, 50, 49, 49, 49,
49, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, -1}),
/* NxS[ 10] */ new Table(21, 28, -1, new sbyte[] {27, -1, -1, -1, -1, -1,
-1, -1, -1, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -1,
27, -1, 27, 27}),
27, -1, 27, 27, 27, 27}),
/* NxS[ 11] */ new Table(0, 0, -1, null),
/* NxS[ 12] */ new Table(23, 1, -1, new sbyte[] {47}),
/* NxS[ 13] */ new Table(16, 1, -1, new sbyte[] {46}),
/* NxS[ 12] */ new Table(23, 1, -1, new sbyte[] {48}),
/* NxS[ 13] */ new Table(16, 1, -1, new sbyte[] {47}),
/* NxS[ 14] */ new Table(0, 0, -1, null),
/* NxS[ 15] */ new Table(0, 0, -1, null),
/* NxS[ 16] */ new Table(0, 0, -1, null),
/* NxS[ 17] */ new Table(16, 5, -1, new sbyte[] {43, -1, 44, -1, 45}),
/* NxS[ 18] */ new Table(21, 26, -1, new sbyte[] {27, -1, -1, -1, -1, -1,
/* NxS[ 17] */ new Table(16, 5, -1, new sbyte[] {44, -1, 45, -1, 46}),
/* NxS[ 18] */ new Table(21, 28, -1, new sbyte[] {27, -1, -1, -1, -1, -1,
-1, -1, -1, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -1,
27, 27, 27, 27}),
27, 27, 27, 27, 27, 27}),
/* NxS[ 19] */ new Table(0, 0, -1, null),
/* NxS[ 20] */ new Table(0, 0, -1, null),
/* NxS[ 21] */ new Table(23, 1, -1, new sbyte[] {42}),
/* NxS[ 22] */ new Table(23, 4, -1, new sbyte[] {40, -1, -1, 41}),
/* NxS[ 23] */ new Table(23, 1, -1, new sbyte[] {39}),
/* NxS[ 24] */ new Table(23, 5, -1, new sbyte[] {34, -1, -1, 35, 75}),
/* NxS[ 21] */ new Table(23, 1, -1, new sbyte[] {43}),
/* NxS[ 22] */ new Table(23, 4, -1, new sbyte[] {41, -1, -1, 42}),
/* NxS[ 23] */ new Table(23, 1, -1, new sbyte[] {40}),
/* NxS[ 24] */ new Table(23, 5, -1, new sbyte[] {35, -1, -1, 36, 77}),
/* NxS[ 25] */ new Table(0, 0, -1, null),
/* NxS[ 26] */ new Table(0, 0, -1, null),
/* NxS[ 27] */ new Table(21, 26, -1, new sbyte[] {27, -1, -1, -1, -1, -1,
/* NxS[ 27] */ new Table(21, 28, -1, new sbyte[] {27, -1, -1, -1, -1, -1,
-1, -1, -1, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -1,
27, 27, 27, 27}),
27, 27, 27, 27, 27, 27}),
/* NxS[ 28] */ new Table(0, 0, -1, null),
/* NxS[ 29] */ new Table(16, 31, -1, new sbyte[] {72, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 29, -1, 73}),
/* NxS[ 30] */ new Table(47, 2, 71, new sbyte[] {31, -1}),
/* NxS[ 31] */ new Table(47, 1, -1, new sbyte[] {71}),
/* NxS[ 32] */ new Table(44, 1, -1, new sbyte[] {32}),
/* NxS[ 33] */ new Table(30, 17, -1, new sbyte[] {73, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 33, -1, 73}),
/* NxS[ 34] */ new Table(0, 0, -1, null),
/* NxS[ 29] */ new Table(16, 33, -1, new sbyte[] {73, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 74, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 29, 75, -1, -1, 74}),
/* NxS[ 30] */ new Table(49, 2, 72, new sbyte[] {31, -1}),
/* NxS[ 31] */ new Table(49, 1, -1, new sbyte[] {72}),
/* NxS[ 32] */ new Table(0, 0, -1, null),
/* NxS[ 33] */ new Table(44, 1, -1, new sbyte[] {33}),
/* NxS[ 34] */ new Table(30, 19, -1, new sbyte[] {74, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 34, -1, -1, -1, 74}),
/* NxS[ 35] */ new Table(0, 0, -1, null),
/* NxS[ 36] */ new Table(0, 0, -1, null),
/* NxS[ 37] */ new Table(0, 0, -1, null),
@ -1241,83 +1241,86 @@ public PT parsertools;
/* NxS[ 45] */ new Table(0, 0, -1, null),
/* NxS[ 46] */ new Table(0, 0, -1, null),
/* NxS[ 47] */ new Table(0, 0, -1, null),
/* NxS[ 48] */ new Table(21, 26, -1, new sbyte[] {48, -1, -1, -1, -1, -1,
-1, -1, -1, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, -1,
48, 48, 48, 48}),
/* NxS[ 49] */ new Table(44, 1, -1, new sbyte[] {49}),
/* NxS[ 50] */ new Table(0, 13, -1, new sbyte[] {50, -1, -1, -1, -1, -1,
50, -1, -1, -1, -1, -1, 50}),
/* NxS[ 48] */ new Table(0, 0, -1, null),
/* NxS[ 49] */ new Table(21, 28, -1, new sbyte[] {49, -1, -1, -1, -1, -1,
-1, -1, -1, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, -1,
49, 49, 49, 49, 49, 49}),
/* NxS[ 50] */ new Table(44, 1, -1, new sbyte[] {50}),
/* NxS[ 51] */ new Table(0, 13, -1, new sbyte[] {51, -1, -1, -1, -1, -1,
51, -1, -1, -1, -1, -1, 51}),
/* NxS[ 52] */ new Table(0, 0, -1, null),
/* NxS[ 52] */ new Table(0, 13, -1, new sbyte[] {52, -1, -1, -1, -1, -1,
52, -1, -1, -1, -1, -1, 52}),
/* NxS[ 53] */ new Table(0, 0, -1, null),
/* NxS[ 54] */ new Table(0, 0, -1, null),
/* NxS[ 55] */ new Table(30, 17, -1, new sbyte[] {55, -1, -1, -1, -1, -1,
-1, -1, -1, 55, -1, -1, -1, -1, 55, 55, 55}),
/* NxS[ 56] */ new Table(47, 1, -1, new sbyte[] {104}),
/* NxS[ 57] */ new Table(0, 0, -1, null),
/* NxS[ 58] */ new Table(0, 7, 58, new sbyte[] {-1, 58, 58, 58, 58, 58,
/* NxS[ 55] */ new Table(0, 0, -1, null),
/* NxS[ 56] */ new Table(30, 19, -1, new sbyte[] {56, -1, -1, -1, -1, -1,
-1, -1, -1, 56, -1, -1, -1, -1, 56, 56, -1, 56, 56}),
/* NxS[ 57] */ new Table(49, 1, -1, new sbyte[] {106}),
/* NxS[ 58] */ new Table(0, 0, -1, null),
/* NxS[ 59] */ new Table(0, 7, 59, new sbyte[] {-1, 59, 59, 59, 59, 59,
-1}),
/* NxS[ 59] */ new Table(0, 0, -1, null),
/* NxS[ 60] */ new Table(0, 0, -1, null),
/* NxS[ 61] */ new Table(0, 0, -1, null),
/* NxS[ 62] */ new Table(0, 0, -1, null),
/* NxS[ 63] */ new Table(9, 1, -1, new sbyte[] {64}),
/* NxS[ 64] */ new Table(0, 0, -1, null),
/* NxS[ 63] */ new Table(0, 0, -1, null),
/* NxS[ 64] */ new Table(9, 1, -1, new sbyte[] {65}),
/* NxS[ 65] */ new Table(0, 0, -1, null),
/* NxS[ 66] */ new Table(1, 1, -1, new sbyte[] {69}),
/* NxS[ 67] */ new Table(4, 1, -1, new sbyte[] {110}),
/* NxS[ 68] */ new Table(0, 0, -1, null),
/* NxS[ 69] */ new Table(0, 7, 69, new sbyte[] {-1, 69, 69, 69, 69, 69,
/* NxS[ 66] */ new Table(0, 0, -1, null),
/* NxS[ 67] */ new Table(1, 1, -1, new sbyte[] {70}),
/* NxS[ 68] */ new Table(4, 1, -1, new sbyte[] {112}),
/* NxS[ 69] */ new Table(0, 0, -1, null),
/* NxS[ 70] */ new Table(0, 7, 70, new sbyte[] {-1, 70, 70, 70, 70, 70,
-1}),
/* NxS[ 70] */ new Table(42, 36, 27, new sbyte[] {28, 27, 29, 27, 27, 30,
-1, 1, 2, 3, 4, 2, -1, 5, 6, 7, 8, 9, -1, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26}),
/* NxS[ 71] */ new Table(47, 2, 71, new sbyte[] {31, -1}),
/* NxS[ 72] */ new Table(44, 1, -1, new sbyte[] {33}),
/* NxS[ 73] */ new Table(24, 21, -1, new sbyte[] {74, 74, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32}),
/* NxS[ 74] */ new Table(44, 1, -1, new sbyte[] {32}),
/* NxS[ 75] */ new Table(30, 9, -1, new sbyte[] {76, -1, -1, -1, 77, -1,
-1, -1, 78}),
/* NxS[ 76] */ new Table(31, 1, -1, new sbyte[] {92}),
/* NxS[ 77] */ new Table(38, 1, -1, new sbyte[] {83}),
/* NxS[ 78] */ new Table(41, 1, -1, new sbyte[] {79}),
/* NxS[ 79] */ new Table(32, 1, -1, new sbyte[] {80}),
/* NxS[ 80] */ new Table(30, 1, -1, new sbyte[] {81}),
/* NxS[ 81] */ new Table(26, 1, -1, new sbyte[] {82}),
/* NxS[ 82] */ new Table(26, 1, -1, new sbyte[] {36}),
/* NxS[ 83] */ new Table(39, 1, -1, new sbyte[] {84}),
/* NxS[ 84] */ new Table(38, 1, -1, new sbyte[] {85}),
/* NxS[ 85] */ new Table(30, 1, -1, new sbyte[] {86}),
/* NxS[ 86] */ new Table(40, 1, -1, new sbyte[] {87}),
/* NxS[ 71] */ new Table(42, 38, 27, new sbyte[] {28, 27, 29, 27, 27, 27,
27, 30, -1, 1, 2, 3, 4, 2, -1, 5, 6, 7, 8, 9, -1, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26}),
/* NxS[ 72] */ new Table(49, 2, 72, new sbyte[] {31, -1}),
/* NxS[ 73] */ new Table(44, 1, -1, new sbyte[] {34}),
/* NxS[ 74] */ new Table(24, 21, -1, new sbyte[] {76, 76, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33}),
/* NxS[ 75] */ new Table(35, 12, -1, new sbyte[] {32, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 32}),
/* NxS[ 76] */ new Table(44, 1, -1, new sbyte[] {33}),
/* NxS[ 77] */ new Table(30, 9, -1, new sbyte[] {78, -1, -1, -1, 79, -1,
-1, -1, 80}),
/* NxS[ 78] */ new Table(31, 1, -1, new sbyte[] {94}),
/* NxS[ 79] */ new Table(38, 1, -1, new sbyte[] {85}),
/* NxS[ 80] */ new Table(41, 1, -1, new sbyte[] {81}),
/* NxS[ 81] */ new Table(32, 1, -1, new sbyte[] {82}),
/* NxS[ 82] */ new Table(30, 1, -1, new sbyte[] {83}),
/* NxS[ 83] */ new Table(26, 1, -1, new sbyte[] {84}),
/* NxS[ 84] */ new Table(26, 1, -1, new sbyte[] {37}),
/* NxS[ 85] */ new Table(39, 1, -1, new sbyte[] {86}),
/* NxS[ 86] */ new Table(38, 1, -1, new sbyte[] {87}),
/* NxS[ 87] */ new Table(30, 1, -1, new sbyte[] {88}),
/* NxS[ 88] */ new Table(37, 1, -1, new sbyte[] {89}),
/* NxS[ 89] */ new Table(38, 1, -1, new sbyte[] {90}),
/* NxS[ 90] */ new Table(26, 1, -1, new sbyte[] {91}),
/* NxS[ 91] */ new Table(26, 1, -1, new sbyte[] {37}),
/* NxS[ 92] */ new Table(32, 1, -1, new sbyte[] {93}),
/* NxS[ 93] */ new Table(33, 1, -1, new sbyte[] {94}),
/* NxS[ 94] */ new Table(30, 1, -1, new sbyte[] {95}),
/* NxS[ 95] */ new Table(34, 1, -1, new sbyte[] {96}),
/* NxS[ 96] */ new Table(34, 1, -1, new sbyte[] {97}),
/* NxS[ 97] */ new Table(35, 1, -1, new sbyte[] {98}),
/* NxS[ 98] */ new Table(36, 1, -1, new sbyte[] {99}),
/* NxS[ 99] */ new Table(37, 1, -1, new sbyte[] {100}),
/* NxS[ 100] */ new Table(26, 1, -1, new sbyte[] {101}),
/* NxS[ 101] */ new Table(26, 1, -1, new sbyte[] {38}),
/* NxS[ 102] */ new Table(0, 13, -1, new sbyte[] {50, -1, -1, -1, -1, -1,
50, -1, -1, -1, -1, 103, 50}),
/* NxS[ 103] */ new Table(0, 13, -1, new sbyte[] {51, -1, -1, -1, -1, -1,
51, -1, -1, -1, -1, -1, 51}),
/* NxS[ 104] */ new Table(47, 2, 104, new sbyte[] {56, -1}),
/* NxS[ 105] */ new Table(0, 7, 105, new sbyte[] {-1, 105, 57, 105, 105, 105,
/* NxS[ 88] */ new Table(40, 1, -1, new sbyte[] {89}),
/* NxS[ 89] */ new Table(30, 1, -1, new sbyte[] {90}),
/* NxS[ 90] */ new Table(37, 1, -1, new sbyte[] {91}),
/* NxS[ 91] */ new Table(38, 1, -1, new sbyte[] {92}),
/* NxS[ 92] */ new Table(26, 1, -1, new sbyte[] {93}),
/* NxS[ 93] */ new Table(26, 1, -1, new sbyte[] {38}),
/* NxS[ 94] */ new Table(32, 1, -1, new sbyte[] {95}),
/* NxS[ 95] */ new Table(33, 1, -1, new sbyte[] {96}),
/* NxS[ 96] */ new Table(30, 1, -1, new sbyte[] {97}),
/* NxS[ 97] */ new Table(34, 1, -1, new sbyte[] {98}),
/* NxS[ 98] */ new Table(34, 1, -1, new sbyte[] {99}),
/* NxS[ 99] */ new Table(35, 1, -1, new sbyte[] {100}),
/* NxS[ 100] */ new Table(36, 1, -1, new sbyte[] {101}),
/* NxS[ 101] */ new Table(37, 1, -1, new sbyte[] {102}),
/* NxS[ 102] */ new Table(26, 1, -1, new sbyte[] {103}),
/* NxS[ 103] */ new Table(26, 1, -1, new sbyte[] {39}),
/* NxS[ 104] */ new Table(0, 13, -1, new sbyte[] {51, -1, -1, -1, -1, -1,
51, -1, -1, -1, -1, 105, 51}),
/* NxS[ 105] */ new Table(0, 13, -1, new sbyte[] {52, -1, -1, -1, -1, -1,
52, -1, -1, -1, -1, -1, 52}),
/* NxS[ 106] */ new Table(49, 2, 106, new sbyte[] {57, -1}),
/* NxS[ 107] */ new Table(0, 7, 107, new sbyte[] {-1, 107, 58, 107, 107, 107,
-1}),
/* NxS[ 106] */ new Table(2, 1, 60, new sbyte[] {61}),
/* NxS[ 107] */ new Table(8, 1, 62, new sbyte[] {63}),
/* NxS[ 108] */ new Table(0, 0, -1, null),
/* NxS[ 109] */ new Table(1, 3, 65, new sbyte[] {66, 65, 67}),
/* NxS[ 110] */ new Table(0, 7, 110, new sbyte[] {-1, 110, 68, 110, 110, 110,
/* NxS[ 108] */ new Table(2, 1, 61, new sbyte[] {62}),
/* NxS[ 109] */ new Table(8, 1, 63, new sbyte[] {64}),
/* NxS[ 110] */ new Table(0, 0, -1, null),
/* NxS[ 111] */ new Table(1, 3, 66, new sbyte[] {67, 66, 68}),
/* NxS[ 112] */ new Table(0, 7, 112, new sbyte[] {-1, 112, 69, 112, 112, 112,
-1}),
};
@ -1328,7 +1331,7 @@ int NextState() {
unchecked {
int rslt;
int idx = Map(code) - NxS[state].min;
if (idx < 0) idx += 48;
if (idx < 0) idx += 50;
if ((uint)idx >= (uint)NxS[state].rng) rslt = NxS[state].dflt;
else rslt = NxS[state].nxt[idx];
return rslt;
@ -2042,93 +2045,99 @@ yylval = new Union();
return (int)Tokens.tkStringLiteral;
break;
case 32:
yylval = new Union();
currentLexLocation = CurrentLexLocation;
yylval.ex = parsertools.create_bigint_const(yytext,currentLexLocation);
return (int)Tokens.tkBigInteger;
break;
case 33:
case 34:
yylval = new Union();
currentLexLocation = CurrentLexLocation;
yylval.ex = parsertools.create_double_const(yytext,currentLexLocation);
return (int)Tokens.tkFloat;
break;
case 34:
case 35:
yylval = new Union(); yylval.op = new op_type_node(Operators.LessEqual); return (int)Tokens.tkLowerEqual;
break;
case 35:
case 36:
yylval = new Union(); yylval.op = new op_type_node(Operators.NotEqual); return (int)Tokens.tkNotEqual;
break;
case 36:
case 37:
return (int)Tokens.tkParseModeType;
break;
case 37:
case 38:
return (int)Tokens.tkParseModeStatement;
break;
case 38:
case 39:
return (int)Tokens.tkParseModeExpression;
break;
case 39:
case 40:
yylval = new Union(); yylval.op = new op_type_node(Operators.GreaterEqual); return (int)Tokens.tkGreaterEqual;
break;
case 40:
case 41:
yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentSubtraction); return (int)Tokens.tkMinusEqual;
break;
case 41:
case 42:
yylval = new Union(); yylval.ti = new token_info(yytext); return (int)Tokens.tkArrow;
break;
case 42:
case 43:
yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentAddition); return (int)Tokens.tkPlusEqual;
break;
case 43:
case 44:
return (int)Tokens.tkQuestionPoint;
break;
case 44:
case 45:
return (int)Tokens.tkQuestionSquareOpen;
break;
case 45:
case 46:
return (int)Tokens.tkDoubleQuestion;
break;
case 46:
case 47:
return (int)Tokens.tkDotDot;
break;
case 47:
case 48:
yylval = new Union(); yylval.op = new op_type_node(Operators.Assignment); return (int)Tokens.tkAssign;
break;
case 48:
case 49:
yylval = new Union();
yylval.id = new ident(yytext,CurrentLexLocation);
return (int)Tokens.tkDirectiveName;
break;
case 49:
case 50:
yylval = new Union();
currentLexLocation = CurrentLexLocation;
yylval.stn = parsertools.create_sharp_char_const(yytext,currentLexLocation);
return (int)Tokens.tkAsciiChar;
break;
case 50:
case 51:
yylval = new Union(); yylval.ti = new token_info("##",CurrentLexLocation); return (int)Tokens.tkShortProgram;
break;
case 51:
case 52:
yylval = new Union(); yylval.ti = new token_info("###",CurrentLexLocation); return (int)Tokens.tkShortSFProgram;
break;
case 52:
case 53:
yylval = new Union(); yylval.op = new op_type_node(Operators.Power); return (int)Tokens.tkStarStar;
break;
case 53:
case 54:
yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentMultiplication); return (int)Tokens.tkMultEqual;
break;
case 54:
case 55:
BEGIN(COMMENT1);
break;
case 55:
case 56:
yylval = new Union();
currentLexLocation = CurrentLexLocation;
yylval.ex = parsertools.create_hex_const(yytext,currentLexLocation);
return (int)Tokens.tkHex;
break;
case 56:
case 57:
yylval = new Union();
currentLexLocation = CurrentLexLocation;
yylval.stn = parsertools.create_format_string_const(yytext,currentLexLocation);
return (int)Tokens.tkFormatStringLiteral;
break;
case 57:
case 58:
if (parsertools.build_tree_for_formatter)
break;
@ -2184,36 +2193,36 @@ if (parsertools.build_tree_for_formatter)
Defines.Remove(directiveparam);
}
break;
case 58:
case 59:
{
}
break;
case 59:
case 60:
yylval = new Union(); yylval.op = new op_type_node(Operators.AssignmentDivision); return (int)Tokens.tkDivEqual;
break;
case 60:
case 61:
{
}
break;
case 61:
BEGIN(INITIAL);
break;
case 62:
case 63:
{
}
break;
case 64:
BEGIN(INITIAL);
break;
case 65:
case 66:
case 67:
case 63:
case 64:
{
}
break;
case 65:
BEGIN(INITIAL);
break;
case 66:
case 67:
case 68:
{
}
break;
case 69:
parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam);
parsertools.CheckDirectiveParams(directivename,directiveparam); // directivename in UPPERCASE!
if (directivename == "IFDEF")
@ -2245,7 +2254,7 @@ parsertools.DivideDirectiveOn(yytext,out directivename,out directiveparam);
BEGIN(INITIAL);
}
break;
case 69:
case 70:
{
}

View file

@ -32,6 +32,7 @@ NOTASCII [^\x00-x7F]
CHARACTERNUM '[^'\n]'
INTNUM {Digit}+
BIGINTNUM {INTNUM}[bB][iI]
FLOATNUM {INTNUM}\.{INTNUM}
EXPNUM ({INTNUM}\.)?{INTNUM}[eE][+\-]?{INTNUM}
STRINGNUM \'([^\'\n]|\'\')*\'
@ -437,6 +438,14 @@ UNICODEARROW \x890
return (int)Tokens.tkInteger;
}
{BIGINTNUM} {
yylval = new Union();
currentLexLocation = CurrentLexLocation;
yylval.ex = parsertools.create_bigint_const(yytext,currentLexLocation);
return (int)Tokens.tkBigInteger;
}
{HEXNUM} {
yylval = new Union();
currentLexLocation = CurrentLexLocation;

View file

@ -50,7 +50,7 @@
%token <id> tkDirectiveName tkIdentifier
%token <stn> tkStringLiteral tkFormatStringLiteral tkAsciiChar
%token <id> tkAbstract tkForward tkOverload tkReintroduce tkOverride tkVirtual tkExtensionMethod
%token <ex> tkInteger tkFloat tkHex
%token <ex> tkInteger tkBigInteger tkFloat tkHex
%token <id> tkUnknown
%type <ti> unit_key_word class_or_static
@ -1043,6 +1043,8 @@ unsigned_number
{ $$ = $1; }
| tkFloat
{ $$ = $1; }
| tkBigInteger
{ $$ = $1; }
;
typed_const

View file

@ -349,6 +349,22 @@ namespace PascalABCSavParser
return create_int_const(text, sc, System.Globalization.NumberStyles.Integer);
}
public const_node create_bigint_const(string text, SourceContext sc)
{
var txt = text.Substring(0, text.Length - 2);
const_node cn = new bigint_const();
try
{
(cn as bigint_const).val = System.UInt64.Parse(txt);
}
catch (Exception)
{
errors.Add(new BadInt(CurrentFileName, sc, null));
}
cn.source_context = sc;
return cn;
}
public const_node create_int_const(string text, SourceContext sc, System.Globalization.NumberStyles NumberStyles)
{
//таблица целых констант на уровне синтаксиса

File diff suppressed because it is too large Load diff

View file

@ -289,5 +289,6 @@ script=

View file

@ -1 +1 @@
3.7.1.2744
3.7.1.2746

View file

@ -1 +1 @@
!define VERSION '3.7.1.2744'
!define VERSION '3.7.1.2746'

View file

@ -1282,6 +1282,11 @@ namespace PascalABCCompiler.SyntaxTree
{
DefaultVisit(_semantic_ith_element_of);
}
public virtual void visit(bigint_const _bigint_const)
{
DefaultVisit(_bigint_const);
}
}

View file

@ -2045,6 +2045,14 @@ namespace PascalABCCompiler.SyntaxTree
{
}
public virtual void pre_do_visit(bigint_const _bigint_const)
{
}
public virtual void post_do_visit(bigint_const _bigint_const)
{
}
public override void visit(expression _expression)
{
DefaultVisit(_expression);
@ -4223,6 +4231,13 @@ namespace PascalABCCompiler.SyntaxTree
visit(semantic_ith_element_of.index);
post_do_visit(_semantic_ith_element_of);
}
public override void visit(bigint_const _bigint_const)
{
DefaultVisit(_bigint_const);
pre_do_visit(_bigint_const);
post_do_visit(_bigint_const);
}
}

View file

@ -530,6 +530,8 @@ namespace PascalABCCompiler.SyntaxTree
return new array_const_new();
case 254:
return new semantic_ith_element_of();
case 255:
return new bigint_const();
}
return null;
}
@ -4445,6 +4447,18 @@ namespace PascalABCCompiler.SyntaxTree
_semantic_ith_element_of.index = _read_node() as expression;
}
public void visit(bigint_const _bigint_const)
{
read_bigint_const(_bigint_const);
}
public void read_bigint_const(bigint_const _bigint_const)
{
read_const_node(_bigint_const);
_bigint_const.val = br.ReadUInt64();
}
}

View file

@ -6959,6 +6959,19 @@ namespace PascalABCCompiler.SyntaxTree
}
}
public void visit(bigint_const _bigint_const)
{
bw.Write((Int16)255);
write_bigint_const(_bigint_const);
}
public void write_bigint_const(bigint_const _bigint_const)
{
write_const_node(_bigint_const);
bw.Write(_bigint_const.val);
}
}

View file

@ -54380,6 +54380,143 @@ namespace PascalABCCompiler.SyntaxTree
}
///<summary>
///
///</summary>
[Serializable]
public partial class bigint_const : const_node
{
///<summary>
///Конструктор без параметров.
///</summary>
public bigint_const()
{
}
///<summary>
///Конструктор с параметрами.
///</summary>
public bigint_const(UInt64 _val)
{
this._val=_val;
FillParentsInDirectChilds();
}
///<summary>
///Конструктор с параметрами.
///</summary>
public bigint_const(UInt64 _val,SourceContext sc)
{
this._val=_val;
source_context = sc;
FillParentsInDirectChilds();
}
protected UInt64 _val;
///<summary>
///
///</summary>
public UInt64 val
{
get
{
return _val;
}
set
{
_val=value;
}
}
/// <summary> Создает копию узла </summary>
public override syntax_tree_node Clone()
{
bigint_const copy = new bigint_const();
copy.Parent = this.Parent;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)
{
copy.attributes = (attribute_list)attributes.Clone();
copy.attributes.Parent = copy;
}
copy.val = val;
return copy;
}
/// <summary> Получает копию данного узла корректного типа </summary>
public new bigint_const TypedClone()
{
return Clone() as bigint_const;
}
///<summary> Заполняет поля Parent в непосредственных дочерних узлах </summary>
public override void FillParentsInDirectChilds()
{
if (attributes != null)
attributes.Parent = this;
}
///<summary> Заполняет поля Parent во всем поддереве </summary>
public override void FillParentsInAllChilds()
{
FillParentsInDirectChilds();
attributes?.FillParentsInAllChilds();
}
///<summary>
///Свойство для получения количества всех подузлов без элементов поля типа List
///</summary>
public override Int32 subnodes_without_list_elements_count
{
get
{
return 0;
}
}
///<summary>
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
///</summary>
public override Int32 subnodes_count
{
get
{
return 0;
}
}
///<summary>
///Индексатор для получения всех подузлов
///</summary>
public override syntax_tree_node this[Int32 ind]
{
get
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
return null;
}
set
{
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
throw new IndexOutOfRangeException();
}
}
///<summary>
///Метод для обхода дерева посетителем
///</summary>
///<param name="visitor">Объект-посетитель.</param>
///<returns>Return value is void</returns>
public override void visit(IVisitor visitor)
{
visitor.visit(this);
}
}
}

View file

@ -1534,6 +1534,12 @@ namespace PascalABCCompiler.SyntaxTree
///<param name="_semantic_ith_element_of">Node to visit</param>
///<returns> Return value is void </returns>
void visit(semantic_ith_element_of _semantic_ith_element_of);
///<summary>
///Method to visit bigint_const.
///</summary>
///<param name="_bigint_const">Node to visit</param>
///<returns> Return value is void </returns>
void visit(bigint_const _bigint_const);
}

View file

@ -3291,6 +3291,16 @@
<TagIndices />
</Tags>
</SyntaxNode>
<SyntaxNode Name="bigint_const" BaseName="const_node">
<Fields>
<ExtendedField Name="val" Type="UInt64" CreateVariable="false" DeleteVariable="false" />
</Fields>
<Methods />
<Tags>
<CategoryIndices />
<TagIndices />
</Tags>
</SyntaxNode>
</SyntaxNodes>
<Settings>
<FileName>Tree.cs</FileName>
@ -3486,6 +3496,8 @@
<HelpData Key="attribute_list.attributes" Value="" />
<HelpData Key="attribute_list.void Add(simple_attribute_list sal, SourceContext sc)" Value="" />
<HelpData Key="attribute_list.w" Value="" />
<HelpData Key="bigint_const" Value="" />
<HelpData Key="bigint_const.val" Value="" />
<HelpData Key="bin_expr" Value="Бинарное выражение" />
<HelpData Key="bin_expr.left" Value="" />
<HelpData Key="bin_expr.operation_type" Value="" />

View file

@ -26,6 +26,9 @@ function Dec(s: string; base: integer): int64;
/// Перевод из системы по основанию base [2..36] в десятичную
function DecBig(s: string; base: integer): BigInteger;
/// Перевод BigInteger в систему счисления по основанию base (2..36)
function ToBase(BI: BigInteger; base: integer): string;
/// Перевод десятичного числа в систему счисления по основанию base (2..36)
function ToBase(sDec: string; base: integer): string;
@ -183,6 +186,8 @@ end;
{$endregion}
const sb = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
{$region Dec}
function Dec(s: string; base: integer): int64;
@ -190,7 +195,6 @@ begin
if not (base in 2..36) then
raise new School_InvalidBase
($'ToDecimal: Недопустимое основание {base}');
var sb := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
s := s.ToUpper;
var r := s.Except(sb[:base + 1]).JoinToString;
if r.Length > 0 then
@ -211,7 +215,6 @@ begin
if not (base in 2..36) then
raise new School_InvalidBase
($'ToDecimal: Недопустимое основание {base}');
var sb := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
s := s.ToUpper;
var r := s.Except(sb[:base + 1]).JoinToString;
if r.Length > 0 then
@ -226,36 +229,37 @@ begin
pa *= base
end
end;
{$endregion}
{$region ToBase}
/// Перевод BigInteger в систему счисления по основанию base (2..36)
function ToBase(BI: BigInteger; base: integer): string;
begin
var s := new System.Text.StringBuilder('');
while BI > 0 do
begin
s.Insert(0,sb[integer(BI mod base) + 1]);
BI := BI div base
end;
Result := if s.Length = 0 then '0' else s.ToString
end;
/// Перевод BigInteger в систему счисления по основанию base (2..36)
function ToBase(Self: BigInteger; base: integer): string; extensionmethod :=
ToBase(Self, base);
/// Перевод десятичного числа в систему счисления по основанию base (2..36)
function ToBase(sDec: string; base: integer): string;
begin
var n: BigInteger;
if not BigInteger.TryParse(sDec, n) then exit;
var s := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
Result := '';
while n > 0 do
begin
Result := s[integer(n mod base) + 1] + Result;
n := n div base
end;
if Result = '' then Result := '0'
if BigInteger.TryParse(sDec, n) then
Result := ToBase(n, base)
end;
/// Перевод десятичного числа в систему счисления по основанию base (2..36)
function ToBase(Self: string; base: integer): string; extensionmethod;
begin
var n: BigInteger;
if not BigInteger.TryParse(Self, n) then exit;
var s := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
Result := '';
while n > 0 do
begin
Result := s[integer(n mod base) + 1] + Result;
n := n div base
end;
if Result = '' then Result := '0'
end;
function ToBase(Self: string; base: integer): string; extensionmethod :=
ToBase(Self, base);
{$endregion}

4
TestSuite/bi1.pas Normal file
View file

@ -0,0 +1,4 @@
begin
var a := 2222222222222222222bi;
Assert(a=2222222222222222222bi);
end.

View file

@ -17272,6 +17272,15 @@ namespace PascalABCCompiler.TreeConverter
return;
}
public override void visit(SyntaxTree.bigint_const bi)
{
var names = new List<ident> { new ident("System"), new ident("Numerics"), new ident("BigInteger") };
var ntr = new named_type_reference(names, bi.source_context);
var ne = new new_expr(ntr, new expression_list(new uint64_const(bi.val)),bi.source_context);
visit(ne);
}
public override void visit(SyntaxTree.int32_const int32)
{

View file

@ -26,6 +26,9 @@ function Dec(s: string; base: integer): int64;
/// Перевод из системы по основанию base [2..36] в десятичную
function DecBig(s: string; base: integer): BigInteger;
/// Перевод BigInteger в систему счисления по основанию base (2..36)
function ToBase(BI: BigInteger; base: integer): string;
/// Перевод десятичного числа в систему счисления по основанию base (2..36)
function ToBase(sDec: string; base: integer): string;
@ -183,6 +186,8 @@ end;
{$endregion}
const sb = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
{$region Dec}
function Dec(s: string; base: integer): int64;
@ -190,7 +195,6 @@ begin
if not (base in 2..36) then
raise new School_InvalidBase
($'ToDecimal: Недопустимое основание {base}');
var sb := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
s := s.ToUpper;
var r := s.Except(sb[:base + 1]).JoinToString;
if r.Length > 0 then
@ -211,7 +215,6 @@ begin
if not (base in 2..36) then
raise new School_InvalidBase
($'ToDecimal: Недопустимое основание {base}');
var sb := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
s := s.ToUpper;
var r := s.Except(sb[:base + 1]).JoinToString;
if r.Length > 0 then
@ -226,36 +229,37 @@ begin
pa *= base
end
end;
{$endregion}
{$region ToBase}
/// Перевод BigInteger в систему счисления по основанию base (2..36)
function ToBase(BI: BigInteger; base: integer): string;
begin
var s := new System.Text.StringBuilder('');
while BI > 0 do
begin
s.Insert(0,sb[integer(BI mod base) + 1]);
BI := BI div base
end;
Result := if s.Length = 0 then '0' else s.ToString
end;
/// Перевод BigInteger в систему счисления по основанию base (2..36)
function ToBase(Self: BigInteger; base: integer): string; extensionmethod :=
ToBase(Self, base);
/// Перевод десятичного числа в систему счисления по основанию base (2..36)
function ToBase(sDec: string; base: integer): string;
begin
var n: BigInteger;
if not BigInteger.TryParse(sDec, n) then exit;
var s := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
Result := '';
while n > 0 do
begin
Result := s[integer(n mod base) + 1] + Result;
n := n div base
end;
if Result = '' then Result := '0'
if BigInteger.TryParse(sDec, n) then
Result := ToBase(n, base)
end;
/// Перевод десятичного числа в систему счисления по основанию base (2..36)
function ToBase(Self: string; base: integer): string; extensionmethod;
begin
var n: BigInteger;
if not BigInteger.TryParse(Self, n) then exit;
var s := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
Result := '';
while n > 0 do
begin
Result := s[integer(n mod base) + 1] + Result;
n := n div base
end;
if Result = '' then Result := '0'
end;
function ToBase(Self: string; base: integer): string; extensionmethod :=
ToBase(Self, base);
{$endregion}