ast

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperatorAnd = "&&"
	OperatorGE  = ">="
	OperatorLE  = "<="
	OperatorAdd = "+"
	OperatorSub = "-"
	OperatorMul = "*"
	OperatorL   = "<"
	OperatorG   = ">"
	OperatorNE  = "!="
	OperatorE   = "=="
)

Operators

View Source
const (
	UserDefinedTypeName = "UserDefinedTypeName"
	ElementaryTypeName  = "ElementaryTypeName"
	ArrayTypeName       = "ArrayTypeName"
)
View Source
const Assignment = "Assignment"
View Source
const BinaryOperation = "BinaryOperation"
View Source
const Block = "Block"
View Source
const Break = "Break"
View Source
const Continue = "Continue"
View Source
const ContractDefinition = "ContractDefinition"
View Source
const ExpressionStatement = "ExpressionStatement"
View Source
const ForStatement = "ForStatement"
View Source
const FunctionCall = "FunctionCall"
View Source
const FunctionDefinition = "FunctionDefinition"
View Source
const Identifier = "Identifier"
View Source
const IfStatement = "IfStatement"
View Source
const IndexAccess = "IndexAccess"
View Source
const Literal = "Literal"
View Source
const MemberAccess = "MemberAccess"
View Source
const ParameterList = "ParameterList"
View Source
const Return = "Return"
View Source
const StructDefinition = "StructDefinition"
View Source
const TupleExpression = "TupleExpression"
View Source
const UnaryOperation = "UnaryOperation"
View Source
const (
	VariableDeclarationStatement = "VariableDeclarationStatement"
)

Variables

This section is empty.

Functions

func GenerateGoFileFromSolidy

func GenerateGoFileFromSolidy(file []byte, enums []converter.Enum) (string, error)

func GenerateGoImports

func GenerateGoImports(symbols []SymbolImport) string

func ProcessAllSolidityFiles

func ProcessAllSolidityFiles(
	basePath string,
	currentPath string,
	destination string,
	enums []converter.Enum,
)

func ProcessSolidityFile

func ProcessSolidityFile(
	path string,
	fileName string,
	outputFolder string,
	enums []converter.Enum,
) error

func ProcessSolidityFiles

func ProcessSolidityFiles(
	basePath string,
	fileName string,
	outputFolder string,
	enums []converter.Enum,
) error

func SaveGoFile

func SaveGoFile(outputFolder string, fileName string, fileContent string) error

Types

type Converter

type Converter struct {
	Enums []converter.Enum
	// contains filtered or unexported fields
}

func NewConverter

func NewConverter() *Converter

func (*Converter) BytesToVariableDeclaration

func (a *Converter) BytesToVariableDeclaration(
	value []byte,
) (name string, typeValue string, err error)

func (*Converter) ProcessAST

func (a *Converter) ProcessAST(data []byte) (string, error)

type SymbolImport

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

Jump to

Keyboard shortcuts

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