Skip to content

wake.core.visitor module #

Visitor class #

Base class for detectors and printers. visit_ methods are called automatically by the execution engine.

Attributes:

Name Type Description
build ProjectBuild

The latest compilation build of the project.

build_info ProjectBuildInfo

Information about the latest compilation build of the project.

config WakeConfig

The loaded Wake configuration.

imports_graph DiGraph

A directed graph representing the import dependencies of the project. Nodes are represented by string source unit names. Edges are directed from the imported source unit to the importing source unit.

Nodes hold the following data attributes:

  • path: Path to the source unit file.
  • versions: SolidityVersionRanges describing allowed Solidity versions by pragma directives.
  • hash: bytes 256-bit BLAKE2b hash of the source unit file contents.
  • content: bytes source unit file contents.

Warning

Imports graph may contain source units that are not present in the build. This can happen for example because of a failed compilation.

logger Logger

A logger instance that can be used to log messages to the console. The log messages are redirected to a VS Code output window in the case of detectors running in the VS Code extension.

Source code in wake/core/visitor.py
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
class Visitor:
    """
    Base class for detectors and printers. `visit_` methods are called automatically by the execution engine.

    Attributes:
        build: The latest compilation build of the project.
        build_info: Information about the latest compilation build of the project.
        config: The loaded Wake configuration.
        imports_graph: A directed graph representing the import dependencies of the project.
            Nodes are represented by string [source unit names](https://docs.soliditylang.org/en/latest/path-resolution.html).
            Edges are directed from the imported source unit to the importing source unit.

            Nodes hold the following data attributes:

            - `path`: [Path][pathlib.Path] to the source unit file.
            - `versions`: [SolidityVersionRanges][wake.core.solidity_version.SolidityVersionRanges] describing allowed Solidity versions by pragma directives.
            - `hash`: [bytes][bytes] 256-bit BLAKE2b hash of the source unit file contents.
            - `content`: [bytes][bytes] source unit file contents.

            !!! warning
                Imports graph may contain source units that are not present in the build. This can happen for example because of a failed compilation.

        logger: A logger instance that can be used to log messages to the console. The log messages are redirected to a VS Code output window in the case of detectors running in the VS Code extension.
    """

    build: ProjectBuild
    build_info: ProjectBuildInfo
    config: WakeConfig
    imports_graph: nx.DiGraph
    logger: logging.Logger

    def visit_ir_abc(self, node: ir.IrAbc):
        """
        Visit any [IrAbc][wake.ir.abc.IrAbc] node.
        """

    def visit_solidity_abc(self, node: ir.SolidityAbc):
        """
        Visit any [SolidityAbc][wake.ir.abc.SolidityAbc] node.
        """

    def visit_yul_abc(self, node: ir.YulAbc):
        """
        Visit any [YulAbc][wake.ir.yul.abc.YulAbc] node.
        """

    def visit_yul_statement_abc(self, node: ir.YulStatementAbc):
        """
        Visit any [YulStatementAbc][wake.ir.yul.abc.YulStatementAbc] node.
        """

    # declarations
    def visit_declaration_abc(self, node: ir.DeclarationAbc):
        """
        Visit any [DeclarationAbc][wake.ir.declarations.abc.DeclarationAbc] node.
        """

    def visit_contract_definition(self, node: ir.ContractDefinition):
        """
        Visit [ContractDefinition][wake.ir.declarations.contract_definition.ContractDefinition] node.
        """

    def visit_enum_definition(self, node: ir.EnumDefinition):
        """
        Visit [EnumDefinition][wake.ir.declarations.enum_definition.EnumDefinition] node.
        """

    def visit_enum_value(self, node: ir.EnumValue):
        """
        Visit [EnumValue][wake.ir.declarations.enum_value.EnumValue] node.
        """

    def visit_error_definition(self, node: ir.ErrorDefinition):
        """
        Visit [ErrorDefinition][wake.ir.declarations.error_definition.ErrorDefinition] node.
        """

    def visit_event_definition(self, node: ir.EventDefinition):
        """
        Visit [EventDefinition][wake.ir.declarations.event_definition.EventDefinition] node.
        """

    def visit_function_definition(self, node: ir.FunctionDefinition):
        """
        Visit [FunctionDefinition][wake.ir.declarations.function_definition.FunctionDefinition] node.
        """

    def visit_modifier_definition(self, node: ir.ModifierDefinition):
        """
        Visit [ModifierDefinition][wake.ir.declarations.modifier_definition.ModifierDefinition] node.
        """

    def visit_struct_definition(self, node: ir.StructDefinition):
        """
        Visit [StructDefinition][wake.ir.declarations.struct_definition.StructDefinition] node.
        """

    def visit_user_defined_value_type_definition(
        self, node: ir.UserDefinedValueTypeDefinition
    ):
        """
        Visit [UserDefinedValueTypeDefinition][wake.ir.declarations.user_defined_value_type_definition.UserDefinedValueTypeDefinition] node.
        """

    def visit_variable_declaration(self, node: ir.VariableDeclaration):
        """
        Visit [VariableDeclaration][wake.ir.declarations.variable_declaration.VariableDeclaration] node.
        """

    # expressions
    def visit_expression_abc(self, node: ir.ExpressionAbc):
        """
        Visit any [ExpressionAbc][wake.ir.expressions.abc.ExpressionAbc] node.
        """

    def visit_assignment(self, node: ir.Assignment):
        """
        Visit [Assignment][wake.ir.expressions.assignment.Assignment] node.
        """

    def visit_binary_operation(self, node: ir.BinaryOperation):
        """
        Visit [BinaryOperation][wake.ir.expressions.binary_operation.BinaryOperation] node.
        """

    def visit_conditional(self, node: ir.Conditional):
        """
        Visit [Conditional][wake.ir.expressions.conditional.Conditional] node.
        """

    def visit_elementary_type_name_expression(
        self, node: ir.ElementaryTypeNameExpression
    ):
        """
        Visit [ElementaryTypeNameExpression][wake.ir.expressions.elementary_type_name_expression.ElementaryTypeNameExpression] node.
        """

    def visit_function_call(self, node: ir.FunctionCall):
        """
        Visit [FunctionCall][wake.ir.expressions.function_call.FunctionCall] node.
        """

    def visit_function_call_options(self, node: ir.FunctionCallOptions):
        """
        Visit [FunctionCallOptions][wake.ir.expressions.function_call_options.FunctionCallOptions] node.
        """

    def visit_identifier(self, node: ir.Identifier):
        """
        Visit [Identifier][wake.ir.expressions.identifier.Identifier] node.
        """

    def visit_index_access(self, node: ir.IndexAccess):
        """
        Visit [IndexAccess][wake.ir.expressions.index_access.IndexAccess] node.
        """

    def visit_index_range_access(self, node: ir.IndexRangeAccess):
        """
        Visit [IndexRangeAccess][wake.ir.expressions.index_range_access.IndexRangeAccess] node.
        """

    def visit_literal(self, node: ir.Literal):
        """
        Visit [Literal][wake.ir.expressions.literal.Literal] node.
        """

    def visit_member_access(self, node: ir.MemberAccess):
        """
        Visit [MemberAccess][wake.ir.expressions.member_access.MemberAccess] node.
        """

    def visit_new_expression(self, node: ir.NewExpression):
        """
        Visit [NewExpression][wake.ir.expressions.new_expression.NewExpression] node.
        """

    def visit_tuple_expression(self, node: ir.TupleExpression):
        """
        Visit [TupleExpression][wake.ir.expressions.tuple_expression.TupleExpression] node.
        """

    def visit_unary_operation(self, node: ir.UnaryOperation):
        """
        Visit [UnaryOperation][wake.ir.expressions.unary_operation.UnaryOperation] node.
        """

    # meta
    def visit_identifier_path(self, node: ir.IdentifierPath):
        """
        Visit [IdentifierPath][wake.ir.meta.identifier_path.IdentifierPath] node.
        """

    def visit_import_directive(self, node: ir.ImportDirective):
        """
        Visit [ImportDirective][wake.ir.meta.import_directive.ImportDirective] node.
        """

    def visit_inheritance_specifier(self, node: ir.InheritanceSpecifier):
        """
        Visit [InheritanceSpecifier][wake.ir.meta.inheritance_specifier.InheritanceSpecifier] node.
        """

    def visit_modifier_invocation(self, node: ir.ModifierInvocation):
        """
        Visit [ModifierInvocation][wake.ir.meta.modifier_invocation.ModifierInvocation] node.
        """

    def visit_override_specifier(self, node: ir.OverrideSpecifier):
        """
        Visit [OverrideSpecifier][wake.ir.meta.override_specifier.OverrideSpecifier] node.
        """

    def visit_parameter_list(self, node: ir.ParameterList):
        """
        Visit [ParameterList][wake.ir.meta.parameter_list.ParameterList] node.
        """

    def visit_pragma_directive(self, node: ir.PragmaDirective):
        """
        Visit [PragmaDirective][wake.ir.meta.pragma_directive.PragmaDirective] node.
        """

    def visit_source_unit(self, node: ir.SourceUnit):
        """
        Visit [SourceUnit][wake.ir.meta.source_unit.SourceUnit] node.
        """

    def visit_structured_documentation(self, node: ir.StructuredDocumentation):
        """
        Visit [StructuredDocumentation][wake.ir.meta.structured_documentation.StructuredDocumentation] node.
        """

    def visit_try_catch_clause(self, node: ir.TryCatchClause):
        """
        Visit [TryCatchClause][wake.ir.meta.try_catch_clause.TryCatchClause] node.
        """

    def visit_using_for_directive(self, node: ir.UsingForDirective):
        """
        Visit [UsingForDirective][wake.ir.meta.using_for_directive.UsingForDirective] node.
        """

    # statements
    def visit_statement_abc(self, node: ir.StatementAbc):
        """
        Visit any [StatementAbc][wake.ir.statements.abc.StatementAbc] node.
        """

    def visit_block(self, node: ir.Block):
        """
        Visit [Block][wake.ir.statements.block.Block] node.
        """

    def visit_break(self, node: ir.Break):
        """
        Visit [Break][wake.ir.statements.break_statement.Break] node.
        """

    def visit_continue(self, node: ir.Continue):
        """
        Visit [Continue][wake.ir.statements.continue_statement.Continue] node.
        """

    def visit_do_while_statement(self, node: ir.DoWhileStatement):
        """
        Visit [DoWhileStatement][wake.ir.statements.do_while_statement.DoWhileStatement] node.
        """

    def visit_emit_statement(self, node: ir.EmitStatement):
        """
        Visit [EmitStatement][wake.ir.statements.emit_statement.EmitStatement] node.
        """

    def visit_expression_statement(self, node: ir.ExpressionStatement):
        """
        Visit [ExpressionStatement][wake.ir.statements.expression_statement.ExpressionStatement] node.
        """

    def visit_for_statement(self, node: ir.ForStatement):
        """
        Visit [ForStatement][wake.ir.statements.for_statement.ForStatement] node.
        """

    def visit_if_statement(self, node: ir.IfStatement):
        """
        Visit [IfStatement][wake.ir.statements.if_statement.IfStatement] node.
        """

    def visit_inline_assembly(self, node: ir.InlineAssembly):
        """
        Visit [InlineAssembly][wake.ir.statements.inline_assembly.InlineAssembly] node.
        """

    def visit_placeholder_statement(self, node: ir.PlaceholderStatement):
        """
        Visit [PlaceholderStatement][wake.ir.statements.placeholder_statement.PlaceholderStatement] node.
        """

    def visit_return(self, node: ir.Return):
        """
        Visit [Return][wake.ir.statements.return_statement.Return] node.
        """

    def visit_revert_statement(self, node: ir.RevertStatement):
        """
        Visit [RevertStatement][wake.ir.statements.revert_statement.RevertStatement] node.
        """

    def visit_try_statement(self, node: ir.TryStatement):
        """
        Visit [TryStatement][wake.ir.statements.try_statement.TryStatement] node.
        """

    def visit_unchecked_block(self, node: ir.UncheckedBlock):
        """
        Visit [UncheckedBlock][wake.ir.statements.unchecked_block.UncheckedBlock] node.
        """

    def visit_variable_declaration_statement(
        self, node: ir.VariableDeclarationStatement
    ):
        """
        Visit [VariableDeclarationStatement][wake.ir.statements.variable_declaration_statement.VariableDeclarationStatement] node.
        """

    def visit_while_statement(self, node: ir.WhileStatement):
        """
        Visit [WhileStatement][wake.ir.statements.while_statement.WhileStatement] node.
        """

    # type names
    def visit_type_name_abc(self, node: ir.TypeNameAbc):
        """
        Visit any [TypeNameAbc][wake.ir.type_names.abc.TypeNameAbc] node.
        """

    def visit_array_type_name(self, node: ir.ArrayTypeName):
        """
        Visit [ArrayTypeName][wake.ir.type_names.array_type_name.ArrayTypeName] node.
        """

    def visit_elementary_type_name(self, node: ir.ElementaryTypeName):
        """
        Visit [ElementaryTypeName][wake.ir.type_names.elementary_type_name.ElementaryTypeName] node.
        """

    def visit_function_type_name(self, node: ir.FunctionTypeName):
        """
        Visit [FunctionTypeName][wake.ir.type_names.function_type_name.FunctionTypeName] node.
        """

    def visit_mapping(self, node: ir.Mapping):
        """
        Visit [Mapping][wake.ir.type_names.mapping.Mapping] node.
        """

    def visit_user_defined_type_name(self, node: ir.UserDefinedTypeName):
        """
        Visit [UserDefinedTypeName][wake.ir.type_names.user_defined_type_name.UserDefinedTypeName] node.
        """

    # yul
    def visit_yul_assignment(self, node: ir.YulAssignment):
        """
        Visit [YulAssignment][wake.ir.yul.assignment.YulAssignment] node.
        """

    def visit_yul_block(self, node: ir.YulBlock):
        """
        Visit [YulBlock][wake.ir.yul.block.YulBlock] node.
        """

    def visit_yul_break(self, node: ir.YulBreak):
        """
        Visit [YulBreak][wake.ir.yul.break_statement.YulBreak] node.
        """

    def visit_yul_case(self, node: ir.YulCase):
        """
        Visit [YulCase][wake.ir.yul.case_.YulCase] node.
        """

    def visit_yul_continue(self, node: ir.YulContinue):
        """
        Visit [YulContinue][wake.ir.yul.continue_statement.YulContinue] node.
        """

    def visit_yul_expression_statement(self, node: ir.YulExpressionStatement):
        """
        Visit [YulExpressionStatement][wake.ir.yul.expression_statement.YulExpressionStatement] node.
        """

    def visit_yul_for_loop(self, node: ir.YulForLoop):
        """
        Visit [YulForLoop][wake.ir.yul.for_loop.YulForLoop] node.
        """

    def visit_yul_function_call(self, node: ir.YulFunctionCall):
        """
        Visit [YulFunctionCall][wake.ir.yul.function_call.YulFunctionCall] node.
        """

    def visit_yul_function_definition(self, node: ir.YulFunctionDefinition):
        """
        Visit [YulFunctionDefinition][wake.ir.yul.function_definition.YulFunctionDefinition] node.
        """

    def visit_yul_identifier(self, node: ir.YulIdentifier):
        """
        Visit [YulIdentifier][wake.ir.yul.identifier.YulIdentifier] node.
        """

    def visit_yul_if(self, node: ir.YulIf):
        """
        Visit [YulIf][wake.ir.yul.if_statement.YulIf] node.
        """

    def visit_yul_leave(self, node: ir.YulLeave):
        """
        Visit [YulLeave][wake.ir.yul.leave.YulLeave] node.
        """

    def visit_yul_literal(self, node: ir.YulLiteral):
        """
        Visit [YulLiteral][wake.ir.yul.literal.YulLiteral] node.
        """

    def visit_yul_switch(self, node: ir.YulSwitch):
        """
        Visit [YulSwitch][wake.ir.yul.switch.YulSwitch] node.
        """

    def visit_yul_typed_name(self, node: ir.YulTypedName):
        """
        Visit [YulTypedName][wake.ir.yul.typed_name.YulTypedName] node.
        """

    def visit_yul_variable_declaration(self, node: ir.YulVariableDeclaration):
        """
        Visit [YulVariableDeclaration][wake.ir.yul.variable_declaration.YulVariableDeclaration] node.
        """

    def generate_link_from_line_col(
        self, path: Union[str, Path], line: int, col: int
    ) -> str:
        """
        Generate a link to the given source unit file location.

        Args:
            path: Path to the source unit file.
            line: Line number.
            col: Column number.

        Returns:
            A link formatted according to the [link_format][wake.config.data_model.GeneralConfig.link_format] configuration option.
        """
        if isinstance(path, Path):
            path = str(path.resolve())
        return self.config.general.link_format.format(path=path, line=line, col=col)

    def generate_link(self, node: ir.IrAbc) -> str:
        """
        Generate a link to the start of the given node based on [name_location][wake.ir.declarations.abc.DeclarationAbc.name_location] or [byte_location][wake.ir.abc.IrAbc.byte_location].

        Args:
            node: Node to generate a link to.

        Returns:
            A link formatted according to the [link_format][wake.config.data_model.GeneralConfig.link_format] configuration option.
        """
        if isinstance(node, ir.DeclarationAbc):
            line, col = node.source_unit.get_line_col_from_byte_offset(
                node.name_location[0]
            )
        else:
            line, col = node.source_unit.get_line_col_from_byte_offset(
                node.byte_location[0]
            )
        return self.generate_link_from_line_col(node.source_unit.file, line, col)

