sources

package
v0.0.0-...-ac32242 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2018 License: MIT Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// ElementaryTypeNameUnknown represents an unknown type.
	ElementaryTypeNameUnknown = iota
	// ElementaryTypeNameInt represents an integer.
	ElementaryTypeNameInt
	// ElementaryTypeNameUint represents an unsigned integer.
	ElementaryTypeNameUint
	// ElementaryTypeNameAddress represents an address.
	ElementaryTypeNameAddress
	// ElementaryTypeNameBool represents a boolean.
	ElementaryTypeNameBool
	// ElementaryTypeNameString represents a string.
	ElementaryTypeNameString
	// ElementaryTypeNameVar represents a variable.
	ElementaryTypeNameVar
	// ElementaryTypeNameBytes represents bytes.
	ElementaryTypeNameBytes
	// ElementaryTypeNameDynamicBytes represents a dynamic byte array.
	ElementaryTypeNameDynamicBytes
	// ElementaryTypeNameFixed represents a fixed type.
	ElementaryTypeNameFixed
	// ElementaryTypeNameUfixed represents an unfixed type.
	ElementaryTypeNameUfixed
)
View Source
const (
	// ExpressionUnknown represents an unknown expression.
	ExpressionUnknown = iota
	// ExpressionPrimary represents a primary expression.
	ExpressionPrimary
	// ExpressionNew represents a 'new' expression.
	ExpressionNew
	// ExpressionUnaryOperation represents a unary operation expression.
	ExpressionUnaryOperation
	// ExpressionParentheses represents a sub-expression in parentheses.
	ExpressionParentheses
	// ExpressionMemberAccess represents a member access expression.
	ExpressionMemberAccess
	// ExpressionBinaryOperation represents a binary operation expression.
	ExpressionBinaryOperation
	// ExpressionFunctionCall represents a function call expression.
	ExpressionFunctionCall
	// ExpressionIndexAccess represents an index access expression.
	ExpressionIndexAccess
	// ExpressionTernary represents a ternary expression.
	ExpressionTernary
)
View Source
const (
	// FunctionCallArgsWithNameValues is a function call with name values.
	FunctionCallArgsWithNameValues = iota
	// FunctionCallArgsWithExprs is a function call with expressions.
	FunctionCallArgsWithExprs
)
View Source
const (
	// ImportPath imports all modules from path
	ImportPath int = iota
	// ImprotModule imports a module from path
	ImprotModule
	// ImportModules imports modules from path
	ImportModules
)
View Source
const (
	// ExpressionPrimaryUnknown represents an unknown expression.
	ExpressionPrimaryUnknown = iota
	// ExpressionPrimaryBoolean represents a boolean expression.
	ExpressionPrimaryBoolean
	// ExpressionPrimaryNumber represents a number expression.
	ExpressionPrimaryNumber
	// ExpressionPrimaryHex represents a hexadecimal expression.
	ExpressionPrimaryHex
	// ExpressionPrimaryString represents a string expression.
	ExpressionPrimaryString
	// ExpressionPrimaryIdentifier represents an identifier expression.
	ExpressionPrimaryIdentifier
	// ExpressionPrimaryTuple represents an tuple expression.
	ExpressionPrimaryTuple
	// ExpressionPrimaryElementaryTypeName represents an elementary type name
	// expression.
	ExpressionPrimaryElementaryTypeName
)
View Source
const (
	// SimpleStatementVarDec is a simple statement with a variable declaration.
	SimpleStatementVarDec = iota
	// SimpleStatementExpr is a simple statement with an expression.
	SimpleStatementExpr
)
View Source
const (
	// StatementIf represents an if statement.
	StatementIf int = iota
	// StatementWhile represents a while statement.
	StatementWhile
	// StatementFor represents a for statement.
	StatementFor
	// StatementBlock represents a block.
	StatementBlock
	// StatementInlineAssembly represents inline assembly.
	StatementInlineAssembly
	// StatementDoWhile represents a do while statement.
	StatementDoWhile
	// StatementContinue represents a continue.
	StatementContinue
	// StatementBreak represents a break.
	StatementBreak
	// StatementReturn represents a return.
	StatementReturn
	// StatementThrow represents a throw.
	StatementThrow
	// StatementEmit represents emit.
	StatementEmit
	// StatementSimple represents a simple statement.
	StatementSimple
)
View Source
const (
	// TypeNameUnknown represents an unknown type.
	TypeNameUnknown int = iota
	// TypeNameElementary represents an elementary type.
	TypeNameElementary
	// TypeNameUserDefined represents a user-defined type.
	TypeNameUserDefined
	// TypeNameMapping represents a mapping type.
	TypeNameMapping
	// TypeNameArray represents an array type.
	TypeNameArray
	// TypeNameFunction represents a function type.
	TypeNameFunction
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Tokens
	Statements []*Statement
}

