@zenstackhq/language 2.16.0 → 3.0.0-alpha.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/LICENSE +1 -1
- package/dist/ast.cjs +1472 -0
- package/dist/ast.cjs.map +1 -0
- package/dist/ast.d.cts +566 -0
- package/dist/ast.d.ts +566 -0
- package/dist/ast.js +1331 -0
- package/dist/ast.js.map +1 -0
- package/dist/index.cjs +7790 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +94 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.js +7755 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -33
- package/res/stdlib.zmodel +721 -0
- package/README.md +0 -5
- package/ast.d.ts +0 -55
- package/ast.js +0 -37
- package/ast.js.map +0 -1
- package/generated/ast.d.ts +0 -485
- package/generated/ast.js +0 -640
- package/generated/ast.js.map +0 -1
- package/generated/grammar.d.ts +0 -6
- package/generated/grammar.js +0 -3941
- package/generated/grammar.js.map +0 -1
- package/generated/module.d.ts +0 -12
- package/generated/module.js +0 -23
- package/generated/module.js.map +0 -1
- package/module.d.ts +0 -1
- package/module.js +0 -18
- package/module.js.map +0 -1
- package/syntaxes/zmodel.tmLanguage +0 -113
- package/syntaxes/zmodel.tmLanguage.json +0 -71
package/dist/ast.d.ts
ADDED
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
import { AstNode, Reference, AbstractAstReflection, ReferenceInfo, TypeMetaData } from 'langium';
|
|
2
|
+
export { AstNode, Reference } from 'langium';
|
|
3
|
+
|
|
4
|
+
/******************************************************************************
|
|
5
|
+
* This file was generated by langium-cli 3.3.0.
|
|
6
|
+
* DO NOT EDIT MANUALLY!
|
|
7
|
+
******************************************************************************/
|
|
8
|
+
|
|
9
|
+
declare const ZModelTerminals: {
|
|
10
|
+
WS: RegExp;
|
|
11
|
+
INTERNAL_ATTRIBUTE_NAME: RegExp;
|
|
12
|
+
MODEL_ATTRIBUTE_NAME: RegExp;
|
|
13
|
+
FIELD_ATTRIBUTE_NAME: RegExp;
|
|
14
|
+
ID: RegExp;
|
|
15
|
+
STRING: RegExp;
|
|
16
|
+
NUMBER: RegExp;
|
|
17
|
+
TRIPLE_SLASH_COMMENT: RegExp;
|
|
18
|
+
ML_COMMENT: RegExp;
|
|
19
|
+
SL_COMMENT: RegExp;
|
|
20
|
+
};
|
|
21
|
+
type ZModelTerminalNames = keyof typeof ZModelTerminals;
|
|
22
|
+
type ZModelKeywordNames = "!" | "!=" | "&&" | "(" | ")" | "," | "." | ":" | ";" | "<" | "<=" | "=" | "==" | ">" | ">=" | "?" | "Any" | "BigInt" | "Boolean" | "Bytes" | "ContextType" | "DateTime" | "Decimal" | "FieldReference" | "Float" | "Int" | "Json" | "Null" | "Object" | "String" | "TransitiveFieldReference" | "Unsupported" | "[" | "]" | "^" | "_" | "abstract" | "attribute" | "datasource" | "enum" | "extends" | "false" | "function" | "generator" | "import" | "in" | "model" | "mutation" | "null" | "plugin" | "procedure" | "this" | "true" | "type" | "view" | "{" | "||" | "}";
|
|
23
|
+
type ZModelTokenNames = ZModelTerminalNames | ZModelKeywordNames;
|
|
24
|
+
type AbstractDeclaration = Attribute | DataModel | DataSource | Enum | FunctionDecl | GeneratorDecl | Plugin | Procedure | TypeDef;
|
|
25
|
+
declare const AbstractDeclaration = "AbstractDeclaration";
|
|
26
|
+
declare function isAbstractDeclaration(item: unknown): item is AbstractDeclaration;
|
|
27
|
+
type Boolean = boolean;
|
|
28
|
+
declare function isBoolean(item: unknown): item is Boolean;
|
|
29
|
+
type BuiltinType = 'BigInt' | 'Boolean' | 'Bytes' | 'DateTime' | 'Decimal' | 'Float' | 'Int' | 'Json' | 'String';
|
|
30
|
+
declare function isBuiltinType(item: unknown): item is BuiltinType;
|
|
31
|
+
type ConfigExpr = ConfigArrayExpr | InvocationExpr | LiteralExpr;
|
|
32
|
+
declare const ConfigExpr = "ConfigExpr";
|
|
33
|
+
declare function isConfigExpr(item: unknown): item is ConfigExpr;
|
|
34
|
+
type Expression = ArrayExpr | BinaryExpr | InvocationExpr | LiteralExpr | MemberAccessExpr | NullExpr | ObjectExpr | ReferenceExpr | ThisExpr | UnaryExpr;
|
|
35
|
+
declare const Expression = "Expression";
|
|
36
|
+
declare function isExpression(item: unknown): item is Expression;
|
|
37
|
+
type ExpressionType = 'Any' | 'Boolean' | 'DateTime' | 'Float' | 'Int' | 'Null' | 'Object' | 'String' | 'Unsupported';
|
|
38
|
+
declare function isExpressionType(item: unknown): item is ExpressionType;
|
|
39
|
+
type LiteralExpr = BooleanLiteral | NumberLiteral | StringLiteral;
|
|
40
|
+
declare const LiteralExpr = "LiteralExpr";
|
|
41
|
+
declare function isLiteralExpr(item: unknown): item is LiteralExpr;
|
|
42
|
+
type MemberAccessTarget = DataModelField | TypeDefField;
|
|
43
|
+
declare const MemberAccessTarget = "MemberAccessTarget";
|
|
44
|
+
declare function isMemberAccessTarget(item: unknown): item is MemberAccessTarget;
|
|
45
|
+
type ReferenceTarget = DataModelField | EnumField | FunctionParam | TypeDefField;
|
|
46
|
+
declare const ReferenceTarget = "ReferenceTarget";
|
|
47
|
+
declare function isReferenceTarget(item: unknown): item is ReferenceTarget;
|
|
48
|
+
type RegularID = 'abstract' | 'attribute' | 'datasource' | 'enum' | 'import' | 'in' | 'model' | 'plugin' | 'type' | 'view' | string;
|
|
49
|
+
declare function isRegularID(item: unknown): item is RegularID;
|
|
50
|
+
type RegularIDWithTypeNames = 'Any' | 'BigInt' | 'Boolean' | 'Bytes' | 'DateTime' | 'Decimal' | 'Float' | 'Int' | 'Json' | 'Null' | 'Object' | 'String' | 'Unsupported' | RegularID;
|
|
51
|
+
declare function isRegularIDWithTypeNames(item: unknown): item is RegularIDWithTypeNames;
|
|
52
|
+
type TypeDeclaration = DataModel | Enum | TypeDef;
|
|
53
|
+
declare const TypeDeclaration = "TypeDeclaration";
|
|
54
|
+
declare function isTypeDeclaration(item: unknown): item is TypeDeclaration;
|
|
55
|
+
type TypeDefFieldTypes = Enum | TypeDef;
|
|
56
|
+
declare const TypeDefFieldTypes = "TypeDefFieldTypes";
|
|
57
|
+
declare function isTypeDefFieldTypes(item: unknown): item is TypeDefFieldTypes;
|
|
58
|
+
interface Argument extends AstNode {
|
|
59
|
+
readonly $container: InvocationExpr;
|
|
60
|
+
readonly $type: 'Argument';
|
|
61
|
+
value: Expression;
|
|
62
|
+
}
|
|
63
|
+
declare const Argument = "Argument";
|
|
64
|
+
declare function isArgument(item: unknown): item is Argument;
|
|
65
|
+
interface ArrayExpr extends AstNode {
|
|
66
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr;
|
|
67
|
+
readonly $type: 'ArrayExpr';
|
|
68
|
+
items: Array<Expression>;
|
|
69
|
+
}
|
|
70
|
+
declare const ArrayExpr = "ArrayExpr";
|
|
71
|
+
declare function isArrayExpr(item: unknown): item is ArrayExpr;
|
|
72
|
+
interface Attribute extends AstNode {
|
|
73
|
+
readonly $container: Model;
|
|
74
|
+
readonly $type: 'Attribute';
|
|
75
|
+
attributes: Array<InternalAttribute>;
|
|
76
|
+
comments: Array<string>;
|
|
77
|
+
name: string;
|
|
78
|
+
params: Array<AttributeParam$1>;
|
|
79
|
+
}
|
|
80
|
+
declare const Attribute = "Attribute";
|
|
81
|
+
declare function isAttribute(item: unknown): item is Attribute;
|
|
82
|
+
interface AttributeArg extends AstNode {
|
|
83
|
+
readonly $container: DataModelAttribute | DataModelFieldAttribute | InternalAttribute;
|
|
84
|
+
readonly $type: 'AttributeArg';
|
|
85
|
+
name?: RegularID;
|
|
86
|
+
value: Expression;
|
|
87
|
+
}
|
|
88
|
+
declare const AttributeArg = "AttributeArg";
|
|
89
|
+
declare function isAttributeArg(item: unknown): item is AttributeArg;
|
|
90
|
+
interface AttributeParam$1 extends AstNode {
|
|
91
|
+
readonly $container: Attribute;
|
|
92
|
+
readonly $type: 'AttributeParam';
|
|
93
|
+
attributes: Array<InternalAttribute>;
|
|
94
|
+
comments: Array<string>;
|
|
95
|
+
default: boolean;
|
|
96
|
+
name: RegularID;
|
|
97
|
+
type: AttributeParamType;
|
|
98
|
+
}
|
|
99
|
+
declare const AttributeParam$1 = "AttributeParam";
|
|
100
|
+
declare function isAttributeParam(item: unknown): item is AttributeParam$1;
|
|
101
|
+
interface AttributeParamType extends AstNode {
|
|
102
|
+
readonly $container: AttributeParam$1;
|
|
103
|
+
readonly $type: 'AttributeParamType';
|
|
104
|
+
array: boolean;
|
|
105
|
+
optional: boolean;
|
|
106
|
+
reference?: Reference<TypeDeclaration>;
|
|
107
|
+
type?: 'ContextType' | 'FieldReference' | 'TransitiveFieldReference' | ExpressionType;
|
|
108
|
+
}
|
|
109
|
+
declare const AttributeParamType = "AttributeParamType";
|
|
110
|
+
declare function isAttributeParamType(item: unknown): item is AttributeParamType;
|
|
111
|
+
interface BinaryExpr extends AstNode {
|
|
112
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | FieldInitializer | FunctionDecl | MemberAccessExpr | ReferenceArg | UnaryExpr;
|
|
113
|
+
readonly $type: 'BinaryExpr';
|
|
114
|
+
left: Expression;
|
|
115
|
+
operator: '!' | '!=' | '&&' | '<' | '<=' | '==' | '>' | '>=' | '?' | '^' | 'in' | '||';
|
|
116
|
+
right: Expression;
|
|
117
|
+
}
|
|
118
|
+
declare const BinaryExpr = "BinaryExpr";
|
|
119
|
+
declare function isBinaryExpr(item: unknown): item is BinaryExpr;
|
|
120
|
+
interface BooleanLiteral extends AstNode {
|
|
121
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
|
|
122
|
+
readonly $type: 'BooleanLiteral';
|
|
123
|
+
value: Boolean;
|
|
124
|
+
}
|
|
125
|
+
declare const BooleanLiteral = "BooleanLiteral";
|
|
126
|
+
declare function isBooleanLiteral(item: unknown): item is BooleanLiteral;
|
|
127
|
+
interface ConfigArrayExpr extends AstNode {
|
|
128
|
+
readonly $container: ConfigField;
|
|
129
|
+
readonly $type: 'ConfigArrayExpr';
|
|
130
|
+
items: Array<ConfigInvocationExpr | LiteralExpr>;
|
|
131
|
+
}
|
|
132
|
+
declare const ConfigArrayExpr = "ConfigArrayExpr";
|
|
133
|
+
declare function isConfigArrayExpr(item: unknown): item is ConfigArrayExpr;
|
|
134
|
+
interface ConfigField extends AstNode {
|
|
135
|
+
readonly $container: DataSource | GeneratorDecl;
|
|
136
|
+
readonly $type: 'ConfigField';
|
|
137
|
+
name: RegularID;
|
|
138
|
+
value: ConfigExpr;
|
|
139
|
+
}
|
|
140
|
+
declare const ConfigField = "ConfigField";
|
|
141
|
+
declare function isConfigField(item: unknown): item is ConfigField;
|
|
142
|
+
interface ConfigInvocationArg extends AstNode {
|
|
143
|
+
readonly $container: ConfigInvocationExpr;
|
|
144
|
+
readonly $type: 'ConfigInvocationArg';
|
|
145
|
+
name: string;
|
|
146
|
+
value: LiteralExpr;
|
|
147
|
+
}
|
|
148
|
+
declare const ConfigInvocationArg = "ConfigInvocationArg";
|
|
149
|
+
declare function isConfigInvocationArg(item: unknown): item is ConfigInvocationArg;
|
|
150
|
+
interface ConfigInvocationExpr extends AstNode {
|
|
151
|
+
readonly $container: ConfigArrayExpr;
|
|
152
|
+
readonly $type: 'ConfigInvocationExpr';
|
|
153
|
+
args: Array<ConfigInvocationArg>;
|
|
154
|
+
name: string;
|
|
155
|
+
}
|
|
156
|
+
declare const ConfigInvocationExpr = "ConfigInvocationExpr";
|
|
157
|
+
declare function isConfigInvocationExpr(item: unknown): item is ConfigInvocationExpr;
|
|
158
|
+
interface DataModel extends AstNode {
|
|
159
|
+
readonly $container: Model;
|
|
160
|
+
readonly $type: 'DataModel';
|
|
161
|
+
attributes: Array<DataModelAttribute>;
|
|
162
|
+
comments: Array<string>;
|
|
163
|
+
fields: Array<DataModelField>;
|
|
164
|
+
isAbstract: boolean;
|
|
165
|
+
isView: boolean;
|
|
166
|
+
name: RegularID;
|
|
167
|
+
superTypes: Array<Reference<DataModel>>;
|
|
168
|
+
}
|
|
169
|
+
declare const DataModel = "DataModel";
|
|
170
|
+
declare function isDataModel(item: unknown): item is DataModel;
|
|
171
|
+
interface DataModelAttribute extends AstNode {
|
|
172
|
+
readonly $container: DataModel | Enum | TypeDef;
|
|
173
|
+
readonly $type: 'DataModelAttribute';
|
|
174
|
+
args: Array<AttributeArg>;
|
|
175
|
+
decl: Reference<Attribute>;
|
|
176
|
+
}
|
|
177
|
+
declare const DataModelAttribute = "DataModelAttribute";
|
|
178
|
+
declare function isDataModelAttribute(item: unknown): item is DataModelAttribute;
|
|
179
|
+
interface DataModelField extends AstNode {
|
|
180
|
+
readonly $container: DataModel;
|
|
181
|
+
readonly $type: 'DataModelField';
|
|
182
|
+
attributes: Array<DataModelFieldAttribute>;
|
|
183
|
+
comments: Array<string>;
|
|
184
|
+
name: RegularIDWithTypeNames;
|
|
185
|
+
type: DataModelFieldType;
|
|
186
|
+
}
|
|
187
|
+
declare const DataModelField = "DataModelField";
|
|
188
|
+
declare function isDataModelField(item: unknown): item is DataModelField;
|
|
189
|
+
interface DataModelFieldAttribute extends AstNode {
|
|
190
|
+
readonly $container: DataModelField | EnumField | TypeDefField;
|
|
191
|
+
readonly $type: 'DataModelFieldAttribute';
|
|
192
|
+
args: Array<AttributeArg>;
|
|
193
|
+
decl: Reference<Attribute>;
|
|
194
|
+
}
|
|
195
|
+
declare const DataModelFieldAttribute = "DataModelFieldAttribute";
|
|
196
|
+
declare function isDataModelFieldAttribute(item: unknown): item is DataModelFieldAttribute;
|
|
197
|
+
interface DataModelFieldType extends AstNode {
|
|
198
|
+
readonly $container: DataModelField;
|
|
199
|
+
readonly $type: 'DataModelFieldType';
|
|
200
|
+
array: boolean;
|
|
201
|
+
optional: boolean;
|
|
202
|
+
reference?: Reference<TypeDeclaration>;
|
|
203
|
+
type?: BuiltinType;
|
|
204
|
+
unsupported?: UnsupportedFieldType;
|
|
205
|
+
}
|
|
206
|
+
declare const DataModelFieldType = "DataModelFieldType";
|
|
207
|
+
declare function isDataModelFieldType(item: unknown): item is DataModelFieldType;
|
|
208
|
+
interface DataSource extends AstNode {
|
|
209
|
+
readonly $container: Model;
|
|
210
|
+
readonly $type: 'DataSource';
|
|
211
|
+
fields: Array<ConfigField>;
|
|
212
|
+
name: RegularID;
|
|
213
|
+
}
|
|
214
|
+
declare const DataSource = "DataSource";
|
|
215
|
+
declare function isDataSource(item: unknown): item is DataSource;
|
|
216
|
+
interface Enum extends AstNode {
|
|
217
|
+
readonly $container: Model;
|
|
218
|
+
readonly $type: 'Enum';
|
|
219
|
+
attributes: Array<DataModelAttribute>;
|
|
220
|
+
comments: Array<string>;
|
|
221
|
+
fields: Array<EnumField>;
|
|
222
|
+
name: RegularID;
|
|
223
|
+
}
|
|
224
|
+
declare const Enum = "Enum";
|
|
225
|
+
declare function isEnum(item: unknown): item is Enum;
|
|
226
|
+
interface EnumField extends AstNode {
|
|
227
|
+
readonly $container: Enum;
|
|
228
|
+
readonly $type: 'EnumField';
|
|
229
|
+
attributes: Array<DataModelFieldAttribute>;
|
|
230
|
+
comments: Array<string>;
|
|
231
|
+
name: RegularIDWithTypeNames;
|
|
232
|
+
}
|
|
233
|
+
declare const EnumField = "EnumField";
|
|
234
|
+
declare function isEnumField(item: unknown): item is EnumField;
|
|
235
|
+
interface FieldInitializer extends AstNode {
|
|
236
|
+
readonly $container: ObjectExpr;
|
|
237
|
+
readonly $type: 'FieldInitializer';
|
|
238
|
+
name: RegularID | string;
|
|
239
|
+
value: Expression;
|
|
240
|
+
}
|
|
241
|
+
declare const FieldInitializer = "FieldInitializer";
|
|
242
|
+
declare function isFieldInitializer(item: unknown): item is FieldInitializer;
|
|
243
|
+
interface FunctionDecl extends AstNode {
|
|
244
|
+
readonly $container: Model;
|
|
245
|
+
readonly $type: 'FunctionDecl';
|
|
246
|
+
attributes: Array<InternalAttribute>;
|
|
247
|
+
expression?: Expression;
|
|
248
|
+
name: RegularID;
|
|
249
|
+
params: Array<FunctionParam>;
|
|
250
|
+
returnType: FunctionParamType;
|
|
251
|
+
}
|
|
252
|
+
declare const FunctionDecl = "FunctionDecl";
|
|
253
|
+
declare function isFunctionDecl(item: unknown): item is FunctionDecl;
|
|
254
|
+
interface FunctionParam extends AstNode {
|
|
255
|
+
readonly $container: FunctionDecl | Procedure;
|
|
256
|
+
readonly $type: 'FunctionParam';
|
|
257
|
+
name: RegularID;
|
|
258
|
+
optional: boolean;
|
|
259
|
+
type: FunctionParamType;
|
|
260
|
+
}
|
|
261
|
+
declare const FunctionParam = "FunctionParam";
|
|
262
|
+
declare function isFunctionParam(item: unknown): item is FunctionParam;
|
|
263
|
+
interface FunctionParamType extends AstNode {
|
|
264
|
+
readonly $container: FunctionDecl | FunctionParam | Procedure | ProcedureParam;
|
|
265
|
+
readonly $type: 'FunctionParamType';
|
|
266
|
+
array: boolean;
|
|
267
|
+
reference?: Reference<TypeDeclaration>;
|
|
268
|
+
type?: ExpressionType;
|
|
269
|
+
}
|
|
270
|
+
declare const FunctionParamType = "FunctionParamType";
|
|
271
|
+
declare function isFunctionParamType(item: unknown): item is FunctionParamType;
|
|
272
|
+
interface GeneratorDecl extends AstNode {
|
|
273
|
+
readonly $container: Model;
|
|
274
|
+
readonly $type: 'GeneratorDecl';
|
|
275
|
+
fields: Array<ConfigField>;
|
|
276
|
+
name: RegularID;
|
|
277
|
+
}
|
|
278
|
+
declare const GeneratorDecl = "GeneratorDecl";
|
|
279
|
+
declare function isGeneratorDecl(item: unknown): item is GeneratorDecl;
|
|
280
|
+
interface InternalAttribute extends AstNode {
|
|
281
|
+
readonly $container: Attribute | AttributeParam$1 | FunctionDecl | Procedure;
|
|
282
|
+
readonly $type: 'InternalAttribute';
|
|
283
|
+
args: Array<AttributeArg>;
|
|
284
|
+
decl: Reference<Attribute>;
|
|
285
|
+
}
|
|
286
|
+
declare const InternalAttribute = "InternalAttribute";
|
|
287
|
+
declare function isInternalAttribute(item: unknown): item is InternalAttribute;
|
|
288
|
+
interface InvocationExpr extends AstNode {
|
|
289
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigField | FieldInitializer | FunctionDecl | MemberAccessExpr | ReferenceArg | UnaryExpr;
|
|
290
|
+
readonly $type: 'InvocationExpr';
|
|
291
|
+
args: Array<Argument>;
|
|
292
|
+
function: Reference<FunctionDecl>;
|
|
293
|
+
}
|
|
294
|
+
declare const InvocationExpr = "InvocationExpr";
|
|
295
|
+
declare function isInvocationExpr(item: unknown): item is InvocationExpr;
|
|
296
|
+
interface MemberAccessExpr extends AstNode {
|
|
297
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | FieldInitializer | FunctionDecl | MemberAccessExpr | ReferenceArg | UnaryExpr;
|
|
298
|
+
readonly $type: 'MemberAccessExpr';
|
|
299
|
+
member: Reference<MemberAccessTarget>;
|
|
300
|
+
operand: Expression;
|
|
301
|
+
}
|
|
302
|
+
declare const MemberAccessExpr = "MemberAccessExpr";
|
|
303
|
+
declare function isMemberAccessExpr(item: unknown): item is MemberAccessExpr;
|
|
304
|
+
interface Model extends AstNode {
|
|
305
|
+
readonly $type: 'Model';
|
|
306
|
+
declarations: Array<AbstractDeclaration>;
|
|
307
|
+
imports: Array<ModelImport>;
|
|
308
|
+
}
|
|
309
|
+
declare const Model = "Model";
|
|
310
|
+
declare function isModel(item: unknown): item is Model;
|
|
311
|
+
interface ModelImport extends AstNode {
|
|
312
|
+
readonly $container: Model;
|
|
313
|
+
readonly $type: 'ModelImport';
|
|
314
|
+
path: string;
|
|
315
|
+
}
|
|
316
|
+
declare const ModelImport = "ModelImport";
|
|
317
|
+
declare function isModelImport(item: unknown): item is ModelImport;
|
|
318
|
+
interface NullExpr extends AstNode {
|
|
319
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | FieldInitializer | FunctionDecl | MemberAccessExpr | ReferenceArg | UnaryExpr;
|
|
320
|
+
readonly $type: 'NullExpr';
|
|
321
|
+
value: 'null';
|
|
322
|
+
}
|
|
323
|
+
declare const NullExpr = "NullExpr";
|
|
324
|
+
declare function isNullExpr(item: unknown): item is NullExpr;
|
|
325
|
+
interface NumberLiteral extends AstNode {
|
|
326
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
|
|
327
|
+
readonly $type: 'NumberLiteral';
|
|
328
|
+
value: string;
|
|
329
|
+
}
|
|
330
|
+
declare const NumberLiteral = "NumberLiteral";
|
|
331
|
+
declare function isNumberLiteral(item: unknown): item is NumberLiteral;
|
|
332
|
+
interface ObjectExpr extends AstNode {
|
|
333
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr;
|
|
334
|
+
readonly $type: 'ObjectExpr';
|
|
335
|
+
fields: Array<FieldInitializer>;
|
|
336
|
+
}
|
|
337
|
+
declare const ObjectExpr = "ObjectExpr";
|
|
338
|
+
declare function isObjectExpr(item: unknown): item is ObjectExpr;
|
|
339
|
+
interface Plugin extends AstNode {
|
|
340
|
+
readonly $container: Model;
|
|
341
|
+
readonly $type: 'Plugin';
|
|
342
|
+
fields: Array<PluginField>;
|
|
343
|
+
name: RegularID;
|
|
344
|
+
}
|
|
345
|
+
declare const Plugin = "Plugin";
|
|
346
|
+
declare function isPlugin(item: unknown): item is Plugin;
|
|
347
|
+
interface PluginField extends AstNode {
|
|
348
|
+
readonly $container: Plugin;
|
|
349
|
+
readonly $type: 'PluginField';
|
|
350
|
+
name: RegularID;
|
|
351
|
+
value: ArrayExpr | LiteralExpr | ObjectExpr;
|
|
352
|
+
}
|
|
353
|
+
declare const PluginField = "PluginField";
|
|
354
|
+
declare function isPluginField(item: unknown): item is PluginField;
|
|
355
|
+
interface Procedure extends AstNode {
|
|
356
|
+
readonly $container: Model;
|
|
357
|
+
readonly $type: 'Procedure';
|
|
358
|
+
attributes: Array<InternalAttribute>;
|
|
359
|
+
mutation: boolean;
|
|
360
|
+
name: RegularID;
|
|
361
|
+
params: Array<FunctionParam | ProcedureParam>;
|
|
362
|
+
returnType: FunctionParamType;
|
|
363
|
+
}
|
|
364
|
+
declare const Procedure = "Procedure";
|
|
365
|
+
declare function isProcedure(item: unknown): item is Procedure;
|
|
366
|
+
interface ProcedureParam extends AstNode {
|
|
367
|
+
readonly $container: Procedure;
|
|
368
|
+
readonly $type: 'ProcedureParam';
|
|
369
|
+
name: RegularID;
|
|
370
|
+
optional: boolean;
|
|
371
|
+
type: FunctionParamType;
|
|
372
|
+
}
|
|
373
|
+
declare const ProcedureParam = "ProcedureParam";
|
|
374
|
+
declare function isProcedureParam(item: unknown): item is ProcedureParam;
|
|
375
|
+
interface ReferenceArg extends AstNode {
|
|
376
|
+
readonly $container: ReferenceExpr;
|
|
377
|
+
readonly $type: 'ReferenceArg';
|
|
378
|
+
name: string;
|
|
379
|
+
value: Expression;
|
|
380
|
+
}
|
|
381
|
+
declare const ReferenceArg = "ReferenceArg";
|
|
382
|
+
declare function isReferenceArg(item: unknown): item is ReferenceArg;
|
|
383
|
+
interface ReferenceExpr extends AstNode {
|
|
384
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | FieldInitializer | FunctionDecl | MemberAccessExpr | ReferenceArg | UnaryExpr;
|
|
385
|
+
readonly $type: 'ReferenceExpr';
|
|
386
|
+
args: Array<ReferenceArg>;
|
|
387
|
+
target: Reference<ReferenceTarget>;
|
|
388
|
+
}
|
|
389
|
+
declare const ReferenceExpr = "ReferenceExpr";
|
|
390
|
+
declare function isReferenceExpr(item: unknown): item is ReferenceExpr;
|
|
391
|
+
interface StringLiteral extends AstNode {
|
|
392
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
|
|
393
|
+
readonly $type: 'StringLiteral';
|
|
394
|
+
value: string;
|
|
395
|
+
}
|
|
396
|
+
declare const StringLiteral = "StringLiteral";
|
|
397
|
+
declare function isStringLiteral(item: unknown): item is StringLiteral;
|
|
398
|
+
interface ThisExpr extends AstNode {
|
|
399
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | FieldInitializer | FunctionDecl | MemberAccessExpr | ReferenceArg | UnaryExpr;
|
|
400
|
+
readonly $type: 'ThisExpr';
|
|
401
|
+
value: 'this';
|
|
402
|
+
}
|
|
403
|
+
declare const ThisExpr = "ThisExpr";
|
|
404
|
+
declare function isThisExpr(item: unknown): item is ThisExpr;
|
|
405
|
+
interface TypeDef extends AstNode {
|
|
406
|
+
readonly $container: Model;
|
|
407
|
+
readonly $type: 'TypeDef';
|
|
408
|
+
attributes: Array<DataModelAttribute>;
|
|
409
|
+
comments: Array<string>;
|
|
410
|
+
fields: Array<TypeDefField>;
|
|
411
|
+
name: RegularID;
|
|
412
|
+
}
|
|
413
|
+
declare const TypeDef = "TypeDef";
|
|
414
|
+
declare function isTypeDef(item: unknown): item is TypeDef;
|
|
415
|
+
interface TypeDefField extends AstNode {
|
|
416
|
+
readonly $container: TypeDef;
|
|
417
|
+
readonly $type: 'TypeDefField';
|
|
418
|
+
attributes: Array<DataModelFieldAttribute>;
|
|
419
|
+
comments: Array<string>;
|
|
420
|
+
name: RegularIDWithTypeNames;
|
|
421
|
+
type: TypeDefFieldType;
|
|
422
|
+
}
|
|
423
|
+
declare const TypeDefField = "TypeDefField";
|
|
424
|
+
declare function isTypeDefField(item: unknown): item is TypeDefField;
|
|
425
|
+
interface TypeDefFieldType extends AstNode {
|
|
426
|
+
readonly $container: TypeDefField;
|
|
427
|
+
readonly $type: 'TypeDefFieldType';
|
|
428
|
+
array: boolean;
|
|
429
|
+
optional: boolean;
|
|
430
|
+
reference?: Reference<TypeDefFieldTypes>;
|
|
431
|
+
type?: BuiltinType;
|
|
432
|
+
}
|
|
433
|
+
declare const TypeDefFieldType = "TypeDefFieldType";
|
|
434
|
+
declare function isTypeDefFieldType(item: unknown): item is TypeDefFieldType;
|
|
435
|
+
interface UnaryExpr extends AstNode {
|
|
436
|
+
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | FieldInitializer | FunctionDecl | MemberAccessExpr | ReferenceArg | UnaryExpr;
|
|
437
|
+
readonly $type: 'UnaryExpr';
|
|
438
|
+
operand: Expression;
|
|
439
|
+
operator: '!';
|
|
440
|
+
}
|
|
441
|
+
declare const UnaryExpr = "UnaryExpr";
|
|
442
|
+
declare function isUnaryExpr(item: unknown): item is UnaryExpr;
|
|
443
|
+
interface UnsupportedFieldType extends AstNode {
|
|
444
|
+
readonly $container: DataModelFieldType;
|
|
445
|
+
readonly $type: 'UnsupportedFieldType';
|
|
446
|
+
value: LiteralExpr;
|
|
447
|
+
}
|
|
448
|
+
declare const UnsupportedFieldType = "UnsupportedFieldType";
|
|
449
|
+
declare function isUnsupportedFieldType(item: unknown): item is UnsupportedFieldType;
|
|
450
|
+
type ZModelAstType = {
|
|
451
|
+
AbstractDeclaration: AbstractDeclaration;
|
|
452
|
+
Argument: Argument;
|
|
453
|
+
ArrayExpr: ArrayExpr;
|
|
454
|
+
Attribute: Attribute;
|
|
455
|
+
AttributeArg: AttributeArg;
|
|
456
|
+
AttributeParam: AttributeParam$1;
|
|
457
|
+
AttributeParamType: AttributeParamType;
|
|
458
|
+
BinaryExpr: BinaryExpr;
|
|
459
|
+
BooleanLiteral: BooleanLiteral;
|
|
460
|
+
ConfigArrayExpr: ConfigArrayExpr;
|
|
461
|
+
ConfigExpr: ConfigExpr;
|
|
462
|
+
ConfigField: ConfigField;
|
|
463
|
+
ConfigInvocationArg: ConfigInvocationArg;
|
|
464
|
+
ConfigInvocationExpr: ConfigInvocationExpr;
|
|
465
|
+
DataModel: DataModel;
|
|
466
|
+
DataModelAttribute: DataModelAttribute;
|
|
467
|
+
DataModelField: DataModelField;
|
|
468
|
+
DataModelFieldAttribute: DataModelFieldAttribute;
|
|
469
|
+
DataModelFieldType: DataModelFieldType;
|
|
470
|
+
DataSource: DataSource;
|
|
471
|
+
Enum: Enum;
|
|
472
|
+
EnumField: EnumField;
|
|
473
|
+
Expression: Expression;
|
|
474
|
+
FieldInitializer: FieldInitializer;
|
|
475
|
+
FunctionDecl: FunctionDecl;
|
|
476
|
+
FunctionParam: FunctionParam;
|
|
477
|
+
FunctionParamType: FunctionParamType;
|
|
478
|
+
GeneratorDecl: GeneratorDecl;
|
|
479
|
+
InternalAttribute: InternalAttribute;
|
|
480
|
+
InvocationExpr: InvocationExpr;
|
|
481
|
+
LiteralExpr: LiteralExpr;
|
|
482
|
+
MemberAccessExpr: MemberAccessExpr;
|
|
483
|
+
MemberAccessTarget: MemberAccessTarget;
|
|
484
|
+
Model: Model;
|
|
485
|
+
ModelImport: ModelImport;
|
|
486
|
+
NullExpr: NullExpr;
|
|
487
|
+
NumberLiteral: NumberLiteral;
|
|
488
|
+
ObjectExpr: ObjectExpr;
|
|
489
|
+
Plugin: Plugin;
|
|
490
|
+
PluginField: PluginField;
|
|
491
|
+
Procedure: Procedure;
|
|
492
|
+
ProcedureParam: ProcedureParam;
|
|
493
|
+
ReferenceArg: ReferenceArg;
|
|
494
|
+
ReferenceExpr: ReferenceExpr;
|
|
495
|
+
ReferenceTarget: ReferenceTarget;
|
|
496
|
+
StringLiteral: StringLiteral;
|
|
497
|
+
ThisExpr: ThisExpr;
|
|
498
|
+
TypeDeclaration: TypeDeclaration;
|
|
499
|
+
TypeDef: TypeDef;
|
|
500
|
+
TypeDefField: TypeDefField;
|
|
501
|
+
TypeDefFieldType: TypeDefFieldType;
|
|
502
|
+
TypeDefFieldTypes: TypeDefFieldTypes;
|
|
503
|
+
UnaryExpr: UnaryExpr;
|
|
504
|
+
UnsupportedFieldType: UnsupportedFieldType;
|
|
505
|
+
};
|
|
506
|
+
declare class ZModelAstReflection extends AbstractAstReflection {
|
|
507
|
+
getAllTypes(): string[];
|
|
508
|
+
protected computeIsSubtype(subtype: string, supertype: string): boolean;
|
|
509
|
+
getReferenceType(refInfo: ReferenceInfo): string;
|
|
510
|
+
getTypeMetaData(type: string): TypeMetaData;
|
|
511
|
+
}
|
|
512
|
+
declare const reflection: ZModelAstReflection;
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Shape of type resolution result: an expression type or reference to a declaration
|
|
516
|
+
*/
|
|
517
|
+
type ResolvedShape = ExpressionType | AbstractDeclaration;
|
|
518
|
+
/**
|
|
519
|
+
* Resolved type information (attached to expressions by linker)
|
|
520
|
+
*/
|
|
521
|
+
type ResolvedType = {
|
|
522
|
+
decl?: ResolvedShape;
|
|
523
|
+
array?: boolean;
|
|
524
|
+
nullable?: boolean;
|
|
525
|
+
};
|
|
526
|
+
declare const BinaryExprOperatorPriority: Record<BinaryExpr['operator'], number>;
|
|
527
|
+
declare module './ast' {
|
|
528
|
+
interface AttributeArg {
|
|
529
|
+
/**
|
|
530
|
+
* Resolved attribute param declaration
|
|
531
|
+
*/
|
|
532
|
+
$resolvedParam?: AttributeParam;
|
|
533
|
+
}
|
|
534
|
+
interface DataModelField {
|
|
535
|
+
$inheritedFrom?: DataModel;
|
|
536
|
+
}
|
|
537
|
+
interface DataModelAttribute {
|
|
538
|
+
$inheritedFrom?: DataModel;
|
|
539
|
+
}
|
|
540
|
+
interface DataModel {
|
|
541
|
+
/**
|
|
542
|
+
* Indicates whether the model is already merged with the base types
|
|
543
|
+
*/
|
|
544
|
+
$baseMerged?: boolean;
|
|
545
|
+
/**
|
|
546
|
+
* All fields including those marked with `@ignore`
|
|
547
|
+
*/
|
|
548
|
+
$allFields?: DataModelField[];
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
interface InheritableNode extends AstNode {
|
|
552
|
+
$inheritedFrom?: DataModel;
|
|
553
|
+
}
|
|
554
|
+
interface InheritableNode extends AstNode {
|
|
555
|
+
$inheritedFrom?: DataModel;
|
|
556
|
+
}
|
|
557
|
+
declare module 'langium' {
|
|
558
|
+
interface AstNode {
|
|
559
|
+
/**
|
|
560
|
+
* Resolved type information attached to expressions
|
|
561
|
+
*/
|
|
562
|
+
$resolvedType?: ResolvedType;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export { AbstractDeclaration, Argument, ArrayExpr, Attribute, AttributeArg, AttributeParam$1 as AttributeParam, AttributeParamType, BinaryExpr, BinaryExprOperatorPriority, type Boolean, BooleanLiteral, type BuiltinType, ConfigArrayExpr, ConfigExpr, ConfigField, ConfigInvocationArg, ConfigInvocationExpr, DataModel, DataModelAttribute, DataModelField, DataModelFieldAttribute, DataModelFieldType, DataSource, Enum, EnumField, Expression, type ExpressionType, FieldInitializer, FunctionDecl, FunctionParam, FunctionParamType, GeneratorDecl, type InheritableNode, InternalAttribute, InvocationExpr, LiteralExpr, MemberAccessExpr, MemberAccessTarget, Model, ModelImport, NullExpr, NumberLiteral, ObjectExpr, Plugin, PluginField, Procedure, ProcedureParam, ReferenceArg, ReferenceExpr, ReferenceTarget, type RegularID, type RegularIDWithTypeNames, type ResolvedShape, type ResolvedType, StringLiteral, ThisExpr, TypeDeclaration, TypeDef, TypeDefField, TypeDefFieldType, TypeDefFieldTypes, UnaryExpr, UnsupportedFieldType, ZModelAstReflection, type ZModelAstType, type ZModelKeywordNames, type ZModelTerminalNames, ZModelTerminals, type ZModelTokenNames, isAbstractDeclaration, isArgument, isArrayExpr, isAttribute, isAttributeArg, isAttributeParam, isAttributeParamType, isBinaryExpr, isBoolean, isBooleanLiteral, isBuiltinType, isConfigArrayExpr, isConfigExpr, isConfigField, isConfigInvocationArg, isConfigInvocationExpr, isDataModel, isDataModelAttribute, isDataModelField, isDataModelFieldAttribute, isDataModelFieldType, isDataSource, isEnum, isEnumField, isExpression, isExpressionType, isFieldInitializer, isFunctionDecl, isFunctionParam, isFunctionParamType, isGeneratorDecl, isInternalAttribute, isInvocationExpr, isLiteralExpr, isMemberAccessExpr, isMemberAccessTarget, isModel, isModelImport, isNullExpr, isNumberLiteral, isObjectExpr, isPlugin, isPluginField, isProcedure, isProcedureParam, isReferenceArg, isReferenceExpr, isReferenceTarget, isRegularID, isRegularIDWithTypeNames, isStringLiteral, isThisExpr, isTypeDeclaration, isTypeDef, isTypeDefField, isTypeDefFieldType, isTypeDefFieldTypes, isUnaryExpr, isUnsupportedFieldType, reflection };
|