Generate a link to the start of the given node based on name_location or byte_location.

Parameters:

Name Type Description Default
node IrAbc

Node to generate a link to.

required

Returns:

Type Description
str

A link formatted according to the link_format configuration option.

Source code in wake/core/visitor.py
def generate_link(self, node: ir.IrAbc) -> str:
    """
    Generate a link to the start of the given node based on [name_location][wake.ir.declarations.abc.DeclarationAbc.name_location] or [byte_location][wake.ir.abc.IrAbc.byte_location].

    Args:
        node: Node to generate a link to.

    Returns:
        A link formatted according to the [link_format][wake.config.data_model.GeneralConfig.link_format] configuration option.
    """
    if isinstance(node, ir.DeclarationAbc):
        line, col = node.source_unit.get_line_col_from_byte_offset(
            node.name_location[0]
        )
    else:
        line, col = node.source_unit.get_line_col_from_byte_offset(
            node.byte_location[0]
        )
    return self.generate_link_from_line_col(node.source_unit.file, line, col)

Generate a link to the given source unit file location.

Parameters:

Name Type Description Default
path Union[str, Path]

Path to the source unit file.

required
line int

Line number.

required
col int

Column number.

required

Returns:

Type Description
str

A link formatted according to the link_format configuration option.

Source code in wake/core/visitor.py
def generate_link_from_line_col(
    self, path: Union[str, Path], line: int, col: int
) -> str:
    """
    Generate a link to the given source unit file location.

    Args:
        path: Path to the source unit file.
        line: Line number.
        col: Column number.

    Returns:
        A link formatted according to the [link_format][wake.config.data_model.GeneralConfig.link_format] configuration option.
    """
    if isinstance(path, Path):
        path = str(path.resolve())
    return self.config.general.link_format.format(path=path, line=line, col=col)

