solidity_parser.ast.solnodes2

Attributes

Classes

AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ResolvedUserType

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

SuperType

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

VisibilityModifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

MutabilityModifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

OverrideSpecifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

SuperConstructorInvocationModifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

FunctionInvocationModifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Ident

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

NamedArgument

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

TopLevelUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

InheritSpecifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

LibraryOverride

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

FileDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ContractDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

InterfaceDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

LibraryDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

UserDefinedValueTypeDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

EnumMember

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

EnumDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

StructMember

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

StructDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ErrorParameter

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ErrorDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

StateVariableDeclaration

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ConstantVariableDeclaration

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

EventParameter

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

EventDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Location

Create a collection of name/value pairs.

Var

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Parameter

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Block

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

If

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Catch

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Try

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

While

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

For

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

FunctionMarker

Special function type markers

FunctionDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

BuiltinFunction

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ModifierDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

TupleVarDecl

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

VarDecl

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ExprStmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Literal

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

TypeLiteral

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

UnaryOp

Single operand expression

BinaryOp

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

TernaryOp

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

SelfObject

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

SuperObject

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

StateVarLoad

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

StaticVarLoad

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

EnumLoad

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

StateVarStore

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

LocalVarLoad

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

LocalVarStore

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ArrayLengthStore

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

TupleLoad

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ArrayLoad

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ArrayStore

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ArraySliceLoad

Gets a subarray at the given start and end indices from the given array

CreateInlineArray

Solidity 8 inline array creation

MappingLoad

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

MappingStore

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

GlobalValue

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ABISelector

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

DynamicBuiltInValue

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

CreateMemoryArray

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

CreateStruct

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

CreateAndDeployContract

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Call

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

DirectCall

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

FunctionCall

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

FunctionPointerCall

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

DynamicBuiltInCall

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

BuiltInCall

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Cast

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

GetType

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

GetFunctionPointer

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

EmitEvent

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Revert

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

RevertWithError

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

RevertWithReason

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Require

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Return

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Continue

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Break

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Assembly

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ExecModifiedCode

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

UnprocessedCode

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Functions

Module Contents

solidity_parser.ast.solnodes2.T
solidity_parser.ast.solnodes2.raiseNotPrintable()
solidity_parser.ast.solnodes2.param_def_str(ps)
class solidity_parser.ast.solnodes2.AST2Node

Bases: solidity_parser.ast.nodebase.Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

get_top_level_unit() TopLevelUnit
class solidity_parser.ast.solnodes2.Stmt

Bases: AST2Node, abc.ABC

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes2.Expr

Bases: AST2Node, abc.ABC

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

abstract type_of() solidity_parser.ast.types.Type
class solidity_parser.ast.solnodes2.Modifier

Bases: AST2Node, abc.ABC

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes2.ResolvedUserType

Bases: solidity_parser.ast.types.Type

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

scope: Scope

Shim for symbol table scoping. The scope field is also defined in solnodes1 Node but since this base class is defined in this file, it must be defined here as well

value: solidity_parser.ast.nodebase.Ref[TopLevelUnit]
__str__()

Return str(self).

__repr__()

Return repr(self).

type_key(*args, **kwargs)

Returns a unique key for the type that can be used to cache types in the symbol table

code_str()

Returns the string representation of the type in Solidity syntax

is_builtin() bool

Check if the type is a Solidity builtin type, e.g. primitives, message object, abi object, etc

is_user_type() bool

Check if the type is a user defined type, e.g. struct, enum, contract, etc

can_implicitly_cast_from(actual_type: solidity_parser.ast.types.Type) bool
get_types_for_declared_type() list[TopLevelUnit]
class solidity_parser.ast.solnodes2.SuperType

Bases: solidity_parser.ast.types.Type

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

declarer: solidity_parser.ast.nodebase.Ref[ContractDefinition | InterfaceDefinition]
is_builtin() bool

Check if the type is a Solidity builtin type, e.g. primitives, message object, abi object, etc

get_types_for_declared_type() list[TopLevelUnit]
code_str()

Returns the string representation of the type in Solidity syntax

__str__()

Return str(self).

class solidity_parser.ast.solnodes2.VisibilityModifier

Bases: Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