Block represents a block in Solidity.

func NewBlock

func NewBlock() *Block

NewBlock returns a new instance of Block.

func (*Block) String

func (b *Block) String() string

func (*Block) Visit

func (b *Block) Visit(ctx *parser.BlockContext)

Visit is called by a visitor.

type Constructor

type Constructor struct {
	Tokens
	Parameters []*Parameter
	Modifiers  *ModifierList
	Block      *Block
}

Constructor represents a constructor in Solidity.

func NewConstructor

func NewConstructor() *Constructor

NewConstructor returns a new instance of Constructor.

func (*Constructor) String

func (c *Constructor) String() string

func (*Constructor) Visit

Visit is called by a visitor.

type Contract

type Contract struct {
	Tokens
	Source      *Source
	DefType     string
	Identifier  string
	Inheritance []*Inheritance
	StateVars   []*StateVariable
	UsingFor    []*UsingFor
	Structs     []*Struct
	Modifiers   []*Modifier
	Constructor *Constructor
	Functions   []*Function
	Events      []*Event
	Enums       []*Enum
}

Contract represents a contract in Solidity.

func NewContract

func NewContract(source *Source) *Contract

NewContract returns a new instance of Contract.

func (*Contract) String

func (c *Contract) String() string

func (*Contract) Visit

func (c *Contract) Visit(ctx *parser.ContractDefinitionContext)

Visit is called by a visitor.

type DoWhileStatement

type DoWhileStatement struct {
	Tokens
	Body      *Statement
	Condition *Expression
}

DoWhileStatement represents a do while statement in Solidity.

func NewDoWhileStatement

func NewDoWhileStatement() *DoWhileStatement

NewDoWhileStatement returns a new instance of DoWhileStatement.

func (*DoWhileStatement) String

func (dws *DoWhileStatement) String() string

func (*DoWhileStatement) Visit

Visit is called by a visitor.

type ElementaryTypeName

type ElementaryTypeName struct {
	Tokens
	SubType int
	Size    int
	Text    string
}

ElementaryTypeName represents an elementary type name in Solidity.

func NewElementaryTypeName

func NewElementaryTypeName() *ElementaryTypeName

NewElementaryTypeName returns a new instance of ElementaryTypeName.

func (*ElementaryTypeName) Equal

Equal evaluates the equality of two elementary type names.

func (*ElementaryTypeName) String

func (etn *ElementaryTypeName) String() string

func (*ElementaryTypeName) Visit

Visit is called by a visitor.

type Emit

type Emit struct {
	EmitCall *EmitCall
}

Emit represents an emit in Solidity.

func NewEmit

func NewEmit() *Emit

NewEmit returns a new instance of Emit.

func (*Emit) Visit

func (e *Emit) Visit(ctx *parser.EmitStatementContext)

Visit is called by a visitor.

type EmitCall

type EmitCall struct {
	Expression *Expression
	Arguments  *FunctionCallArguments
}

EmitCall represents an emit call in Solidity.

func NewEmitCall