visit_array_type_name(node) #

Visit ArrayTypeName node.

Source code in wake/core/visitor.py
def visit_array_type_name(self, node: ir.ArrayTypeName):
    """
    Visit [ArrayTypeName][wake.ir.type_names.array_type_name.ArrayTypeName] node.
    """

visit_assignment(node) #

Visit Assignment node.

Source code in wake/core/visitor.py
def visit_assignment(self, node: ir.Assignment):
    """
    Visit [Assignment][wake.ir.expressions.assignment.Assignment] node.
    """

visit_binary_operation(node) #

Visit BinaryOperation node.

Source code in wake/core/visitor.py
def visit_binary_operation(self, node: ir.BinaryOperation):
    """
    Visit [BinaryOperation][wake.ir.expressions.binary_operation.BinaryOperation] node.
    """

visit_block(node) #

Visit Block node.

Source code in wake/core/visitor.py
def visit_block(self, node: ir.Block):
    """
    Visit [Block][wake.ir.statements.block.Block] node.
    """

visit_break(node) #

Visit Break node.

Source code in wake/core/visitor.py
def visit_break(self, node: ir.Break):
    """
    Visit [Break][wake.ir.statements.break_statement.Break] node.
    """

visit_conditional(node) #

Visit Conditional node.

Source code in wake/core/visitor.py
def visit_conditional(self, node: ir.Conditional):
    """
    Visit [Conditional][wake.ir.expressions.conditional.Conditional] node.
    """

