solcparser

package module
v0.0.0-...-896e758 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

README

Solidty parser in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTreeSitter

func NewTreeSitter(code string) *sitter.Node

Types

type ArrayTypeName

type ArrayTypeName struct {
	Node

	BaseTypeName interface{}
	Length       interface{}
}

type AssemblyAssignment

type AssemblyAssignment struct {
	Expression interface{}
}

type AssemblyBlock

type AssemblyBlock struct {
	Operations []interface{}
}

type AssemblyCall

type AssemblyCall struct {
	Arguments []interface{}
}

type AssemblyCase

type AssemblyCase struct {
	Block interface{}
}

type AssemblyFor

type AssemblyFor struct {
	Pre       interface{}
	Condition interface{}
	Post      interface{}
	Body      interface{}
}

type AssemblyFunctionDefinition

type AssemblyFunctionDefinition struct {
	Body interface{}
}

type AssemblyIf

type AssemblyIf struct {
	Condition interface{}
	Body      interface{}
}

type AssemblyLiteral

type AssemblyLiteral struct {
}

type AssemblyLocalDefinition

type AssemblyLocalDefinition struct {
	Expression interface{}
}

type AssemblyMember

type AssemblyMember struct {
	Expression interface{}
	MemberName interface{}
}

type AssemblySwitch

type AssemblySwitch struct {
	Expression interface{}
	Cases      []interface{}
}

type BinaryOperation

type BinaryOperation struct {
	Node

	Operator string
	Left     interface{}
	Right    interface{}
}

type Block

type Block struct {
	Node

	Statements []interface{}
}

Block

type BooleanLiteral

type BooleanLiteral struct {
	Node

	Value bool
}

type BreakStatement

type BreakStatement struct {
	Node
}

BreakStatement

type CatchClause

type CatchClause struct {
	Node

	IsReasonType bool
	Kind         string
	Parameters   interface{}
	Body         interface{}
}

type Conditional

type Conditional struct {
	Node

	Condition       interface{}
	TrueExpression  interface{}
	FalseExpression interface{}
}

type ContinueStatement

type ContinueStatement struct {
	Node
}

ContinueStatement

type ContractDefinition

type ContractDefinition struct {
	Node

	Name          string `json:"name"`
	SubNodes      []interface{}
	BaseContracts []interface{}
	Kind          string
}

ContractDefinition

type CustomErrorDefinition

type CustomErrorDefinition struct {
	Node

	Name       string
	Parameters []interface{}
}

type CustomErrorListener

type CustomErrorListener struct {
	*antlr.DefaultErrorListener
	Errors []*SyntaxError
}

func (*CustomErrorListener) SyntaxError

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

type DoWhileStatement

type DoWhileStatement struct {
	Node

	Condition interface{}
	Body      interface{}
}

type ElementaryTypeName

type ElementaryTypeName struct {
	Node

	Name            string
	StateMutability string
}

type EmitStatement

type EmitStatement struct {
	Node

	EventCall interface{}
}

type EnumDefinition

type EnumDefinition struct {
	Node

	Name    string        `json:"name"`
	Members []interface{} `json:"members"`
}

EnumDefinition

type EnumValue

type EnumValue struct {
	Node

	Name string `json:"name"`
}

type EventDefinition

type EventDefinition struct {
	Node

	Name       string
	Parameters []interface{}
}

EventDefinition

type ExpressionStatement

type ExpressionStatement struct {
	Node

	Expression interface{}
}

ExpressionStatement

type FileLevelConstant

type FileLevelConstant struct {
	Node

	Name            string
	InitialValue    interface{}
	TypeName        interface{}
	IsDeclaredConst bool
	IsImmutable     bool
}

type ForStatement

type ForStatement struct {
	Node

	InitExpression      interface{}
	ConditionExpression interface{}
	LoopExpression      interface{}
	Body                interface{}
}

ForStatement

type FunctionCall

type FunctionCall struct {
	Node

	Arguments   []interface{}
	Names       []interface{}
	Identifiers []interface{}
	Expression  interface{}
}

type FunctionDefinition

type FunctionDefinition struct {
	Node

	Name             string
	Parameters       []interface{}
	Modifiers        []interface{}
	ReturnParameters interface{}
	Body             interface{}
	StateMutability  string
	Visibility       string
	IsConstructor    bool
	IsReceiveEther   bool
	IsFallback       bool
	IsVirtual        bool
	Override         []interface{}
}

FunctionDefinition

type FunctionTypeName

type FunctionTypeName struct {
	Node

	ParameterTypes  []interface{}
	ReturnTypes     []interface{}
	Visibility      string
	StateMutability string
}

type HexLiteral

type HexLiteral struct {
	Node

	Value string
	Parts []string
}

type INode

type INode interface {
	GetType() string
	IsNode()
	SetTypeName(s string)
}

type Identifier

type Identifier struct {
	Node

	Name string
}

type IfStatement

type IfStatement struct {
	Node

	Condition interface{}
	TrueBody  interface{}
	FalseBody interface{}
}

IfStatement

type ImportDirective