func NewEmitCall() *EmitCall

NewEmitCall returns a new instance of Emit.

func (*EmitCall) Visit

func (ec *EmitCall) Visit(ctx *parser.FunctionCallContext)

Visit is called by a visitor.

type Enum

type Enum struct {
	Tokens
	Contract   *Contract
	Identifier string
	Values     []string
}

Enum represents an enum in Solidity.

func NewEnum

func NewEnum() *Enum

NewEnum returns a new instance of Enum.

func (*Enum) String

func (e *Enum) String() string

func (*Enum) Visit

func (e *Enum) Visit(ctx *parser.EnumDefinitionContext)

Visit is called by a visitor.

type ErrorListener

type ErrorListener struct {
	*antlr.DefaultErrorListener
	SourceFilePath string
}

ErrorListener is a custom error listener for the parser.

func (*ErrorListener) SyntaxError

func (el *ErrorListener) SyntaxError(recognizer antlr.Recognizer,
	offendingSymbol interface{}, line, column int, msg string,
	e antlr.RecognitionException)

SyntaxError is called when the parser's error listener reports a syntax error.

type Event

type Event struct {
	Tokens
	Contract   *Contract
	Identifier string
	Anonymous  bool
	Parameters []*EventParameter
}

Event represents an event in Solidity.

func NewEvent

func NewEvent() *Event

NewEvent returns a new instance of Event.

func (*Event) String

func (e *Event) String() string

func (*Event) Visit

func (e *Event) Visit(ctx *parser.EventDefinitionContext)

Visit is called by a visitor.

type EventParameter

type EventParameter struct {
	Tokens
	Event      *Event
	TypeName   *TypeName
	Indexed    bool
	Identifier string
}

EventParameter represents an event parameter in Solidity.

func NewEventParameter

func NewEventParameter(event *Event) *EventParameter

NewEventParameter returns a new instance of EventParameter.

func (*EventParameter) String

func (ep *EventParameter) String() string

func (*EventParameter) Visit

Visit is called by a visitor.

type Expression

type Expression struct {
	Tokens
	SubType          int
	Operation        string
	MemberName       string
	TypeName         *TypeName
	Primary          *PrimaryExpression
	FunctionCallArgs *FunctionCallArguments
	SubExpression    *Expression
	LeftExpression   *Expression
	RightExpression  *Expression
	IndexExpression  *Expression
	TernaryIf        *Expression
	TernaryThen      *Expression
	TernaryElse      *Expression
}

Expression represents an expression in Solidity.

func NewExpression

func NewExpression() *Expression

NewExpression returns a new instance of Expression.

func (*Expression) String

func (e *Expression) String() string

func (*Expression) Visit

func (e *Expression) Visit(ctx *parser.ExpressionContext)

Visit is called by a visitor.

type ForStatement

type ForStatement struct {
	Tokens
	Initialization *SimpleStatement
	Condition      *Expression
	Increment      *Expression
	Body           *Statement
}

ForStatement represents a for statement in Solidity.

func NewForStatement

func NewForStatement() *ForStatement

NewForStatement returns a new instance of ForStatement.

func (*ForStatement) String

func (fs *ForStatement) String() string

func (*ForStatement) Visit

func (fs *ForStatement) Visit(ctx *parser.ForStatementContext)

Visit is called by a visitor.

type Function

type Function struct {
	Tokens
	Identifier string
	Parameters []*Parameter
	Modifiers  *ModifierList
	Returns    []*Parameter
	Block      *Block
}

Function represents a Solidity function.

func NewFunction

func NewFunction() *Function

NewFunction returns a new instance of Function.

func (*Function) ShortSignature

func (f *Function) ShortSignature() string

ShortSignature returns an abbreviated version of String().

func (*Function) String

func (f *Function) String() string

func (*Function) Visit

func (f *Function) Visit(ctx *parser.FunctionDefinitionContext)

Visit is called by a visitor.

type FunctionCallArguments

