@zenstackhq/language 0.6.0-pre.2 → 1.0.0-alpha.100

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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # ZenStack ZModel language compiler
2
+
3
+ This package provides the AST of ZModel - ZenStack's modeling language.
4
+
5
+ Visit [Homepage](https://zenstack.dev) for more details.
package/ast.d.ts CHANGED
@@ -1,2 +1,32 @@
1
+ import { AbstractDeclaration, ExpressionType, BinaryExpr } from './generated/ast';
1
2
  export * from './generated/ast';
2
3
  export { AstNode, Reference } from 'langium';
4
+ /**
5
+ * Shape of type resolution result: an expression type or reference to a declaration
6
+ */
7
+ export type ResolvedShape = ExpressionType | AbstractDeclaration;
8
+ /**
9
+ * Resolved type information (attached to expressions by linker)
10
+ */
11
+ export type ResolvedType = {
12
+ decl?: ResolvedShape;
13
+ array?: boolean;
14
+ nullable?: boolean;
15
+ };
16
+ export declare const BinaryExprOperatorPriority: Record<BinaryExpr['operator'], number>;
17
+ declare module './generated/ast' {
18
+ interface AttributeArg {
19
+ /**
20
+ * Resolved attribute param declaration
21
+ */
22
+ $resolvedParam?: AttributeParam;
23
+ }
24
+ }
25
+ declare module 'langium' {
26
+ interface AstNode {
27
+ /**
28
+ * Resolved type information attached to expressions
29
+ */
30
+ $resolvedType?: ResolvedType;
31
+ }
32
+ }
package/ast.js CHANGED
@@ -14,5 +14,24 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.BinaryExprOperatorPriority = void 0;
17
18
  __exportStar(require("./generated/ast"), exports);
19
+ exports.BinaryExprOperatorPriority = {
20
+ //LogicalExpr
21
+ '||': 1,
22
+ '&&': 1,
23
+ //EqualityExpr
24
+ '==': 2,
25
+ '!=': 2,
26
+ //ComparisonExpr
27
+ '>': 3,
28
+ '<': 3,
29
+ '>=': 3,
30
+ '<=': 3,
31
+ in: 4,
32
+ //CollectionPredicateExpr
33
+ '^': 5,
34
+ '?': 5,
35
+ '!': 5,
36
+ };
18
37
  //# sourceMappingURL=ast.js.map
package/ast.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ast.js","sourceRoot":"","sources":["../src/ast.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
1
+ {"version":3,"file":"ast.js","sourceRoot":"","sources":["../src/ast.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,kDAAgC;AAiBnB,QAAA,0BAA0B,GAA2C;IAC9E,aAAa;IACb,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,cAAc;IACd,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,gBAAgB;IAChB,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,EAAE,EAAE,CAAC;IACL,yBAAyB;IACzB,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;CACT,CAAC"}
@@ -1,41 +1,46 @@
1
1
  /******************************************************************************
2
- * This file was generated by langium-cli 0.5.0.
2
+ * This file was generated by langium-cli 1.1.0.
3
3
  * DO NOT EDIT MANUALLY!
4
4
  ******************************************************************************/
5
- import { AstNode, AstReflection, Reference, ReferenceInfo, TypeMetaData } from 'langium';
6
- export type AbstractDeclaration = Attribute | DataModel | DataSource | Enum | Function | Generator | Plugin;
5
+ import { AstNode, AbstractAstReflection, Reference, ReferenceInfo, TypeMetaData } from 'langium';
6
+ export type AbstractDeclaration = Attribute | DataModel | DataSource | Enum | FunctionDecl | GeneratorDecl | Plugin;
7
7
  export declare const AbstractDeclaration = "AbstractDeclaration";
8
8
  export declare function isAbstractDeclaration(item: unknown): item is AbstractDeclaration;
9
9
  export type AttributeAttributeName = string;
10
- export type AttributeName = string;
10
+ export type AttributeName = AttributeAttributeName | DataModelAttributeName | DataModelFieldAttributeName;
11
11
  export type BuiltinType = 'BigInt' | 'Boolean' | 'Bytes' | 'DateTime' | 'Decimal' | 'Float' | 'Int' | 'Json' | 'String';
12
12
  export type DataModelAttributeName = string;
13
13
  export type DataModelFieldAttributeName = string;
14
- export type Expression = ArrayExpr | BinaryExpr | InvocationExpr | LiteralExpr | MemberAccessExpr | NullExpr | ReferenceExpr | ThisExpr | UnaryExpr;
14
+ export type Expression = ArrayExpr | BinaryExpr | InvocationExpr | LiteralExpr | MemberAccessExpr | NullExpr | ObjectExpr | ReferenceExpr | ThisExpr | UnaryExpr;
15
15
  export declare const Expression = "Expression";
16
16
  export declare function isExpression(item: unknown): item is Expression;
17
- export type ExpressionType = 'Any' | 'Boolean' | 'DateTime' | 'Float' | 'Int' | 'Null' | 'String';
17
+ export type ExpressionType = 'Any' | 'Boolean' | 'DateTime' | 'Float' | 'Int' | 'Null' | 'Object' | 'String';
18
+ export type QualifiedName = string;
18
19
  export type ReferenceTarget = DataModelField | EnumField | FunctionParam;
19
20
  export declare const ReferenceTarget = "ReferenceTarget";
20
21
  export declare function isReferenceTarget(item: unknown): item is ReferenceTarget;
22
+ export type RegularID = 'in' | string;
21
23
  export type TypeDeclaration = DataModel | Enum;
22
24
  export declare const TypeDeclaration = "TypeDeclaration";
23
25
  export declare function isTypeDeclaration(item: unknown): item is TypeDeclaration;
24
26
  export interface Argument extends AstNode {
25
27
  readonly $container: InvocationExpr;
26
- name?: string;
28
+ readonly $type: 'Argument';
29
+ name?: RegularID;
27
30
  value: Expression;
28
31
  }
29
32
  export declare const Argument = "Argument";
30
33
  export declare function isArgument(item: unknown): item is Argument;
31
34
  export interface ArrayExpr extends AstNode {
32
- readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | Function | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
35
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
36
+ readonly $type: 'ArrayExpr';
33
37
  items: Array<Expression>;
34
38
  }
35
39
  export declare const ArrayExpr = "ArrayExpr";
36
40
  export declare function isArrayExpr(item: unknown): item is ArrayExpr;
37
41
  export interface Attribute extends AstNode {
38
42
  readonly $container: Model;
43
+ readonly $type: 'Attribute';
39
44
  attributes: Array<AttributeAttribute>;
40
45
  name: AttributeName;
41
46
  params: Array<AttributeParam>;
@@ -44,13 +49,15 @@ export declare const Attribute = "Attribute";
44
49
  export declare function isAttribute(item: unknown): item is Attribute;
45
50
  export interface AttributeArg extends AstNode {
46
51
  readonly $container: AttributeAttribute | DataModelAttribute | DataModelFieldAttribute;
47
- name?: string;
52
+ readonly $type: 'AttributeArg';
53
+ name?: RegularID;
48
54
  value: Expression;
49
55
  }
50
56
  export declare const AttributeArg = "AttributeArg";
51
57
  export declare function isAttributeArg(item: unknown): item is AttributeArg;
52
58
  export interface AttributeAttribute extends AstNode {
53
59
  readonly $container: Attribute;
60
+ readonly $type: 'AttributeAttribute';
54
61
  args: Array<AttributeArg>;
55
62
  decl: Reference<Attribute>;
56
63
  }
@@ -58,54 +65,63 @@ export declare const AttributeAttribute = "AttributeAttribute";
58
65
  export declare function isAttributeAttribute(item: unknown): item is AttributeAttribute;
59
66
  export interface AttributeParam extends AstNode {
60
67
  readonly $container: Attribute;
68
+ readonly $type: 'AttributeParam';
61
69
  default: boolean;
62
- name: string;
70
+ name: RegularID;
63
71
  type: AttributeParamType;
64
72
  }
65
73
  export declare const AttributeParam = "AttributeParam";
66
74
  export declare function isAttributeParam(item: unknown): item is AttributeParam;
67
75
  export interface AttributeParamType extends AstNode {
68
76
  readonly $container: AttributeParam;
77
+ readonly $type: 'AttributeParamType';
69
78
  array: boolean;
70
79
  optional: boolean;
71
80
  reference?: Reference<TypeDeclaration>;
72
- type?: 'ContextType' | 'FieldReference' | ExpressionType;
81
+ type?: 'ContextType' | 'FieldReference' | 'TransitiveFieldReference' | ExpressionType;
73
82
  }
74
83
  export declare const AttributeParamType = "AttributeParamType";
75
84
  export declare function isAttributeParamType(item: unknown): item is AttributeParamType;
76
85
  export interface BinaryExpr extends AstNode {
77
- readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | Function | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
86
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
87
+ readonly $type: 'BinaryExpr';
78
88
  left: Expression;
79
- operator: '!' | '!=' | '&&' | '<' | '<=' | '==' | '>' | '>=' | '?' | '^' | '||';
89
+ operator: '!' | '!=' | '&&' | '<' | '<=' | '==' | '>' | '>=' | '?' | '^' | 'in' | '||';
80
90
  right: Expression;
81
91
  }
82
92
  export declare const BinaryExpr = "BinaryExpr";
83
93
  export declare function isBinaryExpr(item: unknown): item is BinaryExpr;
84
94
  export interface DataModel extends AstNode {
85
95
  readonly $container: Model;
96
+ readonly $type: 'DataModel';
86
97
  attributes: Array<DataModelAttribute>;
98
+ comments: Array<string>;
87
99
  fields: Array<DataModelField>;
88
- name: string;
100
+ name: RegularID;
89
101
  }
90
102
  export declare const DataModel = "DataModel";
91
103
  export declare function isDataModel(item: unknown): item is DataModel;
92
104
  export interface DataModelAttribute extends AstNode {
93
- readonly $container: DataModel;
105
+ readonly $container: DataModel | Enum;
106
+ readonly $type: 'DataModelAttribute';
94
107
  args: Array<AttributeArg>;
95
108
  decl: Reference<Attribute>;
96
109
  }
97
110
  export declare const DataModelAttribute = "DataModelAttribute";
98
111
  export declare function isDataModelAttribute(item: unknown): item is DataModelAttribute;
99
112
  export interface DataModelField extends AstNode {
100
- readonly $container: DataModel;
113
+ readonly $container: DataModel | Enum | FunctionDecl;
114
+ readonly $type: 'DataModelField';
101
115
  attributes: Array<DataModelFieldAttribute>;
102
- name: string;
116
+ comments: Array<string>;
117
+ name: RegularID;
103
118
  type: DataModelFieldType;
104
119
  }
105
120
  export declare const DataModelField = "DataModelField";
106
121
  export declare function isDataModelField(item: unknown): item is DataModelField;
107
122
  export interface DataModelFieldAttribute extends AstNode {
108
- readonly $container: DataModelField;
123
+ readonly $container: DataModelField | EnumField;
124
+ readonly $type: 'DataModelFieldAttribute';
109
125
  args: Array<AttributeArg>;
110
126
  decl: Reference<Attribute>;
111
127
  }
@@ -113,6 +129,7 @@ export declare const DataModelFieldAttribute = "DataModelFieldAttribute";
113
129
  export declare function isDataModelFieldAttribute(item: unknown): item is DataModelFieldAttribute;
114
130
  export interface DataModelFieldType extends AstNode {
115
131
  readonly $container: DataModelField;
132
+ readonly $type: 'DataModelFieldType';
116
133
  array: boolean;
117
134
  optional: boolean;
118
135
  reference?: Reference<TypeDeclaration>;
@@ -122,146 +139,225 @@ export declare const DataModelFieldType = "DataModelFieldType";
122
139
  export declare function isDataModelFieldType(item: unknown): item is DataModelFieldType;
123
140
  export interface DataSource extends AstNode {
124
141
  readonly $container: Model;
142
+ readonly $type: 'DataSource';
125
143
  fields: Array<DataSourceField>;
126
- name: string;
144
+ name: RegularID;
127
145
  }
128
146
  export declare const DataSource = "DataSource";
129
147
  export declare function isDataSource(item: unknown): item is DataSource;
130
148
  export interface DataSourceField extends AstNode {
131
149
  readonly $container: DataSource;
132
- name: string;
133
- value: InvocationExpr | LiteralExpr;
150
+ readonly $type: 'DataSourceField';
151
+ name: RegularID;
152
+ value: ArrayExpr | InvocationExpr | LiteralExpr;
134
153
  }
135
154
  export declare const DataSourceField = "DataSourceField";
136
155
  export declare function isDataSourceField(item: unknown): item is DataSourceField;
137
156
  export interface Enum extends AstNode {
138
157
  readonly $container: Model;
158
+ readonly $type: 'Enum';
159
+ attributes: Array<DataModelAttribute>;
160
+ comments: Array<string>;
139
161
  fields: Array<EnumField>;
140
- name: string;
162
+ name: RegularID;
141
163
  }
142
164
  export declare const Enum = "Enum";
143
165
  export declare function isEnum(item: unknown): item is Enum;
144
166
  export interface EnumField extends AstNode {
145
- readonly $container: Enum;
146
- name: string;
167
+ readonly $container: DataModel | Enum | FunctionDecl;
168
+ readonly $type: 'EnumField';
169
+ attributes: Array<DataModelFieldAttribute>;
170
+ comments: Array<string>;
171
+ name: RegularID;
147
172
  }
148
173
  export declare const EnumField = "EnumField";
149
174
  export declare function isEnumField(item: unknown): item is EnumField;
150
- export interface Function extends AstNode {
175
+ export interface FieldInitializer extends AstNode {
176
+ readonly $container: ObjectExpr;
177
+ readonly $type: 'FieldInitializer';
178
+ name: RegularID;
179
+ value: Expression;
180
+ }
181
+ export declare const FieldInitializer = "FieldInitializer";
182
+ export declare function isFieldInitializer(item: unknown): item is FieldInitializer;
183
+ export interface FunctionDecl extends AstNode {
151
184
  readonly $container: Model;
185
+ readonly $type: 'FunctionDecl';
152
186
  expression?: Expression;
153
- name: string;
187
+ name: RegularID;
154
188
  params: Array<FunctionParam>;
155
189
  returnType: FunctionParamType;
156
190
  }
157
- export declare const Function = "Function";
158
- export declare function isFunction(item: unknown): item is Function;
191
+ export declare const FunctionDecl = "FunctionDecl";
192
+ export declare function isFunctionDecl(item: unknown): item is FunctionDecl;
159
193
  export interface FunctionParam extends AstNode {
160
- readonly $container: Function;
161
- name: string;
194
+ readonly $container: DataModel | Enum | FunctionDecl;
195
+ readonly $type: 'FunctionParam';
196
+ name: RegularID;
197
+ optional: boolean;
162
198
  type: FunctionParamType;
163
199
  }
164
200
  export declare const FunctionParam = "FunctionParam";
165
201
  export declare function isFunctionParam(item: unknown): item is FunctionParam;
166
202
  export interface FunctionParamType extends AstNode {
167
- readonly $container: Function | FunctionParam;
203
+ readonly $container: FunctionDecl | FunctionParam;
204
+ readonly $type: 'FunctionParamType';
168
205
  array: boolean;
169
206
  reference?: Reference<TypeDeclaration>;
170
207
  type?: ExpressionType;
171
208
  }
172
209
  export declare const FunctionParamType = "FunctionParamType";
173
210
  export declare function isFunctionParamType(item: unknown): item is FunctionParamType;
174
- export interface Generator extends AstNode {
211
+ export interface GeneratorDecl extends AstNode {
175
212
  readonly $container: Model;
213
+ readonly $type: 'GeneratorDecl';
176
214
  fields: Array<GeneratorField>;
177
- name: string;
215
+ name: RegularID;
178
216
  }
179
- export declare const Generator = "Generator";
180
- export declare function isGenerator(item: unknown): item is Generator;
217
+ export declare const GeneratorDecl = "GeneratorDecl";
218
+ export declare function isGeneratorDecl(item: unknown): item is GeneratorDecl;
181
219
  export interface GeneratorField extends AstNode {
182
- readonly $container: Generator;
183
- name: string;
220
+ readonly $container: GeneratorDecl;
221
+ readonly $type: 'GeneratorField';
222
+ name: RegularID;
184
223
  value: ArrayExpr | LiteralExpr;
185
224
  }
186
225
  export declare const GeneratorField = "GeneratorField";
187
226
  export declare function isGeneratorField(item: unknown): item is GeneratorField;
188
227
  export interface InvocationExpr extends AstNode {
189
- readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | Function | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
228
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
229
+ readonly $type: 'InvocationExpr';
190
230
  args: Array<Argument>;
191
- function: Reference<Function>;
231
+ function: Reference<FunctionDecl>;
192
232
  }
193
233
  export declare const InvocationExpr = "InvocationExpr";
194
234
  export declare function isInvocationExpr(item: unknown): item is InvocationExpr;
195
235
  export interface LiteralExpr extends AstNode {
196
- readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | Function | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
236
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
237
+ readonly $type: 'LiteralExpr';
197
238
  value: boolean | number | string;
198
239
  }
199
240
  export declare const LiteralExpr = "LiteralExpr";
200
241
  export declare function isLiteralExpr(item: unknown): item is LiteralExpr;
201
242
  export interface MemberAccessExpr extends AstNode {
202
- readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | Function | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
243
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
244
+ readonly $type: 'MemberAccessExpr';
203
245
  member: Reference<DataModelField>;
204
246
  operand: Expression;
205
247
  }
206
248
  export declare const MemberAccessExpr = "MemberAccessExpr";
207
249
  export declare function isMemberAccessExpr(item: unknown): item is MemberAccessExpr;
208
250
  export interface Model extends AstNode {
251
+ readonly $type: 'Model';
209
252
  declarations: Array<AbstractDeclaration>;
210
253
  }
211
254
  export declare const Model = "Model";
212
255
  export declare function isModel(item: unknown): item is Model;
213
256
  export interface NullExpr extends AstNode {
214
- readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | Function | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
257
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
258
+ readonly $type: 'NullExpr';
215
259
  value: string;
216
260
  }
217
261
  export declare const NullExpr = "NullExpr";
218
262
  export declare function isNullExpr(item: unknown): item is NullExpr;
263
+ export interface ObjectExpr extends AstNode {
264
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
265
+ readonly $type: 'ObjectExpr';
266
+ fields: Array<FieldInitializer>;
267
+ }
268
+ export declare const ObjectExpr = "ObjectExpr";
269
+ export declare function isObjectExpr(item: unknown): item is ObjectExpr;
219
270
  export interface Plugin extends AstNode {
220
271
  readonly $container: Model;
272
+ readonly $type: 'Plugin';
221
273
  fields: Array<PluginField>;
222
- name: string;
274
+ name: RegularID;
223
275
  }
224
276
  export declare const Plugin = "Plugin";
225
277
  export declare function isPlugin(item: unknown): item is Plugin;
226
278
  export interface PluginField extends AstNode {
227
279
  readonly $container: Plugin;
228
- name: string;
229
- value: ArrayExpr | LiteralExpr;
280
+ readonly $type: 'PluginField';
281
+ name: RegularID;
282
+ value: ArrayExpr | LiteralExpr | ObjectExpr;
230
283
  }
231
284
  export declare const PluginField = "PluginField";
232
285
  export declare function isPluginField(item: unknown): item is PluginField;
233
286
  export interface ReferenceArg extends AstNode {
234
287
  readonly $container: ReferenceExpr;
288
+ readonly $type: 'ReferenceArg';
235
289
  name: 'sort';
236
290
  value: 'Asc' | 'Desc';
237
291
  }
238
292
  export declare const ReferenceArg = "ReferenceArg";
239
293
  export declare function isReferenceArg(item: unknown): item is ReferenceArg;
240
294
  export interface ReferenceExpr extends AstNode {
241
- readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | Function | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
295
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
296
+ readonly $type: 'ReferenceExpr';
242
297
  args: Array<ReferenceArg>;
243
298
  target: Reference<ReferenceTarget>;
244
299
  }
245
300
  export declare const ReferenceExpr = "ReferenceExpr";
246
301
  export declare function isReferenceExpr(item: unknown): item is ReferenceExpr;
247
302
  export interface ThisExpr extends AstNode {
248
- readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | Function | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
303
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
304
+ readonly $type: 'ThisExpr';
249
305
  value: string;
250
306
  }
251
307
  export declare const ThisExpr = "ThisExpr";
252
308
  export declare function isThisExpr(item: unknown): item is ThisExpr;
253
309
  export interface UnaryExpr extends AstNode {
254
- readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | Function | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
310
+ readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr;
311
+ readonly $type: 'UnaryExpr';
255
312
  operand: Expression;
256
313
  operator: '!';
257
314
  }
258
315
  export declare const UnaryExpr = "UnaryExpr";
259
316
  export declare function isUnaryExpr(item: unknown): item is UnaryExpr;
260
- export type ZModelAstType = 'AbstractDeclaration' | 'Argument' | 'ArrayExpr' | 'Attribute' | 'AttributeArg' | 'AttributeAttribute' | 'AttributeParam' | 'AttributeParamType' | 'BinaryExpr' | 'DataModel' | 'DataModelAttribute' | 'DataModelField' | 'DataModelFieldAttribute' | 'DataModelFieldType' | 'DataSource' | 'DataSourceField' | 'Enum' | 'EnumField' | 'Expression' | 'Function' | 'FunctionParam' | 'FunctionParamType' | 'Generator' | 'GeneratorField' | 'InvocationExpr' | 'LiteralExpr' | 'MemberAccessExpr' | 'Model' | 'NullExpr' | 'Plugin' | 'PluginField' | 'ReferenceArg' | 'ReferenceExpr' | 'ReferenceTarget' | 'ThisExpr' | 'TypeDeclaration' | 'UnaryExpr';
261
- export declare class ZModelAstReflection implements AstReflection {
317
+ export interface ZModelAstType {
318
+ AbstractDeclaration: AbstractDeclaration;
319
+ Argument: Argument;
320
+ ArrayExpr: ArrayExpr;
321
+ Attribute: Attribute;
322
+ AttributeArg: AttributeArg;
323
+ AttributeAttribute: AttributeAttribute;
324
+ AttributeParam: AttributeParam;
325
+ AttributeParamType: AttributeParamType;
326
+ BinaryExpr: BinaryExpr;
327
+ DataModel: DataModel;
328
+ DataModelAttribute: DataModelAttribute;
329
+ DataModelField: DataModelField;
330
+ DataModelFieldAttribute: DataModelFieldAttribute;
331
+ DataModelFieldType: DataModelFieldType;
332
+ DataSource: DataSource;
333
+ DataSourceField: DataSourceField;
334
+ Enum: Enum;
335
+ EnumField: EnumField;
336
+ Expression: Expression;
337
+ FieldInitializer: FieldInitializer;
338
+ FunctionDecl: FunctionDecl;
339
+ FunctionParam: FunctionParam;
340
+ FunctionParamType: FunctionParamType;
341
+ GeneratorDecl: GeneratorDecl;
342
+ GeneratorField: GeneratorField;
343
+ InvocationExpr: InvocationExpr;
344
+ LiteralExpr: LiteralExpr;
345
+ MemberAccessExpr: MemberAccessExpr;
346
+ Model: Model;
347
+ NullExpr: NullExpr;
348
+ ObjectExpr: ObjectExpr;
349
+ Plugin: Plugin;
350
+ PluginField: PluginField;
351
+ ReferenceArg: ReferenceArg;
352
+ ReferenceExpr: ReferenceExpr;
353
+ ReferenceTarget: ReferenceTarget;
354
+ ThisExpr: ThisExpr;
355
+ TypeDeclaration: TypeDeclaration;
356
+ UnaryExpr: UnaryExpr;
357
+ }
358
+ export declare class ZModelAstReflection extends AbstractAstReflection {
262
359
  getAllTypes(): string[];
263
- isInstance(node: unknown, type: string): boolean;
264
- isSubtype(subtype: string, supertype: string): boolean;
360
+ protected computeIsSubtype(subtype: string, supertype: string): boolean;
265
361
  getReferenceType(refInfo: ReferenceInfo): string;
266
362
  getTypeMetaData(type: string): TypeMetaData;
267
363
  }