1
|
/**
|
2
|
* @license
|
3
|
* Copyright Google Inc. All Rights Reserved.
|
4
|
*
|
5
|
* Use of this source code is governed by an MIT-style license that can be
|
6
|
* found in the LICENSE file at https://angular.io/license
|
7
|
*/
|
8
|
import { ParseSourceSpan } from '../parse_util';
|
9
|
export declare enum TypeModifier {
|
10
|
Const = 0,
|
11
|
}
|
12
|
export declare abstract class Type {
|
13
|
modifiers: TypeModifier[] | null;
|
14
|
constructor(modifiers?: TypeModifier[] | null);
|
15
|
abstract visitType(visitor: TypeVisitor, context: any): any;
|
16
|
hasModifier(modifier: TypeModifier): boolean;
|
17
|
}
|
18
|
export declare enum BuiltinTypeName {
|
19
|
Dynamic = 0,
|
20
|
Bool = 1,
|
21
|
String = 2,
|
22
|
Int = 3,
|
23
|
Number = 4,
|
24
|
Function = 5,
|
25
|
Inferred = 6,
|
26
|
}
|
27
|
export declare class BuiltinType extends Type {
|
28
|
name: BuiltinTypeName;
|
29
|
constructor(name: BuiltinTypeName, modifiers?: TypeModifier[] | null);
|
30
|
visitType(visitor: TypeVisitor, context: any): any;
|
31
|
}
|
32
|
export declare class ExpressionType extends Type {
|
33
|
value: Expression;
|
34
|
constructor(value: Expression, modifiers?: TypeModifier[] | null);
|
35
|
visitType(visitor: TypeVisitor, context: any): any;
|
36
|
}
|
37
|
export declare class ArrayType extends Type {
|
38
|
of: Type;
|
39
|
constructor(of: Type, modifiers?: TypeModifier[] | null);
|
40
|
visitType(visitor: TypeVisitor, context: any): any;
|
41
|
}
|
42
|
export declare class MapType extends Type {
|
43
|
valueType: Type | null;
|
44
|
constructor(valueType: Type | null | undefined, modifiers?: TypeModifier[] | null);
|
45
|
visitType(visitor: TypeVisitor, context: any): any;
|
46
|
}
|
47
|
export declare const DYNAMIC_TYPE: BuiltinType;
|
48
|
export declare const INFERRED_TYPE: BuiltinType;
|
49
|
export declare const BOOL_TYPE: BuiltinType;
|
50
|
export declare const INT_TYPE: BuiltinType;
|
51
|
export declare const NUMBER_TYPE: BuiltinType;
|
52
|
export declare const STRING_TYPE: BuiltinType;
|
53
|
export declare const FUNCTION_TYPE: BuiltinType;
|
54
|
export interface TypeVisitor {
|
55
|
visitBuiltintType(type: BuiltinType, context: any): any;
|
56
|
visitExpressionType(type: ExpressionType, context: any): any;
|
57
|
visitArrayType(type: ArrayType, context: any): any;
|
58
|
visitMapType(type: MapType, context: any): any;
|
59
|
}
|
60
|
export declare enum BinaryOperator {
|
61
|
Equals = 0,
|
62
|
NotEquals = 1,
|
63
|
Identical = 2,
|
64
|
NotIdentical = 3,
|
65
|
Minus = 4,
|
66
|
Plus = 5,
|
67
|
Divide = 6,
|
68
|
Multiply = 7,
|
69
|
Modulo = 8,
|
70
|
And = 9,
|
71
|
Or = 10,
|
72
|
Lower = 11,
|
73
|
LowerEquals = 12,
|
74
|
Bigger = 13,
|
75
|
BiggerEquals = 14,
|
76
|
}
|
77
|
export declare abstract class Expression {
|
78
|
type: Type | null;
|
79
|
sourceSpan: ParseSourceSpan | null;
|
80
|
constructor(type: Type | null | undefined, sourceSpan?: ParseSourceSpan | null);
|
81
|
abstract visitExpression(visitor: ExpressionVisitor, context: any): any;
|
82
|
prop(name: string, sourceSpan?: ParseSourceSpan | null): ReadPropExpr;
|
83
|
key(index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadKeyExpr;
|
84
|
callMethod(name: string | BuiltinMethod, params: Expression[], sourceSpan?: ParseSourceSpan | null): InvokeMethodExpr;
|
85
|
callFn(params: Expression[], sourceSpan?: ParseSourceSpan | null): InvokeFunctionExpr;
|
86
|
instantiate(params: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): InstantiateExpr;
|
87
|
conditional(trueCase: Expression, falseCase?: Expression | null, sourceSpan?: ParseSourceSpan | null): ConditionalExpr;
|
88
|
equals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
89
|
notEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
90
|
identical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
91
|
notIdentical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
92
|
minus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
93
|
plus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
94
|
divide(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
95
|
multiply(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
96
|
modulo(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
97
|
and(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
98
|
or(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
99
|
lower(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
100
|
lowerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
101
|
bigger(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
102
|
biggerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr;
|
103
|
isBlank(sourceSpan?: ParseSourceSpan | null): Expression;
|
104
|
cast(type: Type, sourceSpan?: ParseSourceSpan | null): Expression;
|
105
|
toStmt(): Statement;
|
106
|
}
|
107
|
export declare enum BuiltinVar {
|
108
|
This = 0,
|
109
|
Super = 1,
|
110
|
CatchError = 2,
|
111
|
CatchStack = 3,
|
112
|
}
|
113
|
export declare class ReadVarExpr extends Expression {
|
114
|
name: string | null;
|
115
|
builtin: BuiltinVar | null;
|
116
|
constructor(name: string | BuiltinVar, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
117
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
118
|
set(value: Expression): WriteVarExpr;
|
119
|
}
|
120
|
export declare class WriteVarExpr extends Expression {
|
121
|
name: string;
|
122
|
value: Expression;
|
123
|
constructor(name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
124
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
125
|
toDeclStmt(type?: Type | null, modifiers?: StmtModifier[] | null): DeclareVarStmt;
|
126
|
}
|
127
|
export declare class WriteKeyExpr extends Expression {
|
128
|
receiver: Expression;
|
129
|
index: Expression;
|
130
|
value: Expression;
|
131
|
constructor(receiver: Expression, index: Expression, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
132
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
133
|
}
|
134
|
export declare class WritePropExpr extends Expression {
|
135
|
receiver: Expression;
|
136
|
name: string;
|
137
|
value: Expression;
|
138
|
constructor(receiver: Expression, name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
139
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
140
|
}
|
141
|
export declare enum BuiltinMethod {
|
142
|
ConcatArray = 0,
|
143
|
SubscribeObservable = 1,
|
144
|
Bind = 2,
|
145
|
}
|
146
|
export declare class InvokeMethodExpr extends Expression {
|
147
|
receiver: Expression;
|
148
|
args: Expression[];
|
149
|
name: string | null;
|
150
|
builtin: BuiltinMethod | null;
|
151
|
constructor(receiver: Expression, method: string | BuiltinMethod, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
152
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
153
|
}
|
154
|
export declare class InvokeFunctionExpr extends Expression {
|
155
|
fn: Expression;
|
156
|
args: Expression[];
|
157
|
constructor(fn: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
158
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
159
|
}
|
160
|
export declare class InstantiateExpr extends Expression {
|
161
|
classExpr: Expression;
|
162
|
args: Expression[];
|
163
|
constructor(classExpr: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
164
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
165
|
}
|
166
|
export declare class LiteralExpr extends Expression {
|
167
|
value: any;
|
168
|
constructor(value: any, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
169
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
170
|
}
|
171
|
export declare class ExternalExpr extends Expression {
|
172
|
value: ExternalReference;
|
173
|
typeParams: Type[] | null;
|
174
|
constructor(value: ExternalReference, type?: Type | null, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null);
|
175
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
176
|
}
|
177
|
export declare class ExternalReference {
|
178
|
moduleName: string | null;
|
179
|
name: string | null;
|
180
|
runtime: any | null;
|
181
|
constructor(moduleName: string | null, name: string | null, runtime: any | null);
|
182
|
}
|
183
|
export declare class ConditionalExpr extends Expression {
|
184
|
condition: Expression;
|
185
|
falseCase: Expression | null;
|
186
|
trueCase: Expression;
|
187
|
constructor(condition: Expression, trueCase: Expression, falseCase?: Expression | null, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
188
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
189
|
}
|
190
|
export declare class NotExpr extends Expression {
|
191
|
condition: Expression;
|
192
|
constructor(condition: Expression, sourceSpan?: ParseSourceSpan | null);
|
193
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
194
|
}
|
195
|
export declare class AssertNotNull extends Expression {
|
196
|
condition: Expression;
|
197
|
constructor(condition: Expression, sourceSpan?: ParseSourceSpan | null);
|
198
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
199
|
}
|
200
|
export declare class CastExpr extends Expression {
|
201
|
value: Expression;
|
202
|
constructor(value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
203
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
204
|
}
|
205
|
export declare class FnParam {
|
206
|
name: string;
|
207
|
type: Type | null;
|
208
|
constructor(name: string, type?: Type | null);
|
209
|
}
|
210
|
export declare class FunctionExpr extends Expression {
|
211
|
params: FnParam[];
|
212
|
statements: Statement[];
|
213
|
constructor(params: FnParam[], statements: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
214
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
215
|
toDeclStmt(name: string, modifiers?: StmtModifier[] | null): DeclareFunctionStmt;
|
216
|
}
|
217
|
export declare class BinaryOperatorExpr extends Expression {
|
218
|
operator: BinaryOperator;
|
219
|
rhs: Expression;
|
220
|
lhs: Expression;
|
221
|
constructor(operator: BinaryOperator, lhs: Expression, rhs: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
222
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
223
|
}
|
224
|
export declare class ReadPropExpr extends Expression {
|
225
|
receiver: Expression;
|
226
|
name: string;
|
227
|
constructor(receiver: Expression, name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
228
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
229
|
set(value: Expression): WritePropExpr;
|
230
|
}
|
231
|
export declare class ReadKeyExpr extends Expression {
|
232
|
receiver: Expression;
|
233
|
index: Expression;
|
234
|
constructor(receiver: Expression, index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
235
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
236
|
set(value: Expression): WriteKeyExpr;
|
237
|
}
|
238
|
export declare class LiteralArrayExpr extends Expression {
|
239
|
entries: Expression[];
|
240
|
constructor(entries: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
241
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
242
|
}
|
243
|
export declare class LiteralMapEntry {
|
244
|
key: string;
|
245
|
value: Expression;
|
246
|
quoted: boolean;
|
247
|
constructor(key: string, value: Expression, quoted: boolean);
|
248
|
}
|
249
|
export declare class LiteralMapExpr extends Expression {
|
250
|
entries: LiteralMapEntry[];
|
251
|
valueType: Type | null;
|
252
|
constructor(entries: LiteralMapEntry[], type?: MapType | null, sourceSpan?: ParseSourceSpan | null);
|
253
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
254
|
}
|
255
|
export declare class CommaExpr extends Expression {
|
256
|
parts: Expression[];
|
257
|
constructor(parts: Expression[], sourceSpan?: ParseSourceSpan | null);
|
258
|
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
259
|
}
|
260
|
export interface ExpressionVisitor {
|
261
|
visitReadVarExpr(ast: ReadVarExpr, context: any): any;
|
262
|
visitWriteVarExpr(expr: WriteVarExpr, context: any): any;
|
263
|
visitWriteKeyExpr(expr: WriteKeyExpr, context: any): any;
|
264
|
visitWritePropExpr(expr: WritePropExpr, context: any): any;
|
265
|
visitInvokeMethodExpr(ast: InvokeMethodExpr, context: any): any;
|
266
|
visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any;
|
267
|
visitInstantiateExpr(ast: InstantiateExpr, context: any): any;
|
268
|
visitLiteralExpr(ast: LiteralExpr, context: any): any;
|
269
|
visitExternalExpr(ast: ExternalExpr, context: any): any;
|
270
|
visitConditionalExpr(ast: ConditionalExpr, context: any): any;
|
271
|
visitNotExpr(ast: NotExpr, context: any): any;
|
272
|
visitAssertNotNullExpr(ast: AssertNotNull, context: any): any;
|
273
|
visitCastExpr(ast: CastExpr, context: any): any;
|
274
|
visitFunctionExpr(ast: FunctionExpr, context: any): any;
|
275
|
visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any;
|
276
|
visitReadPropExpr(ast: ReadPropExpr, context: any): any;
|
277
|
visitReadKeyExpr(ast: ReadKeyExpr, context: any): any;
|
278
|
visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any;
|
279
|
visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;
|
280
|
visitCommaExpr(ast: CommaExpr, context: any): any;
|
281
|
}
|
282
|
export declare const THIS_EXPR: ReadVarExpr;
|
283
|
export declare const SUPER_EXPR: ReadVarExpr;
|
284
|
export declare const CATCH_ERROR_VAR: ReadVarExpr;
|
285
|
export declare const CATCH_STACK_VAR: ReadVarExpr;
|
286
|
export declare const NULL_EXPR: LiteralExpr;
|
287
|
export declare const TYPED_NULL_EXPR: LiteralExpr;
|
288
|
export declare enum StmtModifier {
|
289
|
Final = 0,
|
290
|
Private = 1,
|
291
|
Exported = 2,
|
292
|
}
|
293
|
export declare abstract class Statement {
|
294
|
modifiers: StmtModifier[];
|
295
|
sourceSpan: ParseSourceSpan | null;
|
296
|
constructor(modifiers?: StmtModifier[] | null, sourceSpan?: ParseSourceSpan | null);
|
297
|
abstract visitStatement(visitor: StatementVisitor, context: any): any;
|
298
|
hasModifier(modifier: StmtModifier): boolean;
|
299
|
}
|
300
|
export declare class DeclareVarStmt extends Statement {
|
301
|
name: string;
|
302
|
value: Expression;
|
303
|
type: Type | null;
|
304
|
constructor(name: string, value: Expression, type?: Type | null, modifiers?: StmtModifier[] | null, sourceSpan?: ParseSourceSpan | null);
|
305
|
visitStatement(visitor: StatementVisitor, context: any): any;
|
306
|
}
|
307
|
export declare class DeclareFunctionStmt extends Statement {
|
308
|
name: string;
|
309
|
params: FnParam[];
|
310
|
statements: Statement[];
|
311
|
type: Type | null;
|
312
|
constructor(name: string, params: FnParam[], statements: Statement[], type?: Type | null, modifiers?: StmtModifier[] | null, sourceSpan?: ParseSourceSpan | null);
|
313
|
visitStatement(visitor: StatementVisitor, context: any): any;
|
314
|
}
|
315
|
export declare class ExpressionStatement extends Statement {
|
316
|
expr: Expression;
|
317
|
constructor(expr: Expression, sourceSpan?: ParseSourceSpan | null);
|
318
|
visitStatement(visitor: StatementVisitor, context: any): any;
|
319
|
}
|
320
|
export declare class ReturnStatement extends Statement {
|
321
|
value: Expression;
|
322
|
constructor(value: Expression, sourceSpan?: ParseSourceSpan | null);
|
323
|
visitStatement(visitor: StatementVisitor, context: any): any;
|
324
|
}
|
325
|
export declare class AbstractClassPart {
|
326
|
modifiers: StmtModifier[] | null;
|
327
|
type: Type | null;
|
328
|
constructor(type: Type | null | undefined, modifiers: StmtModifier[] | null);
|
329
|
hasModifier(modifier: StmtModifier): boolean;
|
330
|
}
|
331
|
export declare class ClassField extends AbstractClassPart {
|
332
|
name: string;
|
333
|
constructor(name: string, type?: Type | null, modifiers?: StmtModifier[] | null);
|
334
|
}
|
335
|
export declare class ClassMethod extends AbstractClassPart {
|
336
|
name: string | null;
|
337
|
params: FnParam[];
|
338
|
body: Statement[];
|
339
|
constructor(name: string | null, params: FnParam[], body: Statement[], type?: Type | null, modifiers?: StmtModifier[] | null);
|
340
|
}
|
341
|
export declare class ClassGetter extends AbstractClassPart {
|
342
|
name: string;
|
343
|
body: Statement[];
|
344
|
constructor(name: string, body: Statement[], type?: Type | null, modifiers?: StmtModifier[] | null);
|
345
|
}
|
346
|
export declare class ClassStmt extends Statement {
|
347
|
name: string;
|
348
|
parent: Expression | null;
|
349
|
fields: ClassField[];
|
350
|
getters: ClassGetter[];
|
351
|
constructorMethod: ClassMethod;
|
352
|
methods: ClassMethod[];
|
353
|
constructor(name: string, parent: Expression | null, fields: ClassField[], getters: ClassGetter[], constructorMethod: ClassMethod, methods: ClassMethod[], modifiers?: StmtModifier[] | null, sourceSpan?: ParseSourceSpan | null);
|
354
|
visitStatement(visitor: StatementVisitor, context: any): any;
|
355
|
}
|
356
|
export declare class IfStmt extends Statement {
|
357
|
condition: Expression;
|
358
|
trueCase: Statement[];
|
359
|
falseCase: Statement[];
|
360
|
constructor(condition: Expression, trueCase: Statement[], falseCase?: Statement[], sourceSpan?: ParseSourceSpan | null);
|
361
|
visitStatement(visitor: StatementVisitor, context: any): any;
|
362
|
}
|
363
|
export declare class CommentStmt extends Statement {
|
364
|
comment: string;
|
365
|
constructor(comment: string, sourceSpan?: ParseSourceSpan | null);
|
366
|
visitStatement(visitor: StatementVisitor, context: any): any;
|
367
|
}
|
368
|
export declare class TryCatchStmt extends Statement {
|
369
|
bodyStmts: Statement[];
|
370
|
catchStmts: Statement[];
|
371
|
constructor(bodyStmts: Statement[], catchStmts: Statement[], sourceSpan?: ParseSourceSpan | null);
|
372
|
visitStatement(visitor: StatementVisitor, context: any): any;
|
373
|
}
|
374
|
export declare class ThrowStmt extends Statement {
|
375
|
error: Expression;
|
376
|
constructor(error: Expression, sourceSpan?: ParseSourceSpan | null);
|
377
|
visitStatement(visitor: StatementVisitor, context: any): any;
|
378
|
}
|
379
|
export interface StatementVisitor {
|
380
|
visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any;
|
381
|
visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any;
|
382
|
visitExpressionStmt(stmt: ExpressionStatement, context: any): any;
|
383
|
visitReturnStmt(stmt: ReturnStatement, context: any): any;
|
384
|
visitDeclareClassStmt(stmt: ClassStmt, context: any): any;
|
385
|
visitIfStmt(stmt: IfStmt, context: any): any;
|
386
|
visitTryCatchStmt(stmt: TryCatchStmt, context: any): any;
|
387
|
visitThrowStmt(stmt: ThrowStmt, context: any): any;
|
388
|
visitCommentStmt(stmt: CommentStmt, context: any): any;
|
389
|
}
|
390
|
export declare class AstTransformer implements StatementVisitor, ExpressionVisitor {
|
391
|
transformExpr(expr: Expression, context: any): Expression;
|
392
|
transformStmt(stmt: Statement, context: any): Statement;
|
393
|
visitReadVarExpr(ast: ReadVarExpr, context: any): any;
|
394
|
visitWriteVarExpr(expr: WriteVarExpr, context: any): any;
|
395
|
visitWriteKeyExpr(expr: WriteKeyExpr, context: any): any;
|
396
|
visitWritePropExpr(expr: WritePropExpr, context: any): any;
|
397
|
visitInvokeMethodExpr(ast: InvokeMethodExpr, context: any): any;
|
398
|
visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any;
|
399
|
visitInstantiateExpr(ast: InstantiateExpr, context: any): any;
|
400
|
visitLiteralExpr(ast: LiteralExpr, context: any): any;
|
401
|
visitExternalExpr(ast: ExternalExpr, context: any): any;
|
402
|
visitConditionalExpr(ast: ConditionalExpr, context: any): any;
|
403
|
visitNotExpr(ast: NotExpr, context: any): any;
|
404
|
visitAssertNotNullExpr(ast: AssertNotNull, context: any): any;
|
405
|
visitCastExpr(ast: CastExpr, context: any): any;
|
406
|
visitFunctionExpr(ast: FunctionExpr, context: any): any;
|
407
|
visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any;
|
408
|
visitReadPropExpr(ast: ReadPropExpr, context: any): any;
|
409
|
visitReadKeyExpr(ast: ReadKeyExpr, context: any): any;
|
410
|
visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any;
|
411
|
visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;
|
412
|
visitCommaExpr(ast: CommaExpr, context: any): any;
|
413
|
visitAllExpressions(exprs: Expression[], context: any): Expression[];
|
414
|
visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any;
|
415
|
visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any;
|
416
|
visitExpressionStmt(stmt: ExpressionStatement, context: any): any;
|
417
|
visitReturnStmt(stmt: ReturnStatement, context: any): any;
|
418
|
visitDeclareClassStmt(stmt: ClassStmt, context: any): any;
|
419
|
visitIfStmt(stmt: IfStmt, context: any): any;
|
420
|
visitTryCatchStmt(stmt: TryCatchStmt, context: any): any;
|
421
|
visitThrowStmt(stmt: ThrowStmt, context: any): any;
|
422
|
visitCommentStmt(stmt: CommentStmt, context: any): any;
|
423
|
visitAllStatements(stmts: Statement[], context: any): Statement[];
|
424
|
}
|
425
|
export declare class RecursiveAstVisitor implements StatementVisitor, ExpressionVisitor {
|
426
|
visitReadVarExpr(ast: ReadVarExpr, context: any): any;
|
427
|
visitWriteVarExpr(expr: WriteVarExpr, context: any): any;
|
428
|
visitWriteKeyExpr(expr: WriteKeyExpr, context: any): any;
|
429
|
visitWritePropExpr(expr: WritePropExpr, context: any): any;
|
430
|
visitInvokeMethodExpr(ast: InvokeMethodExpr, context: any): any;
|
431
|
visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any;
|
432
|
visitInstantiateExpr(ast: InstantiateExpr, context: any): any;
|
433
|
visitLiteralExpr(ast: LiteralExpr, context: any): any;
|
434
|
visitExternalExpr(ast: ExternalExpr, context: any): any;
|
435
|
visitConditionalExpr(ast: ConditionalExpr, context: any): any;
|
436
|
visitNotExpr(ast: NotExpr, context: any): any;
|
437
|
visitAssertNotNullExpr(ast: AssertNotNull, context: any): any;
|
438
|
visitCastExpr(ast: CastExpr, context: any): any;
|
439
|
visitFunctionExpr(ast: FunctionExpr, context: any): any;
|
440
|
visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any;
|
441
|
visitReadPropExpr(ast: ReadPropExpr, context: any): any;
|
442
|
visitReadKeyExpr(ast: ReadKeyExpr, context: any): any;
|
443
|
visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any;
|
444
|
visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;
|
445
|
visitCommaExpr(ast: CommaExpr, context: any): any;
|
446
|
visitAllExpressions(exprs: Expression[], context: any): void;
|
447
|
visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any;
|
448
|
visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any;
|
449
|
visitExpressionStmt(stmt: ExpressionStatement, context: any): any;
|
450
|
visitReturnStmt(stmt: ReturnStatement, context: any): any;
|
451
|
visitDeclareClassStmt(stmt: ClassStmt, context: any): any;
|
452
|
visitIfStmt(stmt: IfStmt, context: any): any;
|
453
|
visitTryCatchStmt(stmt: TryCatchStmt, context: any): any;
|
454
|
visitThrowStmt(stmt: ThrowStmt, context: any): any;
|
455
|
visitCommentStmt(stmt: CommentStmt, context: any): any;
|
456
|
visitAllStatements(stmts: Statement[], context: any): void;
|
457
|
}
|
458
|
export declare function findReadVarNames(stmts: Statement[]): Set<string>;
|
459
|
export declare function applySourceSpanToStatementIfNeeded(stmt: Statement, sourceSpan: ParseSourceSpan | null): Statement;
|
460
|
export declare function applySourceSpanToExpressionIfNeeded(expr: Expression, sourceSpan: ParseSourceSpan | null): Expression;
|
461
|
export declare function variable(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadVarExpr;
|
462
|
export declare function importExpr(id: ExternalReference, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null): ExternalExpr;
|
463
|
export declare function importType(id: ExternalReference, typeParams?: Type[] | null, typeModifiers?: TypeModifier[] | null): ExpressionType | null;
|
464
|
export declare function expressionType(expr: Expression, typeModifiers?: TypeModifier[] | null): ExpressionType | null;
|
465
|
export declare function literalArr(values: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralArrayExpr;
|
466
|
export declare function literalMap(values: {
|
467
|
key: string;
|
468
|
quoted: boolean;
|
469
|
value: Expression;
|
470
|
}[], type?: MapType | null): LiteralMapExpr;
|
471
|
export declare function not(expr: Expression, sourceSpan?: ParseSourceSpan | null): NotExpr;
|
472
|
export declare function assertNotNull(expr: Expression, sourceSpan?: ParseSourceSpan | null): AssertNotNull;
|
473
|
export declare function fn(params: FnParam[], body: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): FunctionExpr;
|
474
|
export declare function literal(value: any, type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralExpr;
|