visit_continue(node) #

Visit Continue node.

Source code in wake/core/visitor.py
def visit_continue(self, node: ir.Continue):
    """
    Visit [Continue][wake.ir.statements.continue_statement.Continue] node.
    """

visit_contract_definition(node) #

Visit ContractDefinition node.

Source code in wake/core/visitor.py
def visit_contract_definition(self, node: ir.ContractDefinition):
    """
    Visit [ContractDefinition][wake.ir.declarations.contract_definition.ContractDefinition] node.
    """

visit_declaration_abc(node) #

Visit any DeclarationAbc node.

Source code in wake/core/visitor.py
def visit_declaration_abc(self, node: ir.DeclarationAbc):
    """
    Visit any [DeclarationAbc][wake.ir.declarations.abc.DeclarationAbc] node.
    """

visit_do_while_statement(node) #

Visit DoWhileStatement node.

Source code in wake/core/visitor.py
def visit_do_while_statement(self, node: ir.DoWhileStatement):
    """
    Visit [DoWhileStatement][wake.ir.statements.do_while_statement.DoWhileStatement] node.
    """

visit_elementary_type_name(node) #

Visit ElementaryTypeName node.

Source code in wake/core/visitor.py
def visit_elementary_type_name(self, node: ir.ElementaryTypeName):
    """
    Visit [ElementaryTypeName][wake.ir.type_names.elementary_type_name.ElementaryTypeName] node.
    """