kind: solidity_parser.ast.solnodes.VisibilityModifierKind
code_str()
class solidity_parser.ast.solnodes2.MutabilityModifier

Bases: Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

kind: solidity_parser.ast.solnodes.MutabilityModifierKind
code_str()
class solidity_parser.ast.solnodes2.OverrideSpecifier

Bases: Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

bases: list[ResolvedUserType]
code_str()
class solidity_parser.ast.solnodes2.SuperConstructorInvocationModifier

Bases: Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base_ttype: ResolvedUserType
inputs: list[Expr]
code_str()
class solidity_parser.ast.solnodes2.FunctionInvocationModifier

Bases: Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

modifier: solidity_parser.ast.nodebase.Ref[ModifierDefinition]
inputs: list[Expr]
code_str()
class solidity_parser.ast.solnodes2.Ident

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

text: str
code_str()
__str__()

Return str(self).

class solidity_parser.ast.solnodes2.NamedArgument

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
expr: Expr
code_str()
class solidity_parser.ast.solnodes2.TopLevelUnit

Bases: AST2Node, abc.ABC

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

source_unit_name: str
name: Ident
descriptor() str
is_subttype_of(other_contract: TopLevelUnit) bool
as_type()
get_supers() list[ContractDefinition | InterfaceDefinition]
get_subtypes() list[ContractDefinition | InterfaceDefinition]
is_enum() bool
is_struct() bool
is_contract() bool
is_interface() bool
is_udvt() bool
find_named_parts(name: str, explore_mro: bool, matching_types)
class solidity_parser.ast.solnodes2.ContractPart

Bases: AST2Node, abc.ABC

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

has_modifier_kind(*kinds: solidity_parser.ast.solnodes.VisibilityModifierKind | solidity_parser.ast.solnodes.MutabilityModifierKind)
class solidity_parser.ast.solnodes2.InheritSpecifier

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: ResolvedUserType
args: list[Expr]
code_str()
class solidity_parser.ast.solnodes2.LibraryOverride

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

overriden_type: solidity_parser.ast.types.Type
library: ResolvedUserType
class solidity_parser.ast.solnodes2.FileDefinition

Bases: TopLevelUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

scope: Scope
parts: list[ContractPart]
descriptor() str
class solidity_parser.ast.solnodes2.ContractDefinition

Bases: TopLevelUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

is_abstract: bool
inherits: list[InheritSpecifier]
parts: list[ContractPart]
type_overrides: list[LibraryOverride]
_subtypes: list[solidity_parser.ast.nodebase.Ref[ContractDefinition | InterfaceDefinition]]
class solidity_parser.ast.solnodes2.InterfaceDefinition

Bases: TopLevelUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

inherits: list[InheritSpecifier]
parts: list[ContractPart]
type_overrides: list[LibraryOverride]
_subtypes: list[solidity_parser.ast.nodebase.Ref[ContractDefinition | InterfaceDefinition]]
class solidity_parser.ast.solnodes2.LibraryDefinition

Bases: TopLevelUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

parts: list[ContractPart]
type_overrides: list[LibraryOverride]
class solidity_parser.ast.solnodes2.UserDefinedValueTypeDefinition

Bases: TopLevelUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: solidity_parser.ast.types.Type
class solidity_parser.ast.solnodes2.EnumMember

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
class solidity_parser.ast.solnodes2.EnumDefinition

Bases: TopLevelUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

values: list[EnumMember]
class solidity_parser.ast.solnodes2.StructMember

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: solidity_parser.ast.types.Type
name: Ident
class solidity_parser.ast.solnodes2.StructDefinition

Bases: TopLevelUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

members: list[StructMember]
class solidity_parser.ast.solnodes2.ErrorParameter

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: solidity_parser.ast.types.Type
name: Ident
class solidity_parser.ast.solnodes2.ErrorDefinition

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
inputs: list[ErrorParameter]
class solidity_parser.ast.solnodes2.StateVariableDeclaration

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
ttype: solidity_parser.ast.types.Type
modifiers: list[Modifier]
value: Expr
class solidity_parser.ast.solnodes2.ConstantVariableDeclaration

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
ttype: solidity_parser.ast.types.Type
value: Expr
class solidity_parser.ast.solnodes2.EventParameter

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
ttype: solidity_parser.ast.types.Type
is_indexed: bool
class solidity_parser.ast.solnodes2.EventDefinition

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
inputs: list[EventParameter]
is_anonymous: bool
class solidity_parser.ast.solnodes2.Location

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

