forked from Matway/mpl-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastNodeType.mpl
executable file
·115 lines (101 loc) · 3.09 KB
/
astNodeType.mpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
"astNodeType" module
"Array" includeModule
"HashTable" includeModule
"String" includeModule
"Variant" includeModule
AstNodeType: {
Empty: [ 0 static];
Label: [ 1 static];
Code: [ 2 static];
Object: [ 3 static];
List: [ 4 static];
Name: [ 5 static];
NameRead: [ 6 static];
NameWrite: [ 7 static];
NameMember: [ 8 static];
NameReadMember: [ 9 static];
NameWriteMember: [10 static];
String: [11 static];
Numberi8: [12 static];
Numberi16: [13 static];
Numberi32: [14 static];
Numberi64: [15 static];
Numberix: [16 static];
Numbern8: [17 static];
Numbern16: [18 static];
Numbern32: [19 static];
Numbern64: [20 static];
Numbernx: [21 static];
Real32: [22 static];
Real64: [23 static];
};
#AST Nodes
IndexArray: [Int32 Array];
NamedRecursiveBranch:[{
children: IndexArray; # Array of Index
name: String; # dynamic String
nameInfo: 0 dynamic; #index in NameInfo pool
}];
NamedBranch: [{
name: String; # dynamic String
nameInfo: 0 dynamic; #index in NameInfo pool
}];
AstNode: [{
virtual AST_NODE: ();
token: String;
column: -1 dynamic;
line: -1 dynamic;
offset: -1 dynamic;
fileNumber: 0 dynamic;
data: (
Cond #EmptyNode:
NamedRecursiveBranch #LabelNode:
IndexArray #CodeNode:
IndexArray #ObjectNode:
IndexArray #ListNode:
NamedBranch #NameNode:
NamedBranch #NameReadNode:
NamedBranch #NameWriteNode:
NamedBranch #NameMemberNode:
NamedBranch #NameReadMemberNode:
NamedBranch #NameWriteMemberNode:
String #StringNode:
Int64 #Numberi8Node:
Int64 #Numberi16Node:
Int64 #Numberi32Node:
Int64 #Numberi64Node:
Int64 #NumberixNode:
Nat64 #Numbern8Node:
Nat64 #Numbern16Node:
Nat64 #Numbern32Node:
Nat64 #Numbern64Node:
Nat64 #NumbernxNode:
Real64 #Real32Node:
Real64 #Real64Node:
) Variant;
INIT: []; DIE: []; # default life control, and ban uneffective copy, because object is too big
}];
makePositionInfo: [{
column: copy;
line: copy;
offset: copy;
}];
PositionInfo: [-1 dynamic 1 dynamic 0 dynamic makePositionInfo];
ParserResult: [{
virtual PARSER_RESULT: ();
success: TRUE dynamic;
errorInfo: {
message: String;
position: PositionInfo;
};
memory: AstNode Array;
nodes: IndexArray;
INIT: []; DIE: []; # default life control, and ban uneffective copy, because object is too big
}];
ParserResults: [ParserResult Array];
MultiParserResult: [{
names: String Int32 HashTable;
memory: AstNode Array;
nodes: IndexArray Array; # order of going is not defined before compiling
INIT: []; DIE: []; # default life control, and ban uneffective copy, because object is too big
}];