1
1
/******************************************************************************
2
- * This file was generated by langium-cli 1.2.0 .
2
+ * This file was generated by langium-cli 1.3.1 .
3
3
* DO NOT EDIT MANUALLY!
4
4
******************************************************************************/
5
5
6
6
/* eslint-disable */
7
- import { AstNode , AbstractAstReflection , Reference , ReferenceInfo , TypeMetaData } from 'langium' ;
7
+ import type { AstNode , Reference , ReferenceInfo , TypeMetaData } from 'langium' ;
8
+ import { AbstractAstReflection } from 'langium' ;
9
+
10
+ export const ZModelTerminals = {
11
+ WS : / \s + / ,
12
+ INTERNAL_ATTRIBUTE_NAME : / @ @ @ ( [ _ a - z A - Z ] [ \w _ ] * \. ) * [ _ a - z A - Z ] [ \w _ ] * / ,
13
+ MODEL_ATTRIBUTE_NAME : / @ @ ( [ _ a - z A - Z ] [ \w _ ] * \. ) * [ _ a - z A - Z ] [ \w _ ] * / ,
14
+ FIELD_ATTRIBUTE_NAME : / @ ( [ _ a - z A - Z ] [ \w _ ] * \. ) * [ _ a - z A - Z ] [ \w _ ] * / ,
15
+ ID : / [ _ a - z A - Z ] [ \w _ ] * / ,
16
+ STRING : / " ( \\ .| [ ^ " \\ ] ) * " | ' ( \\ .| [ ^ ' \\ ] ) * ' / ,
17
+ NUMBER : / [ + - ] ? [ 0 - 9 ] + ( \. [ 0 - 9 ] + ) ? / ,
18
+ TRIPLE_SLASH_COMMENT : / \/ \/ \/ [ ^ \n \r ] * / ,
19
+ ML_COMMENT : / \/ \* [ \s \S ] * ?\* \/ / ,
20
+ SL_COMMENT : / \/ \/ [ ^ \n \r ] * / ,
21
+ } ;
8
22
9
23
export type AbstractDeclaration = Attribute | DataModel | DataSource | Enum | FunctionDecl | GeneratorDecl | Plugin ;
10
24
@@ -64,10 +78,10 @@ export function isReferenceTarget(item: unknown): item is ReferenceTarget {
64
78
return reflection . isInstance ( item , ReferenceTarget ) ;
65
79
}
66
80
67
- export type RegularID = 'abstract' | 'attribute' | 'datasource' | 'enum' | 'import' | 'in' | 'model' | 'plugin' | 'sort' | ' view' | string ;
81
+ export type RegularID = 'abstract' | 'attribute' | 'datasource' | 'enum' | 'import' | 'in' | 'model' | 'plugin' | 'view' | string ;
68
82
69
83
export function isRegularID ( item : unknown ) : item is RegularID {
70
- return item === 'model' || item === 'enum' || item === 'attribute' || item === 'datasource' || item === 'plugin' || item === 'abstract' || item === 'in' || item === 'sort' || item === ' view' || item === 'import' || ( typeof item === 'string' && ( / [ _ a - z A - Z ] [ \w _ ] * / . test ( item ) ) ) ;
84
+ return item === 'model' || item === 'enum' || item === 'attribute' || item === 'datasource' || item === 'plugin' || item === 'abstract' || item === 'in' || item === 'view' || item === 'import' || ( typeof item === 'string' && ( / [ _ a - z A - Z ] [ \w _ ] * / . test ( item ) ) ) ;
71
85
}
72
86
73
87
export type TypeDeclaration = DataModel | Enum ;
@@ -81,7 +95,6 @@ export function isTypeDeclaration(item: unknown): item is TypeDeclaration {
81
95
export interface Argument extends AstNode {
82
96
readonly $container : InvocationExpr ;
83
97
readonly $type : 'Argument' ;
84
- name ?: RegularID
85
98
value : Expression
86
99
}
87
100
@@ -92,7 +105,7 @@ export function isArgument(item: unknown): item is Argument {
92
105
}
93
106
94
107
export interface ArrayExpr extends AstNode {
95
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
108
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
96
109
readonly $type : 'ArrayExpr' ;
97
110
items : Array < Expression >
98
111
}
@@ -163,7 +176,7 @@ export function isAttributeParamType(item: unknown): item is AttributeParamType
163
176
}
164
177
165
178
export interface BinaryExpr extends AstNode {
166
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
179
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
167
180
readonly $type : 'BinaryExpr' ;
168
181
left : Expression
169
182
operator : '!' | '!=' | '&&' | '<' | '<=' | '==' | '>' | '>=' | '?' | '^' | 'in' | '||'
@@ -177,7 +190,7 @@ export function isBinaryExpr(item: unknown): item is BinaryExpr {
177
190
}
178
191
179
192
export interface BooleanLiteral extends AstNode {
180
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
193
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
181
194
readonly $type : 'BooleanLiteral' ;
182
195
value : Boolean
183
196
}
@@ -189,7 +202,7 @@ export function isBooleanLiteral(item: unknown): item is BooleanLiteral {
189
202
}
190
203
191
204
export interface ConfigArrayExpr extends AstNode {
192
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
205
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
193
206
readonly $type : 'ConfigArrayExpr' ;
194
207
items : Array < ConfigInvocationExpr | LiteralExpr >
195
208
}
@@ -440,7 +453,7 @@ export function isInternalAttribute(item: unknown): item is InternalAttribute {
440
453
}
441
454
442
455
export interface InvocationExpr extends AstNode {
443
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
456
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
444
457
readonly $type : 'InvocationExpr' ;
445
458
args : Array < Argument >
446
459
function : Reference < FunctionDecl >
@@ -453,7 +466,7 @@ export function isInvocationExpr(item: unknown): item is InvocationExpr {
453
466
}
454
467
455
468
export interface MemberAccessExpr extends AstNode {
456
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
469
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
457
470
readonly $type : 'MemberAccessExpr' ;
458
471
member : Reference < DataModelField >
459
472
operand : Expression
@@ -490,7 +503,7 @@ export function isModelImport(item: unknown): item is ModelImport {
490
503
}
491
504
492
505
export interface NullExpr extends AstNode {
493
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
506
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
494
507
readonly $type : 'NullExpr' ;
495
508
value : 'null'
496
509
}
@@ -502,7 +515,7 @@ export function isNullExpr(item: unknown): item is NullExpr {
502
515
}
503
516
504
517
export interface NumberLiteral extends AstNode {
505
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
518
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
506
519
readonly $type : 'NumberLiteral' ;
507
520
value : string
508
521
}
@@ -514,7 +527,7 @@ export function isNumberLiteral(item: unknown): item is NumberLiteral {
514
527
}
515
528
516
529
export interface ObjectExpr extends AstNode {
517
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
530
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
518
531
readonly $type : 'ObjectExpr' ;
519
532
fields : Array < FieldInitializer >
520
533
}
@@ -554,8 +567,8 @@ export function isPluginField(item: unknown): item is PluginField {
554
567
export interface ReferenceArg extends AstNode {
555
568
readonly $container : ReferenceExpr ;
556
569
readonly $type : 'ReferenceArg' ;
557
- name : 'sort'
558
- value : 'Asc' | 'Desc'
570
+ name : string
571
+ value : Expression
559
572
}
560
573
561
574
export const ReferenceArg = 'ReferenceArg' ;
@@ -565,7 +578,7 @@ export function isReferenceArg(item: unknown): item is ReferenceArg {
565
578
}
566
579
567
580
export interface ReferenceExpr extends AstNode {
568
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
581
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
569
582
readonly $type : 'ReferenceExpr' ;
570
583
args : Array < ReferenceArg >
571
584
target : Reference < ReferenceTarget >
@@ -578,7 +591,7 @@ export function isReferenceExpr(item: unknown): item is ReferenceExpr {
578
591
}
579
592
580
593
export interface StringLiteral extends AstNode {
581
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
594
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
582
595
readonly $type : 'StringLiteral' ;
583
596
value : string
584
597
}
@@ -590,7 +603,7 @@ export function isStringLiteral(item: unknown): item is StringLiteral {
590
603
}
591
604
592
605
export interface ThisExpr extends AstNode {
593
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
606
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
594
607
readonly $type : 'ThisExpr' ;
595
608
value : 'this'
596
609
}
@@ -602,7 +615,7 @@ export function isThisExpr(item: unknown): item is ThisExpr {
602
615
}
603
616
604
617
export interface UnaryExpr extends AstNode {
605
- readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType ;
618
+ readonly $container : Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType ;
606
619
readonly $type : 'UnaryExpr' ;
607
620
operand : Expression
608
621
operator : '!'
0 commit comments