MEMORY = 'memory'
STORAGE = 'storage'
CALLDATA = 'calldata'
__str__()

Return str(self).

class solidity_parser.ast.solnodes2.Var

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
ttype: solidity_parser.ast.types.Type
location: Location
code_str()
class solidity_parser.ast.solnodes2.Parameter

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var: Var
class solidity_parser.ast.solnodes2.Block

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

stmts: list[Stmt]
is_unchecked: bool
code_str(brackets=True)
class solidity_parser.ast.solnodes2.If

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

condition: Expr
true_branch: Stmt
false_branch: Stmt
code_str()
class solidity_parser.ast.solnodes2.Catch

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ident: Ident
parameters: list[Parameter]
body: Block
code_str()
class solidity_parser.ast.solnodes2.Try

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

expr: Expr
return_parameters: list[Parameter]
body: Block
catch_clauses: list[Catch]
code_str()
class solidity_parser.ast.solnodes2.While

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

condition: Expr
body: Stmt
is_do_while: bool
code_str()
class solidity_parser.ast.solnodes2.For

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

initialiser: Stmt
condition: Expr
advancement: Expr
body: Stmt
code_str()
class solidity_parser.ast.solnodes2.FunctionMarker

Bases: enum.Enum

Special function type markers

CONSTRUCTOR = 1
SYNTHETIC_FIELD_GETTER = 2
class solidity_parser.ast.solnodes2.FunctionDefinition

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
inputs: list[Parameter]
outputs: list[Parameter]
modifiers: list[Modifier]
code: Block
markers: list[FunctionMarker]
static param_str(ps) str
descriptor() str
__str__()

Return str(self).

class solidity_parser.ast.solnodes2.BuiltinFunction

Bases: AST2Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
inputs: list[Parameter]
outputs: list[Parameter]
class solidity_parser.ast.solnodes2.ModifierDefinition

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
inputs: list[Parameter]
modifiers: list[Modifier]
code: Block
class solidity_parser.ast.solnodes2.TupleVarDecl

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

vars: list[Var]
value: Expr
code_str()
class solidity_parser.ast.solnodes2.VarDecl

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var: Var
value: Expr
code_str()
class solidity_parser.ast.solnodes2.ExprStmt

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

expr: Expr
code_str()
class solidity_parser.ast.solnodes2.Literal

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

value: Any
ttype: solidity_parser.ast.types.Type
unit: solidity_parser.ast.solnodes.Unit = None
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.TypeLiteral

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: solidity_parser.ast.types.Type
type_of()
code_str()
class solidity_parser.ast.solnodes2.UnaryOp

Bases: Expr

Single operand expression

expr: Expr
op: solidity_parser.ast.solnodes.UnaryOpCode
is_pre: bool
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.BinaryOp

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

left: Expr
right: Expr
op: solidity_parser.ast.solnodes.BinaryOpCode
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.TernaryOp

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

condition: Expr
left: Expr
right: Expr
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.SelfObject

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

declarer: solidity_parser.ast.nodebase.Ref[ContractDefinition | InterfaceDefinition]
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.SuperObject

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: SuperType
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.StateVarLoad

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base: Expr
name: Ident
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.StaticVarLoad

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: ResolvedUserType
name: Ident
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.EnumLoad

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

member: solidity_parser.ast.nodebase.Ref[EnumMember]
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.StateVarStore

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base: Expr
name: Ident
value: Expr
type_of() solidity_parser.ast.types.Type
state_var()
code_str()
class solidity_parser.ast.solnodes2.LocalVarLoad

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var: Var
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.LocalVarStore

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var: Var
value: Expr
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.ArrayLengthStore

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base: Expr
value: Expr
type_of() solidity_parser.ast.types.Type
abstract code_str()
class solidity_parser.ast.solnodes2.TupleLoad

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base: Expr
index: int
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.ArrayLoad

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base: Expr
index: Expr
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.ArrayStore

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base: Expr
index: Expr
value: Expr
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.ArraySliceLoad

Bases: Expr