visit_elementary_type_name_expression(node) #

Visit ElementaryTypeNameExpression node.

Source code in wake/core/visitor.py
def visit_elementary_type_name_expression(
    self, node: ir.ElementaryTypeNameExpression
):
    """
    Visit [ElementaryTypeNameExpression][wake.ir.expressions.elementary_type_name_expression.ElementaryTypeNameExpression] node.
    """

visit_emit_statement(node) #

Visit EmitStatement node.

Source code in wake/core/visitor.py
def visit_emit_statement(self, node: ir.EmitStatement):
    """
    Visit [EmitStatement][wake.ir.statements.emit_statement.EmitStatement] node.
    """

visit_enum_definition(node) #

Visit EnumDefinition node.

Source code in wake/core/visitor.py
def visit_enum_definition(self, node: ir.EnumDefinition):
    """
    Visit [EnumDefinition][wake.ir.declarations.enum_definition.EnumDefinition] node.
    """

visit_enum_value(node) #

Visit EnumValue node.

Source code in wake/core/visitor.py
def visit_enum_value(self, node: ir.EnumValue):
    """
    Visit [EnumValue][wake.ir.declarations.enum_value.EnumValue] node.
    """

visit_error_definition(node) #

Visit ErrorDefinition node.

Source code in wake/core/visitor.py
def visit_error_definition(self, node: ir.ErrorDefinition):
    """
    Visit [ErrorDefinition][wake.ir.declarations.error_definition.ErrorDefinition] node.
    """

visit_event_definition(node) #

Visit EventDefinition node.

Source code in wake/core/visitor.py
def visit_event_definition(self, node: ir.EventDefinition):
    """
    Visit [EventDefinition][wake.ir.declarations.event_definition.EventDefinition] node.
    """

visit_expression_abc(node) #

Visit any ExpressionAbc node.

Source code in wake/core/visitor.py
def visit_expression_abc(self, node: ir.ExpressionAbc):
    """
    Visit any [ExpressionAbc][wake.ir.expressions.abc.ExpressionAbc] node.
    """

visit_expression_statement(node) #

Visit ExpressionStatement node.

Source code in wake/core/visitor.py
def visit_expression_statement(self, node: ir.ExpressionStatement):
    """
    Visit [ExpressionStatement][wake.ir.statements.expression_statement.ExpressionStatement] node.
    """

visit_for_statement(node) #

Visit ForStatement node.

Source code in wake/core/visitor.py
def visit_for_statement(self, node: ir.ForStatement):
    """
    Visit [ForStatement][wake.ir.statements.for_statement.ForStatement] node.
    """

visit_function_call(node) #

Visit FunctionCall node.

Source code in wake/core/visitor.py
def visit_function_call(self, node: ir.FunctionCall):
    """
    Visit [FunctionCall][wake.ir.expressions.function_call.FunctionCall] node.
    """

visit_function_call_options(node) #

Visit FunctionCallOptions node.

Source code in wake/core/visitor.py
def visit_function_call_options(self, node: ir.FunctionCallOptions):
    """
    Visit [FunctionCallOptions][wake.ir.expressions.function_call_options.FunctionCallOptions] node.
    """

visit_function_definition(node) #

Visit FunctionDefinition node.

Source code in wake/core/visitor.py
def visit_function_definition(self, node: ir.FunctionDefinition):
    """
    Visit [FunctionDefinition][wake.ir.declarations.function_definition.FunctionDefinition] node.
    """

visit_function_type_name(node) #

Visit FunctionTypeName node.

Source code in wake/core/visitor.py
def visit_function_type_name(self, node: ir.FunctionTypeName):
    """
    Visit [FunctionTypeName][wake.ir.type_names.function_type_name.FunctionTypeName] node.
    """