type FunctionCallArguments struct {
	Tokens
	SubType     int
	NameValues  []*NameValue
	Expressions []*Expression
}

FunctionCallArguments represents a list of function call arguments in Solidity.

func NewFunctionCallArguments

func NewFunctionCallArguments() *FunctionCallArguments

NewFunctionCallArguments returns a new instance of FunctionCallArguments.

func (*FunctionCallArguments) String

func (fca *FunctionCallArguments) String() string

func (*FunctionCallArguments) Visit

Visit is called by a visitor.

type FunctionTypeName

type FunctionTypeName struct {
	Tokens
	Parameters      []*FunctionTypeParameter
	Internal        bool
	External        bool
	StateMutability *StateMutability
	Returns         []*FunctionTypeParameter
}

FunctionTypeName represents a function type name in Solidity.

func NewFunctionTypeName

func NewFunctionTypeName() *FunctionTypeName

NewFunctionTypeName returns a new instance of FunctionTypeName.

func (*FunctionTypeName) String

func (ftn *FunctionTypeName) String() string

func (*FunctionTypeName) Visit

Visit is called by a visitor.

type FunctionTypeParameter

type FunctionTypeParameter struct {
	Tokens
	TypeName        *TypeName
	StorageLocation string
}

FunctionTypeParameter represents a function type parameter in Solidity.

func NewFunctionTypeParameter

func NewFunctionTypeParameter() *FunctionTypeParameter

NewFunctionTypeParameter returns a new instance of FunctionTypeParameter.

func (*FunctionTypeParameter) String

func (ftp *FunctionTypeParameter) String() string

func (*FunctionTypeParameter) Visit

Visit is called by a visitor.

type IfStatement

type IfStatement struct {
	Tokens
	If   *Expression
	Body *Statement
	Else *Statement
}

IfStatement represents an if statement in Solidity.

func NewIfStatement

func NewIfStatement() *IfStatement

NewIfStatement returns a new instance of IfStatement.

func (*IfStatement) String

func (is *IfStatement) String() string

func (*IfStatement) Visit

func (is *IfStatement) Visit(ctx *parser.IfStatementContext)

Visit is called by a visitor.

type ImportDeclaration

type ImportDeclaration struct {
	Tokens
	Identifier string
	As         string
}

ImportDeclaration represents an import declaration in Solidity.

func NewImportDeclaration

func NewImportDeclaration() *ImportDeclaration

NewImportDeclaration returns a new instance of ImportDeclaration.

func (*ImportDeclaration) String

func (id *ImportDeclaration) String() string

func (*ImportDeclaration) Visit

Visit is called by a visitor.

type ImportDirective

type ImportDirective struct {
	Tokens
	Source       *Source
	SubType      int
	Module       string
	From         string
	As           string
	Declarations []*ImportDeclaration
}

ImportDirective represents an import directive in Solidity.

func NewImportDirective

func NewImportDirective(source *Source) *ImportDirective

NewImportDirective returns a new instance of ImportDirective.

func (*ImportDirective) String

func (id *ImportDirective) String() string

func (*ImportDirective) Visit

Visit is called by a visitor.

type Inheritance

type Inheritance struct {
	Tokens
	TypeName    *UserDefinedTypeName
	Expressions []*Expression
}

Inheritance represents inheritance in Solidity.

func NewInheritance

func NewInheritance() *Inheritance

NewInheritance returns a new instance of Inheritance.

func (*Inheritance) String

func (i *Inheritance) String() string

func (*Inheritance) Visit

Visit is called by a visitor.

type Mapping

type Mapping struct {
	Tokens
	Elementary *ElementaryTypeName
	TypeName   *TypeName
}

Mapping represents a mapping in Solidity.

func NewMapping

func NewMapping() *Mapping

NewMapping returns a new instance of Mapping.

func (*Mapping) String

func (m *Mapping) String() string

func (*Mapping) Visit

func (m *Mapping) Visit(ctx *parser.MappingContext)