Gets a subarray at the given start and end indices from the given array

base: Expr
start_index: Expr
end_index: Expr
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.CreateInlineArray

Bases: Expr

Solidity 8 inline array creation

An inline array is one where the elements are explicitly stated in the definition, for example: ‘int[5] foo2 = [1, 0, 0, 0, 0];’

elements: list[Expr]
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.MappingLoad

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base: Expr
key: Expr
code_str()
type_of() solidity_parser.ast.types.Type
class solidity_parser.ast.solnodes2.MappingStore

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base: Expr
key: Expr
value: Expr
code_str()
class solidity_parser.ast.solnodes2.GlobalValue

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: str
ttype: solidity_parser.ast.types.Type
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.ABISelector

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

function: solidity_parser.ast.nodebase.Ref[FunctionDefinition | ErrorDefinition] | Expr
type_of() solidity_parser.ast.types.Type
__str__()

Return str(self).

code_str()
class solidity_parser.ast.solnodes2.DynamicBuiltInValue

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: str
ttype: solidity_parser.ast.types.Type
base: Expr
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.CreateMemoryArray

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: solidity_parser.ast.types.ArrayType
size: Expr
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.CreateStruct

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: ResolvedUserType
args: list[Expr]
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.CreateAndDeployContract

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: ResolvedUserType
call_options: list[NamedArgument]
args: list[Expr]
type_of() solidity_parser.ast.types.Type
code_str()
solidity_parser.ast.solnodes2.check_arg_types(args: list[Expr], f: FunctionDefinition) bool
class solidity_parser.ast.solnodes2.Call

Bases: Expr, abc.ABC

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

call_options: list[NamedArgument]
args: list[Expr]
check_arg_types(f: FunctionDefinition) bool
param_str()
class solidity_parser.ast.solnodes2.DirectCall

Bases: Call

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: ResolvedUserType
name: Ident
base_type()
resolve_call() FunctionDefinition
type_of() solidity_parser.ast.types.Type
code_str()
__str__()

Return str(self).

class solidity_parser.ast.solnodes2.FunctionCall

Bases: Call

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base: Expr
name: Ident
base_type()
resolve_call() FunctionDefinition
type_of() solidity_parser.ast.types.Type
code_str()
__str__()

Return str(self).

class solidity_parser.ast.solnodes2.FunctionPointerCall

Bases: Call

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

callee: Expr
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.DynamicBuiltInCall

Bases: Call

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: solidity_parser.ast.types.Type
base: Expr | ResolvedUserType
name: str
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.BuiltInCall

Bases: Call

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: str
ttype: solidity_parser.ast.types.Type
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.Cast

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: solidity_parser.ast.types.Type
value: Expr
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.GetType

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ttype: solidity_parser.ast.types.Type
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.GetFunctionPointer

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

func: solidity_parser.ast.nodebase.Ref[FunctionDefinition | ErrorDefinition | EventDefinition | BuiltinFunction]
type_of() solidity_parser.ast.types.Type
code_str()
class solidity_parser.ast.solnodes2.EmitEvent

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

event: solidity_parser.ast.nodebase.Ref[EventDefinition]
args: list[Expr]
code_str()
class solidity_parser.ast.solnodes2.Revert

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes2.RevertWithError

Bases: Revert

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

error: solidity_parser.ast.nodebase.Ref[ErrorDefinition]
args: list[Expr]
code_str()
class solidity_parser.ast.solnodes2.RevertWithReason

Bases: Revert

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

reason: Expr
code_str()
class solidity_parser.ast.solnodes2.Require

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

condition: Expr
reason: Expr
code_str()
class solidity_parser.ast.solnodes2.Return

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

values: list[Expr]
code_str()
class solidity_parser.ast.solnodes2.Continue

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

code_str()
class solidity_parser.ast.solnodes2.Break

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

code_str()
class solidity_parser.ast.solnodes2.Assembly

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

code: str
code_str()
class solidity_parser.ast.solnodes2.ExecModifiedCode

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes2.UnprocessedCode

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

error: Exception
solidity_parser.ast.solnodes2.Types: TypeAlias = soltypes.VariableLengthArrayType | soltypes.VoidType | soltypes.IntType | soltypes.FunctionType...