visit_identifier(node) #

Visit Identifier node.

Source code in wake/core/visitor.py
def visit_identifier(self, node: ir.Identifier):
    """
    Visit [Identifier][wake.ir.expressions.identifier.Identifier] node.
    """

visit_identifier_path(node) #

Visit IdentifierPath node.

Source code in wake/core/visitor.py
def visit_identifier_path(self, node: ir.IdentifierPath):
    """
    Visit [IdentifierPath][wake.ir.meta.identifier_path.IdentifierPath] node.
    """

visit_if_statement(node) #

Visit IfStatement node.

Source code in wake/core/visitor.py
def visit_if_statement(self, node: ir.IfStatement):
    """
    Visit [IfStatement][wake.ir.statements.if_statement.IfStatement] node.
    """

visit_import_directive(node) #

Visit ImportDirective node.

Source code in wake/core/visitor.py
def visit_import_directive(self, node: ir.ImportDirective):
    """
    Visit [ImportDirective][wake.ir.meta.import_directive.ImportDirective] node.
    """

visit_index_access(node) #

Visit IndexAccess node.

Source code in wake/core/visitor.py
def visit_index_access(self, node: ir.IndexAccess):
    """
    Visit [IndexAccess][wake.ir.expressions.index_access.IndexAccess] node.
    """

visit_index_range_access(node) #

Visit IndexRangeAccess node.

Source code in wake/core/visitor.py
def visit_index_range_access(self, node: ir.IndexRangeAccess):
    """
    Visit [IndexRangeAccess][wake.ir.expressions.index_range_access.IndexRangeAccess] node.
    """

visit_inheritance_specifier(node) #

Visit InheritanceSpecifier node.

Source code in wake/core/visitor.py
def visit_inheritance_specifier(self, node: ir.InheritanceSpecifier):
    """
    Visit [InheritanceSpecifier][wake.ir.meta.inheritance_specifier.InheritanceSpecifier] node.
    """

visit_inline_assembly(node) #

Visit InlineAssembly node.

Source code in wake/core/visitor.py
def visit_inline_assembly(self, node: ir.InlineAssembly):
    """
    Visit [InlineAssembly][wake.ir.statements.inline_assembly.InlineAssembly] node.
    """

visit_ir_abc(node) #

Visit any IrAbc node.

Source code in wake/core/visitor.py
def visit_ir_abc(self, node: ir.IrAbc):
    """
    Visit any [IrAbc][wake.ir.abc.IrAbc] node.
    """

visit_literal(node) #

Visit Literal node.

Source code in wake/core/visitor.py
def visit_literal(self, node: ir.Literal):
    """
    Visit [Literal][wake.ir.expressions.literal.Literal] node.
    """

visit_mapping(node) #

Visit Mapping node.

Source code in wake/core/visitor.py
def visit_mapping(self, node: ir.Mapping):
    """
    Visit [Mapping][wake.ir.type_names.mapping.Mapping] node.
    """

visit_member_access(node) #

Visit MemberAccess node.

Source code in wake/core/visitor.py
def visit_member_access(self, node: ir.MemberAccess):
    """
    Visit [MemberAccess][wake.ir.expressions.member_access.MemberAccess] node.
    """

visit_modifier_definition(node) #

Visit ModifierDefinition node.

Source code in wake/core/visitor.py
def visit_modifier_definition(self, node: ir.ModifierDefinition):
    """
    Visit [ModifierDefinition][wake.ir.declarations.modifier_definition.ModifierDefinition] node.
    """

visit_modifier_invocation(node) #

Visit ModifierInvocation node.

Source code in wake/core/visitor.py
def visit_modifier_invocation(self, node: ir.ModifierInvocation):
    """
    Visit [ModifierInvocation][wake.ir.meta.modifier_invocation.ModifierInvocation] node.
    """

visit_new_expression(node) #

Visit NewExpression node.

Source code in wake/core/visitor.py
def visit_new_expression(self, node: ir.NewExpression):
    """
    Visit [NewExpression][wake.ir.expressions.new_expression.NewExpression] node.
    """

visit_override_specifier(node) #

Visit OverrideSpecifier node.

Source code in wake/core/visitor.py
def visit_override_specifier(self, node: ir.OverrideSpecifier):
    """
    Visit [OverrideSpecifier][wake.ir.meta.override_specifier.OverrideSpecifier] node.
    """

visit_parameter_list(node) #

Visit ParameterList node.

Source code in wake/core/visitor.py
def visit_parameter_list(self, node: ir.ParameterList):
    """
    Visit [ParameterList][wake.ir.meta.parameter_list.ParameterList] node.
    """

visit_placeholder_statement(node) #

Visit PlaceholderStatement node.

Source code in wake/core/visitor.py
def visit_placeholder_statement(self, node: ir.PlaceholderStatement):
    """
    Visit [PlaceholderStatement][wake.ir.statements.placeholder_statement.PlaceholderStatement] node.
    """

visit_pragma_directive(node) #

Visit PragmaDirective node.

Source code in wake/core/visitor.py
def visit_pragma_directive(self, node: ir.PragmaDirective):
    """
    Visit [PragmaDirective][wake.ir.meta.pragma_directive.PragmaDirective] node.
    """