type ImportDirective struct {
	Node

	Path        string
	PathLiteral interface{}

	UnitAlias           string
	UnitAliasIdentifier interface{}

	SymbolAliases            [][]string
	SymbolAliasesIdentifiers [][]*Identifier
}

ImportDirective

type IndexAccess

type IndexAccess struct {
	Node

	Base  interface{}
	Index interface{}
}

type IndexRangeAccess

type IndexRangeAccess struct {
	Node

	Base       interface{}
	IndexStart interface{}
	IndexEnd   interface{}
}

type InheritanceSpecifier

type InheritanceSpecifier struct {
	Node

	BaseName  interface{}
	Arguments []interface{}
}

type InlineAssemblyStatement

type InlineAssemblyStatement struct {
	Body interface{}
}

type Mapping

type Mapping struct {
	Node

	KeyType   interface{}
	ValueType interface{}
}

type MemberAccess

type MemberAccess struct {
	Node

	Expression interface{}
	MemberName string
}

type ModifierDefinition

type ModifierDefinition struct {
	Node

	Name       string
	Parameters interface{}
	Body       interface{}
	IsVirtual  bool
	Override   []interface{}
}

ModifierDefinition

type ModifierInvocation

type ModifierInvocation struct {
	Node

	Name      string
	Arguments []interface{}
}

type NameValueExpression

type NameValueExpression struct {
	Node

	Expression interface{}
	Arguments  interface{}
}

type NameValueList

type NameValueList struct {
	Node

	Names       []string
	Identifiers []interface{}
	Args        []interface{}
}

type NewExpression

type NewExpression struct {
	Node

	TypeName interface{}
}

Expression

type Node

type Node struct {
	Type string `json:"type"`
}

func (*Node) GetType

func (n *Node) GetType() string

func (*Node) IsNode

func (n *Node) IsNode()

func (*Node) SetTypeName

func (n *Node) SetTypeName(typ string)

type NumberLiteral

type NumberLiteral struct {
	Node

	Number          string
	SubDenomination interface{}
}

type OverrideSpecifier

type OverrideSpecifier struct {
	Node
}

type Parser

type Parser struct {
	Result INode
	Errors []*SyntaxError
}

func Parse

func Parse(s string) *Parser

func (*Parser) Json

func (p *Parser) Json() (string, error)

type PragmaDirective

type PragmaDirective struct {
	Node

	Name  string
	Value string
}

type ReturnStatement

type ReturnStatement struct {
	Node

	Expression interface{}
}

ReturnStatement

type RevertStatement

type RevertStatement struct {
	Node

	RevertCall interface{}
}

type SourceUnit

type SourceUnit struct {
	Node

	Children []interface{}
}

SourceUnit

type StateVariableDeclaration

type StateVariableDeclaration struct {
	Node

	Variables    []interface{}
	InitialValue interface{}
}

type StateVariableDeclarationVariable

type StateVariableDeclarationVariable struct {
	VariableDeclaration
	IsInmutable bool
}

type StringLiteral

type StringLiteral struct {
	Node

	Value     string
	Parts     []string
	IsUnicode []bool
}

type StructDefinition

type StructDefinition struct {
	Node

	Name    string
	Members []interface{}
}

StructDefinition

type SyntaxError

type SyntaxError struct {
	// contains filtered or unexported fields
}

func (*SyntaxError) Error

func (c *SyntaxError) Error() string

type ThrowStatement

type ThrowStatement struct {
	Node
}

type TryStatement

type TryStatement struct {
	Node

	Expression       interface{}
	CatchClause      []interface{}
	Body             interface{}
	ReturnParameters interface{}
}

TryStatement

type TupleExpression

type TupleExpression struct {
	Node

	Components []interface{}
	IsArray    bool
}

type TypeDefinition

type TypeDefinition struct {
	Node

	Name       string
	Definition interface{}
}

type TypeNameExpression

type TypeNameExpression struct {
	Node

	TypeName interface{}
}

type UnaryOperation

type UnaryOperation struct {
	Node

	Operator      string
	SubExpression interface{}
	IsPrefix      bool
}

type UncheckedStatement

type UncheckedStatement struct {
	Node

	Block interface{}
}

type UserDefinedTypeName

type UserDefinedTypeName struct {
	Node

	NamePath string
}

type UsingForDeclaration

type UsingForDeclaration struct {
	Node

	LibraryName string
	TypeName    interface{}
}

UsingForDeclaration

type VariableDeclaration

type VariableDeclaration struct {
	Node

	Name            string
	TypeName        interface{}
	Identifier      interface{}
	IsIndexed       bool
	IsStateVar      bool
	IsDeclaredConst bool
	StorageLocation string
	Expression      interface{}
	Visibility      string
	Override        []interface{}
}

VariableDeclaration

type VariableDeclarationStatement

type VariableDeclarationStatement struct {
	Node

	InitialValue interface{}
	Variables    []interface{}
}

VariableDeclarationStatement

type WhileStatement

type WhileStatement struct {
	Node

	Condition interface{}
	Body      interface{}
}

WhileStatement

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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