Visit is called by a visitor.

type Modifier

type Modifier struct {
	Tokens
	Identifier string
	Parameters []*Parameter
	Block      *Block
}

Modifier represents a modifier in Solidity.

func NewModifier

func NewModifier() *Modifier

NewModifier returns a new instance of Modifier.

func (*Modifier) String

func (m *Modifier) String() string

func (*Modifier) Visit

func (m *Modifier) Visit(ctx *parser.ModifierDefinitionContext)

Visit is called by a visitor.

type ModifierInvocation

type ModifierInvocation struct {
	Tokens
	Identifier  string
	Expressions []*Expression
}

ModifierInvocation represents a modifier invocation in Solidity.

func NewModifierInvocation

func NewModifierInvocation() *ModifierInvocation

NewModifierInvocation returns a new instance of ModifierInvocation.

func (*ModifierInvocation) String

func (mi *ModifierInvocation) String() string

func (*ModifierInvocation) Visit

Visit is called by a visitor.

type ModifierList

type ModifierList struct {
	Tokens
	Invocations     []*ModifierInvocation
	External        bool
	Public          bool
	Internal        bool
	Private         bool
	StateMutability *StateMutability
}

ModifierList represents a list of modifiers in Solidity.

func NewModifierList

func NewModifierList() *ModifierList

NewModifierList returns a new instance of ModifierList.

func (*ModifierList) String

func (ml *ModifierList) String() string

func (*ModifierList) Visit

func (ml *ModifierList) Visit(ctx *parser.ModifierListContext)

Visit is called by a visitor.

type NameValue

type NameValue struct {
	Tokens
	Identifier string
	Expression *Expression
}

NameValue represents a name-value in Solidity.

func NewNameValue

func NewNameValue() *NameValue

NewNameValue returns a new instance of NameValue.

func (*NameValue) String

func (nv *NameValue) String() string

func (*NameValue) Visit

func (nv *NameValue) Visit(ctx *parser.NameValueContext)

Visit is called by a visitor.

type Parameter

type Parameter struct {
	Tokens
	Identifier      string
	TypeName        *TypeName
	StorageLocation string
}

Parameter represents a parameter in Solidity.

func NewParameter

func NewParameter() *Parameter

NewParameter returns a new instance of Parameter.

func (*Parameter) String

func (p *Parameter) String() string

func (*Parameter) Visit

func (p *Parameter) Visit(ctx *parser.ParameterContext)

Visit is called by a visitor.

type Pragma

type Pragma struct {
	Tokens
	Source *Source
	Name   string
	Value  string
}

Pragma represents a pragma in Solidity.

func NewPragma

func NewPragma(source *Source) *Pragma

NewPragma returns a new instance of Pragma.

func (*Pragma) String

func (p *Pragma) String() string

func (*Pragma) Visit

func (p *Pragma) Visit(ctx *parser.PragmaDirectiveContext)

Visit is called by a visitor.

type PrimaryExpression

type PrimaryExpression struct {
	Tokens
	SubType            int
	Boolean            bool
	Integer            *big.Int
	Hex                string
	Text               string
	Identifier         string
	Tuple              *TupleExpression
	ElementaryTypeName *ElementaryTypeName
}

PrimaryExpression represents a primary expression in Solidity.

func NewPrimaryExpression

func NewPrimaryExpression() *PrimaryExpression

NewPrimaryExpression returns a new instance of PrimaryExpression.

func (*PrimaryExpression) String

func (pe *PrimaryExpression) String() string

func (*PrimaryExpression) Visit

Visit is called by a visitor.

type ReturnStatement

type ReturnStatement struct {
	Tokens
	Expression *Expression
}

ReturnStatement represents a return statement in Solidity.

func NewReturnStatement

func NewReturnStatement() *ReturnStatement

NewReturnStatement returns a new instance of ReturnStatement.

func (*ReturnStatement) String

func (rs *ReturnStatement) String() string