visit_return(node) #

Visit Return node.

Source code in wake/core/visitor.py
def visit_return(self, node: ir.Return):
    """
    Visit [Return][wake.ir.statements.return_statement.Return] node.
    """

visit_revert_statement(node) #

Visit RevertStatement node.

Source code in wake/core/visitor.py
def visit_revert_statement(self, node: ir.RevertStatement):
    """
    Visit [RevertStatement][wake.ir.statements.revert_statement.RevertStatement] node.
    """

visit_solidity_abc(node) #

Visit any SolidityAbc node.

Source code in wake/core/visitor.py
def visit_solidity_abc(self, node: ir.SolidityAbc):
    """
    Visit any [SolidityAbc][wake.ir.abc.SolidityAbc] node.
    """

visit_source_unit(node) #

Visit SourceUnit node.

Source code in wake/core/visitor.py
def visit_source_unit(self, node: ir.SourceUnit):
    """
    Visit [SourceUnit][wake.ir.meta.source_unit.SourceUnit] node.
    """

visit_statement_abc(node) #

Visit any StatementAbc node.

Source code in wake/core/visitor.py
def visit_statement_abc(self, node: ir.StatementAbc):
    """
    Visit any [StatementAbc][wake.ir.statements.abc.StatementAbc] node.
    """

visit_struct_definition(node) #

Visit StructDefinition node.

Source code in wake/core/visitor.py
def visit_struct_definition(self, node: ir.StructDefinition):
    """
    Visit [StructDefinition][wake.ir.declarations.struct_definition.StructDefinition] node.
    """

visit_structured_documentation(node) #

Visit StructuredDocumentation node.

Source code in wake/core/visitor.py
def visit_structured_documentation(self, node: ir.StructuredDocumentation):
    """
    Visit [StructuredDocumentation][wake.ir.meta.structured_documentation.StructuredDocumentation] node.
    """

visit_try_catch_clause(node) #

Visit TryCatchClause node.

Source code in wake/core/visitor.py
def visit_try_catch_clause(self, node: ir.TryCatchClause):
    """
    Visit [TryCatchClause][wake.ir.meta.try_catch_clause.TryCatchClause] node.
    """

visit_try_statement(node) #

Visit TryStatement node.

Source code in wake/core/visitor.py
def visit_try_statement(self, node: ir.TryStatement):
    """
    Visit [TryStatement][wake.ir.statements.try_statement.TryStatement] node.
    """

visit_tuple_expression(node) #

Visit TupleExpression node.

Source code in wake/core/visitor.py
def visit_tuple_expression(self, node: ir.TupleExpression):
    """
    Visit [TupleExpression][wake.ir.expressions.tuple_expression.TupleExpression] node.
    """

visit_type_name_abc(node) #

Visit any TypeNameAbc node.

Source code in wake/core/visitor.py
def visit_type_name_abc(self, node: ir.TypeNameAbc):
    """
    Visit any [TypeNameAbc][wake.ir.type_names.abc.TypeNameAbc] node.
    """

visit_unary_operation(node) #

Visit UnaryOperation node.

Source code in wake/core/visitor.py
def visit_unary_operation(self, node: ir.UnaryOperation):
    """
    Visit [UnaryOperation][wake.ir.expressions.unary_operation.UnaryOperation] node.
    """

visit_unchecked_block(node) #

Visit UncheckedBlock node.

Source code in wake/core/visitor.py
def visit_unchecked_block(self, node: ir.UncheckedBlock):
    """
    Visit [UncheckedBlock][wake.ir.statements.unchecked_block.UncheckedBlock] node.
    """

visit_user_defined_type_name(node) #

Visit UserDefinedTypeName node.

Source code in wake/core/visitor.py
def visit_user_defined_type_name(self, node: ir.UserDefinedTypeName):
    """
    Visit [UserDefinedTypeName][wake.ir.type_names.user_defined_type_name.UserDefinedTypeName] node.
    """

visit_user_defined_value_type_definition(node) #

Visit UserDefinedValueTypeDefinition node.

Source code in wake/core/visitor.py
def visit_user_defined_value_type_definition(
    self, node: ir.UserDefinedValueTypeDefinition
):
    """
    Visit [UserDefinedValueTypeDefinition][wake.ir.declarations.user_defined_value_type_definition.UserDefinedValueTypeDefinition] node.
    """

visit_using_for_directive(node) #

Visit UsingForDirective node.

Source code in wake/core/visitor.py
def visit_using_for_directive(self, node: ir.UsingForDirective):
    """
    Visit [UsingForDirective][wake.ir.meta.using_for_directive.UsingForDirective] node.
    """

visit_variable_declaration(node) #

Visit VariableDeclaration node.

Source code in wake/core/visitor.py
def visit_variable_declaration(self, node: ir.VariableDeclaration):
    """
    Visit [VariableDeclaration][wake.ir.declarations.variable_declaration.VariableDeclaration] node.
    """

visit_variable_declaration_statement(node) #

Visit VariableDeclarationStatement node.

Source code in wake/core/visitor.py
def visit_variable_declaration_statement(
    self, node: ir.VariableDeclarationStatement
):
    """
    Visit [VariableDeclarationStatement][wake.ir.statements.variable_declaration_statement.VariableDeclarationStatement] node.
    """

