1
- import {
1
+ import type {
2
2
CstNode as ChevrotainCstNode ,
3
3
IToken as ChevrotainIToken ,
4
4
CstNodeLocation ,
@@ -7,24 +7,261 @@ import {
7
7
8
8
export interface CstNode extends ChevrotainCstNode {
9
9
children : CstChildrenDictionary ;
10
- leadingComments ?: IToken [ ] ;
11
- trailingComments ?: IToken [ ] ;
10
+ location : Required < CstNodeLocation > ;
11
+ comments ?: IToken [ ] ;
12
12
ignore ?: boolean ;
13
- location : CstNodeLocation ;
14
13
}
15
14
16
15
export interface IToken extends ChevrotainIToken {
17
- leadingComments ?: IToken [ ] ;
18
- trailingComments ?: IToken [ ] ;
19
16
startOffset : number ;
20
17
startLine : number ;
21
18
startColumn : number ;
22
19
endOffset : number ;
23
20
endLine : number ;
24
21
endColumn : number ;
25
- }
26
-
27
- export type CstElement = IToken | CstNode ;
22
+ comments ?: IToken [ ] ;
23
+ }
24
+
25
+ export type CstElement =
26
+ | IToken
27
+ | AdditionalBoundCstNode
28
+ | AmbiguousNameCstNode
29
+ | AnnotationCstNode
30
+ | AnnotationInterfaceBodyCstNode
31
+ | AnnotationInterfaceDeclarationCstNode
32
+ | AnnotationInterfaceElementDeclarationCstNode
33
+ | AnnotationInterfaceElementModifierCstNode
34
+ | AnnotationInterfaceMemberDeclarationCstNode
35
+ | ArgumentListCstNode
36
+ | ArrayAccessSuffixCstNode
37
+ | ArrayCreationExpressionCstNode
38
+ | ArrayCreationExpressionWithoutInitializerSuffixCstNode
39
+ | ArrayCreationWithInitializerSuffixCstNode
40
+ | ArrayInitializerCstNode
41
+ | AssertStatementCstNode
42
+ | BasicForStatementCstNode
43
+ | BinaryExpressionCstNode
44
+ | BlockCstNode
45
+ | BlockStatementCstNode
46
+ | BlockStatementsCstNode
47
+ | BooleanLiteralCstNode
48
+ | BreakStatementCstNode
49
+ | CaseConstantCstNode
50
+ | CasePatternCstNode
51
+ | CastExpressionCstNode
52
+ | CatchClauseCstNode
53
+ | CatchesCstNode
54
+ | CatchFormalParameterCstNode
55
+ | CatchTypeCstNode
56
+ | ClassBodyCstNode
57
+ | ClassBodyDeclarationCstNode
58
+ | ClassDeclarationCstNode
59
+ | ClassExtendsCstNode
60
+ | ClassImplementsCstNode
61
+ | ClassLiteralSuffixCstNode
62
+ | ClassMemberDeclarationCstNode
63
+ | ClassModifierCstNode
64
+ | ClassOrInterfaceTypeCstNode
65
+ | ClassOrInterfaceTypeToInstantiateCstNode
66
+ | ClassPermitsCstNode
67
+ | ClassTypeCstNode
68
+ | CompactConstructorDeclarationCstNode
69
+ | CompilationUnitCstNode
70
+ | ComponentPatternCstNode
71
+ | ComponentPatternListCstNode
72
+ | ConciseLambdaParameterCstNode
73
+ | ConciseLambdaParameterListCstNode
74
+ | ConditionalExpressionCstNode
75
+ | ConstantDeclarationCstNode
76
+ | ConstantModifierCstNode
77
+ | ConstructorBodyCstNode
78
+ | ConstructorDeclarationCstNode
79
+ | ConstructorDeclaratorCstNode
80
+ | ConstructorModifierCstNode
81
+ | ContinueStatementCstNode
82
+ | DefaultValueCstNode
83
+ | DiamondCstNode
84
+ | DimExprCstNode
85
+ | DimExprsCstNode
86
+ | DimsCstNode
87
+ | DoStatementCstNode
88
+ | ElementValueArrayInitializerCstNode
89
+ | ElementValueCstNode
90
+ | ElementValueListCstNode
91
+ | ElementValuePairCstNode
92
+ | ElementValuePairListCstNode
93
+ | EmbeddedExpressionCstNode
94
+ | EmptyStatementCstNode
95
+ | EnhancedForStatementCstNode
96
+ | EnumBodyCstNode
97
+ | EnumBodyDeclarationsCstNode
98
+ | EnumConstantCstNode
99
+ | EnumConstantListCstNode
100
+ | EnumConstantModifierCstNode
101
+ | EnumDeclarationCstNode
102
+ | ExceptionTypeCstNode
103
+ | ExceptionTypeListCstNode
104
+ | ExplicitConstructorInvocationCstNode
105
+ | ExportsModuleDirectiveCstNode
106
+ | ExpressionCstNode
107
+ | ExpressionNameCstNode
108
+ | ExpressionStatementCstNode
109
+ | FieldDeclarationCstNode
110
+ | FieldModifierCstNode
111
+ | FinallyCstNode
112
+ | FloatingPointLiteralCstNode
113
+ | FloatingPointTypeCstNode
114
+ | ForInitCstNode
115
+ | FormalParameterCstNode
116
+ | FormalParameterListCstNode
117
+ | ForStatementCstNode
118
+ | ForUpdateCstNode
119
+ | FqnOrRefTypeCstNode
120
+ | FqnOrRefTypePartCommonCstNode
121
+ | FqnOrRefTypePartFirstCstNode
122
+ | FqnOrRefTypePartRestCstNode
123
+ | GuardCstNode
124
+ | IfStatementCstNode
125
+ | ImportDeclarationCstNode
126
+ | InstanceInitializerCstNode
127
+ | IntegerLiteralCstNode
128
+ | IntegralTypeCstNode
129
+ | InterfaceBodyCstNode
130
+ | InterfaceDeclarationCstNode
131
+ | InterfaceExtendsCstNode
132
+ | InterfaceMemberDeclarationCstNode
133
+ | InterfaceMethodDeclarationCstNode
134
+ | InterfaceMethodModifierCstNode
135
+ | InterfaceModifierCstNode
136
+ | InterfacePermitsCstNode
137
+ | InterfaceTypeCstNode
138
+ | InterfaceTypeListCstNode
139
+ | LabeledStatementCstNode
140
+ | LambdaBodyCstNode
141
+ | LambdaExpressionCstNode
142
+ | LambdaParameterListCstNode
143
+ | LambdaParametersCstNode
144
+ | LambdaParametersWithBracesCstNode
145
+ | LambdaParameterTypeCstNode
146
+ | LiteralCstNode
147
+ | LocalVariableDeclarationCstNode
148
+ | LocalVariableDeclarationStatementCstNode
149
+ | LocalVariableTypeCstNode
150
+ | MatchAllPatternCstNode
151
+ | MethodBodyCstNode
152
+ | MethodDeclarationCstNode
153
+ | MethodDeclaratorCstNode
154
+ | MethodHeaderCstNode
155
+ | MethodInvocationSuffixCstNode
156
+ | MethodModifierCstNode
157
+ | MethodNameCstNode
158
+ | MethodReferenceSuffixCstNode
159
+ | ModularCompilationUnitCstNode
160
+ | ModuleDeclarationCstNode
161
+ | ModuleDirectiveCstNode
162
+ | ModuleNameCstNode
163
+ | NewExpressionCstNode
164
+ | NormalClassDeclarationCstNode
165
+ | NormalInterfaceDeclarationCstNode
166
+ | NormalLambdaParameterCstNode
167
+ | NormalLambdaParameterListCstNode
168
+ | NumericTypeCstNode
169
+ | OpensModuleDirectiveCstNode
170
+ | OrdinaryCompilationUnitCstNode
171
+ | PackageDeclarationCstNode
172
+ | PackageModifierCstNode
173
+ | PackageNameCstNode
174
+ | PackageOrTypeNameCstNode
175
+ | ParenthesisExpressionCstNode
176
+ | PatternCstNode
177
+ | PrimaryCstNode
178
+ | PrimaryPrefixCstNode
179
+ | PrimarySuffixCstNode
180
+ | PrimitiveCastExpressionCstNode
181
+ | PrimitiveTypeCstNode
182
+ | ProvidesModuleDirectiveCstNode
183
+ | QualifiedExplicitConstructorInvocationCstNode
184
+ | ReceiverParameterCstNode
185
+ | RecordBodyCstNode
186
+ | RecordBodyDeclarationCstNode
187
+ | RecordComponentCstNode
188
+ | RecordComponentListCstNode
189
+ | RecordComponentModifierCstNode
190
+ | RecordDeclarationCstNode
191
+ | RecordHeaderCstNode
192
+ | RecordPatternCstNode
193
+ | ReferenceTypeCastExpressionCstNode
194
+ | ReferenceTypeCstNode
195
+ | RegularLambdaParameterCstNode
196
+ | RequiresModifierCstNode
197
+ | RequiresModuleDirectiveCstNode
198
+ | ResourceCstNode
199
+ | ResourceListCstNode
200
+ | ResourceSpecificationCstNode
201
+ | ResultCstNode
202
+ | ReturnStatementCstNode
203
+ | ShiftOperatorCstNode
204
+ | SimpleTypeNameCstNode
205
+ | StatementCstNode
206
+ | StatementExpressionCstNode
207
+ | StatementExpressionListCstNode
208
+ | StatementWithoutTrailingSubstatementCstNode
209
+ | StaticInitializerCstNode
210
+ | StringTemplateCstNode
211
+ | SwitchBlockCstNode
212
+ | SwitchBlockStatementGroupCstNode
213
+ | SwitchLabelCstNode
214
+ | SwitchRuleCstNode
215
+ | SwitchStatementCstNode
216
+ | SynchronizedStatementCstNode
217
+ | TemplateArgumentCstNode
218
+ | TemplateCstNode
219
+ | TextBlockTemplateCstNode
220
+ | ThrowsCstNode
221
+ | ThrowStatementCstNode
222
+ | TryStatementCstNode
223
+ | TryWithResourcesStatementCstNode
224
+ | TypeArgumentCstNode
225
+ | TypeArgumentListCstNode
226
+ | TypeArgumentsCstNode
227
+ | TypeArgumentsOrDiamondCstNode
228
+ | TypeBoundCstNode
229
+ | TypeDeclarationCstNode
230
+ | TypeIdentifierCstNode
231
+ | TypeNameCstNode
232
+ | TypeParameterCstNode
233
+ | TypeParameterListCstNode
234
+ | TypeParameterModifierCstNode
235
+ | TypeParametersCstNode
236
+ | TypePatternCstNode
237
+ | TypeVariableCstNode
238
+ | UnannClassOrInterfaceTypeCstNode
239
+ | UnannClassTypeCstNode
240
+ | UnannInterfaceTypeCstNode
241
+ | UnannPrimitiveTypeCstNode
242
+ | UnannPrimitiveTypeWithOptionalDimsSuffixCstNode
243
+ | UnannReferenceTypeCstNode
244
+ | UnannTypeCstNode
245
+ | UnannTypeVariableCstNode
246
+ | UnaryExpressionCstNode
247
+ | UnaryExpressionNotPlusMinusCstNode
248
+ | UnqualifiedClassInstanceCreationExpressionCstNode
249
+ | UnqualifiedExplicitConstructorInvocationCstNode
250
+ | UsesModuleDirectiveCstNode
251
+ | VariableAccessCstNode
252
+ | VariableArityParameterCstNode
253
+ | VariableArityRecordComponentCstNode
254
+ | VariableDeclaratorCstNode
255
+ | VariableDeclaratorIdCstNode
256
+ | VariableDeclaratorListCstNode
257
+ | VariableInitializerCstNode
258
+ | VariableInitializerListCstNode
259
+ | VariableModifierCstNode
260
+ | VariableParaRegularParameterCstNode
261
+ | WhileStatementCstNode
262
+ | WildcardBoundsCstNode
263
+ | WildcardCstNode
264
+ | YieldStatementCstNode ;
28
265
29
266
export declare type CstChildrenDictionary = {
30
267
[ identifier : string ] : CstElement [ ] ;
@@ -57,6 +294,7 @@ export abstract class JavaCstVisitor<IN, OUT> implements ICstVisitor<IN, OUT> {
57
294
integerLiteral ( ctx : IntegerLiteralCtx , param ?: IN ) : OUT ;
58
295
floatingPointLiteral ( ctx : FloatingPointLiteralCtx , param ?: IN ) : OUT ;
59
296
booleanLiteral ( ctx : BooleanLiteralCtx , param ?: IN ) : OUT ;
297
+ shiftOperator ( cts : ShiftOperatorCtx , param ?: IN ) : OUT ;
60
298
primitiveType ( ctx : PrimitiveTypeCtx , param ?: IN ) : OUT ;
61
299
numericType ( ctx : NumericTypeCtx , param ?: IN ) : OUT ;
62
300
integralType ( ctx : IntegralTypeCtx , param ?: IN ) : OUT ;
@@ -304,7 +542,7 @@ export abstract class JavaCstVisitor<IN, OUT> implements ICstVisitor<IN, OUT> {
304
542
param ?: IN
305
543
) : OUT ;
306
544
normalLambdaParameterList ( ctx : NormalLambdaParameterListCtx , param ?: IN ) : OUT ;
307
- normalLambdaParameter ( ctx : LambdaParameterCtx , param ?: IN ) : OUT ;
545
+ normalLambdaParameter ( ctx : NormalLambdaParameterCtx , param ?: IN ) : OUT ;
308
546
regularLambdaParameter ( ctx : RegularLambdaParameterCtx , param ?: IN ) : OUT ;
309
547
lambdaParameterType ( ctx : LambdaParameterTypeCtx , param ?: IN ) : OUT ;
310
548
conciseLambdaParameter ( ctx : ConciseLambdaParameterCtx , param ?: IN ) : OUT ;
@@ -389,6 +627,7 @@ export abstract class JavaCstVisitorWithDefaults<IN, OUT>
389
627
integerLiteral ( ctx : IntegerLiteralCtx , param ?: IN ) : OUT ;
390
628
floatingPointLiteral ( ctx : FloatingPointLiteralCtx , param ?: IN ) : OUT ;
391
629
booleanLiteral ( ctx : BooleanLiteralCtx , param ?: IN ) : OUT ;
630
+ shiftOperator ( cts : ShiftOperatorCtx , param ?: IN ) : OUT ;
392
631
primitiveType ( ctx : PrimitiveTypeCtx , param ?: IN ) : OUT ;
393
632
numericType ( ctx : NumericTypeCtx , param ?: IN ) : OUT ;
394
633
integralType ( ctx : IntegralTypeCtx , param ?: IN ) : OUT ;
@@ -636,7 +875,7 @@ export abstract class JavaCstVisitorWithDefaults<IN, OUT>
636
875
param ?: IN
637
876
) : OUT ;
638
877
normalLambdaParameterList ( ctx : NormalLambdaParameterListCtx , param ?: IN ) : OUT ;
639
- normalLambdaParameter ( ctx : LambdaParameterCtx , param ?: IN ) : OUT ;
878
+ normalLambdaParameter ( ctx : NormalLambdaParameterCtx , param ?: IN ) : OUT ;
640
879
regularLambdaParameter ( ctx : RegularLambdaParameterCtx , param ?: IN ) : OUT ;
641
880
lambdaParameterType ( ctx : LambdaParameterTypeCtx , param ?: IN ) : OUT ;
642
881
conciseLambdaParameter ( ctx : ConciseLambdaParameterCtx , param ?: IN ) : OUT ;
@@ -763,6 +1002,16 @@ export type BooleanLiteralCtx = {
763
1002
False ?: IToken [ ] ;
764
1003
} ;
765
1004
1005
+ export interface ShiftOperatorCstNode extends CstNode {
1006
+ name : "shiftOperator" ;
1007
+ children : ShiftOperatorCtx ;
1008
+ }
1009
+
1010
+ export type ShiftOperatorCtx = {
1011
+ Less ?: IToken [ ] ;
1012
+ Greater ?: IToken [ ] ;
1013
+ } ;
1014
+
766
1015
export interface PrimitiveTypeCstNode extends CstNode {
767
1016
name : "primitiveType" ;
768
1017
children : PrimitiveTypeCtx ;
@@ -1819,17 +2068,16 @@ export interface CompilationUnitCstNode extends CstNode {
1819
2068
1820
2069
export type AbstractOrdinaryCompilationUnitCtx = {
1821
2070
ordinaryCompilationUnit : OrdinaryCompilationUnitCstNode [ ] ;
1822
- EOF : IToken [ ] ;
1823
2071
} ;
1824
2072
1825
2073
export type AbstractModularCompilationUnitCtx = {
1826
2074
modularCompilationUnit : OrdinaryCompilationUnitCstNode [ ] ;
1827
- EOF : IToken [ ] ;
1828
2075
} ;
1829
2076
1830
2077
export type CompilationUnitCtx =
1831
2078
| AbstractOrdinaryCompilationUnitCtx
1832
- | AbstractModularCompilationUnitCtx ;
2079
+ | AbstractModularCompilationUnitCtx
2080
+ | { EOF : IToken [ ] } ;
1833
2081
1834
2082
export interface OrdinaryCompilationUnitCstNode extends CstNode {
1835
2083
name : "ordinaryCompilationUnit" ;
@@ -2912,10 +3160,10 @@ export type NormalLambdaParameterListCtx = {
2912
3160
2913
3161
export interface NormalLambdaParameterCstNode extends CstNode {
2914
3162
name : "normalLambdaParameter" ;
2915
- children : LambdaParameterCtx ;
3163
+ children : NormalLambdaParameterCtx ;
2916
3164
}
2917
3165
2918
- export type LambdaParameterCtx = {
3166
+ export type NormalLambdaParameterCtx = {
2919
3167
regularLambdaParameter ?: RegularLambdaParameterCstNode [ ] ;
2920
3168
variableArityParameter ?: VariableArityParameterCstNode [ ] ;
2921
3169
} ;
@@ -2985,8 +3233,7 @@ export type BinaryExpressionCtx = {
2985
3233
referenceType ?: ReferenceTypeCstNode [ ] ;
2986
3234
AssignmentOperator ?: IToken [ ] ;
2987
3235
expression ?: ExpressionCstNode [ ] ;
2988
- Less ?: IToken [ ] ;
2989
- Greater ?: IToken [ ] ;
3236
+ shiftOperator ?: ShiftOperatorCstNode [ ] ;
2990
3237
BinaryOperator ?: IToken [ ] ;
2991
3238
} ;
2992
3239
0 commit comments