func (*ReturnStatement) Visit

Visit is called by a visitor.

type SimpleStatement

type SimpleStatement struct {
	Tokens
	SubType             int
	VariableDeclaration *VariableDeclarationStatement
	Expression          *Expression
}

SimpleStatement represents a simple statement in Solidity.

func NewSimpleStatement

func NewSimpleStatement() *SimpleStatement

NewSimpleStatement returns a new instance of SimpleStatement.

func (*SimpleStatement) String

func (ss *SimpleStatement) String() string

func (*SimpleStatement) Visit

Visit is called by a visitor.

type Source

type Source struct {
	FilePath      string
	Module        string
	Pragma        *Pragma
	Imports       []*ImportDirective
	Dependencies  []*Source
	DependencyMap map[string]*Source
	Contracts     []*Contract
	// contains filtered or unexported fields
}

Source represents a unit of source code in Solidity.

func New

func New(path string, tree *parser.SourceUnitContext) *Source

New returns a new instance of Source.

func Parse

func Parse(path string, source string) *Source

Parse parses a Solidity source string.

func ParseFile

func ParseFile(path string) *Source

ParseFile parses a Solidity source file.

func (*Source) AddDependency

func (s *Source) AddDependency(source *Source)

func (*Source) String

func (s *Source) String() string

func (*Source) Visit

func (s *Source) Visit()

Visit creates a representation of a Solidity syntax tree by creating and then "visiting" each object with a parser context. This is used as an alternative to ANTLR's visitor pattern, which is not yet fully implemented in the Go library.

type StateMutability

type StateMutability struct {
	Pure     bool
	Constant bool
	View     bool
	Payable  bool
}

StateMutability represents a state mutability keyword in Solidity.

func NewStateMutability

func NewStateMutability() *StateMutability

NewStateMutability returns an instance of StateMutability.

func NewStateMutabilityFromCtxs

func NewStateMutabilityFromCtxs(ctxs []parser.IStateMutabilityContext) *StateMutability

NewStateMutabilityFromCtxs returns an instance of StateMutability given a parser context.

func (*StateMutability) String

func (sm *StateMutability) String() string

type StateVariable

type StateVariable struct {
	Tokens
	TypeName   *TypeName
	Public     bool
	Internal   bool
	Private    bool
	Constant   bool
	Identifier string
	Expression *Expression
}

StateVariable represents a state variable in Solidity.

func NewStateVariable

func NewStateVariable() *StateVariable

NewStateVariable returns a new instance of StateVariable.

func (*StateVariable) String

func (sv *StateVariable) String() string

func (*StateVariable) Visit

Visit is called by a visitor.

type Statement

type Statement struct {
	Tokens
	SubType         int
	If              *IfStatement
	While           *WhileStatement
	For             *ForStatement
	Block           *Block
	DoWhile         *DoWhileStatement
	ReturnStatement *ReturnStatement
	SimpleStatement *SimpleStatement
}

Statement represents a statement in Solidity.

func NewStatement

func NewStatement() *Statement

NewStatement returns a new instance of Statement.

func (*Statement) String

func (s *Statement) String() string

func (*Statement) Visit

func (s *Statement) Visit(ctx *parser.StatementContext)

Visit is called by a visitor.

type Struct

type Struct struct {
	Tokens
	Identifier           string
	VariableDeclarations []*VariableDeclaration
}

Struct represents a struct in Solidity.

func NewStruct

func NewStruct() *Struct

NewStruct returns a new instance of Struct.

func (*Struct) String

func (s *Struct) String() string

func (*Struct) Visit

func (s *Struct) Visit(ctx *parser.StructDefinitionContext)

Visit is called by a visitor.

type Tokens

type Tokens struct {
	Start antlr.Token
	Stop  antlr.Token
}

Tokens store the start and stop of a parse tree node.

type TupleExpression

type TupleExpression struct {
	Tokens
	SquareBrackets bool
	Expressions    []*Expression
}

