11/******************************************************************************
2- * This file was generated by langium-cli 1.2.0 .
2+ * This file was generated by langium-cli 1.3.1 .
33 * DO NOT EDIT MANUALLY!
44 ******************************************************************************/
55
66/* 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+ } ;
822
923export type AbstractDeclaration = Attribute | DataModel | DataSource | Enum | FunctionDecl | GeneratorDecl | Plugin ;
1024
@@ -64,10 +78,10 @@ export function isReferenceTarget(item: unknown): item is ReferenceTarget {
6478 return reflection . isInstance ( item , ReferenceTarget ) ;
6579}
6680
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 ;
6882
6983export 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 ) ) ) ;
7185}
7286
7387export type TypeDeclaration = DataModel | Enum ;
@@ -81,7 +95,6 @@ export function isTypeDeclaration(item: unknown): item is TypeDeclaration {
8195export interface Argument extends AstNode {
8296 readonly $container : InvocationExpr ;
8397 readonly $type : 'Argument' ;
84- name ?: RegularID
8598 value : Expression
8699}
87100
@@ -92,7 +105,7 @@ export function isArgument(item: unknown): item is Argument {
92105}
93106
94107export 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 ;
96109 readonly $type : 'ArrayExpr' ;
97110 items : Array < Expression >
98111}
@@ -163,7 +176,7 @@ export function isAttributeParamType(item: unknown): item is AttributeParamType
163176}
164177
165178export 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 ;
167180 readonly $type : 'BinaryExpr' ;
168181 left : Expression
169182 operator : '!' | '!=' | '&&' | '<' | '<=' | '==' | '>' | '>=' | '?' | '^' | 'in' | '||'
@@ -177,7 +190,7 @@ export function isBinaryExpr(item: unknown): item is BinaryExpr {
177190}
178191
179192export 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 ;
181194 readonly $type : 'BooleanLiteral' ;
182195 value : Boolean
183196}
@@ -189,7 +202,7 @@ export function isBooleanLiteral(item: unknown): item is BooleanLiteral {
189202}
190203
191204export 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 ;
193206 readonly $type : 'ConfigArrayExpr' ;
194207 items : Array < ConfigInvocationExpr | LiteralExpr >
195208}
@@ -440,7 +453,7 @@ export function isInternalAttribute(item: unknown): item is InternalAttribute {
440453}
441454
442455export 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 ;
444457 readonly $type : 'InvocationExpr' ;
445458 args : Array < Argument >
446459 function : Reference < FunctionDecl >
@@ -453,7 +466,7 @@ export function isInvocationExpr(item: unknown): item is InvocationExpr {
453466}
454467
455468export 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 ;
457470 readonly $type : 'MemberAccessExpr' ;
458471 member : Reference < DataModelField >
459472 operand : Expression
@@ -490,7 +503,7 @@ export function isModelImport(item: unknown): item is ModelImport {
490503}
491504
492505export 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 ;
494507 readonly $type : 'NullExpr' ;
495508 value : 'null'
496509}
@@ -502,7 +515,7 @@ export function isNullExpr(item: unknown): item is NullExpr {
502515}
503516
504517export 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 ;
506519 readonly $type : 'NumberLiteral' ;
507520 value : string
508521}
@@ -514,7 +527,7 @@ export function isNumberLiteral(item: unknown): item is NumberLiteral {
514527}
515528
516529export 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 ;
518531 readonly $type : 'ObjectExpr' ;
519532 fields : Array < FieldInitializer >
520533}
@@ -554,8 +567,8 @@ export function isPluginField(item: unknown): item is PluginField {
554567export interface ReferenceArg extends AstNode {
555568 readonly $container : ReferenceExpr ;
556569 readonly $type : 'ReferenceArg' ;
557- name : 'sort'
558- value : 'Asc' | 'Desc'
570+ name : string
571+ value : Expression
559572}
560573
561574export const ReferenceArg = 'ReferenceArg' ;
@@ -565,7 +578,7 @@ export function isReferenceArg(item: unknown): item is ReferenceArg {
565578}
566579
567580export 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 ;
569582 readonly $type : 'ReferenceExpr' ;
570583 args : Array < ReferenceArg >
571584 target : Reference < ReferenceTarget >
@@ -578,7 +591,7 @@ export function isReferenceExpr(item: unknown): item is ReferenceExpr {
578591}
579592
580593export 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 ;
582595 readonly $type : 'StringLiteral' ;
583596 value : string
584597}
@@ -590,7 +603,7 @@ export function isStringLiteral(item: unknown): item is StringLiteral {
590603}
591604
592605export 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 ;
594607 readonly $type : 'ThisExpr' ;
595608 value : 'this'
596609}
@@ -602,7 +615,7 @@ export function isThisExpr(item: unknown): item is ThisExpr {
602615}
603616
604617export 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 ;
606619 readonly $type : 'UnaryExpr' ;
607620 operand : Expression
608621 operator : '!'
0 commit comments