visit_while_statement(node) #

Visit WhileStatement node.

Source code in wake/core/visitor.py
def visit_while_statement(self, node: ir.WhileStatement):
    """
    Visit [WhileStatement][wake.ir.statements.while_statement.WhileStatement] node.
    """

visit_yul_abc(node) #

Visit any YulAbc node.

Source code in wake/core/visitor.py
def visit_yul_abc(self, node: ir.YulAbc):
    """
    Visit any [YulAbc][wake.ir.yul.abc.YulAbc] node.
    """

visit_yul_assignment(node) #

Visit YulAssignment node.

Source code in wake/core/visitor.py
def visit_yul_assignment(self, node: ir.YulAssignment):
    """
    Visit [YulAssignment][wake.ir.yul.assignment.YulAssignment] node.
    """

visit_yul_block(node) #

Visit YulBlock node.

Source code in wake/core/visitor.py
def visit_yul_block(self, node: ir.YulBlock):
    """
    Visit [YulBlock][wake.ir.yul.block.YulBlock] node.
    """

visit_yul_break(node) #

Visit YulBreak node.

Source code in wake/core/visitor.py
def visit_yul_break(self, node: ir.YulBreak):
    """
    Visit [YulBreak][wake.ir.yul.break_statement.YulBreak] node.
    """

visit_yul_case(node) #

Visit YulCase node.

Source code in wake/core/visitor.py
def visit_yul_case(self, node: ir.YulCase):
    """
    Visit [YulCase][wake.ir.yul.case_.YulCase] node.
    """

visit_yul_continue(node) #

Visit YulContinue node.

Source code in wake/core/visitor.py
def visit_yul_continue(self, node: ir.YulContinue):
    """
    Visit [YulContinue][wake.ir.yul.continue_statement.YulContinue] node.
    """

visit_yul_expression_statement(node) #

Visit YulExpressionStatement node.

Source code in wake/core/visitor.py
def visit_yul_expression_statement(self, node: ir.YulExpressionStatement):
    """
    Visit [YulExpressionStatement][wake.ir.yul.expression_statement.YulExpressionStatement] node.
    """

visit_yul_for_loop(node) #

Visit YulForLoop node.

Source code in wake/core/visitor.py
def visit_yul_for_loop(self, node: ir.YulForLoop):
    """
    Visit [YulForLoop][wake.ir.yul.for_loop.YulForLoop] node.
    """

visit_yul_function_call(node) #

Visit YulFunctionCall node.

Source code in wake/core/visitor.py
def visit_yul_function_call(self, node: ir.YulFunctionCall):
    """
    Visit [YulFunctionCall][wake.ir.yul.function_call.YulFunctionCall] node.
    """

visit_yul_function_definition(node) #

Visit YulFunctionDefinition node.

Source code in wake/core/visitor.py
def visit_yul_function_definition(self, node: ir.YulFunctionDefinition):
    """
    Visit [YulFunctionDefinition][wake.ir.yul.function_definition.YulFunctionDefinition] node.
    """

visit_yul_identifier(node) #

Visit YulIdentifier node.

Source code in wake/core/visitor.py
def visit_yul_identifier(self, node: ir.YulIdentifier):
    """
    Visit [YulIdentifier][wake.ir.yul.identifier.YulIdentifier] node.
    """

visit_yul_if(node) #

Visit YulIf node.

Source code in wake/core/visitor.py
def visit_yul_if(self, node: ir.YulIf):
    """
    Visit [YulIf][wake.ir.yul.if_statement.YulIf] node.
    """

visit_yul_leave(node) #

Visit YulLeave node.

Source code in wake/core/visitor.py
def visit_yul_leave(self, node: ir.YulLeave):
    """
    Visit [YulLeave][wake.ir.yul.leave.YulLeave] node.
    """

visit_yul_literal(node) #

Visit YulLiteral node.

Source code in wake/core/visitor.py
def visit_yul_literal(self, node: ir.YulLiteral):
    """
    Visit [YulLiteral][wake.ir.yul.literal.YulLiteral] node.
    """

visit_yul_statement_abc(node) #

Visit any YulStatementAbc node.

Source code in wake/core/visitor.py
def visit_yul_statement_abc(self, node: ir.YulStatementAbc):
    """
    Visit any [YulStatementAbc][wake.ir.yul.abc.YulStatementAbc] node.
    """

visit_yul_switch(node) #

Visit YulSwitch node.

Source code in wake/core/visitor.py
def visit_yul_switch(self, node: ir.YulSwitch):
    """
    Visit [YulSwitch][wake.ir.yul.switch.YulSwitch] node.
    """

visit_yul_typed_name(node) #

Visit YulTypedName node.

Source code in wake/core/visitor.py
def visit_yul_typed_name(self, node: ir.YulTypedName):
    """
    Visit [YulTypedName][wake.ir.yul.typed_name.YulTypedName] node.
    """

visit_yul_variable_declaration(node) #

Visit YulVariableDeclaration node.

Source code in wake/core/visitor.py
def visit_yul_variable_declaration(self, node: ir.YulVariableDeclaration):
    """
    Visit [YulVariableDeclaration][wake.ir.yul.variable_declaration.YulVariableDeclaration] node.
    """