TupleExpression represents a tuple expression in Solidity.

func NewTupleExpression

func NewTupleExpression() *TupleExpression

NewTupleExpression returns a new instance of TupleExpression.

func (*TupleExpression) String

func (te *TupleExpression) String() string

func (*TupleExpression) Visit

Visit is called by a visitor.

type TypeName

type TypeName struct {
	Tokens
	SubType     int
	Elementary  *ElementaryTypeName
	UserDefined *UserDefinedTypeName
	Mapping     *Mapping
	TypeName    *TypeName
	Expression  *Expression
	Function    *FunctionTypeName
}

TypeName represents the name of a type in Solidity.

func NewTypeName

func NewTypeName() *TypeName

NewTypeName returns a new instance of TypeName.

func (*TypeName) Equal

func (tn *TypeName) Equal(b *TypeName) bool

Equal evaluates the equality of two type names.

func (*TypeName) IsComplex

func (tn *TypeName) IsComplex() bool

IsComplex returns true if type is of an array, mapping, or struct.

func (*TypeName) String

func (tn *TypeName) String() string

func (*TypeName) Visit

func (tn *TypeName) Visit(ctx *parser.TypeNameContext)

Visit is called by a visitor.

type UserDefinedTypeName

type UserDefinedTypeName []string

UserDefinedTypeName represents a user-defined type name in Solidity.

func NewUserDefinedTypeName

func NewUserDefinedTypeName() *UserDefinedTypeName

NewUserDefinedTypeName returns a new instance of UserDefinedTypeName.

func (*UserDefinedTypeName) Add

func (ut *UserDefinedTypeName) Add(identifier string)

Add adds an identifier to an instance of UserDefinedTypeName.

func (*UserDefinedTypeName) String

func (ut *UserDefinedTypeName) String() string

type UsingFor

type UsingFor struct {
	Tokens
	Contract   *Contract
	Identifier string
	TypeName   *TypeName
}

UsingFor represents a using for declaration in Solidity.

func NewUsingFor

func NewUsingFor() *UsingFor

NewUsingFor returns a new instance of UsingFor.

func (*UsingFor) String

func (uf *UsingFor) String() string

func (*UsingFor) Visit

func (uf *UsingFor) Visit(ctx *parser.UsingForDeclarationContext)

Visit is called by a visitor.

type VariableDeclaration

type VariableDeclaration struct {
	Tokens
	TypeName        *TypeName
	StorageLocation string
	Identifier      string
}

VariableDeclaration represents a variable declaration in Solidity.

func NewVariableDeclaration

func NewVariableDeclaration() *VariableDeclaration

NewVariableDeclaration returns a new instance of VariableDeclaration.

func (*VariableDeclaration) String

func (vd *VariableDeclaration) String() string

func (*VariableDeclaration) Visit

Visit is called by a visitor.

type VariableDeclarationStatement

type VariableDeclarationStatement struct {
	Tokens
	Identifiers             []string
	VariableDeclaration     *VariableDeclaration
	VariableDeclarationList []*VariableDeclaration
	Expression              *Expression
}

VariableDeclarationStatement represents a variable declaration statement in Solidity.

func NewVariableDeclarationStatement

func NewVariableDeclarationStatement() *VariableDeclarationStatement

NewVariableDeclarationStatement returns a new instance of SimpleStatement.

func (*VariableDeclarationStatement) String

func (vds *VariableDeclarationStatement) String() string

func (*VariableDeclarationStatement) Visit

Visit is called by a visitor.

type WhileStatement

type WhileStatement struct {
	Tokens
	Condition *Expression
	Body      *Statement
}

WhileStatement represents a while statement in Solidity.

func NewWhileStatement

func NewWhileStatement() *WhileStatement

NewWhileStatement returns a new instance of WhileStatement.

func (*WhileStatement) String

func (ws *WhileStatement) String() string

func (*WhileStatement) Visit

Visit is called by a visitor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL