@zenstackhq/language 3.5.6 → 3.6.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/dist/ast-Clidp86c.cjs +1465 -0
- package/dist/ast-Clidp86c.cjs.map +1 -0
- package/dist/ast-DEfhnj8j.mjs +765 -0
- package/dist/ast-DEfhnj8j.mjs.map +1 -0
- package/dist/ast-DQDdBZQ3.d.mts +525 -0
- package/dist/ast-W2h6Qtfk.d.cts +525 -0
- package/dist/ast.cjs +130 -1432
- package/dist/ast.cjs.map +1 -1
- package/dist/ast.d.cts +2 -541
- package/dist/ast.d.mts +2 -0
- package/dist/ast.mjs +20 -0
- package/dist/ast.mjs.map +1 -0
- package/dist/factory.cjs +754 -2030
- package/dist/factory.cjs.map +1 -1
- package/dist/factory.d.cts +220 -215
- package/dist/factory.d.mts +289 -0
- package/dist/factory.mjs +778 -0
- package/dist/factory.mjs.map +1 -0
- package/dist/index.cjs +2691 -5454
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -103
- package/dist/index.d.mts +170 -0
- package/dist/index.mjs +6925 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils-BB6L7ug2.mjs +529 -0
- package/dist/utils-BB6L7ug2.mjs.map +1 -0
- package/dist/utils-CfXGZkv7.cjs +842 -0
- package/dist/utils-CfXGZkv7.cjs.map +1 -0
- package/dist/utils.cjs +47 -1650
- package/dist/utils.d.cts +101 -10
- package/dist/{utils.d.ts → utils.d.mts} +101 -10
- package/dist/utils.mjs +2 -0
- package/package.json +16 -15
- package/dist/ast.d.ts +0 -541
- package/dist/ast.js +0 -1288
- package/dist/ast.js.map +0 -1
- package/dist/factory.d.ts +0 -284
- package/dist/factory.js +0 -2020
- package/dist/factory.js.map +0 -1
- package/dist/index.d.ts +0 -169
- package/dist/index.js +0 -9656
- package/dist/index.js.map +0 -1
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.js +0 -1572
- package/dist/utils.js.map +0 -1
package/dist/factory.cjs
CHANGED
|
@@ -1,2087 +1,811 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
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
|
-
// src/factory/index.ts
|
|
32
|
-
var factory_exports = {};
|
|
33
|
-
__export(factory_exports, {
|
|
34
|
-
ArgumentFactory: () => ArgumentFactory,
|
|
35
|
-
ArrayExprFactory: () => ArrayExprFactory,
|
|
36
|
-
AstFactory: () => AstFactory,
|
|
37
|
-
AttributeArgFactory: () => AttributeArgFactory,
|
|
38
|
-
AttributeFactory: () => AttributeFactory,
|
|
39
|
-
AttributeParamFactory: () => AttributeParamFactory,
|
|
40
|
-
AttributeParamTypeFactory: () => AttributeParamTypeFactory,
|
|
41
|
-
BinaryExprFactory: () => BinaryExprFactory,
|
|
42
|
-
BooleanLiteralFactory: () => BooleanLiteralFactory,
|
|
43
|
-
DataFieldAttributeFactory: () => DataFieldAttributeFactory,
|
|
44
|
-
DataFieldFactory: () => DataFieldFactory,
|
|
45
|
-
DataFieldTypeFactory: () => DataFieldTypeFactory,
|
|
46
|
-
DataModelAttributeFactory: () => DataModelAttributeFactory,
|
|
47
|
-
DataModelFactory: () => DataModelFactory,
|
|
48
|
-
DeclarationBuilder: () => DeclarationBuilder,
|
|
49
|
-
EnumFactory: () => EnumFactory,
|
|
50
|
-
EnumFieldFactory: () => EnumFieldFactory,
|
|
51
|
-
ExpressionBuilder: () => ExpressionBuilder,
|
|
52
|
-
FieldInitializerFactory: () => FieldInitializerFactory,
|
|
53
|
-
InternalAttributeFactory: () => InternalAttributeFactory,
|
|
54
|
-
InvocationExprFactory: () => InvocationExprFactory,
|
|
55
|
-
MemberAccessExprFactory: () => MemberAccessExprFactory,
|
|
56
|
-
ModelFactory: () => ModelFactory,
|
|
57
|
-
ModelImportFactory: () => ModelImportFactory,
|
|
58
|
-
NullExprFactory: () => NullExprFactory,
|
|
59
|
-
NumberLiteralFactory: () => NumberLiteralFactory,
|
|
60
|
-
ObjectExprFactory: () => ObjectExprFactory,
|
|
61
|
-
ReferenceArgFactory: () => ReferenceArgFactory,
|
|
62
|
-
ReferenceExprFactory: () => ReferenceExprFactory,
|
|
63
|
-
StringLiteralFactory: () => StringLiteralFactory,
|
|
64
|
-
ThisExprFactory: () => ThisExprFactory,
|
|
65
|
-
UnaryExprFactory: () => UnaryExprFactory,
|
|
66
|
-
UnsupportedFieldTypeFactory: () => UnsupportedFieldTypeFactory
|
|
67
|
-
});
|
|
68
|
-
module.exports = __toCommonJS(factory_exports);
|
|
69
|
-
|
|
70
|
-
// src/factory/ast-factory.ts
|
|
71
|
-
var AstFactory = class _AstFactory {
|
|
72
|
-
static {
|
|
73
|
-
__name(this, "AstFactory");
|
|
74
|
-
}
|
|
75
|
-
node = {};
|
|
76
|
-
constructor({ type, node }) {
|
|
77
|
-
this.node.$type = type;
|
|
78
|
-
if (node) {
|
|
79
|
-
this.update(node);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
setContainer(container) {
|
|
83
|
-
this.node.$container = container;
|
|
84
|
-
return this;
|
|
85
|
-
}
|
|
86
|
-
get(params) {
|
|
87
|
-
if (params) this.update(params);
|
|
88
|
-
return this.node;
|
|
89
|
-
}
|
|
90
|
-
update(nodeArg) {
|
|
91
|
-
const keys = Object.keys(nodeArg);
|
|
92
|
-
keys.forEach((key) => {
|
|
93
|
-
const child = nodeArg[key];
|
|
94
|
-
if (child instanceof _AstFactory) {
|
|
95
|
-
this.node[key] = child.get({
|
|
96
|
-
$container: this.node
|
|
97
|
-
});
|
|
98
|
-
} else if (Array.isArray(child)) {
|
|
99
|
-
this.node[key] = child.map((item) => item instanceof _AstFactory ? item.get({
|
|
100
|
-
$container: this.node
|
|
101
|
-
}) : item);
|
|
102
|
-
} else {
|
|
103
|
-
this.node[key] = child;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
return this.node;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// src/generated/ast.ts
|
|
111
|
-
var langium = __toESM(require("langium"), 1);
|
|
112
|
-
var AbstractDeclaration = "AbstractDeclaration";
|
|
113
|
-
var ConfigExpr = "ConfigExpr";
|
|
114
|
-
var Expression = "Expression";
|
|
115
|
-
var LiteralExpr = "LiteralExpr";
|
|
116
|
-
var MemberAccessTarget = "MemberAccessTarget";
|
|
117
|
-
var ReferenceTarget = "ReferenceTarget";
|
|
118
|
-
var TypeDeclaration = "TypeDeclaration";
|
|
119
|
-
var Argument = "Argument";
|
|
120
|
-
var ArrayExpr = "ArrayExpr";
|
|
121
|
-
var Attribute = "Attribute";
|
|
122
|
-
var AttributeArg = "AttributeArg";
|
|
123
|
-
var AttributeParam = "AttributeParam";
|
|
124
|
-
var AttributeParamType = "AttributeParamType";
|
|
125
|
-
var BinaryExpr = "BinaryExpr";
|
|
126
|
-
var BooleanLiteral = "BooleanLiteral";
|
|
127
|
-
var CollectionPredicateBinding = "CollectionPredicateBinding";
|
|
128
|
-
var ConfigArrayExpr = "ConfigArrayExpr";
|
|
129
|
-
var ConfigField = "ConfigField";
|
|
130
|
-
var ConfigInvocationArg = "ConfigInvocationArg";
|
|
131
|
-
var ConfigInvocationExpr = "ConfigInvocationExpr";
|
|
132
|
-
var DataField = "DataField";
|
|
133
|
-
var DataFieldAttribute = "DataFieldAttribute";
|
|
134
|
-
var DataFieldType = "DataFieldType";
|
|
135
|
-
var DataModel = "DataModel";
|
|
136
|
-
var DataModelAttribute = "DataModelAttribute";
|
|
137
|
-
var DataSource = "DataSource";
|
|
138
|
-
var Enum = "Enum";
|
|
139
|
-
var EnumField = "EnumField";
|
|
140
|
-
var FieldInitializer = "FieldInitializer";
|
|
141
|
-
var FunctionDecl = "FunctionDecl";
|
|
142
|
-
var FunctionParam = "FunctionParam";
|
|
143
|
-
var FunctionParamType = "FunctionParamType";
|
|
144
|
-
var GeneratorDecl = "GeneratorDecl";
|
|
145
|
-
var InternalAttribute = "InternalAttribute";
|
|
146
|
-
var InvocationExpr = "InvocationExpr";
|
|
147
|
-
var MemberAccessExpr = "MemberAccessExpr";
|
|
148
|
-
var Model = "Model";
|
|
149
|
-
var ModelImport = "ModelImport";
|
|
150
|
-
var NullExpr = "NullExpr";
|
|
151
|
-
var NumberLiteral = "NumberLiteral";
|
|
152
|
-
var ObjectExpr = "ObjectExpr";
|
|
153
|
-
var Plugin = "Plugin";
|
|
154
|
-
var PluginField = "PluginField";
|
|
155
|
-
var Procedure = "Procedure";
|
|
156
|
-
var ProcedureParam = "ProcedureParam";
|
|
157
|
-
var ReferenceArg = "ReferenceArg";
|
|
158
|
-
var ReferenceExpr = "ReferenceExpr";
|
|
159
|
-
var StringLiteral = "StringLiteral";
|
|
160
|
-
var ThisExpr = "ThisExpr";
|
|
161
|
-
var TypeDef = "TypeDef";
|
|
162
|
-
var UnaryExpr = "UnaryExpr";
|
|
163
|
-
var UnsupportedFieldType = "UnsupportedFieldType";
|
|
164
|
-
var ZModelAstReflection = class extends langium.AbstractAstReflection {
|
|
165
|
-
static {
|
|
166
|
-
__name(this, "ZModelAstReflection");
|
|
167
|
-
}
|
|
168
|
-
getAllTypes() {
|
|
169
|
-
return [
|
|
170
|
-
AbstractDeclaration,
|
|
171
|
-
Argument,
|
|
172
|
-
ArrayExpr,
|
|
173
|
-
Attribute,
|
|
174
|
-
AttributeArg,
|
|
175
|
-
AttributeParam,
|
|
176
|
-
AttributeParamType,
|
|
177
|
-
BinaryExpr,
|
|
178
|
-
BooleanLiteral,
|
|
179
|
-
CollectionPredicateBinding,
|
|
180
|
-
ConfigArrayExpr,
|
|
181
|
-
ConfigExpr,
|
|
182
|
-
ConfigField,
|
|
183
|
-
ConfigInvocationArg,
|
|
184
|
-
ConfigInvocationExpr,
|
|
185
|
-
DataField,
|
|
186
|
-
DataFieldAttribute,
|
|
187
|
-
DataFieldType,
|
|
188
|
-
DataModel,
|
|
189
|
-
DataModelAttribute,
|
|
190
|
-
DataSource,
|
|
191
|
-
Enum,
|
|
192
|
-
EnumField,
|
|
193
|
-
Expression,
|
|
194
|
-
FieldInitializer,
|
|
195
|
-
FunctionDecl,
|
|
196
|
-
FunctionParam,
|
|
197
|
-
FunctionParamType,
|
|
198
|
-
GeneratorDecl,
|
|
199
|
-
InternalAttribute,
|
|
200
|
-
InvocationExpr,
|
|
201
|
-
LiteralExpr,
|
|
202
|
-
MemberAccessExpr,
|
|
203
|
-
MemberAccessTarget,
|
|
204
|
-
Model,
|
|
205
|
-
ModelImport,
|
|
206
|
-
NullExpr,
|
|
207
|
-
NumberLiteral,
|
|
208
|
-
ObjectExpr,
|
|
209
|
-
Plugin,
|
|
210
|
-
PluginField,
|
|
211
|
-
Procedure,
|
|
212
|
-
ProcedureParam,
|
|
213
|
-
ReferenceArg,
|
|
214
|
-
ReferenceExpr,
|
|
215
|
-
ReferenceTarget,
|
|
216
|
-
StringLiteral,
|
|
217
|
-
ThisExpr,
|
|
218
|
-
TypeDeclaration,
|
|
219
|
-
TypeDef,
|
|
220
|
-
UnaryExpr,
|
|
221
|
-
UnsupportedFieldType
|
|
222
|
-
];
|
|
223
|
-
}
|
|
224
|
-
computeIsSubtype(subtype, supertype) {
|
|
225
|
-
switch (subtype) {
|
|
226
|
-
case ArrayExpr:
|
|
227
|
-
case BinaryExpr:
|
|
228
|
-
case MemberAccessExpr:
|
|
229
|
-
case NullExpr:
|
|
230
|
-
case ObjectExpr:
|
|
231
|
-
case ReferenceExpr:
|
|
232
|
-
case ThisExpr:
|
|
233
|
-
case UnaryExpr: {
|
|
234
|
-
return this.isSubtype(Expression, supertype);
|
|
235
|
-
}
|
|
236
|
-
case Attribute:
|
|
237
|
-
case DataSource:
|
|
238
|
-
case FunctionDecl:
|
|
239
|
-
case GeneratorDecl:
|
|
240
|
-
case Plugin:
|
|
241
|
-
case Procedure: {
|
|
242
|
-
return this.isSubtype(AbstractDeclaration, supertype);
|
|
243
|
-
}
|
|
244
|
-
case BooleanLiteral:
|
|
245
|
-
case NumberLiteral:
|
|
246
|
-
case StringLiteral: {
|
|
247
|
-
return this.isSubtype(LiteralExpr, supertype);
|
|
248
|
-
}
|
|
249
|
-
case CollectionPredicateBinding:
|
|
250
|
-
case EnumField:
|
|
251
|
-
case FunctionParam: {
|
|
252
|
-
return this.isSubtype(ReferenceTarget, supertype);
|
|
253
|
-
}
|
|
254
|
-
case ConfigArrayExpr: {
|
|
255
|
-
return this.isSubtype(ConfigExpr, supertype);
|
|
256
|
-
}
|
|
257
|
-
case DataField: {
|
|
258
|
-
return this.isSubtype(MemberAccessTarget, supertype) || this.isSubtype(ReferenceTarget, supertype);
|
|
259
|
-
}
|
|
260
|
-
case DataModel:
|
|
261
|
-
case Enum:
|
|
262
|
-
case TypeDef: {
|
|
263
|
-
return this.isSubtype(AbstractDeclaration, supertype) || this.isSubtype(TypeDeclaration, supertype);
|
|
264
|
-
}
|
|
265
|
-
case InvocationExpr:
|
|
266
|
-
case LiteralExpr: {
|
|
267
|
-
return this.isSubtype(ConfigExpr, supertype) || this.isSubtype(Expression, supertype);
|
|
268
|
-
}
|
|
269
|
-
default: {
|
|
270
|
-
return false;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
getReferenceType(refInfo) {
|
|
275
|
-
const referenceId = `${refInfo.container.$type}:${refInfo.property}`;
|
|
276
|
-
switch (referenceId) {
|
|
277
|
-
case "AttributeParamType:reference":
|
|
278
|
-
case "DataFieldType:reference":
|
|
279
|
-
case "FunctionParamType:reference": {
|
|
280
|
-
return TypeDeclaration;
|
|
281
|
-
}
|
|
282
|
-
case "DataFieldAttribute:decl":
|
|
283
|
-
case "DataModelAttribute:decl":
|
|
284
|
-
case "InternalAttribute:decl": {
|
|
285
|
-
return Attribute;
|
|
286
|
-
}
|
|
287
|
-
case "DataModel:baseModel": {
|
|
288
|
-
return DataModel;
|
|
289
|
-
}
|
|
290
|
-
case "DataModel:mixins":
|
|
291
|
-
case "TypeDef:mixins": {
|
|
292
|
-
return TypeDef;
|
|
293
|
-
}
|
|
294
|
-
case "InvocationExpr:function": {
|
|
295
|
-
return FunctionDecl;
|
|
296
|
-
}
|
|
297
|
-
case "MemberAccessExpr:member": {
|
|
298
|
-
return MemberAccessTarget;
|
|
299
|
-
}
|
|
300
|
-
case "ReferenceExpr:target": {
|
|
301
|
-
return ReferenceTarget;
|
|
302
|
-
}
|
|
303
|
-
default: {
|
|
304
|
-
throw new Error(`${referenceId} is not a valid reference id.`);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
getTypeMetaData(type) {
|
|
309
|
-
switch (type) {
|
|
310
|
-
case Argument: {
|
|
311
|
-
return {
|
|
312
|
-
name: Argument,
|
|
313
|
-
properties: [
|
|
314
|
-
{
|
|
315
|
-
name: "value"
|
|
316
|
-
}
|
|
317
|
-
]
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
case ArrayExpr: {
|
|
321
|
-
return {
|
|
322
|
-
name: ArrayExpr,
|
|
323
|
-
properties: [
|
|
324
|
-
{
|
|
325
|
-
name: "items",
|
|
326
|
-
defaultValue: []
|
|
327
|
-
}
|
|
328
|
-
]
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
case Attribute: {
|
|
332
|
-
return {
|
|
333
|
-
name: Attribute,
|
|
334
|
-
properties: [
|
|
335
|
-
{
|
|
336
|
-
name: "attributes",
|
|
337
|
-
defaultValue: []
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
name: "comments",
|
|
341
|
-
defaultValue: []
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
name: "name"
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
name: "params",
|
|
348
|
-
defaultValue: []
|
|
349
|
-
}
|
|
350
|
-
]
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
case AttributeArg: {
|
|
354
|
-
return {
|
|
355
|
-
name: AttributeArg,
|
|
356
|
-
properties: [
|
|
357
|
-
{
|
|
358
|
-
name: "name"
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
name: "value"
|
|
362
|
-
}
|
|
363
|
-
]
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
case AttributeParam: {
|
|
367
|
-
return {
|
|
368
|
-
name: AttributeParam,
|
|
369
|
-
properties: [
|
|
370
|
-
{
|
|
371
|
-
name: "attributes",
|
|
372
|
-
defaultValue: []
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
name: "comments",
|
|
376
|
-
defaultValue: []
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
name: "default",
|
|
380
|
-
defaultValue: false
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
name: "name"
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
name: "type"
|
|
387
|
-
}
|
|
388
|
-
]
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
case AttributeParamType: {
|
|
392
|
-
return {
|
|
393
|
-
name: AttributeParamType,
|
|
394
|
-
properties: [
|
|
395
|
-
{
|
|
396
|
-
name: "array",
|
|
397
|
-
defaultValue: false
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
name: "optional",
|
|
401
|
-
defaultValue: false
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
name: "reference"
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
name: "type"
|
|
408
|
-
}
|
|
409
|
-
]
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
case BinaryExpr: {
|
|
413
|
-
return {
|
|
414
|
-
name: BinaryExpr,
|
|
415
|
-
properties: [
|
|
416
|
-
{
|
|
417
|
-
name: "binding"
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
name: "left"
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
name: "operator"
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
name: "right"
|
|
427
|
-
}
|
|
428
|
-
]
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
case BooleanLiteral: {
|
|
432
|
-
return {
|
|
433
|
-
name: BooleanLiteral,
|
|
434
|
-
properties: [
|
|
435
|
-
{
|
|
436
|
-
name: "value"
|
|
437
|
-
}
|
|
438
|
-
]
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
case CollectionPredicateBinding: {
|
|
442
|
-
return {
|
|
443
|
-
name: CollectionPredicateBinding,
|
|
444
|
-
properties: [
|
|
445
|
-
{
|
|
446
|
-
name: "name"
|
|
447
|
-
}
|
|
448
|
-
]
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
case ConfigArrayExpr: {
|
|
452
|
-
return {
|
|
453
|
-
name: ConfigArrayExpr,
|
|
454
|
-
properties: [
|
|
455
|
-
{
|
|
456
|
-
name: "items",
|
|
457
|
-
defaultValue: []
|
|
458
|
-
}
|
|
459
|
-
]
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
case ConfigField: {
|
|
463
|
-
return {
|
|
464
|
-
name: ConfigField,
|
|
465
|
-
properties: [
|
|
466
|
-
{
|
|
467
|
-
name: "name"
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
name: "value"
|
|
471
|
-
}
|
|
472
|
-
]
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
case ConfigInvocationArg: {
|
|
476
|
-
return {
|
|
477
|
-
name: ConfigInvocationArg,
|
|
478
|
-
properties: [
|
|
479
|
-
{
|
|
480
|
-
name: "name"
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
name: "value"
|
|
484
|
-
}
|
|
485
|
-
]
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
case ConfigInvocationExpr: {
|
|
489
|
-
return {
|
|
490
|
-
name: ConfigInvocationExpr,
|
|
491
|
-
properties: [
|
|
492
|
-
{
|
|
493
|
-
name: "args",
|
|
494
|
-
defaultValue: []
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
name: "name"
|
|
498
|
-
}
|
|
499
|
-
]
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
case DataField: {
|
|
503
|
-
return {
|
|
504
|
-
name: DataField,
|
|
505
|
-
properties: [
|
|
506
|
-
{
|
|
507
|
-
name: "attributes",
|
|
508
|
-
defaultValue: []
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
name: "comments",
|
|
512
|
-
defaultValue: []
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
name: "name"
|
|
516
|
-
},
|
|
517
|
-
{
|
|
518
|
-
name: "type"
|
|
519
|
-
}
|
|
520
|
-
]
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
case DataFieldAttribute: {
|
|
524
|
-
return {
|
|
525
|
-
name: DataFieldAttribute,
|
|
526
|
-
properties: [
|
|
527
|
-
{
|
|
528
|
-
name: "args",
|
|
529
|
-
defaultValue: []
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
name: "decl"
|
|
533
|
-
}
|
|
534
|
-
]
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
case DataFieldType: {
|
|
538
|
-
return {
|
|
539
|
-
name: DataFieldType,
|
|
540
|
-
properties: [
|
|
541
|
-
{
|
|
542
|
-
name: "array",
|
|
543
|
-
defaultValue: false
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
name: "optional",
|
|
547
|
-
defaultValue: false
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
name: "reference"
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
name: "type"
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
name: "unsupported"
|
|
557
|
-
}
|
|
558
|
-
]
|
|
559
|
-
};
|
|
560
|
-
}
|
|
561
|
-
case DataModel: {
|
|
562
|
-
return {
|
|
563
|
-
name: DataModel,
|
|
564
|
-
properties: [
|
|
565
|
-
{
|
|
566
|
-
name: "attributes",
|
|
567
|
-
defaultValue: []
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
name: "baseModel"
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
name: "comments",
|
|
574
|
-
defaultValue: []
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
name: "fields",
|
|
578
|
-
defaultValue: []
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
name: "isView",
|
|
582
|
-
defaultValue: false
|
|
583
|
-
},
|
|
584
|
-
{
|
|
585
|
-
name: "mixins",
|
|
586
|
-
defaultValue: []
|
|
587
|
-
},
|
|
588
|
-
{
|
|
589
|
-
name: "name"
|
|
590
|
-
}
|
|
591
|
-
]
|
|
592
|
-
};
|
|
593
|
-
}
|
|
594
|
-
case DataModelAttribute: {
|
|
595
|
-
return {
|
|
596
|
-
name: DataModelAttribute,
|
|
597
|
-
properties: [
|
|
598
|
-
{
|
|
599
|
-
name: "args",
|
|
600
|
-
defaultValue: []
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
name: "decl"
|
|
604
|
-
}
|
|
605
|
-
]
|
|
606
|
-
};
|
|
607
|
-
}
|
|
608
|
-
case DataSource: {
|
|
609
|
-
return {
|
|
610
|
-
name: DataSource,
|
|
611
|
-
properties: [
|
|
612
|
-
{
|
|
613
|
-
name: "fields",
|
|
614
|
-
defaultValue: []
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
name: "name"
|
|
618
|
-
}
|
|
619
|
-
]
|
|
620
|
-
};
|
|
621
|
-
}
|
|
622
|
-
case Enum: {
|
|
623
|
-
return {
|
|
624
|
-
name: Enum,
|
|
625
|
-
properties: [
|
|
626
|
-
{
|
|
627
|
-
name: "attributes",
|
|
628
|
-
defaultValue: []
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
name: "comments",
|
|
632
|
-
defaultValue: []
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
name: "fields",
|
|
636
|
-
defaultValue: []
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
name: "name"
|
|
640
|
-
}
|
|
641
|
-
]
|
|
642
|
-
};
|
|
643
|
-
}
|
|
644
|
-
case EnumField: {
|
|
645
|
-
return {
|
|
646
|
-
name: EnumField,
|
|
647
|
-
properties: [
|
|
648
|
-
{
|
|
649
|
-
name: "attributes",
|
|
650
|
-
defaultValue: []
|
|
651
|
-
},
|
|
652
|
-
{
|
|
653
|
-
name: "comments",
|
|
654
|
-
defaultValue: []
|
|
655
|
-
},
|
|
656
|
-
{
|
|
657
|
-
name: "name"
|
|
658
|
-
}
|
|
659
|
-
]
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
case FieldInitializer: {
|
|
663
|
-
return {
|
|
664
|
-
name: FieldInitializer,
|
|
665
|
-
properties: [
|
|
666
|
-
{
|
|
667
|
-
name: "name"
|
|
668
|
-
},
|
|
669
|
-
{
|
|
670
|
-
name: "value"
|
|
671
|
-
}
|
|
672
|
-
]
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
case FunctionDecl: {
|
|
676
|
-
return {
|
|
677
|
-
name: FunctionDecl,
|
|
678
|
-
properties: [
|
|
679
|
-
{
|
|
680
|
-
name: "attributes",
|
|
681
|
-
defaultValue: []
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
name: "expression"
|
|
685
|
-
},
|
|
686
|
-
{
|
|
687
|
-
name: "name"
|
|
688
|
-
},
|
|
689
|
-
{
|
|
690
|
-
name: "params",
|
|
691
|
-
defaultValue: []
|
|
692
|
-
},
|
|
693
|
-
{
|
|
694
|
-
name: "returnType"
|
|
695
|
-
}
|
|
696
|
-
]
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
case FunctionParam: {
|
|
700
|
-
return {
|
|
701
|
-
name: FunctionParam,
|
|
702
|
-
properties: [
|
|
703
|
-
{
|
|
704
|
-
name: "name"
|
|
705
|
-
},
|
|
706
|
-
{
|
|
707
|
-
name: "optional",
|
|
708
|
-
defaultValue: false
|
|
709
|
-
},
|
|
710
|
-
{
|
|
711
|
-
name: "type"
|
|
712
|
-
}
|
|
713
|
-
]
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
case FunctionParamType: {
|
|
717
|
-
return {
|
|
718
|
-
name: FunctionParamType,
|
|
719
|
-
properties: [
|
|
720
|
-
{
|
|
721
|
-
name: "array",
|
|
722
|
-
defaultValue: false
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
name: "reference"
|
|
726
|
-
},
|
|
727
|
-
{
|
|
728
|
-
name: "type"
|
|
729
|
-
}
|
|
730
|
-
]
|
|
731
|
-
};
|
|
732
|
-
}
|
|
733
|
-
case GeneratorDecl: {
|
|
734
|
-
return {
|
|
735
|
-
name: GeneratorDecl,
|
|
736
|
-
properties: [
|
|
737
|
-
{
|
|
738
|
-
name: "fields",
|
|
739
|
-
defaultValue: []
|
|
740
|
-
},
|
|
741
|
-
{
|
|
742
|
-
name: "name"
|
|
743
|
-
}
|
|
744
|
-
]
|
|
745
|
-
};
|
|
746
|
-
}
|
|
747
|
-
case InternalAttribute: {
|
|
748
|
-
return {
|
|
749
|
-
name: InternalAttribute,
|
|
750
|
-
properties: [
|
|
751
|
-
{
|
|
752
|
-
name: "args",
|
|
753
|
-
defaultValue: []
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
name: "decl"
|
|
757
|
-
}
|
|
758
|
-
]
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
case InvocationExpr: {
|
|
762
|
-
return {
|
|
763
|
-
name: InvocationExpr,
|
|
764
|
-
properties: [
|
|
765
|
-
{
|
|
766
|
-
name: "args",
|
|
767
|
-
defaultValue: []
|
|
768
|
-
},
|
|
769
|
-
{
|
|
770
|
-
name: "function"
|
|
771
|
-
}
|
|
772
|
-
]
|
|
773
|
-
};
|
|
774
|
-
}
|
|
775
|
-
case MemberAccessExpr: {
|
|
776
|
-
return {
|
|
777
|
-
name: MemberAccessExpr,
|
|
778
|
-
properties: [
|
|
779
|
-
{
|
|
780
|
-
name: "member"
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
name: "operand"
|
|
784
|
-
}
|
|
785
|
-
]
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
case Model: {
|
|
789
|
-
return {
|
|
790
|
-
name: Model,
|
|
791
|
-
properties: [
|
|
792
|
-
{
|
|
793
|
-
name: "declarations",
|
|
794
|
-
defaultValue: []
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
name: "imports",
|
|
798
|
-
defaultValue: []
|
|
799
|
-
}
|
|
800
|
-
]
|
|
801
|
-
};
|
|
802
|
-
}
|
|
803
|
-
case ModelImport: {
|
|
804
|
-
return {
|
|
805
|
-
name: ModelImport,
|
|
806
|
-
properties: [
|
|
807
|
-
{
|
|
808
|
-
name: "path"
|
|
809
|
-
}
|
|
810
|
-
]
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
|
-
case NullExpr: {
|
|
814
|
-
return {
|
|
815
|
-
name: NullExpr,
|
|
816
|
-
properties: [
|
|
817
|
-
{
|
|
818
|
-
name: "value"
|
|
819
|
-
}
|
|
820
|
-
]
|
|
821
|
-
};
|
|
822
|
-
}
|
|
823
|
-
case NumberLiteral: {
|
|
824
|
-
return {
|
|
825
|
-
name: NumberLiteral,
|
|
826
|
-
properties: [
|
|
827
|
-
{
|
|
828
|
-
name: "value"
|
|
829
|
-
}
|
|
830
|
-
]
|
|
831
|
-
};
|
|
832
|
-
}
|
|
833
|
-
case ObjectExpr: {
|
|
834
|
-
return {
|
|
835
|
-
name: ObjectExpr,
|
|
836
|
-
properties: [
|
|
837
|
-
{
|
|
838
|
-
name: "fields",
|
|
839
|
-
defaultValue: []
|
|
840
|
-
}
|
|
841
|
-
]
|
|
842
|
-
};
|
|
843
|
-
}
|
|
844
|
-
case Plugin: {
|
|
845
|
-
return {
|
|
846
|
-
name: Plugin,
|
|
847
|
-
properties: [
|
|
848
|
-
{
|
|
849
|
-
name: "fields",
|
|
850
|
-
defaultValue: []
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
name: "name"
|
|
854
|
-
}
|
|
855
|
-
]
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
case PluginField: {
|
|
859
|
-
return {
|
|
860
|
-
name: PluginField,
|
|
861
|
-
properties: [
|
|
862
|
-
{
|
|
863
|
-
name: "name"
|
|
864
|
-
},
|
|
865
|
-
{
|
|
866
|
-
name: "value"
|
|
867
|
-
}
|
|
868
|
-
]
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
|
-
case Procedure: {
|
|
872
|
-
return {
|
|
873
|
-
name: Procedure,
|
|
874
|
-
properties: [
|
|
875
|
-
{
|
|
876
|
-
name: "attributes",
|
|
877
|
-
defaultValue: []
|
|
878
|
-
},
|
|
879
|
-
{
|
|
880
|
-
name: "mutation",
|
|
881
|
-
defaultValue: false
|
|
882
|
-
},
|
|
883
|
-
{
|
|
884
|
-
name: "name"
|
|
885
|
-
},
|
|
886
|
-
{
|
|
887
|
-
name: "params",
|
|
888
|
-
defaultValue: []
|
|
889
|
-
},
|
|
890
|
-
{
|
|
891
|
-
name: "returnType"
|
|
892
|
-
}
|
|
893
|
-
]
|
|
894
|
-
};
|
|
895
|
-
}
|
|
896
|
-
case ProcedureParam: {
|
|
897
|
-
return {
|
|
898
|
-
name: ProcedureParam,
|
|
899
|
-
properties: [
|
|
900
|
-
{
|
|
901
|
-
name: "name"
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
name: "optional",
|
|
905
|
-
defaultValue: false
|
|
906
|
-
},
|
|
907
|
-
{
|
|
908
|
-
name: "type"
|
|
909
|
-
}
|
|
910
|
-
]
|
|
911
|
-
};
|
|
912
|
-
}
|
|
913
|
-
case ReferenceArg: {
|
|
914
|
-
return {
|
|
915
|
-
name: ReferenceArg,
|
|
916
|
-
properties: [
|
|
917
|
-
{
|
|
918
|
-
name: "name"
|
|
919
|
-
},
|
|
920
|
-
{
|
|
921
|
-
name: "value"
|
|
922
|
-
}
|
|
923
|
-
]
|
|
924
|
-
};
|
|
925
|
-
}
|
|
926
|
-
case ReferenceExpr: {
|
|
927
|
-
return {
|
|
928
|
-
name: ReferenceExpr,
|
|
929
|
-
properties: [
|
|
930
|
-
{
|
|
931
|
-
name: "args",
|
|
932
|
-
defaultValue: []
|
|
933
|
-
},
|
|
934
|
-
{
|
|
935
|
-
name: "target"
|
|
936
|
-
}
|
|
937
|
-
]
|
|
938
|
-
};
|
|
939
|
-
}
|
|
940
|
-
case StringLiteral: {
|
|
941
|
-
return {
|
|
942
|
-
name: StringLiteral,
|
|
943
|
-
properties: [
|
|
944
|
-
{
|
|
945
|
-
name: "value"
|
|
946
|
-
}
|
|
947
|
-
]
|
|
948
|
-
};
|
|
949
|
-
}
|
|
950
|
-
case ThisExpr: {
|
|
951
|
-
return {
|
|
952
|
-
name: ThisExpr,
|
|
953
|
-
properties: [
|
|
954
|
-
{
|
|
955
|
-
name: "value"
|
|
956
|
-
}
|
|
957
|
-
]
|
|
958
|
-
};
|
|
959
|
-
}
|
|
960
|
-
case TypeDef: {
|
|
961
|
-
return {
|
|
962
|
-
name: TypeDef,
|
|
963
|
-
properties: [
|
|
964
|
-
{
|
|
965
|
-
name: "attributes",
|
|
966
|
-
defaultValue: []
|
|
967
|
-
},
|
|
968
|
-
{
|
|
969
|
-
name: "comments",
|
|
970
|
-
defaultValue: []
|
|
971
|
-
},
|
|
972
|
-
{
|
|
973
|
-
name: "fields",
|
|
974
|
-
defaultValue: []
|
|
975
|
-
},
|
|
976
|
-
{
|
|
977
|
-
name: "mixins",
|
|
978
|
-
defaultValue: []
|
|
979
|
-
},
|
|
980
|
-
{
|
|
981
|
-
name: "name"
|
|
982
|
-
}
|
|
983
|
-
]
|
|
984
|
-
};
|
|
985
|
-
}
|
|
986
|
-
case UnaryExpr: {
|
|
987
|
-
return {
|
|
988
|
-
name: UnaryExpr,
|
|
989
|
-
properties: [
|
|
990
|
-
{
|
|
991
|
-
name: "operand"
|
|
992
|
-
},
|
|
993
|
-
{
|
|
994
|
-
name: "operator"
|
|
995
|
-
}
|
|
996
|
-
]
|
|
997
|
-
};
|
|
998
|
-
}
|
|
999
|
-
case UnsupportedFieldType: {
|
|
1000
|
-
return {
|
|
1001
|
-
name: UnsupportedFieldType,
|
|
1002
|
-
properties: [
|
|
1003
|
-
{
|
|
1004
|
-
name: "value"
|
|
1005
|
-
}
|
|
1006
|
-
]
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
default: {
|
|
1010
|
-
return {
|
|
1011
|
-
name: type,
|
|
1012
|
-
properties: []
|
|
1013
|
-
};
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
};
|
|
1018
|
-
var reflection = new ZModelAstReflection();
|
|
1019
|
-
|
|
1020
|
-
// src/factory/primitives.ts
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_ast = require("./ast-Clidp86c.cjs");
|
|
3
|
+
require("./ast.cjs");
|
|
4
|
+
//#region src/factory/ast-factory.ts
|
|
5
|
+
var AstFactory = class AstFactory {
|
|
6
|
+
node = {};
|
|
7
|
+
constructor({ type, node }) {
|
|
8
|
+
this.node.$type = type;
|
|
9
|
+
if (node) this.update(node);
|
|
10
|
+
}
|
|
11
|
+
setContainer(container) {
|
|
12
|
+
this.node.$container = container;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
get(params) {
|
|
16
|
+
if (params) this.update(params);
|
|
17
|
+
return this.node;
|
|
18
|
+
}
|
|
19
|
+
update(nodeArg) {
|
|
20
|
+
Object.keys(nodeArg).forEach((key) => {
|
|
21
|
+
const child = nodeArg[key];
|
|
22
|
+
if (child instanceof AstFactory) this.node[key] = child.get({ $container: this.node });
|
|
23
|
+
else if (Array.isArray(child)) this.node[key] = child.map((item) => item instanceof AstFactory ? item.get({ $container: this.node }) : item);
|
|
24
|
+
else this.node[key] = child;
|
|
25
|
+
});
|
|
26
|
+
return this.node;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/factory/primitives.ts
|
|
1021
31
|
var ThisExprFactory = class extends AstFactory {
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
node: {
|
|
1029
|
-
value: "this"
|
|
1030
|
-
}
|
|
1031
|
-
});
|
|
1032
|
-
}
|
|
32
|
+
constructor() {
|
|
33
|
+
super({
|
|
34
|
+
type: require_ast.ThisExpr,
|
|
35
|
+
node: { value: "this" }
|
|
36
|
+
});
|
|
37
|
+
}
|
|
1033
38
|
};
|
|
1034
39
|
var NullExprFactory = class extends AstFactory {
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
node: {
|
|
1042
|
-
value: "null"
|
|
1043
|
-
}
|
|
1044
|
-
});
|
|
1045
|
-
}
|
|
40
|
+
constructor() {
|
|
41
|
+
super({
|
|
42
|
+
type: require_ast.NullExpr,
|
|
43
|
+
node: { value: "null" }
|
|
44
|
+
});
|
|
45
|
+
}
|
|
1046
46
|
};
|
|
1047
47
|
var NumberLiteralFactory = class extends AstFactory {
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
setValue(value) {
|
|
1058
|
-
this.value = value;
|
|
1059
|
-
this.update({
|
|
1060
|
-
value: this.value.toString()
|
|
1061
|
-
});
|
|
1062
|
-
return this;
|
|
1063
|
-
}
|
|
48
|
+
value;
|
|
49
|
+
constructor() {
|
|
50
|
+
super({ type: require_ast.NumberLiteral });
|
|
51
|
+
}
|
|
52
|
+
setValue(value) {
|
|
53
|
+
this.value = value;
|
|
54
|
+
this.update({ value: this.value.toString() });
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
1064
57
|
};
|
|
1065
58
|
var StringLiteralFactory = class extends AstFactory {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
setValue(value) {
|
|
1076
|
-
this.value = value;
|
|
1077
|
-
this.update({
|
|
1078
|
-
value: this.value
|
|
1079
|
-
});
|
|
1080
|
-
return this;
|
|
1081
|
-
}
|
|
59
|
+
value;
|
|
60
|
+
constructor() {
|
|
61
|
+
super({ type: require_ast.StringLiteral });
|
|
62
|
+
}
|
|
63
|
+
setValue(value) {
|
|
64
|
+
this.value = value;
|
|
65
|
+
this.update({ value: this.value });
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
1082
68
|
};
|
|
1083
69
|
var BooleanLiteralFactory = class extends AstFactory {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
get ThisExpr() {
|
|
1135
|
-
return new ThisExprFactory();
|
|
1136
|
-
},
|
|
1137
|
-
get UnaryExpr() {
|
|
1138
|
-
return new UnaryExprFactory();
|
|
1139
|
-
}
|
|
1140
|
-
}), "ExpressionBuilder");
|
|
70
|
+
value;
|
|
71
|
+
constructor() {
|
|
72
|
+
super({ type: require_ast.BooleanLiteral });
|
|
73
|
+
}
|
|
74
|
+
setValue(value) {
|
|
75
|
+
this.value = value;
|
|
76
|
+
this.update({ value: this.value });
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/factory/expression.ts
|
|
82
|
+
const ExpressionBuilder = () => ({
|
|
83
|
+
get ArrayExpr() {
|
|
84
|
+
return new ArrayExprFactory();
|
|
85
|
+
},
|
|
86
|
+
get BinaryExpr() {
|
|
87
|
+
return new BinaryExprFactory();
|
|
88
|
+
},
|
|
89
|
+
get BooleanLiteral() {
|
|
90
|
+
return new BooleanLiteralFactory();
|
|
91
|
+
},
|
|
92
|
+
get InvocationExpr() {
|
|
93
|
+
return new InvocationExprFactory();
|
|
94
|
+
},
|
|
95
|
+
get MemberAccessExpr() {
|
|
96
|
+
return new MemberAccessExprFactory();
|
|
97
|
+
},
|
|
98
|
+
get NullExpr() {
|
|
99
|
+
return new NullExprFactory();
|
|
100
|
+
},
|
|
101
|
+
get NumberLiteral() {
|
|
102
|
+
return new NumberLiteralFactory();
|
|
103
|
+
},
|
|
104
|
+
get ObjectExpr() {
|
|
105
|
+
return new ObjectExprFactory();
|
|
106
|
+
},
|
|
107
|
+
get ReferenceExpr() {
|
|
108
|
+
return new ReferenceExprFactory();
|
|
109
|
+
},
|
|
110
|
+
get StringLiteral() {
|
|
111
|
+
return new StringLiteralFactory();
|
|
112
|
+
},
|
|
113
|
+
get ThisExpr() {
|
|
114
|
+
return new ThisExprFactory();
|
|
115
|
+
},
|
|
116
|
+
get UnaryExpr() {
|
|
117
|
+
return new UnaryExprFactory();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
1141
120
|
var UnaryExprFactory = class extends AstFactory {
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
setOperand(builder) {
|
|
1155
|
-
this.operand = builder(ExpressionBuilder());
|
|
1156
|
-
this.update({
|
|
1157
|
-
operand: this.operand
|
|
1158
|
-
});
|
|
1159
|
-
return this;
|
|
1160
|
-
}
|
|
121
|
+
operand;
|
|
122
|
+
constructor() {
|
|
123
|
+
super({
|
|
124
|
+
type: require_ast.UnaryExpr,
|
|
125
|
+
node: { operator: "!" }
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
setOperand(builder) {
|
|
129
|
+
this.operand = builder(ExpressionBuilder());
|
|
130
|
+
this.update({ operand: this.operand });
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
1161
133
|
};
|
|
1162
134
|
var ReferenceExprFactory = class extends AstFactory {
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
addArg(builder, name) {
|
|
1187
|
-
const arg = new ReferenceArgFactory().setValue(builder);
|
|
1188
|
-
if (name) {
|
|
1189
|
-
arg.setName(name);
|
|
1190
|
-
}
|
|
1191
|
-
this.args.push(arg);
|
|
1192
|
-
this.update({
|
|
1193
|
-
args: this.args
|
|
1194
|
-
});
|
|
1195
|
-
return this;
|
|
1196
|
-
}
|
|
135
|
+
target;
|
|
136
|
+
args = [];
|
|
137
|
+
constructor() {
|
|
138
|
+
super({
|
|
139
|
+
type: require_ast.ReferenceExpr,
|
|
140
|
+
node: { args: [] }
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
setTarget(target) {
|
|
144
|
+
this.target = {
|
|
145
|
+
$refText: target.name,
|
|
146
|
+
ref: target
|
|
147
|
+
};
|
|
148
|
+
this.update({ target: this.target });
|
|
149
|
+
return this;
|
|
150
|
+
}
|
|
151
|
+
addArg(builder, name) {
|
|
152
|
+
const arg = new ReferenceArgFactory().setValue(builder);
|
|
153
|
+
if (name) arg.setName(name);
|
|
154
|
+
this.args.push(arg);
|
|
155
|
+
this.update({ args: this.args });
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
1197
158
|
};
|
|
1198
159
|
var ReferenceArgFactory = class extends AstFactory {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
return this;
|
|
1215
|
-
}
|
|
1216
|
-
setValue(builder) {
|
|
1217
|
-
this.value = builder(ExpressionBuilder());
|
|
1218
|
-
this.update({
|
|
1219
|
-
value: this.value
|
|
1220
|
-
});
|
|
1221
|
-
return this;
|
|
1222
|
-
}
|
|
160
|
+
name;
|
|
161
|
+
value;
|
|
162
|
+
constructor() {
|
|
163
|
+
super({ type: require_ast.ReferenceArg });
|
|
164
|
+
}
|
|
165
|
+
setName(name) {
|
|
166
|
+
this.name = name;
|
|
167
|
+
this.update({ name: this.name });
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
setValue(builder) {
|
|
171
|
+
this.value = builder(ExpressionBuilder());
|
|
172
|
+
this.update({ value: this.value });
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
1223
175
|
};
|
|
1224
176
|
var MemberAccessExprFactory = class extends AstFactory {
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
return this;
|
|
1241
|
-
}
|
|
1242
|
-
setOperand(builder) {
|
|
1243
|
-
this.operand = builder(ExpressionBuilder());
|
|
1244
|
-
this.update({
|
|
1245
|
-
operand: this.operand
|
|
1246
|
-
});
|
|
1247
|
-
return this;
|
|
1248
|
-
}
|
|
177
|
+
member;
|
|
178
|
+
operand;
|
|
179
|
+
constructor() {
|
|
180
|
+
super({ type: require_ast.MemberAccessExpr });
|
|
181
|
+
}
|
|
182
|
+
setMember(target) {
|
|
183
|
+
this.member = target;
|
|
184
|
+
this.update({ member: this.member });
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
setOperand(builder) {
|
|
188
|
+
this.operand = builder(ExpressionBuilder());
|
|
189
|
+
this.update({ operand: this.operand });
|
|
190
|
+
return this;
|
|
191
|
+
}
|
|
1249
192
|
};
|
|
1250
193
|
var ObjectExprFactory = class extends AstFactory {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
addField(builder) {
|
|
1264
|
-
this.fields.push(builder(new FieldInitializerFactory()));
|
|
1265
|
-
this.update({
|
|
1266
|
-
fields: this.fields
|
|
1267
|
-
});
|
|
1268
|
-
return this;
|
|
1269
|
-
}
|
|
194
|
+
fields = [];
|
|
195
|
+
constructor() {
|
|
196
|
+
super({
|
|
197
|
+
type: require_ast.ObjectExpr,
|
|
198
|
+
node: { fields: [] }
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
addField(builder) {
|
|
202
|
+
this.fields.push(builder(new FieldInitializerFactory()));
|
|
203
|
+
this.update({ fields: this.fields });
|
|
204
|
+
return this;
|
|
205
|
+
}
|
|
1270
206
|
};
|
|
1271
207
|
var FieldInitializerFactory = class extends AstFactory {
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
return this;
|
|
1288
|
-
}
|
|
1289
|
-
setValue(builder) {
|
|
1290
|
-
this.value = builder(ExpressionBuilder());
|
|
1291
|
-
this.update({
|
|
1292
|
-
value: this.value
|
|
1293
|
-
});
|
|
1294
|
-
return this;
|
|
1295
|
-
}
|
|
208
|
+
name;
|
|
209
|
+
value;
|
|
210
|
+
constructor() {
|
|
211
|
+
super({ type: require_ast.FieldInitializer });
|
|
212
|
+
}
|
|
213
|
+
setName(name) {
|
|
214
|
+
this.name = name;
|
|
215
|
+
this.update({ name: this.name });
|
|
216
|
+
return this;
|
|
217
|
+
}
|
|
218
|
+
setValue(builder) {
|
|
219
|
+
this.value = builder(ExpressionBuilder());
|
|
220
|
+
this.update({ value: this.value });
|
|
221
|
+
return this;
|
|
222
|
+
}
|
|
1296
223
|
};
|
|
1297
224
|
var InvocationExprFactory = class extends AstFactory {
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
this.function = {
|
|
1320
|
-
$refText: value.name,
|
|
1321
|
-
ref: value
|
|
1322
|
-
};
|
|
1323
|
-
this.update({
|
|
1324
|
-
function: this.function
|
|
1325
|
-
});
|
|
1326
|
-
return this;
|
|
1327
|
-
}
|
|
225
|
+
args = [];
|
|
226
|
+
function;
|
|
227
|
+
constructor() {
|
|
228
|
+
super({
|
|
229
|
+
type: require_ast.InvocationExpr,
|
|
230
|
+
node: { args: [] }
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
addArg(builder) {
|
|
234
|
+
this.args.push(builder(new ArgumentFactory()));
|
|
235
|
+
this.update({ args: this.args });
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
238
|
+
setFunction(value) {
|
|
239
|
+
this.function = {
|
|
240
|
+
$refText: value.name,
|
|
241
|
+
ref: value
|
|
242
|
+
};
|
|
243
|
+
this.update({ function: this.function });
|
|
244
|
+
return this;
|
|
245
|
+
}
|
|
1328
246
|
};
|
|
1329
247
|
var ArgumentFactory = class extends AstFactory {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
setValue(builder) {
|
|
1340
|
-
this.value = builder(ExpressionBuilder());
|
|
1341
|
-
this.update({
|
|
1342
|
-
value: this.value
|
|
1343
|
-
});
|
|
1344
|
-
return this;
|
|
1345
|
-
}
|
|
248
|
+
value;
|
|
249
|
+
constructor() {
|
|
250
|
+
super({ type: require_ast.Argument });
|
|
251
|
+
}
|
|
252
|
+
setValue(builder) {
|
|
253
|
+
this.value = builder(ExpressionBuilder());
|
|
254
|
+
this.update({ value: this.value });
|
|
255
|
+
return this;
|
|
256
|
+
}
|
|
1346
257
|
};
|
|
1347
258
|
var ArrayExprFactory = class extends AstFactory {
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
addItem(builder) {
|
|
1361
|
-
this.items.push(builder(ExpressionBuilder()));
|
|
1362
|
-
this.update({
|
|
1363
|
-
items: this.items
|
|
1364
|
-
});
|
|
1365
|
-
return this;
|
|
1366
|
-
}
|
|
259
|
+
items = [];
|
|
260
|
+
constructor() {
|
|
261
|
+
super({
|
|
262
|
+
type: require_ast.ArrayExpr,
|
|
263
|
+
node: { items: [] }
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
addItem(builder) {
|
|
267
|
+
this.items.push(builder(ExpressionBuilder()));
|
|
268
|
+
this.update({ items: this.items });
|
|
269
|
+
return this;
|
|
270
|
+
}
|
|
1367
271
|
};
|
|
1368
272
|
var BinaryExprFactory = class extends AstFactory {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
return this;
|
|
1394
|
-
}
|
|
1395
|
-
setLeft(builder) {
|
|
1396
|
-
this.left = builder(ExpressionBuilder());
|
|
1397
|
-
this.update({
|
|
1398
|
-
left: this.left
|
|
1399
|
-
});
|
|
1400
|
-
return this;
|
|
1401
|
-
}
|
|
1402
|
-
};
|
|
1403
|
-
|
|
1404
|
-
// src/factory/attribute.ts
|
|
273
|
+
operator;
|
|
274
|
+
right;
|
|
275
|
+
left;
|
|
276
|
+
constructor() {
|
|
277
|
+
super({ type: require_ast.BinaryExpr });
|
|
278
|
+
}
|
|
279
|
+
setOperator(operator) {
|
|
280
|
+
this.operator = operator;
|
|
281
|
+
this.update({ operator: this.operator });
|
|
282
|
+
return this;
|
|
283
|
+
}
|
|
284
|
+
setRight(builder) {
|
|
285
|
+
this.right = builder(ExpressionBuilder());
|
|
286
|
+
this.update({ right: this.right });
|
|
287
|
+
return this;
|
|
288
|
+
}
|
|
289
|
+
setLeft(builder) {
|
|
290
|
+
this.left = builder(ExpressionBuilder());
|
|
291
|
+
this.update({ left: this.left });
|
|
292
|
+
return this;
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region src/factory/attribute.ts
|
|
1405
297
|
var DataFieldAttributeFactory = class extends AstFactory {
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
return this;
|
|
1431
|
-
}
|
|
1432
|
-
addArg(builder, name) {
|
|
1433
|
-
const factory = new AttributeArgFactory().setValue(builder);
|
|
1434
|
-
if (name) {
|
|
1435
|
-
factory.setName(name);
|
|
1436
|
-
}
|
|
1437
|
-
this.args.push(factory);
|
|
1438
|
-
this.update({
|
|
1439
|
-
args: this.args
|
|
1440
|
-
});
|
|
1441
|
-
return this;
|
|
1442
|
-
}
|
|
298
|
+
args = [];
|
|
299
|
+
decl;
|
|
300
|
+
constructor() {
|
|
301
|
+
super({
|
|
302
|
+
type: require_ast.DataFieldAttribute,
|
|
303
|
+
node: { args: [] }
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
setDecl(decl) {
|
|
307
|
+
if (!decl) throw new Error("Attribute declaration is required");
|
|
308
|
+
this.decl = {
|
|
309
|
+
$refText: decl.name,
|
|
310
|
+
ref: decl
|
|
311
|
+
};
|
|
312
|
+
this.update({ decl: this.decl });
|
|
313
|
+
return this;
|
|
314
|
+
}
|
|
315
|
+
addArg(builder, name) {
|
|
316
|
+
const factory = new AttributeArgFactory().setValue(builder);
|
|
317
|
+
if (name) factory.setName(name);
|
|
318
|
+
this.args.push(factory);
|
|
319
|
+
this.update({ args: this.args });
|
|
320
|
+
return this;
|
|
321
|
+
}
|
|
1443
322
|
};
|
|
1444
323
|
var DataModelAttributeFactory = class extends AstFactory {
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
return this;
|
|
1470
|
-
}
|
|
1471
|
-
addArg(builder, name) {
|
|
1472
|
-
const factory = new AttributeArgFactory().setValue(builder);
|
|
1473
|
-
if (name) {
|
|
1474
|
-
factory.setName(name);
|
|
1475
|
-
}
|
|
1476
|
-
this.args.push(factory);
|
|
1477
|
-
this.update({
|
|
1478
|
-
args: this.args
|
|
1479
|
-
});
|
|
1480
|
-
return this;
|
|
1481
|
-
}
|
|
324
|
+
args = [];
|
|
325
|
+
decl;
|
|
326
|
+
constructor() {
|
|
327
|
+
super({
|
|
328
|
+
type: require_ast.DataModelAttribute,
|
|
329
|
+
node: { args: [] }
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
setDecl(decl) {
|
|
333
|
+
if (!decl) throw new Error("Attribute declaration is required");
|
|
334
|
+
this.decl = {
|
|
335
|
+
$refText: decl.name,
|
|
336
|
+
ref: decl
|
|
337
|
+
};
|
|
338
|
+
this.update({ decl: this.decl });
|
|
339
|
+
return this;
|
|
340
|
+
}
|
|
341
|
+
addArg(builder, name) {
|
|
342
|
+
const factory = new AttributeArgFactory().setValue(builder);
|
|
343
|
+
if (name) factory.setName(name);
|
|
344
|
+
this.args.push(factory);
|
|
345
|
+
this.update({ args: this.args });
|
|
346
|
+
return this;
|
|
347
|
+
}
|
|
1482
348
|
};
|
|
1483
349
|
var AttributeArgFactory = class extends AstFactory {
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
return this;
|
|
1500
|
-
}
|
|
1501
|
-
setValue(builder) {
|
|
1502
|
-
this.value = builder(ExpressionBuilder());
|
|
1503
|
-
this.update({
|
|
1504
|
-
value: this.value
|
|
1505
|
-
});
|
|
1506
|
-
return this;
|
|
1507
|
-
}
|
|
350
|
+
name = "";
|
|
351
|
+
value;
|
|
352
|
+
constructor() {
|
|
353
|
+
super({ type: require_ast.AttributeArg });
|
|
354
|
+
}
|
|
355
|
+
setName(name) {
|
|
356
|
+
this.name = name;
|
|
357
|
+
this.update({ name: this.name });
|
|
358
|
+
return this;
|
|
359
|
+
}
|
|
360
|
+
setValue(builder) {
|
|
361
|
+
this.value = builder(ExpressionBuilder());
|
|
362
|
+
this.update({ value: this.value });
|
|
363
|
+
return this;
|
|
364
|
+
}
|
|
1508
365
|
};
|
|
1509
366
|
var InternalAttributeFactory = class extends AstFactory {
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
addArg(builder, name) {
|
|
1534
|
-
const factory = new AttributeArgFactory().setValue(builder);
|
|
1535
|
-
if (name) {
|
|
1536
|
-
factory.setName(name);
|
|
1537
|
-
}
|
|
1538
|
-
this.args.push(factory);
|
|
1539
|
-
this.update({
|
|
1540
|
-
args: this.args
|
|
1541
|
-
});
|
|
1542
|
-
return this;
|
|
1543
|
-
}
|
|
367
|
+
decl;
|
|
368
|
+
args = [];
|
|
369
|
+
constructor() {
|
|
370
|
+
super({
|
|
371
|
+
type: require_ast.InternalAttribute,
|
|
372
|
+
node: { args: [] }
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
setDecl(decl) {
|
|
376
|
+
this.decl = {
|
|
377
|
+
$refText: decl.name,
|
|
378
|
+
ref: decl
|
|
379
|
+
};
|
|
380
|
+
this.update({ decl: this.decl });
|
|
381
|
+
return this;
|
|
382
|
+
}
|
|
383
|
+
addArg(builder, name) {
|
|
384
|
+
const factory = new AttributeArgFactory().setValue(builder);
|
|
385
|
+
if (name) factory.setName(name);
|
|
386
|
+
this.args.push(factory);
|
|
387
|
+
this.update({ args: this.args });
|
|
388
|
+
return this;
|
|
389
|
+
}
|
|
1544
390
|
};
|
|
1545
391
|
var AttributeParamFactory = class extends AstFactory {
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
this.name = name;
|
|
1586
|
-
this.update({
|
|
1587
|
-
name: this.name
|
|
1588
|
-
});
|
|
1589
|
-
return this;
|
|
1590
|
-
}
|
|
1591
|
-
setType(builder) {
|
|
1592
|
-
this.type = builder(new AttributeParamTypeFactory());
|
|
1593
|
-
this.update({
|
|
1594
|
-
type: this.type
|
|
1595
|
-
});
|
|
1596
|
-
return this;
|
|
1597
|
-
}
|
|
392
|
+
attributes = [];
|
|
393
|
+
comments = [];
|
|
394
|
+
default;
|
|
395
|
+
name;
|
|
396
|
+
type;
|
|
397
|
+
constructor() {
|
|
398
|
+
super({
|
|
399
|
+
type: require_ast.AttributeParam,
|
|
400
|
+
node: {
|
|
401
|
+
comments: [],
|
|
402
|
+
attributes: []
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
addAttribute(builder) {
|
|
407
|
+
this.attributes.push(builder(new InternalAttributeFactory()));
|
|
408
|
+
this.update({ attributes: this.attributes });
|
|
409
|
+
return this;
|
|
410
|
+
}
|
|
411
|
+
setComments(comments) {
|
|
412
|
+
this.comments = comments;
|
|
413
|
+
this.update({ comments: this.comments });
|
|
414
|
+
return this;
|
|
415
|
+
}
|
|
416
|
+
setDefault(defaultValue) {
|
|
417
|
+
this.default = defaultValue;
|
|
418
|
+
this.update({ default: this.default });
|
|
419
|
+
return this;
|
|
420
|
+
}
|
|
421
|
+
setName(name) {
|
|
422
|
+
this.name = name;
|
|
423
|
+
this.update({ name: this.name });
|
|
424
|
+
return this;
|
|
425
|
+
}
|
|
426
|
+
setType(builder) {
|
|
427
|
+
this.type = builder(new AttributeParamTypeFactory());
|
|
428
|
+
this.update({ type: this.type });
|
|
429
|
+
return this;
|
|
430
|
+
}
|
|
1598
431
|
};
|
|
1599
432
|
var AttributeParamTypeFactory = class extends AstFactory {
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
};
|
|
1631
|
-
this.update({
|
|
1632
|
-
reference: this.reference
|
|
1633
|
-
});
|
|
1634
|
-
return this;
|
|
1635
|
-
}
|
|
1636
|
-
setType(type) {
|
|
1637
|
-
this.type = type;
|
|
1638
|
-
this.update({
|
|
1639
|
-
type: this.type
|
|
1640
|
-
});
|
|
1641
|
-
return this;
|
|
1642
|
-
}
|
|
433
|
+
array;
|
|
434
|
+
optional;
|
|
435
|
+
reference;
|
|
436
|
+
type;
|
|
437
|
+
constructor() {
|
|
438
|
+
super({ type: require_ast.AttributeParamType });
|
|
439
|
+
}
|
|
440
|
+
setArray(array) {
|
|
441
|
+
this.array = array;
|
|
442
|
+
this.update({ array: this.array });
|
|
443
|
+
return this;
|
|
444
|
+
}
|
|
445
|
+
setOptional(optional) {
|
|
446
|
+
this.optional = optional;
|
|
447
|
+
this.update({ optional: this.optional });
|
|
448
|
+
return this;
|
|
449
|
+
}
|
|
450
|
+
setReference(reference) {
|
|
451
|
+
this.reference = {
|
|
452
|
+
$refText: reference.name,
|
|
453
|
+
ref: reference
|
|
454
|
+
};
|
|
455
|
+
this.update({ reference: this.reference });
|
|
456
|
+
return this;
|
|
457
|
+
}
|
|
458
|
+
setType(type) {
|
|
459
|
+
this.type = type;
|
|
460
|
+
this.update({ type: this.type });
|
|
461
|
+
return this;
|
|
462
|
+
}
|
|
1643
463
|
};
|
|
1644
464
|
var AttributeFactory = class extends AstFactory {
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
},
|
|
1712
|
-
get Plugin() {
|
|
1713
|
-
throw new Error("Plugin is not implemented");
|
|
1714
|
-
},
|
|
1715
|
-
get Procedure() {
|
|
1716
|
-
throw new Error("Procedure is not implemented");
|
|
1717
|
-
},
|
|
1718
|
-
get TypeDef() {
|
|
1719
|
-
throw new Error("TypeDef is not implemented");
|
|
1720
|
-
}
|
|
1721
|
-
}), "DeclarationBuilder");
|
|
465
|
+
name;
|
|
466
|
+
comments = [];
|
|
467
|
+
attributes = [];
|
|
468
|
+
params = [];
|
|
469
|
+
constructor() {
|
|
470
|
+
super({
|
|
471
|
+
type: require_ast.Attribute,
|
|
472
|
+
node: {
|
|
473
|
+
comments: [],
|
|
474
|
+
attributes: [],
|
|
475
|
+
params: []
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
setName(name) {
|
|
480
|
+
this.name = name;
|
|
481
|
+
this.update({ name: this.name });
|
|
482
|
+
return this;
|
|
483
|
+
}
|
|
484
|
+
setComments(comments) {
|
|
485
|
+
this.comments = comments;
|
|
486
|
+
this.update({ comments: this.comments });
|
|
487
|
+
return this;
|
|
488
|
+
}
|
|
489
|
+
addAttribute(builder) {
|
|
490
|
+
this.attributes.push(builder(new InternalAttributeFactory()));
|
|
491
|
+
this.update({ attributes: this.attributes });
|
|
492
|
+
return this;
|
|
493
|
+
}
|
|
494
|
+
addParam(builder) {
|
|
495
|
+
this.params.push(builder(new AttributeParamFactory()));
|
|
496
|
+
this.update({ params: this.params });
|
|
497
|
+
return this;
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/factory/declaration.ts
|
|
502
|
+
const DeclarationBuilder = () => ({
|
|
503
|
+
get Attribute() {
|
|
504
|
+
return new AttributeFactory();
|
|
505
|
+
},
|
|
506
|
+
get DataModel() {
|
|
507
|
+
return new DataModelFactory();
|
|
508
|
+
},
|
|
509
|
+
get DataSource() {
|
|
510
|
+
throw new Error("DataSource is not implemented");
|
|
511
|
+
},
|
|
512
|
+
get Enum() {
|
|
513
|
+
return new EnumFactory();
|
|
514
|
+
},
|
|
515
|
+
get FunctionDecl() {
|
|
516
|
+
throw new Error("FunctionDecl is not implemented");
|
|
517
|
+
},
|
|
518
|
+
get GeneratorDecl() {
|
|
519
|
+
throw new Error("GeneratorDecl is not implemented");
|
|
520
|
+
},
|
|
521
|
+
get Plugin() {
|
|
522
|
+
throw new Error("Plugin is not implemented");
|
|
523
|
+
},
|
|
524
|
+
get Procedure() {
|
|
525
|
+
throw new Error("Procedure is not implemented");
|
|
526
|
+
},
|
|
527
|
+
get TypeDef() {
|
|
528
|
+
throw new Error("TypeDef is not implemented");
|
|
529
|
+
}
|
|
530
|
+
});
|
|
1722
531
|
var DataModelFactory = class extends AstFactory {
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
this.update({
|
|
1782
|
-
isView: this.isView
|
|
1783
|
-
});
|
|
1784
|
-
return this;
|
|
1785
|
-
}
|
|
1786
|
-
addMixin(mixin) {
|
|
1787
|
-
this.mixins.push(mixin);
|
|
1788
|
-
this.update({
|
|
1789
|
-
mixins: this.mixins
|
|
1790
|
-
});
|
|
1791
|
-
return this;
|
|
1792
|
-
}
|
|
1793
|
-
setName(name) {
|
|
1794
|
-
this.name = name;
|
|
1795
|
-
this.update({
|
|
1796
|
-
name: this.name
|
|
1797
|
-
});
|
|
1798
|
-
return this;
|
|
1799
|
-
}
|
|
532
|
+
attributes = [];
|
|
533
|
+
baseModel;
|
|
534
|
+
comments = [];
|
|
535
|
+
fields = [];
|
|
536
|
+
isView;
|
|
537
|
+
mixins = [];
|
|
538
|
+
name;
|
|
539
|
+
constructor() {
|
|
540
|
+
super({
|
|
541
|
+
type: require_ast.DataModel,
|
|
542
|
+
node: {
|
|
543
|
+
attributes: [],
|
|
544
|
+
comments: [],
|
|
545
|
+
fields: [],
|
|
546
|
+
mixins: []
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
addAttribute(builder) {
|
|
551
|
+
this.attributes.push(builder(new DataModelAttributeFactory()).setContainer(this.node));
|
|
552
|
+
this.update({ attributes: this.attributes });
|
|
553
|
+
return this;
|
|
554
|
+
}
|
|
555
|
+
setBaseModel(model) {
|
|
556
|
+
this.baseModel = model;
|
|
557
|
+
this.update({ baseModel: this.baseModel });
|
|
558
|
+
return this;
|
|
559
|
+
}
|
|
560
|
+
setComments(comments) {
|
|
561
|
+
this.comments = comments;
|
|
562
|
+
this.update({ comments: this.comments });
|
|
563
|
+
return this;
|
|
564
|
+
}
|
|
565
|
+
addComment(comment) {
|
|
566
|
+
this.comments.push(comment);
|
|
567
|
+
this.update({ comments: this.comments });
|
|
568
|
+
return this;
|
|
569
|
+
}
|
|
570
|
+
addField(builder) {
|
|
571
|
+
this.fields.push(builder(new DataFieldFactory()).setContainer(this.node));
|
|
572
|
+
this.update({ fields: this.fields });
|
|
573
|
+
return this;
|
|
574
|
+
}
|
|
575
|
+
setIsView(isView) {
|
|
576
|
+
this.isView = isView;
|
|
577
|
+
this.update({ isView: this.isView });
|
|
578
|
+
return this;
|
|
579
|
+
}
|
|
580
|
+
addMixin(mixin) {
|
|
581
|
+
this.mixins.push(mixin);
|
|
582
|
+
this.update({ mixins: this.mixins });
|
|
583
|
+
return this;
|
|
584
|
+
}
|
|
585
|
+
setName(name) {
|
|
586
|
+
this.name = name;
|
|
587
|
+
this.update({ name: this.name });
|
|
588
|
+
return this;
|
|
589
|
+
}
|
|
1800
590
|
};
|
|
1801
591
|
var DataFieldFactory = class extends AstFactory {
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
name: this.name
|
|
1843
|
-
});
|
|
1844
|
-
return this;
|
|
1845
|
-
}
|
|
1846
|
-
setType(builder) {
|
|
1847
|
-
this.type = builder(new DataFieldTypeFactory()).setContainer(this.node);
|
|
1848
|
-
this.update({
|
|
1849
|
-
type: this.type
|
|
1850
|
-
});
|
|
1851
|
-
return this;
|
|
1852
|
-
}
|
|
592
|
+
attributes = [];
|
|
593
|
+
comments = [];
|
|
594
|
+
name;
|
|
595
|
+
type;
|
|
596
|
+
constructor() {
|
|
597
|
+
super({
|
|
598
|
+
type: require_ast.DataField,
|
|
599
|
+
node: {
|
|
600
|
+
attributes: [],
|
|
601
|
+
comments: []
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
addAttribute(builder) {
|
|
606
|
+
if (builder instanceof DataFieldAttributeFactory) {
|
|
607
|
+
builder.setContainer(this.node);
|
|
608
|
+
this.attributes.push(builder);
|
|
609
|
+
} else {
|
|
610
|
+
const attr = builder(new DataFieldAttributeFactory());
|
|
611
|
+
attr.setContainer(this.node);
|
|
612
|
+
this.attributes.push(attr);
|
|
613
|
+
}
|
|
614
|
+
this.update({ attributes: this.attributes });
|
|
615
|
+
return this;
|
|
616
|
+
}
|
|
617
|
+
setComments(comments) {
|
|
618
|
+
this.comments = comments;
|
|
619
|
+
this.update({ comments: this.comments });
|
|
620
|
+
return this;
|
|
621
|
+
}
|
|
622
|
+
setName(name) {
|
|
623
|
+
this.name = name;
|
|
624
|
+
this.update({ name: this.name });
|
|
625
|
+
return this;
|
|
626
|
+
}
|
|
627
|
+
setType(builder) {
|
|
628
|
+
this.type = builder(new DataFieldTypeFactory()).setContainer(this.node);
|
|
629
|
+
this.update({ type: this.type });
|
|
630
|
+
return this;
|
|
631
|
+
}
|
|
1853
632
|
};
|
|
1854
633
|
var DataFieldTypeFactory = class extends AstFactory {
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
}
|
|
1892
|
-
setType(type) {
|
|
1893
|
-
this.type = type;
|
|
1894
|
-
this.update({
|
|
1895
|
-
type: this.type
|
|
1896
|
-
});
|
|
1897
|
-
return this;
|
|
1898
|
-
}
|
|
1899
|
-
setUnsupported(builder) {
|
|
1900
|
-
this.unsupported = builder(new UnsupportedFieldTypeFactory()).setContainer(this.node);
|
|
1901
|
-
this.update({
|
|
1902
|
-
unsupported: this.unsupported
|
|
1903
|
-
});
|
|
1904
|
-
return this;
|
|
1905
|
-
}
|
|
634
|
+
array;
|
|
635
|
+
optional;
|
|
636
|
+
reference;
|
|
637
|
+
type;
|
|
638
|
+
unsupported;
|
|
639
|
+
constructor() {
|
|
640
|
+
super({ type: require_ast.DataFieldType });
|
|
641
|
+
}
|
|
642
|
+
setArray(array) {
|
|
643
|
+
this.array = array;
|
|
644
|
+
this.update({ array: this.array });
|
|
645
|
+
return this;
|
|
646
|
+
}
|
|
647
|
+
setOptional(optional) {
|
|
648
|
+
this.optional = optional;
|
|
649
|
+
this.update({ optional: this.optional });
|
|
650
|
+
return this;
|
|
651
|
+
}
|
|
652
|
+
setReference(reference) {
|
|
653
|
+
this.reference = {
|
|
654
|
+
$refText: reference.name,
|
|
655
|
+
ref: reference
|
|
656
|
+
};
|
|
657
|
+
this.update({ reference: this.reference });
|
|
658
|
+
return this;
|
|
659
|
+
}
|
|
660
|
+
setType(type) {
|
|
661
|
+
this.type = type;
|
|
662
|
+
this.update({ type: this.type });
|
|
663
|
+
return this;
|
|
664
|
+
}
|
|
665
|
+
setUnsupported(builder) {
|
|
666
|
+
this.unsupported = builder(new UnsupportedFieldTypeFactory()).setContainer(this.node);
|
|
667
|
+
this.update({ unsupported: this.unsupported });
|
|
668
|
+
return this;
|
|
669
|
+
}
|
|
1906
670
|
};
|
|
1907
671
|
var UnsupportedFieldTypeFactory = class extends AstFactory {
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
setValue(builder) {
|
|
1918
|
-
this.value = builder(ExpressionBuilder());
|
|
1919
|
-
this.update({
|
|
1920
|
-
value: this.value
|
|
1921
|
-
});
|
|
1922
|
-
return this;
|
|
1923
|
-
}
|
|
672
|
+
value;
|
|
673
|
+
constructor() {
|
|
674
|
+
super({ type: require_ast.UnsupportedFieldType });
|
|
675
|
+
}
|
|
676
|
+
setValue(builder) {
|
|
677
|
+
this.value = builder(ExpressionBuilder());
|
|
678
|
+
this.update({ value: this.value });
|
|
679
|
+
return this;
|
|
680
|
+
}
|
|
1924
681
|
};
|
|
1925
682
|
var ModelFactory = class extends AstFactory {
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
addDeclaration(builder) {
|
|
1948
|
-
this.declarations.push(builder(DeclarationBuilder()).setContainer(this.node));
|
|
1949
|
-
this.update({
|
|
1950
|
-
declarations: this.declarations
|
|
1951
|
-
});
|
|
1952
|
-
return this;
|
|
1953
|
-
}
|
|
683
|
+
declarations = [];
|
|
684
|
+
imports = [];
|
|
685
|
+
constructor() {
|
|
686
|
+
super({
|
|
687
|
+
type: require_ast.Model,
|
|
688
|
+
node: {
|
|
689
|
+
declarations: [],
|
|
690
|
+
imports: []
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
addImport(builder) {
|
|
695
|
+
this.imports.push(builder(new ModelImportFactory()).setContainer(this.node));
|
|
696
|
+
this.update({ imports: this.imports });
|
|
697
|
+
return this;
|
|
698
|
+
}
|
|
699
|
+
addDeclaration(builder) {
|
|
700
|
+
this.declarations.push(builder(DeclarationBuilder()).setContainer(this.node));
|
|
701
|
+
this.update({ declarations: this.declarations });
|
|
702
|
+
return this;
|
|
703
|
+
}
|
|
1954
704
|
};
|
|
1955
705
|
var ModelImportFactory = class extends AstFactory {
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
setPath(path) {
|
|
1966
|
-
this.path = path;
|
|
1967
|
-
this.update({
|
|
1968
|
-
path: this.path
|
|
1969
|
-
});
|
|
1970
|
-
return this;
|
|
1971
|
-
}
|
|
706
|
+
path;
|
|
707
|
+
constructor() {
|
|
708
|
+
super({ type: require_ast.ModelImport });
|
|
709
|
+
}
|
|
710
|
+
setPath(path) {
|
|
711
|
+
this.path = path;
|
|
712
|
+
this.update({ path: this.path });
|
|
713
|
+
return this;
|
|
714
|
+
}
|
|
1972
715
|
};
|
|
1973
716
|
var EnumFactory = class extends AstFactory {
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
return this;
|
|
2004
|
-
}
|
|
2005
|
-
setName(name) {
|
|
2006
|
-
this.name = name;
|
|
2007
|
-
this.update({
|
|
2008
|
-
name: this.name
|
|
2009
|
-
});
|
|
2010
|
-
return this;
|
|
2011
|
-
}
|
|
717
|
+
name;
|
|
718
|
+
comments = [];
|
|
719
|
+
fields = [];
|
|
720
|
+
attributes = [];
|
|
721
|
+
constructor() {
|
|
722
|
+
super({
|
|
723
|
+
type: require_ast.Enum,
|
|
724
|
+
node: {
|
|
725
|
+
comments: [],
|
|
726
|
+
fields: [],
|
|
727
|
+
attributes: []
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
addField(builder) {
|
|
732
|
+
this.fields.push(builder(new EnumFieldFactory()).setContainer(this.node));
|
|
733
|
+
this.update({ fields: this.fields });
|
|
734
|
+
return this;
|
|
735
|
+
}
|
|
736
|
+
addAttribute(builder) {
|
|
737
|
+
this.attributes.push(builder(new DataModelAttributeFactory()).setContainer(this.node));
|
|
738
|
+
this.update({ attributes: this.attributes });
|
|
739
|
+
return this;
|
|
740
|
+
}
|
|
741
|
+
setName(name) {
|
|
742
|
+
this.name = name;
|
|
743
|
+
this.update({ name: this.name });
|
|
744
|
+
return this;
|
|
745
|
+
}
|
|
2012
746
|
};
|
|
2013
747
|
var EnumFieldFactory = class extends AstFactory {
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
NullExprFactory,
|
|
2078
|
-
NumberLiteralFactory,
|
|
2079
|
-
ObjectExprFactory,
|
|
2080
|
-
ReferenceArgFactory,
|
|
2081
|
-
ReferenceExprFactory,
|
|
2082
|
-
StringLiteralFactory,
|
|
2083
|
-
ThisExprFactory,
|
|
2084
|
-
UnaryExprFactory,
|
|
2085
|
-
UnsupportedFieldTypeFactory
|
|
2086
|
-
});
|
|
748
|
+
name;
|
|
749
|
+
comments = [];
|
|
750
|
+
attributes = [];
|
|
751
|
+
constructor() {
|
|
752
|
+
super({
|
|
753
|
+
type: require_ast.EnumField,
|
|
754
|
+
node: {
|
|
755
|
+
comments: [],
|
|
756
|
+
attributes: []
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
setName(name) {
|
|
761
|
+
this.name = name;
|
|
762
|
+
this.update({ name: this.name });
|
|
763
|
+
return this;
|
|
764
|
+
}
|
|
765
|
+
addAttribute(builder) {
|
|
766
|
+
this.attributes.push(builder(new DataFieldAttributeFactory()).setContainer(this.node));
|
|
767
|
+
this.update({ attributes: this.attributes });
|
|
768
|
+
return this;
|
|
769
|
+
}
|
|
770
|
+
addComment(comment) {
|
|
771
|
+
this.comments.push(comment);
|
|
772
|
+
this.update({ comments: this.comments });
|
|
773
|
+
return this;
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
//#endregion
|
|
777
|
+
exports.ArgumentFactory = ArgumentFactory;
|
|
778
|
+
exports.ArrayExprFactory = ArrayExprFactory;
|
|
779
|
+
exports.AstFactory = AstFactory;
|
|
780
|
+
exports.AttributeArgFactory = AttributeArgFactory;
|
|
781
|
+
exports.AttributeFactory = AttributeFactory;
|
|
782
|
+
exports.AttributeParamFactory = AttributeParamFactory;
|
|
783
|
+
exports.AttributeParamTypeFactory = AttributeParamTypeFactory;
|
|
784
|
+
exports.BinaryExprFactory = BinaryExprFactory;
|
|
785
|
+
exports.BooleanLiteralFactory = BooleanLiteralFactory;
|
|
786
|
+
exports.DataFieldAttributeFactory = DataFieldAttributeFactory;
|
|
787
|
+
exports.DataFieldFactory = DataFieldFactory;
|
|
788
|
+
exports.DataFieldTypeFactory = DataFieldTypeFactory;
|
|
789
|
+
exports.DataModelAttributeFactory = DataModelAttributeFactory;
|
|
790
|
+
exports.DataModelFactory = DataModelFactory;
|
|
791
|
+
exports.DeclarationBuilder = DeclarationBuilder;
|
|
792
|
+
exports.EnumFactory = EnumFactory;
|
|
793
|
+
exports.EnumFieldFactory = EnumFieldFactory;
|
|
794
|
+
exports.ExpressionBuilder = ExpressionBuilder;
|
|
795
|
+
exports.FieldInitializerFactory = FieldInitializerFactory;
|
|
796
|
+
exports.InternalAttributeFactory = InternalAttributeFactory;
|
|
797
|
+
exports.InvocationExprFactory = InvocationExprFactory;
|
|
798
|
+
exports.MemberAccessExprFactory = MemberAccessExprFactory;
|
|
799
|
+
exports.ModelFactory = ModelFactory;
|
|
800
|
+
exports.ModelImportFactory = ModelImportFactory;
|
|
801
|
+
exports.NullExprFactory = NullExprFactory;
|
|
802
|
+
exports.NumberLiteralFactory = NumberLiteralFactory;
|
|
803
|
+
exports.ObjectExprFactory = ObjectExprFactory;
|
|
804
|
+
exports.ReferenceArgFactory = ReferenceArgFactory;
|
|
805
|
+
exports.ReferenceExprFactory = ReferenceExprFactory;
|
|
806
|
+
exports.StringLiteralFactory = StringLiteralFactory;
|
|
807
|
+
exports.ThisExprFactory = ThisExprFactory;
|
|
808
|
+
exports.UnaryExprFactory = UnaryExprFactory;
|
|
809
|
+
exports.UnsupportedFieldTypeFactory = UnsupportedFieldTypeFactory;
|
|
810
|
+
|
|
2087
811
|
//# sourceMappingURL=factory.cjs.map
|