Expand description
Bindings for the Solidity and Yul ASTs.
The Yul AST bindings are available in the yul module.
To gain an overview of the AST, it might be helpful to start at the entry point of a complete Solidity AST: the SourceUnit node.
§Version Support
These types should be compatible with at least Solidity 0.5.x and above, but may also support 0.4.x-0.5.x in most cases.
The legacy Solidity AST is not supported.
Modules§
Structs§
- ArrayType Name 
- An array type name.
- Assignment
- An assignment expression.
- Ast
- Represents the AST field in the solc output
- BinaryOperation 
- A binary operation.
- Block
- A block of statements.
- Break
- The break keyword.
- Conditional
- A conditional expression.
- Continue
- The continue keyword.
- ContractDefinition 
- A contract definition.
- DoWhileStatement 
- A do while statement.
- ElementaryType Name 
- ElementaryType Name Expression 
- EmitStatement 
- An emit statement.
- EnumDefinition 
- An enum definition.
- EnumValue 
- An enum value.
- ErrorDefinition 
- A custom error definition.
- EventDefinition 
- An event definition.
- ExpressionStatement 
- An expression statement.
- ExternalInline Assembly Reference 
- A reference to an external variable or slot in an inline assembly block.
- ForStatement
- A for statement.
- FunctionCall 
- A function call expression.
- FunctionCall Options 
- A function call options expression (e.g. x.f{gas: 1}).
- FunctionDefinition 
- A function definition.
- FunctionIdentifier Path 
- A wrapper around IdentifierPath for the UsingForDirective.
- FunctionType Name 
- A function type name.
- Identifier
- An identifier.
- IdentifierPath 
- An identifier path.
- IfStatement
- An if statement.
- ImportDirective 
- An import directive.
- IndexAccess 
- An index access.
- IndexRange Access 
- An index range access.
- InheritanceSpecifier 
- An inheritance specifier.
- InlineAssembly 
- A block of inline assembly.
- Literal
- A literal value.
- LowFidelitySource Location 
- Represents the source location of a node: <start byte>:<length>:<source index>.
- Mapping
- A mapping type.
- MemberAccess 
- Member access.
- ModifierDefinition 
- A modifier definition.
- ModifierInvocation 
- A modifier or base constructor invocation.
- NewExpression
- A newexpression.
- Node
- OverloadedOperator 
- OverrideSpecifier 
- An override specifier.
- ParameterList 
- A parameter list.
- PlaceholderStatement 
- A placeholder statement (_)
- PragmaDirective 
- A pragma directive.
- Return
- A return statement.
- RevertStatement 
- A revert statement.
- SourceLocation 
- Represents the source location of a node: <start byte>:<length>:<source index>.
- SourceUnit 
- The root node of a Solidity AST.
- StructDefinition 
- A struct definition.
- StructuredDocumentation 
- Structured documentation (NatSpec).
- SymbolAlias 
- A symbol alias.
- TryCatchClause 
- A try/catch clause.
- TryStatement
- A try/catch statement.
- TupleExpression 
- A tuple expression.
- TypeDescriptions 
- A type description.
- UnaryOperation 
- A unary operation.
- UncheckedBlock 
- An unchecked block.
- UserDefined Type Name 
- A user defined type name.
- UserDefined Value Type Definition 
- A user defined value type definition.
- UsingForDirective 
- A using for directive.
- VariableDeclaration 
- A variable declaration.
- VariableDeclaration Statement 
- A variable declaration statement.
- WhileStatement 
- A while statement.
Enums§
- AssemblyReference Suffix 
- An assembly reference suffix.
- AssignmentOperator 
- Assignment operators.
- BinaryOperator 
- Binary operators.
- BlockOrStatement 
- ContractDefinition Part 
- ContractKind 
- All Solidity contract kinds.
- Documentation
- ElementaryOrRaw Type Name 
- Expression
- ExpressionOrVariable Declaration Statement 
- FunctionCall Kind 
- Function call kinds.
- FunctionKind 
- Function kinds.
- IdentifierOrIdentifier Path 
- InlineAssembly Flag 
- Inline assembly flags.
- LiteralKind 
- Literal kinds.
- ModifierInvocation Kind 
- Modifier invocation kinds.
- Mutability
- Variable mutability specifier.
- NodeType 
- SourceUnit Part 
- StateMutability 
- Function mutability specifier.
- Statement
- StorageLocation 
- Storage location specifier.
- TypeName 
- UnaryOperator 
- Unary operators.
- UserDefined Type Name OrIdentifier Path 
- UsingForFunction Item 
- Visibility
- Visibility specifier.