forked from federicobond/solidity-parser-antlr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
688 lines (686 loc) · 20.1 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
// Type definitions for solidity-parser-antlr 0.2
// Project: https://github.com/federicobond/solidity-parser-antlr
// Definitions by: Leonid Logvinov <https://github.com/LogvinovLeon>
// Alex Browne <https://github.com/albrow>
// Xiao Liang <https://github.com/yxliang01>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
export interface LineColumn {
line: number;
column: number;
}
export interface Location {
start: LineColumn;
end: LineColumn;
}
// Note: This should be consistent with the definition of type ASTNode
export type ASTNodeTypeString =
| 'SourceUnit'
| 'PragmaDirective'
| 'PragmaName'
| 'PragmaValue'
| 'ImportDirective'
| 'ContractDefinition'
| 'InheritanceSpecifier'
| 'StateVariableDeclaration'
| 'UsingForDeclaration'
| 'StructDefinition'
| 'ModifierDefinition'
| 'ModifierInvocation'
| 'FunctionDefinition'
| 'EventDefinition'
| 'EnumValue'
| 'EnumDefinition'
| 'VariableDeclaration'
| 'UserDefinedTypeName'
| 'Mapping'
| 'ArrayTypeName'
| 'FunctionTypeName'
| 'StorageLocation'
| 'StateMutability'
| 'Block'
| 'ExpressionStatement'
| 'IfStatement'
| 'WhileStatement'
| 'ForStatement'
| 'InlineAssemblyStatement'
| 'DoWhileStatement'
| 'ContinueStatement'
| 'Break'
| 'Continue'
| 'BreakStatement'
| 'ReturnStatement'
| 'EmitStatement'
| 'ThrowStatement'
| 'VariableDeclarationStatement'
| 'IdentifierList'
| 'ElementaryTypeName'
| 'FunctionCall'
| 'AssemblyBlock'
| 'AssemblyItem'
| 'AssemblyCall'
| 'AssemblyLocalDefinition'
| 'AssemblyAssignment'
| 'AssemblyStackAssignment'
| 'LabelDefinition'
| 'AssemblySwitch'
| 'AssemblyCase'
| 'AssemblyFunctionDefinition'
| 'AssemblyFunctionReturns'
| 'AssemblyFor'
| 'AssemblyIf'
| 'AssemblyLiteral'
| 'SubAssembly'
| 'TupleExpression'
| 'ElementaryTypeNameExpression'
| 'BooleanLiteral'
| 'NumberLiteral'
| 'Identifier'
| 'BinaryOperation'
| 'UnaryOperation'
| 'Conditional'
| 'StringLiteral'
| 'HexLiteral'
| 'HexNumber'
| 'DecimalNumber'
| 'MemberAccess'
| 'IndexAccess';
export interface BaseASTNode {
type: ASTNodeTypeString;
range?: [number, number];
loc?: Location;
}
export interface SourceUnit extends BaseASTNode {
type: 'SourceUnit';
children: ASTNode[]; // TODO: Can be more precise
} // tslint:disable-line:no-empty-interface
export interface PragmaDirective extends BaseASTNode {
type: 'PragmaDirective';
name: string;
value: string;
}
export interface ImportDirective extends BaseASTNode {
type: 'ImportDirective';
path: string;
unitAlias: string,
symbolAliases: Array<[string, string]>;
}
export interface ContractDefinition extends BaseASTNode {
type: 'ContractDefinition';
name: string;
baseContracts: InheritanceSpecifier[];
kind: string;
subNodes: ASTNode[]; // TODO: Can be more precise
}
export interface InheritanceSpecifier extends BaseASTNode {
type: 'InheritanceSpecifier';
baseName: UserDefinedTypeName;
arguments: Expression[];
}
export interface StateVariableDeclaration extends BaseASTNode {
type: 'StateVariableDeclaration';
variables: VariableDeclaration[];
initialValue?: Expression;
}
export interface UsingForDeclaration extends BaseASTNode {
type: 'UsingForDeclaration';
typeName: TypeName;
libraryName: string;
}
export interface StructDefinition extends BaseASTNode {
type: 'StructDefinition';
name: string;
members: VariableDeclaration[];
}
export interface ModifierDefinition extends BaseASTNode {
type: 'ModifierDefinition';
name: string;
}
export interface ModifierInvocation extends BaseASTNode {
type: 'ModifierInvocation';
name: string;
arguments: Expression[] | null;
}
export interface FunctionDefinition extends BaseASTNode {
type: 'FunctionDefinition';
name?: string;
parameters: VariableDeclaration[];
modifiers: ModifierInvocation[];
stateMutability?: 'pure' | 'constant' | 'payable' | 'view'
visibility: 'default' | 'external' | 'internal' | 'public' | 'private';
isConstructor: boolean;
returnParameters?: VariableDeclaration[];
body?: Block;
}
export interface EventDefinition extends BaseASTNode {
type: 'EventDefinition';
name: string;
parameters: VariableDeclaration[];
}
export interface EnumValue extends BaseASTNode {
type: 'EnumValue';
name: string;
}
export interface EnumDefinition extends BaseASTNode {
type: 'EnumDefinition';
name: string;
members: EnumValue[];
}
export interface VariableDeclaration extends BaseASTNode {
type: 'VariableDeclaration';
isIndexed: boolean;
isStateVar: boolean;
typeName: TypeName;
name: string;
isDeclaredConst?: boolean;
storageLocation?: string;
expression?: Expression;
visibility?: 'public' | 'private' | 'internal' | 'default';
}
export interface UserDefinedTypeName extends BaseASTNode {
type: 'UserDefinedTypeName';
namePath: string;
}
export interface ArrayTypeName extends BaseASTNode {
type: 'ArrayTypeName';
baseTypeName: TypeName;
length?: Expression;
}
export interface Mapping extends BaseASTNode {
type: 'Mapping';
keyType: ElementaryTypeName;
valueType: TypeName;
}
export interface FunctionTypeName extends BaseASTNode {
type: 'FunctionTypeName';
parameterTypes: TypeName[];
returnTypes: TypeName[];
visibility: string;
stateMutability: string;
}
export interface Block extends BaseASTNode {
type: 'Block';
statements: Statement[]
}
export interface ExpressionStatement extends BaseASTNode {
type: 'ExpressionStatement';
expression: Expression;
}
export interface IfStatement extends BaseASTNode {
type: 'IfStatement';
condition: Expression;
trueBody: Statement;
falseBody?: Statement;
}
export interface WhileStatement extends BaseASTNode {
type: 'WhileStatement';
}
export interface ForStatement extends BaseASTNode {
type: 'ForStatement';
initExpression?: SimpleStatement;
conditionExpression?: Expression;
loopExpression?: ExpressionStatement;
body: Statement;
}
export interface InlineAssemblyStatement extends BaseASTNode {
type: 'InlineAssemblyStatement';
language: string;
body: AssemblyBlock;
}
export interface DoWhileStatement extends BaseASTNode {
type: 'DoWhileStatement';
condition: Expression;
body: Statement;
}
export interface ContinueStatement extends BaseASTNode {
type: 'ContinueStatement';
}
export interface Break extends BaseASTNode {
type: 'Break';
}
export interface Continue extends BaseASTNode {
type: 'Continue';
}
export interface BreakStatement extends BaseASTNode {
type: 'BreakStatement';
}
export interface ReturnStatement extends BaseASTNode {
type: 'ReturnStatement';
expression: Expression | null;
}
export interface EmitStatement extends BaseASTNode {
type: 'EmitStatement';
eventCall: FunctionCall;
}
export interface ThrowStatement extends BaseASTNode {
type: 'ThrowStatement';
}
export interface VariableDeclarationStatement extends BaseASTNode {
type: 'VariableDeclarationStatement';
variables: ASTNode[];
initialValue?: Expression;
}
export interface ElementaryTypeName extends BaseASTNode {
type: 'ElementaryTypeName';
name: string;
}
export interface FunctionCall extends BaseASTNode {
type: 'FunctionCall';
expression: Expression;
arguments: Expression[];
names: string[];
}
export interface AssemblyBlock extends BaseASTNode {
type: 'AssemblyBlock';
operations: AssemblyItem[]
}
export interface AssemblyCall extends BaseASTNode {
type: 'AssemblyCall';
functionName: string,
arguments: AssemblyExpression[];
}
export interface AssemblyLocalDefinition extends BaseASTNode {
type: 'AssemblyLocalDefinition';
}
export interface AssemblyAssignment extends BaseASTNode {
type: 'AssemblyAssignment';
expression: AssemblyExpression;
names: Identifier[]
}
export interface AssemblyStackAssignment extends BaseASTNode {
type: 'AssemblyStackAssignment';
}
export interface LabelDefinition extends BaseASTNode {
type: 'LabelDefinition';
}
export interface AssemblySwitch extends BaseASTNode {
type: 'AssemblySwitch';
}
export interface AssemblyCase extends BaseASTNode {
type: 'AssemblyCase';
}
export interface AssemblyFunctionDefinition extends BaseASTNode {
type: 'AssemblyFunctionDefinition';
}
export interface AssemblyFunctionReturns extends BaseASTNode {
type: 'AssemblyFunctionReturns';
}
export interface AssemblyFor extends BaseASTNode {
type: 'AssemblyFor';
}
export interface AssemblyIf extends BaseASTNode {
type: 'AssemblyIf';
}
export interface AssemblyLiteral extends BaseASTNode {
type: 'AssemblyLiteral';
}
export interface SubAssembly extends BaseASTNode {
type: 'SubAssembly';
}
export interface TupleExpression extends BaseASTNode {
type: 'TupleExpression';
components: Expression[];
isArray: boolean;
}
export interface ElementaryTypeNameExpression extends BaseASTNode {
type: 'ElementaryTypeNameExpression';
typeName: ElementaryTypeName;
}
export interface NumberLiteral extends BaseASTNode {
type: 'NumberLiteral';
number: string;
subdenomination:
| null
| 'wei'
| 'szabo'
| 'finney'
| 'ether'
| 'seconds'
| 'minutes'
| 'hours'
| 'days'
| 'weeks'
| 'years';
}
export interface BooleanLiteral extends BaseASTNode {
type: 'BooleanLiteral';
value: boolean;
}
export interface HexLiteral extends BaseASTNode {
type: 'HexLiteral';
value: string;
}
export interface StringLiteral extends BaseASTNode {
type: 'StringLiteral';
value: string;
}
export interface Identifier extends BaseASTNode {
type: 'Identifier';
name: string;
}
export type BinOp =
| '+'
| '-'
| '*'
| '/'
| '**'
| '%'
| '<<'
| '>>'
| '&&'
| '||'
| '&'
| '|'
| '^'
| '<'
| '>'
| '<='
| '>='
| '=='
| '!='
| '='
| '|='
| '^='
| '&='
| '<<='
| '>>='
| '+='
| '-='
| '*='
| '/='
| '%=';
export type UnOp =
| '-'
| '!'
| '--'
| '++';
export interface BinaryOperation extends BaseASTNode {
type: 'BinaryOperation';
left: Expression;
right: Expression;
operator: BinOp;
}
export interface UnaryOperation extends BaseASTNode {
type: 'UnaryOperation';
subExpression: Expression;
operator: UnOp;
isPrefix: boolean;
}
export interface Conditional extends BaseASTNode {
type: 'Conditional';
condition: Expression;
trueExpression: Expression;
falseExpression: Expression;
}
export interface IndexAccess extends BaseASTNode {
type: 'IndexAccess';
base: Expression;
index: Expression;
}
export interface MemberAccess extends BaseASTNode {
type: 'MemberAccess';
expression: Expression;
memberName: string;
}
export interface HexNumber extends BaseASTNode {
type: 'HexNumber';
value: string;
}
export interface DecimalNumber extends BaseASTNode {
type: 'DecimalNumber';
value: string;
}
export type ASTNode =
| SourceUnit
| PragmaDirective
| ImportDirective
| ContractDefinition
| InheritanceSpecifier
| StateVariableDeclaration
| UsingForDeclaration
| StructDefinition
| ModifierDefinition
| ModifierInvocation
| FunctionDefinition
| EventDefinition
| EnumValue
| EnumDefinition
| VariableDeclaration
| TypeName
| UserDefinedTypeName
| Mapping
| FunctionTypeName
| Block
| ExpressionStatement
| IfStatement
| WhileStatement
| ForStatement
| InlineAssemblyStatement
| DoWhileStatement
| ContinueStatement
| BreakStatement
| ReturnStatement
| EmitStatement
| ThrowStatement
| VariableDeclarationStatement
| ElementaryTypeName
| AssemblyBlock
| AssemblyCall
| AssemblyLocalDefinition
| AssemblyAssignment
| AssemblyStackAssignment
| LabelDefinition
| AssemblySwitch
| AssemblyCase
| AssemblyFunctionDefinition
| AssemblyFunctionReturns
| AssemblyFor
| AssemblyIf
| AssemblyLiteral
| SubAssembly
| TupleExpression
| ElementaryTypeNameExpression
| BinaryOperation
| Conditional
| IndexAccess
| AssemblyItem
| Expression;
export type AssemblyItem =
| Identifier
| AssemblyBlock
| AssemblyExpression
| AssemblyLocalDefinition
| AssemblyAssignment
| AssemblyStackAssignment
| LabelDefinition
| AssemblySwitch
| AssemblyFunctionDefinition
| AssemblyFor
| AssemblyIf
| Break
| Continue
| SubAssembly
| NumberLiteral
| StringLiteral
| HexNumber
| HexLiteral
| DecimalNumber;
export type AssemblyExpression =
| AssemblyCall
| AssemblyLiteral
export type Expression =
| IndexAccess
| TupleExpression
| BinaryOperation
| UnaryOperation
| Conditional
| MemberAccess
| FunctionCall
| PrimaryExpression;
export type PrimaryExpression =
| BooleanLiteral
| NumberLiteral
| Identifier
| TupleExpression
| ElementaryTypeNameExpression;
export type SimpleStatement =
| VariableDeclarationStatement
| ExpressionStatement;
export type TypeName =
| ElementaryTypeName
| UserDefinedTypeName
| Mapping
| ArrayTypeName
| FunctionTypeName;
export type Statement =
| IfStatement
| WhileStatement
| ForStatement
| Block
| InlineAssemblyStatement
| DoWhileStatement
| ContinueStatement
| BreakStatement
| ReturnStatement
| EmitStatement
| ThrowStatement
| SimpleStatement
| VariableDeclarationStatement;
export interface Visitor {
SourceUnit?: (node: SourceUnit) => any;
PragmaDirective?: (node: PragmaDirective) => any;
ImportDirective?: (node: ImportDirective) => any;
ContractDefinition?: (node: ContractDefinition) => any;
InheritanceSpecifier?: (node: InheritanceSpecifier) => any;
StateVariableDeclaration?: (node: StateVariableDeclaration) => any;
UsingForDeclaration?: (node: UsingForDeclaration) => any;
StructDefinition?: (node: StructDefinition) => any;
ModifierDefinition?: (node: ModifierDefinition) => any;
ModifierInvocation?: (node: ModifierInvocation) => any;
FunctionDefinition?: (node: FunctionDefinition) => any;
EventDefinition?: (node: EventDefinition) => any;
EnumValue?: (node: EnumValue) => any;
EnumDefinition?: (node: EnumDefinition) => any;
VariableDeclaration?: (node: VariableDeclaration) => any;
UserDefinedTypeName?: (node: UserDefinedTypeName) => any;
Mapping?: (node: Mapping) => any;
ArrayTypeName?: (node: ArrayTypeName) => any;
FunctionTypeName?: (node: FunctionTypeName) => any;
Block?: (node: Block) => any;
ExpressionStatement?: (node: ExpressionStatement) => any;
IfStatement?: (node: IfStatement) => any;
WhileStatement?: (node: WhileStatement) => any;
ForStatement?: (node: ForStatement) => any;
InlineAssemblyStatement?: (node: InlineAssemblyStatement) => any;
DoWhileStatement?: (node: DoWhileStatement) => any;
ContinueStatement?: (node: ContinueStatement) => any;
BreakStatement?: (node: BreakStatement) => any;
ReturnStatement?: (node: ReturnStatement) => any;
EmitStatement?: (node: EmitStatement) => any;
ThrowStatement?: (node: ThrowStatement) => any;
VariableDeclarationStatement?: (node: VariableDeclarationStatement) => any;
ElementaryTypeName?: (node: ElementaryTypeName) => any;
AssemblyBlock?: (node: AssemblyBlock) => any;
AssemblyCall?: (node: AssemblyCall) => any;
AssemblyLocalDefinition?: (node: AssemblyLocalDefinition) => any;
AssemblyAssignment?: (node: AssemblyAssignment) => any;
AssemblyStackAssignment?: (node: AssemblyStackAssignment) => any;
LabelDefinition?: (node: LabelDefinition) => any;
AssemblySwitch?: (node: AssemblySwitch) => any;
AssemblyCase?: (node: AssemblyCase) => any;
AssemblyFunctionDefinition?: (node: AssemblyFunctionDefinition) => any;
AssemblyFunctionReturns?: (node: AssemblyFunctionReturns) => any;
AssemblyFor?: (node: AssemblyFor) => any;
AssemblyIf?: (node: AssemblyIf) => any;
AssemblyLiteral?: (node: AssemblyLiteral) => any;
SubAssembly?: (node: SubAssembly) => any;
TupleExpression?: (node: TupleExpression) => any;
ElementaryTypeNameExpression?: (node: ElementaryTypeNameExpression) => any;
NumberLiteral?: (node: NumberLiteral) => any;
BooleanLiteral?: (node: BooleanLiteral) => any;
Identifier?: (node: Identifier) => any;
BinaryOperation?: (node: BinaryOperation) => any;
UnaryOperation?: (node: UnaryOperation) => any;
Conditional?: (node: Conditional) => any;
IndexAccess?: (node: IndexAccess) => any;
MemberAccess?: (node: MemberAccess) => any;
FunctionCall?: (node: FunctionCall) => any;
Break?: (node: Break) => any;
HexNumber?: (node: HexNumber) => any;
DecimalNumber?: (node: DecimalNumber) => any;
Continue?: (node: Continue) => any;
// Start of :exit handler for each type. Must be consistent with above
'SourceUnit:exit'?: (node: SourceUnit) => any;
'PragmaDirective:exit'?: (node: PragmaDirective) => any;
'ImportDirective:exit'?: (node: ImportDirective) => any;
'ContractDefinition:exit'?: (node: ContractDefinition) => any;
'InheritanceSpecifier:exit'?: (node: InheritanceSpecifier) => any;
'StateVariableDeclaration:exit'?: (node: StateVariableDeclaration) => any;
'UsingForDeclaration:exit'?: (node: UsingForDeclaration) => any;
'StructDefinition:exit'?: (node: StructDefinition) => any;
'ModifierDefinition:exit'?: (node: ModifierDefinition) => any;
'ModifierInvocation:exit'?: (node: ModifierInvocation) => any;
'FunctionDefinition:exit'?: (node: FunctionDefinition) => any;
'EventDefinition:exit'?: (node: EventDefinition) => any;
'EnumValue:exit'?: (node: EnumValue) => any;
'EnumDefinition:exit'?: (node: EnumDefinition) => any;
'VariableDeclaration:exit'?: (node: VariableDeclaration) => any;
'UserDefinedTypeName:exit'?: (node: UserDefinedTypeName) => any;
'Mapping:exit'?: (node: Mapping) => any;
'ArrayTypeName:exit'?: (node: ArrayTypeName) => any;
'FunctionTypeName:exit'?: (node: FunctionTypeName) => any;
'Block:exit'?: (node: Block) => any;
'ExpressionStatement:exit'?: (node: ExpressionStatement) => any;
'IfStatement:exit'?: (node: IfStatement) => any;
'WhileStatement:exit'?: (node: WhileStatement) => any;
'ForStatement:exit'?: (node: ForStatement) => any;
'InlineAssemblyStatement:exit'?: (node: InlineAssemblyStatement) => any;
'DoWhileStatement:exit'?: (node: DoWhileStatement) => any;
'ContinueStatement:exit'?: (node: ContinueStatement) => any;
'BreakStatement:exit'?: (node: BreakStatement) => any;
'ReturnStatement:exit'?: (node: ReturnStatement) => any;
'EmitStatement:exit'?: (node: EmitStatement) => any;
'ThrowStatement:exit'?: (node: ThrowStatement) => any;
'VariableDeclarationStatement:exit'?: (node: VariableDeclarationStatement) => any;
'ElementaryTypeName:exit'?: (node: ElementaryTypeName) => any;
'AssemblyBlock:exit'?: (node: AssemblyBlock) => any;
'AssemblyCall:exit'?: (node: AssemblyCall) => any;
'AssemblyLocalDefinition:exit'?: (node: AssemblyLocalDefinition) => any;
'AssemblyAssignment:exit'?: (node: AssemblyAssignment) => any;
'AssemblyStackAssignment:exit'?: (node: AssemblyStackAssignment) => any;
'LabelDefinition:exit'?: (node: LabelDefinition) => any;
'AssemblySwitch:exit'?: (node: AssemblySwitch) => any;
'AssemblyCase:exit'?: (node: AssemblyCase) => any;
'AssemblyFunctionDefinition:exit'?: (
node: AssemblyFunctionDefinition
) => any;
'AssemblyFunctionReturns:exit'?: (node: AssemblyFunctionReturns) => any;
'AssemblyFor:exit'?: (node: AssemblyFor) => any;
'AssemblyIf:exit'?: (node: AssemblyIf) => any;
'AssemblyLiteral:exit'?: (node: AssemblyLiteral) => any;
'SubAssembly:exit'?: (node: SubAssembly) => any;
'TupleExpression:exit'?: (node: TupleExpression) => any;
'ElementaryTypeNameExpression:exit'?: (
node: ElementaryTypeNameExpression
) => any;
'NumberLiteral:exit'?: (node: NumberLiteral) => any;
'BooleanLiteral:exit'?: (node: BooleanLiteral) => any;
'Identifier:exit'?: (node: Identifier) => any;
'BinaryOperation:exit'?: (node: BinaryOperation) => any;
'Conditional:exit'?: (node: Conditional) => any;
'IndexAccess:exit'?: (node: IndexAccess) => any;
'MemberAccess:exit'?: (node: MemberAccess) => any;
'HexNumber:exit'?: (node: HexNumber) => any;
'DecimalNumber:exit'?: (node: DecimalNumber) => any;
'Break:exit'?: (node: Break) => any;
'Continue:exit'?: (node: Continue) => any;
}
export interface ParserOpts {
tolerant?: boolean;
range?: boolean;
loc?: boolean;
}
export function parse(sourceCode: string, parserOpts: ParserOpts): ASTNode;
export function parseType(sourceCode: string, parserOpts: ParserOpts): ASTNode;
export function parseExpression(sourceCode: string, parserOpts: ParserOpts): Expression;
export function visit(ast: ASTNode, visitor: Visitor): void;