@minduscript/parser 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +2 -0
- package/dist/exe.d.ts +2 -0
- package/dist/exe.js +75 -0
- package/dist/expression-parser.d.ts +25 -0
- package/dist/expression-parser.js +349 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.js +17 -0
- package/dist/nodes.d.ts +648 -0
- package/dist/nodes.js +167 -0
- package/dist/parser.d.ts +5 -0
- package/dist/parser.js +1280 -0
- package/package.json +26 -0
package/dist/parser.js
ADDED
|
@@ -0,0 +1,1280 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parser = void 0;
|
|
4
|
+
const chlamydomonos_parser_1 = require("chlamydomonos-parser");
|
|
5
|
+
const lexer_1 = require("@minduscript/lexer");
|
|
6
|
+
const nodes_1 = require("./nodes");
|
|
7
|
+
const expression_parser_1 = require("./expression-parser");
|
|
8
|
+
const MIN_NODE_TYPE = nodes_1.NodeType.DOCUMENT;
|
|
9
|
+
const buildNodeBase = (...values) => {
|
|
10
|
+
const tokensOf = (value) => {
|
|
11
|
+
if (value.type < MIN_NODE_TYPE) {
|
|
12
|
+
return [value];
|
|
13
|
+
}
|
|
14
|
+
return value.tokens;
|
|
15
|
+
};
|
|
16
|
+
return { tokens: values.flatMap((v) => tokensOf(v)) };
|
|
17
|
+
};
|
|
18
|
+
exports.parser = (0, chlamydomonos_parser_1.createParser)('type')()(nodes_1.NodeType.DOCUMENT, (g, c) => {
|
|
19
|
+
g.item()
|
|
20
|
+
.target(nodes_1.NodeType.DOCUMENT)
|
|
21
|
+
.source(nodes_1.NodeType.IMPORT_LIST)(nodes_1.NodeType.STATEMENT_LIST)
|
|
22
|
+
.factory((rawImportList, rawStatementList) => {
|
|
23
|
+
const importList = [];
|
|
24
|
+
let currentImportList = rawImportList;
|
|
25
|
+
while (currentImportList) {
|
|
26
|
+
importList.push(currentImportList.first);
|
|
27
|
+
currentImportList = currentImportList.other;
|
|
28
|
+
}
|
|
29
|
+
const statementList = [];
|
|
30
|
+
let currentStatementList = rawStatementList;
|
|
31
|
+
while (currentStatementList) {
|
|
32
|
+
statementList.push(currentStatementList.first);
|
|
33
|
+
currentStatementList = currentStatementList.other;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
...buildNodeBase(rawImportList, rawStatementList),
|
|
37
|
+
importList,
|
|
38
|
+
statementList,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
g.item()
|
|
42
|
+
.target(nodes_1.NodeType.DOCUMENT)
|
|
43
|
+
.source(nodes_1.NodeType.IMPORT_LIST)
|
|
44
|
+
.factory((rawImportList) => {
|
|
45
|
+
const importList = [];
|
|
46
|
+
let currentImportList = rawImportList;
|
|
47
|
+
while (currentImportList) {
|
|
48
|
+
importList.push(currentImportList.first);
|
|
49
|
+
currentImportList = currentImportList.other;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
...buildNodeBase(rawImportList),
|
|
53
|
+
importList,
|
|
54
|
+
statementList: [],
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
g.item()
|
|
58
|
+
.target(nodes_1.NodeType.DOCUMENT)
|
|
59
|
+
.source(nodes_1.NodeType.STATEMENT_LIST)
|
|
60
|
+
.factory((rawStatementList) => {
|
|
61
|
+
const statementList = [];
|
|
62
|
+
let currentStatementList = rawStatementList;
|
|
63
|
+
while (currentStatementList) {
|
|
64
|
+
statementList.push(currentStatementList.first);
|
|
65
|
+
currentStatementList = currentStatementList.other;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
...buildNodeBase(rawStatementList),
|
|
69
|
+
importList: [],
|
|
70
|
+
statementList,
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
g.item()
|
|
74
|
+
.target(nodes_1.NodeType.IMPORT_LIST)
|
|
75
|
+
.source(nodes_1.NodeType.IMPORT_STATEMENT)(nodes_1.NodeType.IMPORT_LIST)
|
|
76
|
+
.factory((statement, list) => ({
|
|
77
|
+
...buildNodeBase(statement, list),
|
|
78
|
+
first: statement,
|
|
79
|
+
other: list,
|
|
80
|
+
}));
|
|
81
|
+
g.item()
|
|
82
|
+
.target(nodes_1.NodeType.IMPORT_LIST)
|
|
83
|
+
.source(nodes_1.NodeType.IMPORT_STATEMENT)
|
|
84
|
+
.factory((statement) => ({
|
|
85
|
+
...buildNodeBase(statement),
|
|
86
|
+
first: statement,
|
|
87
|
+
other: undefined,
|
|
88
|
+
}));
|
|
89
|
+
g.item()
|
|
90
|
+
.target(nodes_1.NodeType.STATEMENT_LIST)
|
|
91
|
+
.source(nodes_1.NodeType.STATEMENT)(nodes_1.NodeType.STATEMENT_LIST)
|
|
92
|
+
.factory((statement, list) => ({
|
|
93
|
+
...buildNodeBase(statement, list),
|
|
94
|
+
first: statement,
|
|
95
|
+
other: list,
|
|
96
|
+
}));
|
|
97
|
+
g.item()
|
|
98
|
+
.target(nodes_1.NodeType.STATEMENT_LIST)
|
|
99
|
+
.source(nodes_1.NodeType.STATEMENT)
|
|
100
|
+
.factory((statement) => ({
|
|
101
|
+
...buildNodeBase(statement),
|
|
102
|
+
first: statement,
|
|
103
|
+
other: undefined,
|
|
104
|
+
}));
|
|
105
|
+
g.item()
|
|
106
|
+
.target(nodes_1.NodeType.IMPORT_STATEMENT)
|
|
107
|
+
.source(lexer_1.TokenType.IMPORT)(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.FROM)(lexer_1.TokenType.STRING)(lexer_1.TokenType.SEMICOLON)
|
|
108
|
+
.factory((t1, name, t3, path, t4) => ({
|
|
109
|
+
...buildNodeBase(t1, name, t3, path, t4),
|
|
110
|
+
name: name.raw,
|
|
111
|
+
asName: name.raw,
|
|
112
|
+
from: JSON.parse(path.raw),
|
|
113
|
+
}));
|
|
114
|
+
g.item()
|
|
115
|
+
.target(nodes_1.NodeType.IMPORT_STATEMENT)
|
|
116
|
+
.source(lexer_1.TokenType.IMPORT)(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.AS)(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.FROM)(lexer_1.TokenType.STRING)(lexer_1.TokenType.SEMICOLON)
|
|
117
|
+
.factory((t1, name, t3, asName, t5, path, t7) => ({
|
|
118
|
+
...buildNodeBase(t1, name, t3, asName, t5, path, t7),
|
|
119
|
+
name: name.raw,
|
|
120
|
+
asName: asName.raw,
|
|
121
|
+
from: JSON.parse(path.raw),
|
|
122
|
+
}));
|
|
123
|
+
g.item()
|
|
124
|
+
.target(nodes_1.NodeType.STATEMENT)
|
|
125
|
+
.source(nodes_1.NodeType.SINGLE_STATEMENT)
|
|
126
|
+
.factory((singleStatement) => singleStatement);
|
|
127
|
+
g.item()
|
|
128
|
+
.target(nodes_1.NodeType.STATEMENT)
|
|
129
|
+
.source(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
130
|
+
.factory((blockStatement) => blockStatement);
|
|
131
|
+
g.item()
|
|
132
|
+
.target(nodes_1.NodeType.SINGLE_STATEMENT)
|
|
133
|
+
.source(nodes_1.NodeType.STATEMENT_BODY)(lexer_1.TokenType.SEMICOLON)
|
|
134
|
+
.factory((statementBody, t) => ({
|
|
135
|
+
...statementBody,
|
|
136
|
+
...buildNodeBase(statementBody, t),
|
|
137
|
+
}));
|
|
138
|
+
g.item()
|
|
139
|
+
.target(nodes_1.NodeType.SINGLE_STATEMENT)
|
|
140
|
+
.source(lexer_1.TokenType.SEMICOLON)
|
|
141
|
+
.factory((t) => ({
|
|
142
|
+
...buildNodeBase(t),
|
|
143
|
+
statementType: nodes_1.StatementType.EMPTY,
|
|
144
|
+
}));
|
|
145
|
+
g.item()
|
|
146
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
147
|
+
.source(lexer_1.TokenType.LET)(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.ASSIGN)(nodes_1.NodeType.EXPRESSION)
|
|
148
|
+
.factory((t1, identifier, t3, expression) => ({
|
|
149
|
+
...buildNodeBase(t1, identifier, t3, expression),
|
|
150
|
+
statementType: nodes_1.StatementType.VARIABLE_DEFINE,
|
|
151
|
+
isConst: false,
|
|
152
|
+
variableName: identifier.raw,
|
|
153
|
+
expression,
|
|
154
|
+
}));
|
|
155
|
+
g.item()
|
|
156
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
157
|
+
.source(lexer_1.TokenType.CONST)(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.ASSIGN)(nodes_1.NodeType.EXPRESSION)
|
|
158
|
+
.factory((t1, identifier, t3, expression) => ({
|
|
159
|
+
...buildNodeBase(t1, identifier, t3, expression),
|
|
160
|
+
statementType: nodes_1.StatementType.VARIABLE_DEFINE,
|
|
161
|
+
isConst: true,
|
|
162
|
+
variableName: identifier.raw,
|
|
163
|
+
expression,
|
|
164
|
+
}));
|
|
165
|
+
g.item()
|
|
166
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
167
|
+
.source(lexer_1.TokenType.IDENTIFIER)(nodes_1.NodeType.ASSIGN_OP)(nodes_1.NodeType.EXPRESSION)
|
|
168
|
+
.factory((identifier, t, expression) => ({
|
|
169
|
+
...buildNodeBase(identifier, t, expression),
|
|
170
|
+
statementType: nodes_1.StatementType.ASSIGN,
|
|
171
|
+
assignType: nodes_1.AssignType.SIMPLE,
|
|
172
|
+
variableName: identifier.raw,
|
|
173
|
+
expression,
|
|
174
|
+
}));
|
|
175
|
+
g.item()
|
|
176
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
177
|
+
.source(lexer_1.TokenType.MINDUSTRY_IDENTIFIER)(nodes_1.NodeType.ASSIGN_OP)(nodes_1.NodeType.EXPRESSION)
|
|
178
|
+
.factory((identifier, t, expression) => ({
|
|
179
|
+
...buildNodeBase(identifier, t, expression),
|
|
180
|
+
statementType: nodes_1.StatementType.ASSIGN,
|
|
181
|
+
assignType: nodes_1.AssignType.SIMPLE,
|
|
182
|
+
variableName: identifier.raw,
|
|
183
|
+
expression,
|
|
184
|
+
}));
|
|
185
|
+
g.item()
|
|
186
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
187
|
+
.source(lexer_1.TokenType.READ)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
188
|
+
.factory((t1, t2, identifier, t4, expression1, t6, expression2, t8) => ({
|
|
189
|
+
...buildNodeBase(t1, t2, identifier, t4, expression1, t6, expression2, t8),
|
|
190
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
191
|
+
controlType: nodes_1.ControlType.READ,
|
|
192
|
+
output: identifier,
|
|
193
|
+
memoryName: expression1,
|
|
194
|
+
memoryIndex: expression2,
|
|
195
|
+
}));
|
|
196
|
+
g.item()
|
|
197
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
198
|
+
.source(lexer_1.TokenType.WRITE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
199
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8) => ({
|
|
200
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8),
|
|
201
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
202
|
+
controlType: nodes_1.ControlType.WRITE,
|
|
203
|
+
value: expression1,
|
|
204
|
+
memoryName: expression2,
|
|
205
|
+
memoryIndex: expression3,
|
|
206
|
+
}));
|
|
207
|
+
g.item()
|
|
208
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
209
|
+
.source(lexer_1.TokenType.DRAW_CLEAR)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
210
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8) => ({
|
|
211
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8),
|
|
212
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
213
|
+
controlType: nodes_1.ControlType.DRAW_CLEAR,
|
|
214
|
+
r: expression1,
|
|
215
|
+
g: expression2,
|
|
216
|
+
b: expression3,
|
|
217
|
+
}));
|
|
218
|
+
g.item()
|
|
219
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
220
|
+
.source(lexer_1.TokenType.DRAW_COLOR)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
221
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10) => ({
|
|
222
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10),
|
|
223
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
224
|
+
controlType: nodes_1.ControlType.DRAW_COLOR,
|
|
225
|
+
r: expression1,
|
|
226
|
+
g: expression2,
|
|
227
|
+
b: expression3,
|
|
228
|
+
a: expression4,
|
|
229
|
+
}));
|
|
230
|
+
g.item()
|
|
231
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
232
|
+
.source(lexer_1.TokenType.DRAW_COL)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
233
|
+
.factory((t1, t2, expression, t4) => ({
|
|
234
|
+
...buildNodeBase(t1, t2, expression, t4),
|
|
235
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
236
|
+
controlType: nodes_1.ControlType.DRAW_COL,
|
|
237
|
+
color: expression,
|
|
238
|
+
}));
|
|
239
|
+
g.item()
|
|
240
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
241
|
+
.source(lexer_1.TokenType.DRAW_STROKE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
242
|
+
.factory((t1, t2, expression, t4) => ({
|
|
243
|
+
...buildNodeBase(t1, t2, expression, t4),
|
|
244
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
245
|
+
controlType: nodes_1.ControlType.DRAW_STROKE,
|
|
246
|
+
width: expression,
|
|
247
|
+
}));
|
|
248
|
+
g.item()
|
|
249
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
250
|
+
.source(lexer_1.TokenType.DRAW_LINE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
251
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10) => ({
|
|
252
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10),
|
|
253
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
254
|
+
controlType: nodes_1.ControlType.DRAW_LINE,
|
|
255
|
+
x: expression1,
|
|
256
|
+
y: expression2,
|
|
257
|
+
x2: expression3,
|
|
258
|
+
y2: expression4,
|
|
259
|
+
}));
|
|
260
|
+
g.item()
|
|
261
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
262
|
+
.source(lexer_1.TokenType.DRAW_RECT)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
263
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10) => ({
|
|
264
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10),
|
|
265
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
266
|
+
controlType: nodes_1.ControlType.DRAW_RECT,
|
|
267
|
+
x: expression1,
|
|
268
|
+
y: expression2,
|
|
269
|
+
width: expression3,
|
|
270
|
+
height: expression4,
|
|
271
|
+
}));
|
|
272
|
+
g.item()
|
|
273
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
274
|
+
.source(lexer_1.TokenType.DRAW_LINE_RECT)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
275
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10) => ({
|
|
276
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10),
|
|
277
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
278
|
+
controlType: nodes_1.ControlType.DRAW_LINE_RECT,
|
|
279
|
+
x: expression1,
|
|
280
|
+
y: expression2,
|
|
281
|
+
width: expression3,
|
|
282
|
+
height: expression4,
|
|
283
|
+
}));
|
|
284
|
+
g.item()
|
|
285
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
286
|
+
.source(lexer_1.TokenType.DRAW_POLY)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
287
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12) => ({
|
|
288
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12),
|
|
289
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
290
|
+
controlType: nodes_1.ControlType.DRAW_POLY,
|
|
291
|
+
x: expression1,
|
|
292
|
+
y: expression2,
|
|
293
|
+
sides: expression3,
|
|
294
|
+
radius: expression4,
|
|
295
|
+
rotation: expression5,
|
|
296
|
+
}));
|
|
297
|
+
g.item()
|
|
298
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
299
|
+
.source(lexer_1.TokenType.DRAW_LINE_POLY)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
300
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12) => ({
|
|
301
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12),
|
|
302
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
303
|
+
controlType: nodes_1.ControlType.DRAW_LINE_POLY,
|
|
304
|
+
x: expression1,
|
|
305
|
+
y: expression2,
|
|
306
|
+
sides: expression3,
|
|
307
|
+
radius: expression4,
|
|
308
|
+
rotation: expression5,
|
|
309
|
+
}));
|
|
310
|
+
g.item()
|
|
311
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
312
|
+
.source(lexer_1.TokenType.DRAW_TRIANGLE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
313
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12, expression6, t14) => ({
|
|
314
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12, expression6, t14),
|
|
315
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
316
|
+
controlType: nodes_1.ControlType.DRAW_TRIANGLE,
|
|
317
|
+
x: expression1,
|
|
318
|
+
y: expression2,
|
|
319
|
+
x2: expression3,
|
|
320
|
+
y2: expression4,
|
|
321
|
+
x3: expression5,
|
|
322
|
+
y3: expression6,
|
|
323
|
+
}));
|
|
324
|
+
g.item()
|
|
325
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
326
|
+
.source(lexer_1.TokenType.DRAW_IMAGE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
327
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12) => ({
|
|
328
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12),
|
|
329
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
330
|
+
controlType: nodes_1.ControlType.DRAW_IMAGE,
|
|
331
|
+
x: expression1,
|
|
332
|
+
y: expression2,
|
|
333
|
+
image: expression3,
|
|
334
|
+
size: expression4,
|
|
335
|
+
rotation: expression5,
|
|
336
|
+
}));
|
|
337
|
+
g.item()
|
|
338
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
339
|
+
.source(lexer_1.TokenType.PRINT)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
340
|
+
.factory((t1, t2, expression, t4) => ({
|
|
341
|
+
...buildNodeBase(t1, t2, expression, t4),
|
|
342
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
343
|
+
controlType: nodes_1.ControlType.PRINT,
|
|
344
|
+
value: expression,
|
|
345
|
+
}));
|
|
346
|
+
g.item()
|
|
347
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
348
|
+
.source(lexer_1.TokenType.DRAW_FLUSH)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
349
|
+
.factory((t1, t2, expression, t4) => ({
|
|
350
|
+
...buildNodeBase(t1, t2, expression, t4),
|
|
351
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
352
|
+
controlType: nodes_1.ControlType.DRAW_FLUSH,
|
|
353
|
+
target: expression,
|
|
354
|
+
}));
|
|
355
|
+
const g30 = g
|
|
356
|
+
.item()
|
|
357
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
358
|
+
.source(lexer_1.TokenType.PRINT_FLUSH)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
359
|
+
.factory((t1, t2, expression, t4) => ({
|
|
360
|
+
...buildNodeBase(t1, t2, expression, t4),
|
|
361
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
362
|
+
controlType: nodes_1.ControlType.PRINT_FLUSH,
|
|
363
|
+
target: expression,
|
|
364
|
+
}));
|
|
365
|
+
g.item()
|
|
366
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
367
|
+
.source(lexer_1.TokenType.GET_LINK)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
368
|
+
.factory((t1, t2, identifier, t4, expression, t6) => ({
|
|
369
|
+
...buildNodeBase(t1, t2, identifier, t4, expression, t6),
|
|
370
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
371
|
+
controlType: nodes_1.ControlType.GET_LINK,
|
|
372
|
+
result: identifier,
|
|
373
|
+
id: expression,
|
|
374
|
+
}));
|
|
375
|
+
g.item()
|
|
376
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
377
|
+
.source(lexer_1.TokenType.SET_ENABLED)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
378
|
+
.factory((t1, t2, expression1, t4, expression2, t6) => ({
|
|
379
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6),
|
|
380
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
381
|
+
controlType: nodes_1.ControlType.SET_ENABLED,
|
|
382
|
+
building: expression1,
|
|
383
|
+
value: expression2,
|
|
384
|
+
}));
|
|
385
|
+
g.item()
|
|
386
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
387
|
+
.source(lexer_1.TokenType.SET_SHOOT)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
388
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10) => ({
|
|
389
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10),
|
|
390
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
391
|
+
controlType: nodes_1.ControlType.SET_SHOOT,
|
|
392
|
+
building: expression1,
|
|
393
|
+
x: expression2,
|
|
394
|
+
y: expression3,
|
|
395
|
+
shoot: expression4,
|
|
396
|
+
}));
|
|
397
|
+
g.item()
|
|
398
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
399
|
+
.source(lexer_1.TokenType.SET_SHOOT_P)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
400
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8) => ({
|
|
401
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8),
|
|
402
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
403
|
+
controlType: nodes_1.ControlType.SET_SHOOT_P,
|
|
404
|
+
building: expression1,
|
|
405
|
+
unit: expression2,
|
|
406
|
+
shoot: expression3,
|
|
407
|
+
}));
|
|
408
|
+
g.item()
|
|
409
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
410
|
+
.source(lexer_1.TokenType.SET_CONFIG)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
411
|
+
.factory((t1, t2, expression1, t4, expression2, t6) => ({
|
|
412
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6),
|
|
413
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
414
|
+
controlType: nodes_1.ControlType.SET_CONFIG,
|
|
415
|
+
building: expression1,
|
|
416
|
+
config: expression2,
|
|
417
|
+
}));
|
|
418
|
+
g.item()
|
|
419
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
420
|
+
.source(lexer_1.TokenType.SET_COLOR)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
421
|
+
.factory((t1, t2, expression1, t4, expression2, t6) => ({
|
|
422
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6),
|
|
423
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
424
|
+
controlType: nodes_1.ControlType.SET_COLOR,
|
|
425
|
+
building: expression1,
|
|
426
|
+
color: expression2,
|
|
427
|
+
}));
|
|
428
|
+
g.item()
|
|
429
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
430
|
+
.source(lexer_1.TokenType.RADAR)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.RADAR_CONDITION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.RADAR_CONDITION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.RADAR_CONDITION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.RADAR_SORT_CONFIG)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
431
|
+
.factory((t1, t2, expression, t4, condition1, t6, condition2, t8, condition3, t10, order, t12, sort, t14, identifier, t16) => ({
|
|
432
|
+
...buildNodeBase(t1, t2, expression, t4, condition1, t6, condition2, t8, condition3, t10, order, t12, sort, t14, identifier, t16),
|
|
433
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
434
|
+
controlType: nodes_1.ControlType.RADAR,
|
|
435
|
+
building: expression,
|
|
436
|
+
condition1: condition1.value,
|
|
437
|
+
condition2: condition2.value,
|
|
438
|
+
condition3: condition3.value,
|
|
439
|
+
order,
|
|
440
|
+
sort: sort.value,
|
|
441
|
+
result: identifier,
|
|
442
|
+
}));
|
|
443
|
+
g.item()
|
|
444
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
445
|
+
.source(lexer_1.TokenType.SENSOR)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
446
|
+
.factory((t1, t2, expression1, t4, expression2, t6, identifier, t8) => ({
|
|
447
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, identifier, t8),
|
|
448
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
449
|
+
controlType: nodes_1.ControlType.SENSOR,
|
|
450
|
+
target: expression1,
|
|
451
|
+
building: expression2,
|
|
452
|
+
result: identifier,
|
|
453
|
+
}));
|
|
454
|
+
g.item()
|
|
455
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
456
|
+
.source(lexer_1.TokenType.PACK_COLOR)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
457
|
+
.factory((t1, t2, result, t4, r, t6, g, t7, b, t8, a, t9) => ({
|
|
458
|
+
...buildNodeBase(t1, t2, result, t4, r, t6, g, t7, b, t8, a, t9),
|
|
459
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
460
|
+
controlType: nodes_1.ControlType.PACK_COLOR,
|
|
461
|
+
r,
|
|
462
|
+
g,
|
|
463
|
+
b,
|
|
464
|
+
a,
|
|
465
|
+
result,
|
|
466
|
+
}));
|
|
467
|
+
g.item()
|
|
468
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
469
|
+
.source(lexer_1.TokenType.WAIT)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
470
|
+
.factory((t1, t2, expression, t4) => ({
|
|
471
|
+
...buildNodeBase(t1, t2, expression, t4),
|
|
472
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
473
|
+
controlType: nodes_1.ControlType.WAIT,
|
|
474
|
+
time: expression,
|
|
475
|
+
}));
|
|
476
|
+
g.item()
|
|
477
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
478
|
+
.source(lexer_1.TokenType.CPU_STOP)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)
|
|
479
|
+
.factory((t1, t2, t3) => ({
|
|
480
|
+
...buildNodeBase(t1, t2, t3),
|
|
481
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
482
|
+
controlType: nodes_1.ControlType.CPU_STOP,
|
|
483
|
+
}));
|
|
484
|
+
g.item()
|
|
485
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
486
|
+
.source(lexer_1.TokenType.UNIT_BIND)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
487
|
+
.factory((t1, t2, expression, t4) => ({
|
|
488
|
+
...buildNodeBase(t1, t2, expression, t4),
|
|
489
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
490
|
+
controlType: nodes_1.ControlType.UNIT_BIND,
|
|
491
|
+
unit: expression,
|
|
492
|
+
}));
|
|
493
|
+
g.item()
|
|
494
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
495
|
+
.source(lexer_1.TokenType.UNIT_RADAR)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.RADAR_CONDITION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.RADAR_CONDITION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.RADAR_CONDITION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.RADAR_SORT_CONFIG)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
496
|
+
.factory((t1, t2, condition1, t4, condition2, t6, condition3, t8, order, t10, sort, t12, result, t14) => ({
|
|
497
|
+
...buildNodeBase(t1, t2, condition1, t4, condition2, t6, condition3, t8, order, t10, sort, t12, result, t14),
|
|
498
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
499
|
+
controlType: nodes_1.ControlType.UNIT_RADAR,
|
|
500
|
+
condition1: condition1.value,
|
|
501
|
+
condition2: condition2.value,
|
|
502
|
+
condition3: condition3.value,
|
|
503
|
+
order,
|
|
504
|
+
sort: sort.value,
|
|
505
|
+
result,
|
|
506
|
+
}));
|
|
507
|
+
g.item()
|
|
508
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
509
|
+
.source(lexer_1.TokenType.UNIT_LOCATE)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.ORE)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
510
|
+
.factory((t1, t2, t3, t4, expression, t6, outX, t8, outY, t10, found, t12) => ({
|
|
511
|
+
...buildNodeBase(t1, t2, t3, t4, expression, t6, outX, t8, outY, t10, found, t12),
|
|
512
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
513
|
+
controlType: nodes_1.ControlType.UNIT_LOCATE,
|
|
514
|
+
category: nodes_1.UnitLocateCategory.ORE,
|
|
515
|
+
target: expression,
|
|
516
|
+
outX,
|
|
517
|
+
outY,
|
|
518
|
+
found,
|
|
519
|
+
}));
|
|
520
|
+
g.item()
|
|
521
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
522
|
+
.source(lexer_1.TokenType.UNIT_LOCATE)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.BUILDING)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.UNIT_LOCATE_BUILDING_GROUP)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
523
|
+
.factory((t1, t2, t3, t4, group, t6, enemy, t8, outX, t10, outY, t12, found, t14, building, t16) => ({
|
|
524
|
+
...buildNodeBase(t1, t2, t3, t4, group, t6, enemy, t8, outX, t10, outY, t12, found, t14, building, t16),
|
|
525
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
526
|
+
controlType: nodes_1.ControlType.UNIT_LOCATE,
|
|
527
|
+
category: nodes_1.UnitLocateCategory.BUILDING,
|
|
528
|
+
group: group.value,
|
|
529
|
+
enemy,
|
|
530
|
+
outX,
|
|
531
|
+
outY,
|
|
532
|
+
found,
|
|
533
|
+
building,
|
|
534
|
+
}));
|
|
535
|
+
g.item()
|
|
536
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
537
|
+
.source(lexer_1.TokenType.UNIT_LOCATE)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.SPAWN)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
538
|
+
.factory((t1, t2, t3, t4, outX, t6, outY, t8, found, t10, building, t12) => ({
|
|
539
|
+
...buildNodeBase(t1, t2, t3, t4, outX, t6, outY, t8, found, t10, building, t12),
|
|
540
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
541
|
+
controlType: nodes_1.ControlType.UNIT_LOCATE,
|
|
542
|
+
category: nodes_1.UnitLocateCategory.SPAWN,
|
|
543
|
+
outX,
|
|
544
|
+
outY,
|
|
545
|
+
found,
|
|
546
|
+
building,
|
|
547
|
+
}));
|
|
548
|
+
g.item()
|
|
549
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
550
|
+
.source(lexer_1.TokenType.UNIT_LOCATE)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.DAMAGED)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
551
|
+
.factory((t1, t2, t3, t4, outX, t6, outY, t8, found, t10, building, t12) => ({
|
|
552
|
+
...buildNodeBase(t1, t2, t3, t4, outX, t6, outY, t8, found, t10, building, t12),
|
|
553
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
554
|
+
controlType: nodes_1.ControlType.UNIT_LOCATE,
|
|
555
|
+
category: nodes_1.UnitLocateCategory.DAMAGED,
|
|
556
|
+
outX,
|
|
557
|
+
outY,
|
|
558
|
+
found,
|
|
559
|
+
building,
|
|
560
|
+
}));
|
|
561
|
+
g.item()
|
|
562
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
563
|
+
.source(lexer_1.TokenType.IDLE)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)
|
|
564
|
+
.factory((t1, t2, t3) => ({
|
|
565
|
+
...buildNodeBase(t1, t2, t3),
|
|
566
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
567
|
+
controlType: nodes_1.ControlType.IDLE,
|
|
568
|
+
}));
|
|
569
|
+
g.item()
|
|
570
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
571
|
+
.source(lexer_1.TokenType.STOP)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)
|
|
572
|
+
.factory((t1, t2, t3) => ({
|
|
573
|
+
...buildNodeBase(t1, t2, t3),
|
|
574
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
575
|
+
controlType: nodes_1.ControlType.STOP,
|
|
576
|
+
}));
|
|
577
|
+
g.item()
|
|
578
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
579
|
+
.source(lexer_1.TokenType.MOVE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
580
|
+
.factory((t1, t2, expression1, t4, expression2, t6) => ({
|
|
581
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6),
|
|
582
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
583
|
+
controlType: nodes_1.ControlType.MOVE,
|
|
584
|
+
x: expression1,
|
|
585
|
+
y: expression2,
|
|
586
|
+
}));
|
|
587
|
+
g.item()
|
|
588
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
589
|
+
.source(lexer_1.TokenType.APPROACH)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
590
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8) => ({
|
|
591
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8),
|
|
592
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
593
|
+
controlType: nodes_1.ControlType.APPROACH,
|
|
594
|
+
x: expression1,
|
|
595
|
+
y: expression2,
|
|
596
|
+
distance: expression3,
|
|
597
|
+
}));
|
|
598
|
+
g.item()
|
|
599
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
600
|
+
.source(lexer_1.TokenType.PATH_FIND)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
601
|
+
.factory((t1, t2, expression1, t4, expression2, t6) => ({
|
|
602
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6),
|
|
603
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
604
|
+
controlType: nodes_1.ControlType.PATH_FIND,
|
|
605
|
+
x: expression1,
|
|
606
|
+
y: expression2,
|
|
607
|
+
}));
|
|
608
|
+
g.item()
|
|
609
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
610
|
+
.source(lexer_1.TokenType.AUTO_PATH_FIND)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)
|
|
611
|
+
.factory((t1, t2, t3) => ({
|
|
612
|
+
...buildNodeBase(t1, t2, t3),
|
|
613
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
614
|
+
controlType: nodes_1.ControlType.AUTO_PATH_FIND,
|
|
615
|
+
}));
|
|
616
|
+
g.item()
|
|
617
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
618
|
+
.source(lexer_1.TokenType.BOOST)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
619
|
+
.factory((t1, t2, expression, t4) => ({
|
|
620
|
+
...buildNodeBase(t1, t2, expression, t4),
|
|
621
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
622
|
+
controlType: nodes_1.ControlType.BOOST,
|
|
623
|
+
enabled: expression,
|
|
624
|
+
}));
|
|
625
|
+
g.item()
|
|
626
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
627
|
+
.source(lexer_1.TokenType.TARGET)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
628
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8) => ({
|
|
629
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8),
|
|
630
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
631
|
+
controlType: nodes_1.ControlType.TARGET,
|
|
632
|
+
x: expression1,
|
|
633
|
+
y: expression2,
|
|
634
|
+
shoot: expression3,
|
|
635
|
+
}));
|
|
636
|
+
g.item()
|
|
637
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
638
|
+
.source(lexer_1.TokenType.TARGET_P)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
639
|
+
.factory((t1, t2, expression1, t4, expression2, t6) => ({
|
|
640
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6),
|
|
641
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
642
|
+
controlType: nodes_1.ControlType.TARGET_P,
|
|
643
|
+
unit: expression1,
|
|
644
|
+
shoot: expression2,
|
|
645
|
+
}));
|
|
646
|
+
g.item()
|
|
647
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
648
|
+
.source(lexer_1.TokenType.ITEM_DROP)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
649
|
+
.factory((t1, t2, expression1, t4, expression2, t6) => ({
|
|
650
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6),
|
|
651
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
652
|
+
controlType: nodes_1.ControlType.ITEM_DROP,
|
|
653
|
+
building: expression1,
|
|
654
|
+
amount: expression2,
|
|
655
|
+
}));
|
|
656
|
+
g.item()
|
|
657
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
658
|
+
.source(lexer_1.TokenType.ITEM_TAKE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
659
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8) => ({
|
|
660
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8),
|
|
661
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
662
|
+
controlType: nodes_1.ControlType.ITEM_TAKE,
|
|
663
|
+
building: expression1,
|
|
664
|
+
item: expression2,
|
|
665
|
+
amount: expression3,
|
|
666
|
+
}));
|
|
667
|
+
g.item()
|
|
668
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
669
|
+
.source(lexer_1.TokenType.PAY_DROP)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)
|
|
670
|
+
.factory((t1, t2, t3) => ({
|
|
671
|
+
...buildNodeBase(t1, t2, t3),
|
|
672
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
673
|
+
controlType: nodes_1.ControlType.PAY_DROP,
|
|
674
|
+
}));
|
|
675
|
+
g.item()
|
|
676
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
677
|
+
.source(lexer_1.TokenType.PAY_TAKE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
678
|
+
.factory((t1, t2, takeUnits, t4) => ({
|
|
679
|
+
...buildNodeBase(t1, t2, takeUnits, t4),
|
|
680
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
681
|
+
controlType: nodes_1.ControlType.PAY_TAKE,
|
|
682
|
+
takeUnits,
|
|
683
|
+
}));
|
|
684
|
+
g.item()
|
|
685
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
686
|
+
.source(lexer_1.TokenType.PAY_ENTER)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)
|
|
687
|
+
.factory((t1, t2, t3) => ({
|
|
688
|
+
...buildNodeBase(t1, t2, t3),
|
|
689
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
690
|
+
controlType: nodes_1.ControlType.PAY_ENTER,
|
|
691
|
+
}));
|
|
692
|
+
g.item()
|
|
693
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
694
|
+
.source(lexer_1.TokenType.MINE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
695
|
+
.factory((t1, t2, expression1, t4, expression2, t6) => ({
|
|
696
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6),
|
|
697
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
698
|
+
controlType: nodes_1.ControlType.MINE,
|
|
699
|
+
x: expression1,
|
|
700
|
+
y: expression2,
|
|
701
|
+
}));
|
|
702
|
+
g.item()
|
|
703
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
704
|
+
.source(lexer_1.TokenType.FLAG)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
705
|
+
.factory((t1, t2, flag, t4) => ({
|
|
706
|
+
...buildNodeBase(t1, t2, flag, t4),
|
|
707
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
708
|
+
controlType: nodes_1.ControlType.FLAG,
|
|
709
|
+
flag,
|
|
710
|
+
}));
|
|
711
|
+
g.item()
|
|
712
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
713
|
+
.source(lexer_1.TokenType.BUILD)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
714
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12) => ({
|
|
715
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, expression4, t10, expression5, t12),
|
|
716
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
717
|
+
controlType: nodes_1.ControlType.BUILD,
|
|
718
|
+
x: expression1,
|
|
719
|
+
y: expression2,
|
|
720
|
+
block: expression3,
|
|
721
|
+
rotation: expression4,
|
|
722
|
+
config: expression5,
|
|
723
|
+
}));
|
|
724
|
+
g.item()
|
|
725
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
726
|
+
.source(lexer_1.TokenType.GET_BLOCK)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
727
|
+
.factory((t1, t2, expression1, t4, expression2, t6, outType, t8, building, t10, floor, t12) => ({
|
|
728
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, outType, t8, building, t10, floor, t12),
|
|
729
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
730
|
+
controlType: nodes_1.ControlType.GET_BLOCK,
|
|
731
|
+
x: expression1,
|
|
732
|
+
y: expression2,
|
|
733
|
+
outType,
|
|
734
|
+
building,
|
|
735
|
+
floor,
|
|
736
|
+
}));
|
|
737
|
+
g.item()
|
|
738
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
739
|
+
.source(lexer_1.TokenType.WITHIN)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.R_PAREN)
|
|
740
|
+
.factory((t1, t2, expression1, t4, expression2, t6, expression3, t8, result, t10) => ({
|
|
741
|
+
...buildNodeBase(t1, t2, expression1, t4, expression2, t6, expression3, t8, result, t10),
|
|
742
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
743
|
+
controlType: nodes_1.ControlType.WITHIN,
|
|
744
|
+
x: expression1,
|
|
745
|
+
y: expression2,
|
|
746
|
+
radius: expression3,
|
|
747
|
+
result,
|
|
748
|
+
}));
|
|
749
|
+
g.item()
|
|
750
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
751
|
+
.source(lexer_1.TokenType.UNBIND)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)
|
|
752
|
+
.factory((t1, t2, t3) => ({
|
|
753
|
+
...buildNodeBase(t1, t2, t3),
|
|
754
|
+
statementType: nodes_1.StatementType.CONTROL,
|
|
755
|
+
controlType: nodes_1.ControlType.UNBIND,
|
|
756
|
+
}));
|
|
757
|
+
g.item()
|
|
758
|
+
.target(nodes_1.NodeType.RADAR_CONDITION)
|
|
759
|
+
.source(lexer_1.TokenType.ANY)
|
|
760
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarCondition.ANY }));
|
|
761
|
+
g.item()
|
|
762
|
+
.target(nodes_1.NodeType.RADAR_CONDITION)
|
|
763
|
+
.source(lexer_1.TokenType.ENEMY)
|
|
764
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarCondition.ENEMY }));
|
|
765
|
+
g.item()
|
|
766
|
+
.target(nodes_1.NodeType.RADAR_CONDITION)
|
|
767
|
+
.source(lexer_1.TokenType.ALLY)
|
|
768
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarCondition.ALLY }));
|
|
769
|
+
g.item()
|
|
770
|
+
.target(nodes_1.NodeType.RADAR_CONDITION)
|
|
771
|
+
.source(lexer_1.TokenType.PLAYER)
|
|
772
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarCondition.PLAYER }));
|
|
773
|
+
g.item()
|
|
774
|
+
.target(nodes_1.NodeType.RADAR_CONDITION)
|
|
775
|
+
.source(lexer_1.TokenType.ATTACKER)
|
|
776
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarCondition.ATTACKER }));
|
|
777
|
+
g.item()
|
|
778
|
+
.target(nodes_1.NodeType.RADAR_CONDITION)
|
|
779
|
+
.source(lexer_1.TokenType.FLYING)
|
|
780
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarCondition.FLYING }));
|
|
781
|
+
g.item()
|
|
782
|
+
.target(nodes_1.NodeType.RADAR_CONDITION)
|
|
783
|
+
.source(lexer_1.TokenType.BOSS)
|
|
784
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarCondition.BOSS }));
|
|
785
|
+
g.item()
|
|
786
|
+
.target(nodes_1.NodeType.RADAR_CONDITION)
|
|
787
|
+
.source(lexer_1.TokenType.GROUND)
|
|
788
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarCondition.GROUND }));
|
|
789
|
+
g.item()
|
|
790
|
+
.target(nodes_1.NodeType.RADAR_SORT_CONFIG)
|
|
791
|
+
.source(lexer_1.TokenType.DISTANCE)
|
|
792
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarSortConfig.DISTANCE }));
|
|
793
|
+
g.item()
|
|
794
|
+
.target(nodes_1.NodeType.RADAR_SORT_CONFIG)
|
|
795
|
+
.source(lexer_1.TokenType.HEALTH)
|
|
796
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarSortConfig.HEALTH }));
|
|
797
|
+
g.item()
|
|
798
|
+
.target(nodes_1.NodeType.RADAR_SORT_CONFIG)
|
|
799
|
+
.source(lexer_1.TokenType.SHIELD)
|
|
800
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarSortConfig.SHIELD }));
|
|
801
|
+
g.item()
|
|
802
|
+
.target(nodes_1.NodeType.RADAR_SORT_CONFIG)
|
|
803
|
+
.source(lexer_1.TokenType.ARMOR)
|
|
804
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarSortConfig.ARMOR }));
|
|
805
|
+
g.item()
|
|
806
|
+
.target(nodes_1.NodeType.RADAR_SORT_CONFIG)
|
|
807
|
+
.source(lexer_1.TokenType.MAX_HEALTH)
|
|
808
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.RadarSortConfig.MAX_HEALTH }));
|
|
809
|
+
g.item()
|
|
810
|
+
.target(nodes_1.NodeType.UNIT_LOCATE_BUILDING_GROUP)
|
|
811
|
+
.source(lexer_1.TokenType.CORE)
|
|
812
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.UnitLocateBuildingGroup.CORE }));
|
|
813
|
+
g.item()
|
|
814
|
+
.target(nodes_1.NodeType.UNIT_LOCATE_BUILDING_GROUP)
|
|
815
|
+
.source(lexer_1.TokenType.STORAGE)
|
|
816
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.UnitLocateBuildingGroup.STORAGE }));
|
|
817
|
+
g.item()
|
|
818
|
+
.target(nodes_1.NodeType.UNIT_LOCATE_BUILDING_GROUP)
|
|
819
|
+
.source(lexer_1.TokenType.GENERATOR)
|
|
820
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.UnitLocateBuildingGroup.GENERATOR }));
|
|
821
|
+
g.item()
|
|
822
|
+
.target(nodes_1.NodeType.UNIT_LOCATE_BUILDING_GROUP)
|
|
823
|
+
.source(lexer_1.TokenType.TURRET)
|
|
824
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.UnitLocateBuildingGroup.TURRET }));
|
|
825
|
+
g.item()
|
|
826
|
+
.target(nodes_1.NodeType.UNIT_LOCATE_BUILDING_GROUP)
|
|
827
|
+
.source(lexer_1.TokenType.FACTORY)
|
|
828
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.UnitLocateBuildingGroup.FACTORY }));
|
|
829
|
+
g.item()
|
|
830
|
+
.target(nodes_1.NodeType.UNIT_LOCATE_BUILDING_GROUP)
|
|
831
|
+
.source(lexer_1.TokenType.REPAIR)
|
|
832
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.UnitLocateBuildingGroup.REPAIR }));
|
|
833
|
+
g.item()
|
|
834
|
+
.target(nodes_1.NodeType.UNIT_LOCATE_BUILDING_GROUP)
|
|
835
|
+
.source(lexer_1.TokenType.BATTERY)
|
|
836
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.UnitLocateBuildingGroup.BATTERY }));
|
|
837
|
+
g.item()
|
|
838
|
+
.target(nodes_1.NodeType.UNIT_LOCATE_BUILDING_GROUP)
|
|
839
|
+
.source(lexer_1.TokenType.REACTOR)
|
|
840
|
+
.factory((t1) => ({ ...buildNodeBase(t1), value: nodes_1.UnitLocateBuildingGroup.REACTOR }));
|
|
841
|
+
g.item()
|
|
842
|
+
.target(nodes_1.NodeType.CODE_BLOCK)
|
|
843
|
+
.source(lexer_1.TokenType.L_BRACE)(nodes_1.NodeType.STATEMENT_LIST)(lexer_1.TokenType.R_BRACE)
|
|
844
|
+
.factory((t1, statementList, t3) => {
|
|
845
|
+
const statements = [];
|
|
846
|
+
let current = statementList;
|
|
847
|
+
while (current) {
|
|
848
|
+
statements.push(current.first);
|
|
849
|
+
current = current.other;
|
|
850
|
+
}
|
|
851
|
+
return {
|
|
852
|
+
...buildNodeBase(t1, statementList, t3),
|
|
853
|
+
statements,
|
|
854
|
+
};
|
|
855
|
+
});
|
|
856
|
+
g.item()
|
|
857
|
+
.target(nodes_1.NodeType.CODE_BLOCK)
|
|
858
|
+
.source(lexer_1.TokenType.L_BRACE)(lexer_1.TokenType.R_BRACE)
|
|
859
|
+
.factory((t1, t2) => ({
|
|
860
|
+
...buildNodeBase(t1, t2),
|
|
861
|
+
statements: [],
|
|
862
|
+
}));
|
|
863
|
+
g.item()
|
|
864
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
865
|
+
.source(lexer_1.TokenType.MACRO)(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.MACRO_PARAM_LIST)(lexer_1.TokenType.R_PAREN)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.MACRO_PARAM_LIST)(lexer_1.TokenType.R_PAREN)(nodes_1.NodeType.CODE_BLOCK)
|
|
866
|
+
.factory((t1, t2, t3, paramList1, t5, t6, paramList2, t8, codeBlock) => {
|
|
867
|
+
const inputParams = [];
|
|
868
|
+
const outputParams = [];
|
|
869
|
+
let currentInput = paramList1;
|
|
870
|
+
while (currentInput) {
|
|
871
|
+
inputParams.push(currentInput.first.value);
|
|
872
|
+
currentInput = currentInput.other;
|
|
873
|
+
}
|
|
874
|
+
let currentOutput = paramList2;
|
|
875
|
+
while (currentOutput) {
|
|
876
|
+
outputParams.push(currentOutput.first.value);
|
|
877
|
+
currentOutput = currentOutput.other;
|
|
878
|
+
}
|
|
879
|
+
return {
|
|
880
|
+
...buildNodeBase(t1, t2, t3, paramList1, t5, t6, paramList2, t8, codeBlock),
|
|
881
|
+
statementType: nodes_1.StatementType.MACRO_DEFINE,
|
|
882
|
+
name: t2.raw,
|
|
883
|
+
inputParams,
|
|
884
|
+
outputParams,
|
|
885
|
+
body: codeBlock.statements,
|
|
886
|
+
};
|
|
887
|
+
});
|
|
888
|
+
g.item()
|
|
889
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
890
|
+
.source(lexer_1.TokenType.MACRO)(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.MACRO_PARAM_LIST)(lexer_1.TokenType.R_PAREN)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)(nodes_1.NodeType.CODE_BLOCK)
|
|
891
|
+
.factory((t1, t2, t3, paramList, t5, t6, t7, codeBlock) => {
|
|
892
|
+
const inputParams = [];
|
|
893
|
+
let currentInput = paramList;
|
|
894
|
+
while (currentInput) {
|
|
895
|
+
inputParams.push(currentInput.first.value);
|
|
896
|
+
currentInput = currentInput.other;
|
|
897
|
+
}
|
|
898
|
+
return {
|
|
899
|
+
...buildNodeBase(t1, t2, t3, paramList, t5, t6, t7, codeBlock),
|
|
900
|
+
statementType: nodes_1.StatementType.MACRO_DEFINE,
|
|
901
|
+
name: t2.raw,
|
|
902
|
+
inputParams,
|
|
903
|
+
outputParams: [],
|
|
904
|
+
body: codeBlock.statements,
|
|
905
|
+
};
|
|
906
|
+
});
|
|
907
|
+
g.item()
|
|
908
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
909
|
+
.source(lexer_1.TokenType.MACRO)(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.MACRO_PARAM_LIST)(lexer_1.TokenType.R_PAREN)(nodes_1.NodeType.CODE_BLOCK)
|
|
910
|
+
.factory((t1, t2, t3, t4, t5, paramList, t7, codeBlock) => {
|
|
911
|
+
const outputParams = [];
|
|
912
|
+
let currentOutput = paramList;
|
|
913
|
+
while (currentOutput) {
|
|
914
|
+
outputParams.push(currentOutput.first.value);
|
|
915
|
+
currentOutput = currentOutput.other;
|
|
916
|
+
}
|
|
917
|
+
return {
|
|
918
|
+
...buildNodeBase(t1, t2, t3, t4, t5, paramList, t7, codeBlock),
|
|
919
|
+
statementType: nodes_1.StatementType.MACRO_DEFINE,
|
|
920
|
+
name: t2.raw,
|
|
921
|
+
inputParams: [],
|
|
922
|
+
outputParams,
|
|
923
|
+
body: codeBlock.statements,
|
|
924
|
+
};
|
|
925
|
+
});
|
|
926
|
+
g.item()
|
|
927
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
928
|
+
.source(lexer_1.TokenType.MACRO)(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)(nodes_1.NodeType.CODE_BLOCK)
|
|
929
|
+
.factory((t1, t2, t3, t4, t5, t6, codeBlock) => ({
|
|
930
|
+
...buildNodeBase(t1, t2, t3, t4, t5, t6, codeBlock),
|
|
931
|
+
statementType: nodes_1.StatementType.MACRO_DEFINE,
|
|
932
|
+
name: t2.raw,
|
|
933
|
+
inputParams: [],
|
|
934
|
+
outputParams: [],
|
|
935
|
+
body: codeBlock.statements,
|
|
936
|
+
}));
|
|
937
|
+
g.item()
|
|
938
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
939
|
+
.source(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.MACRO_ARG_LIST)(lexer_1.TokenType.R_PAREN)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.MACRO_PARAM_LIST)(lexer_1.TokenType.R_PAREN)
|
|
940
|
+
.factory((t1, t2, argList, t4, t5, paramList, t7) => {
|
|
941
|
+
const inputArgs = [];
|
|
942
|
+
const outputArgs = [];
|
|
943
|
+
let currentArg = argList;
|
|
944
|
+
while (currentArg) {
|
|
945
|
+
inputArgs.push(currentArg.first);
|
|
946
|
+
currentArg = currentArg.other;
|
|
947
|
+
}
|
|
948
|
+
let currentParam = paramList;
|
|
949
|
+
while (currentParam) {
|
|
950
|
+
outputArgs.push(currentParam.first);
|
|
951
|
+
currentParam = currentParam.other;
|
|
952
|
+
}
|
|
953
|
+
return {
|
|
954
|
+
...buildNodeBase(t1, t2, argList, t4, t5, paramList, t7),
|
|
955
|
+
statementType: nodes_1.StatementType.MACRO_CALL,
|
|
956
|
+
name: t1.raw,
|
|
957
|
+
inputArgs,
|
|
958
|
+
outputArgs,
|
|
959
|
+
};
|
|
960
|
+
});
|
|
961
|
+
g.item()
|
|
962
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
963
|
+
.source(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.MACRO_ARG_LIST)(lexer_1.TokenType.R_PAREN)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)
|
|
964
|
+
.factory((t1, t2, argList, t4, t5, t6) => {
|
|
965
|
+
const inputArgs = [];
|
|
966
|
+
let currentArg = argList;
|
|
967
|
+
while (currentArg) {
|
|
968
|
+
inputArgs.push(currentArg.first);
|
|
969
|
+
currentArg = currentArg.other;
|
|
970
|
+
}
|
|
971
|
+
return {
|
|
972
|
+
...buildNodeBase(t1, t2, argList, t4, t5, t6),
|
|
973
|
+
statementType: nodes_1.StatementType.MACRO_CALL,
|
|
974
|
+
name: t1.raw,
|
|
975
|
+
inputArgs,
|
|
976
|
+
outputArgs: [],
|
|
977
|
+
};
|
|
978
|
+
});
|
|
979
|
+
g.item()
|
|
980
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
981
|
+
.source(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)
|
|
982
|
+
.factory((t1, t2, t3, t4, t5) => ({
|
|
983
|
+
...buildNodeBase(t1, t2, t3, t4, t5),
|
|
984
|
+
statementType: nodes_1.StatementType.MACRO_CALL,
|
|
985
|
+
name: t1.raw,
|
|
986
|
+
inputArgs: [],
|
|
987
|
+
outputArgs: [],
|
|
988
|
+
}));
|
|
989
|
+
g.item()
|
|
990
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
991
|
+
.source(lexer_1.TokenType.IDENTIFIER)(lexer_1.TokenType.L_PAREN)(lexer_1.TokenType.R_PAREN)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.MACRO_PARAM_LIST)(lexer_1.TokenType.R_PAREN)
|
|
992
|
+
.factory((t1, t2, t3, t4, paramList, t6) => {
|
|
993
|
+
const outputArgs = [];
|
|
994
|
+
let currentParam = paramList;
|
|
995
|
+
while (currentParam) {
|
|
996
|
+
outputArgs.push(currentParam.first);
|
|
997
|
+
currentParam = currentParam.other;
|
|
998
|
+
}
|
|
999
|
+
return {
|
|
1000
|
+
...buildNodeBase(t1, t2, t3, t4, paramList, t6),
|
|
1001
|
+
statementType: nodes_1.StatementType.MACRO_CALL,
|
|
1002
|
+
name: t1.raw,
|
|
1003
|
+
inputArgs: [],
|
|
1004
|
+
outputArgs,
|
|
1005
|
+
};
|
|
1006
|
+
});
|
|
1007
|
+
g.item()
|
|
1008
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT_BODY)
|
|
1009
|
+
.source(nodes_1.NodeType.STATEMENT)
|
|
1010
|
+
.factory((statement) => ({
|
|
1011
|
+
...buildNodeBase(statement),
|
|
1012
|
+
statements: [statement],
|
|
1013
|
+
}));
|
|
1014
|
+
g.item()
|
|
1015
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT_BODY)
|
|
1016
|
+
.source(nodes_1.NodeType.CODE_BLOCK)
|
|
1017
|
+
.factory((codeBlock) => ({
|
|
1018
|
+
...buildNodeBase(codeBlock),
|
|
1019
|
+
statements: codeBlock.statements,
|
|
1020
|
+
}));
|
|
1021
|
+
g.item()
|
|
1022
|
+
.target(nodes_1.NodeType.MACRO_PARAM_LIST)
|
|
1023
|
+
.source(nodes_1.NodeType.IDENTIFIER_EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.MACRO_PARAM_LIST)
|
|
1024
|
+
.factory((identifier, t2, paramList) => ({
|
|
1025
|
+
...buildNodeBase(identifier, t2, paramList),
|
|
1026
|
+
first: identifier,
|
|
1027
|
+
other: paramList,
|
|
1028
|
+
}));
|
|
1029
|
+
g.item()
|
|
1030
|
+
.target(nodes_1.NodeType.MACRO_PARAM_LIST)
|
|
1031
|
+
.source(nodes_1.NodeType.IDENTIFIER_EXPRESSION)
|
|
1032
|
+
.factory((identifier) => ({
|
|
1033
|
+
...buildNodeBase(identifier),
|
|
1034
|
+
first: identifier,
|
|
1035
|
+
other: undefined,
|
|
1036
|
+
}));
|
|
1037
|
+
g.item()
|
|
1038
|
+
.target(nodes_1.NodeType.MACRO_ARG_LIST)
|
|
1039
|
+
.source(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.COMMA)(nodes_1.NodeType.MACRO_ARG_LIST)
|
|
1040
|
+
.factory((expression, t2, argList) => ({
|
|
1041
|
+
...buildNodeBase(expression, t2, argList),
|
|
1042
|
+
first: expression,
|
|
1043
|
+
other: argList,
|
|
1044
|
+
}));
|
|
1045
|
+
g.item()
|
|
1046
|
+
.target(nodes_1.NodeType.MACRO_ARG_LIST)
|
|
1047
|
+
.source(nodes_1.NodeType.EXPRESSION)
|
|
1048
|
+
.factory((expression) => ({
|
|
1049
|
+
...buildNodeBase(expression),
|
|
1050
|
+
first: expression,
|
|
1051
|
+
other: undefined,
|
|
1052
|
+
}));
|
|
1053
|
+
g.item()
|
|
1054
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
1055
|
+
.source(lexer_1.TokenType.IF)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)(nodes_1.NodeType.BLOCK_STATEMENT_BODY)(lexer_1.TokenType.ELSE)(nodes_1.NodeType.BLOCK_STATEMENT_BODY)
|
|
1056
|
+
.factory((t1, t2, condition, t4, trueBranch, t6, falseBranch) => ({
|
|
1057
|
+
...buildNodeBase(t1, t2, condition, t4, trueBranch, t6, falseBranch),
|
|
1058
|
+
statementType: nodes_1.StatementType.IF_ELSE,
|
|
1059
|
+
condition,
|
|
1060
|
+
ifBody: trueBranch.statements,
|
|
1061
|
+
elseBody: falseBranch.statements,
|
|
1062
|
+
}));
|
|
1063
|
+
g.item()
|
|
1064
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
1065
|
+
.source(lexer_1.TokenType.IF)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)(nodes_1.NodeType.BLOCK_STATEMENT_BODY)
|
|
1066
|
+
.factory((t1, t2, condition, t4, trueBranch) => ({
|
|
1067
|
+
...buildNodeBase(t1, t2, condition, t4, trueBranch),
|
|
1068
|
+
statementType: nodes_1.StatementType.IF,
|
|
1069
|
+
condition,
|
|
1070
|
+
ifBody: trueBranch.statements,
|
|
1071
|
+
}));
|
|
1072
|
+
g.item()
|
|
1073
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
1074
|
+
.source(lexer_1.TokenType.FOR)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.SINGLE_STATEMENT)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.SEMICOLON)(nodes_1.NodeType.STATEMENT_BODY)(lexer_1.TokenType.R_PAREN)(nodes_1.NodeType.BLOCK_STATEMENT_BODY)
|
|
1075
|
+
.factory((t1, t2, init, condition, t5, increment, t7, body) => ({
|
|
1076
|
+
...buildNodeBase(t1, t2, init, condition, t5, increment, t7, body),
|
|
1077
|
+
statementType: nodes_1.StatementType.FOR,
|
|
1078
|
+
init: { ...init, type: nodes_1.NodeType.STATEMENT },
|
|
1079
|
+
condition,
|
|
1080
|
+
increment: { ...increment, type: nodes_1.NodeType.STATEMENT },
|
|
1081
|
+
body: body.statements,
|
|
1082
|
+
}));
|
|
1083
|
+
g.item()
|
|
1084
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
1085
|
+
.source(lexer_1.TokenType.FOR)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.SINGLE_STATEMENT)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.SEMICOLON)(lexer_1.TokenType.R_PAREN)(nodes_1.NodeType.BLOCK_STATEMENT_BODY)
|
|
1086
|
+
.factory((t1, t2, init, condition, t5, t6, body) => ({
|
|
1087
|
+
...buildNodeBase(t1, t2, init, condition, t5, t6, body),
|
|
1088
|
+
statementType: nodes_1.StatementType.FOR,
|
|
1089
|
+
init: { ...init, type: nodes_1.NodeType.STATEMENT },
|
|
1090
|
+
condition,
|
|
1091
|
+
increment: undefined,
|
|
1092
|
+
body: body.statements,
|
|
1093
|
+
}));
|
|
1094
|
+
g.item()
|
|
1095
|
+
.target(nodes_1.NodeType.BLOCK_STATEMENT)
|
|
1096
|
+
.source(lexer_1.TokenType.WHILE)(lexer_1.TokenType.L_PAREN)(nodes_1.NodeType.EXPRESSION)(lexer_1.TokenType.R_PAREN)(nodes_1.NodeType.BLOCK_STATEMENT_BODY)
|
|
1097
|
+
.factory((t1, t2, condition, t4, body) => ({
|
|
1098
|
+
...buildNodeBase(t1, t2, condition, t4, body),
|
|
1099
|
+
statementType: nodes_1.StatementType.WHILE,
|
|
1100
|
+
condition,
|
|
1101
|
+
body: body.statements,
|
|
1102
|
+
}));
|
|
1103
|
+
g.item()
|
|
1104
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
1105
|
+
.source(lexer_1.TokenType.CONTINUE)
|
|
1106
|
+
.factory((t) => ({
|
|
1107
|
+
...buildNodeBase(t),
|
|
1108
|
+
statementType: nodes_1.StatementType.LOOP_CONTROL,
|
|
1109
|
+
controlType: nodes_1.LoopControlType.CONTINUE,
|
|
1110
|
+
}));
|
|
1111
|
+
g.item()
|
|
1112
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
1113
|
+
.source(lexer_1.TokenType.BREAK)
|
|
1114
|
+
.factory((t) => ({
|
|
1115
|
+
...buildNodeBase(t),
|
|
1116
|
+
statementType: nodes_1.StatementType.LOOP_CONTROL,
|
|
1117
|
+
controlType: nodes_1.LoopControlType.BREAK,
|
|
1118
|
+
}));
|
|
1119
|
+
g.item()
|
|
1120
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
1121
|
+
.source(lexer_1.TokenType.RETURN)(nodes_1.NodeType.EXPRESSION)
|
|
1122
|
+
.factory((t, expression) => ({
|
|
1123
|
+
...buildNodeBase(t, expression),
|
|
1124
|
+
statementType: nodes_1.StatementType.RETURN,
|
|
1125
|
+
expression,
|
|
1126
|
+
}));
|
|
1127
|
+
g.item()
|
|
1128
|
+
.target(nodes_1.NodeType.STATEMENT_BODY)
|
|
1129
|
+
.source(lexer_1.TokenType.BIND)(lexer_1.TokenType.IDENTIFIER)
|
|
1130
|
+
.factory((t, identifier) => ({
|
|
1131
|
+
...buildNodeBase(t, identifier),
|
|
1132
|
+
statementType: nodes_1.StatementType.BIND,
|
|
1133
|
+
variableName: identifier.raw,
|
|
1134
|
+
}));
|
|
1135
|
+
g.item()
|
|
1136
|
+
.target(nodes_1.NodeType.IDENTIFIER_EXPRESSION)
|
|
1137
|
+
.source(lexer_1.TokenType.IDENTIFIER)
|
|
1138
|
+
.factory((t) => ({
|
|
1139
|
+
...buildNodeBase(t),
|
|
1140
|
+
value: t.raw,
|
|
1141
|
+
identifierType: nodes_1.IdentifierType.SIMPLE,
|
|
1142
|
+
isMindustry: false,
|
|
1143
|
+
}));
|
|
1144
|
+
g.item()
|
|
1145
|
+
.target(nodes_1.NodeType.IDENTIFIER_EXPRESSION)
|
|
1146
|
+
.source(lexer_1.TokenType.LET)(lexer_1.TokenType.IDENTIFIER)
|
|
1147
|
+
.factory((t, name) => ({
|
|
1148
|
+
...buildNodeBase(t, name),
|
|
1149
|
+
value: name.raw,
|
|
1150
|
+
identifierType: nodes_1.IdentifierType.LET,
|
|
1151
|
+
isMindustry: false,
|
|
1152
|
+
}));
|
|
1153
|
+
g.item()
|
|
1154
|
+
.target(nodes_1.NodeType.IDENTIFIER_EXPRESSION)
|
|
1155
|
+
.source(lexer_1.TokenType.CONST)(lexer_1.TokenType.IDENTIFIER)
|
|
1156
|
+
.factory((t, name) => ({
|
|
1157
|
+
...buildNodeBase(t, name),
|
|
1158
|
+
value: name.raw,
|
|
1159
|
+
identifierType: nodes_1.IdentifierType.CONST,
|
|
1160
|
+
isMindustry: false,
|
|
1161
|
+
}));
|
|
1162
|
+
g.item()
|
|
1163
|
+
.target(nodes_1.NodeType.IDENTIFIER_EXPRESSION)
|
|
1164
|
+
.source(lexer_1.TokenType.MINDUSTRY_IDENTIFIER)
|
|
1165
|
+
.factory((t) => ({
|
|
1166
|
+
...buildNodeBase(t),
|
|
1167
|
+
value: t.raw,
|
|
1168
|
+
isMindustry: true,
|
|
1169
|
+
}));
|
|
1170
|
+
g.item()
|
|
1171
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1172
|
+
.source(lexer_1.TokenType.ASSIGN)
|
|
1173
|
+
.factory((t) => ({
|
|
1174
|
+
...buildNodeBase(t),
|
|
1175
|
+
assignType: nodes_1.AssignType.SIMPLE,
|
|
1176
|
+
}));
|
|
1177
|
+
g.item()
|
|
1178
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1179
|
+
.source(lexer_1.TokenType.ADD_ASSIGN)
|
|
1180
|
+
.factory((t) => ({
|
|
1181
|
+
...buildNodeBase(t),
|
|
1182
|
+
assignType: nodes_1.AssignType.ADD,
|
|
1183
|
+
}));
|
|
1184
|
+
g.item()
|
|
1185
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1186
|
+
.source(lexer_1.TokenType.SUB_ASSIGN)
|
|
1187
|
+
.factory((t) => ({
|
|
1188
|
+
...buildNodeBase(t),
|
|
1189
|
+
assignType: nodes_1.AssignType.SUB,
|
|
1190
|
+
}));
|
|
1191
|
+
g.item()
|
|
1192
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1193
|
+
.source(lexer_1.TokenType.MUL_ASSIGN)
|
|
1194
|
+
.factory((t) => ({
|
|
1195
|
+
...buildNodeBase(t),
|
|
1196
|
+
assignType: nodes_1.AssignType.MUL,
|
|
1197
|
+
}));
|
|
1198
|
+
g.item()
|
|
1199
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1200
|
+
.source(lexer_1.TokenType.DIV_ASSIGN)
|
|
1201
|
+
.factory((t) => ({
|
|
1202
|
+
...buildNodeBase(t),
|
|
1203
|
+
assignType: nodes_1.AssignType.DIV,
|
|
1204
|
+
}));
|
|
1205
|
+
g.item()
|
|
1206
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1207
|
+
.source(lexer_1.TokenType.IDIV_ASSIGN)
|
|
1208
|
+
.factory((t) => ({
|
|
1209
|
+
...buildNodeBase(t),
|
|
1210
|
+
assignType: nodes_1.AssignType.IDIV,
|
|
1211
|
+
}));
|
|
1212
|
+
g.item()
|
|
1213
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1214
|
+
.source(lexer_1.TokenType.MOD_ASSIGN)
|
|
1215
|
+
.factory((t) => ({
|
|
1216
|
+
...buildNodeBase(t),
|
|
1217
|
+
assignType: nodes_1.AssignType.MOD,
|
|
1218
|
+
}));
|
|
1219
|
+
g.item()
|
|
1220
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1221
|
+
.source(lexer_1.TokenType.POW_ASSIGN)
|
|
1222
|
+
.factory((t) => ({
|
|
1223
|
+
...buildNodeBase(t),
|
|
1224
|
+
assignType: nodes_1.AssignType.POW,
|
|
1225
|
+
}));
|
|
1226
|
+
g.item()
|
|
1227
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1228
|
+
.source(lexer_1.TokenType.AND_ASSIGN)
|
|
1229
|
+
.factory((t) => ({
|
|
1230
|
+
...buildNodeBase(t),
|
|
1231
|
+
assignType: nodes_1.AssignType.AND,
|
|
1232
|
+
}));
|
|
1233
|
+
g.item()
|
|
1234
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1235
|
+
.source(lexer_1.TokenType.SHL_ASSIGN)
|
|
1236
|
+
.factory((t) => ({
|
|
1237
|
+
...buildNodeBase(t),
|
|
1238
|
+
assignType: nodes_1.AssignType.SHL,
|
|
1239
|
+
}));
|
|
1240
|
+
g.item()
|
|
1241
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1242
|
+
.source(lexer_1.TokenType.SHR_ASSIGN)
|
|
1243
|
+
.factory((t) => ({
|
|
1244
|
+
...buildNodeBase(t),
|
|
1245
|
+
assignType: nodes_1.AssignType.SHR,
|
|
1246
|
+
}));
|
|
1247
|
+
g.item()
|
|
1248
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1249
|
+
.source(lexer_1.TokenType.BITAND_ASSIGN)
|
|
1250
|
+
.factory((t) => ({
|
|
1251
|
+
...buildNodeBase(t),
|
|
1252
|
+
assignType: nodes_1.AssignType.BITAND,
|
|
1253
|
+
}));
|
|
1254
|
+
g.item()
|
|
1255
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1256
|
+
.source(lexer_1.TokenType.BITOR_ASSIGN)
|
|
1257
|
+
.factory((t) => ({
|
|
1258
|
+
...buildNodeBase(t),
|
|
1259
|
+
assignType: nodes_1.AssignType.BITOR,
|
|
1260
|
+
}));
|
|
1261
|
+
g.item()
|
|
1262
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1263
|
+
.source(lexer_1.TokenType.XOR_ASSIGN)
|
|
1264
|
+
.factory((t) => ({
|
|
1265
|
+
...buildNodeBase(t),
|
|
1266
|
+
assignType: nodes_1.AssignType.XOR,
|
|
1267
|
+
}));
|
|
1268
|
+
g.item()
|
|
1269
|
+
.target(nodes_1.NodeType.ASSIGN_OP)
|
|
1270
|
+
.source(lexer_1.TokenType.OR_ASSIGN)
|
|
1271
|
+
.factory((t) => ({
|
|
1272
|
+
...buildNodeBase(t),
|
|
1273
|
+
assignType: nodes_1.AssignType.OR,
|
|
1274
|
+
}));
|
|
1275
|
+
return {
|
|
1276
|
+
grammar: g.build(),
|
|
1277
|
+
customRules: [c(nodes_1.NodeType.EXPRESSION, expression_parser_1.expressionParser)],
|
|
1278
|
+
};
|
|
1279
|
+
}, lexer_1.TokenType, nodes_1.NodeType);
|
|
1280
|
+
//# sourceMappingURL=parser.js.map
|