ast

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentNode

type AssignmentNode struct {
	Name       string
	Expression Node
	Block      Node
	NewBlock   bool
}

func NewAssignmentNode

func NewAssignmentNode(name string, expression, block Node) *AssignmentNode

func (*AssignmentNode) SetBlock

func (n *AssignmentNode) SetBlock(node Node)

type BooleanNode

type BooleanNode struct {
	Value bool
}

func NewBooleanNode

func NewBooleanNode(v bool) *BooleanNode

func (*BooleanNode) SetBlock

func (*BooleanNode) SetBlock(Node)

type BytesNode

type BytesNode struct {
	Value []byte
}

func NewBytesNode

func NewBytesNode(v []byte) *BytesNode

func (*BytesNode) SetBlock

func (*BytesNode) SetBlock(Node)

type ConditionalNode

type ConditionalNode struct {
	Condition       Node
	TrueExpression  Node
	FalseExpression Node
}

func NewConditionalNode

func NewConditionalNode(condition, trueExpression, falseExpression Node) *ConditionalNode

func (*ConditionalNode) SetBlock

func (*ConditionalNode) SetBlock(Node)

type ContentType

type ContentType byte
const (
	ContentTypeExpression ContentType = iota + 1
	ContentTypeApplication
)

func NewContentType

func NewContentType(b byte) (ContentType, error)

type Function

type Function interface {
	Name() string
	Type() string
}

type FunctionCallNode

type FunctionCallNode struct {
	Function  Function
	Arguments []Node
}

func NewFunctionCallNode

func NewFunctionCallNode(function Function, arguments []Node) *FunctionCallNode

func (*FunctionCallNode) SetBlock

func (*FunctionCallNode) SetBlock(Node)

type FunctionDeclarationNode

type FunctionDeclarationNode struct {
	Name                string
	Arguments           []string
	Body                Node
	Block               Node
	InvocationParameter string
}

func NewFunctionDeclarationNode

func NewFunctionDeclarationNode(name string, arguments []string, body, block Node) *FunctionDeclarationNode

func (*FunctionDeclarationNode) SetBlock

func (n *FunctionDeclarationNode) SetBlock(node Node)

type LibraryVersion

type LibraryVersion byte
const (
	LibV1 LibraryVersion = iota + 1
	LibV2
	LibV3
	LibV4
	LibV5
	LibV6
	LibV7
)

func CurrentMaxLibraryVersion added in v0.10.3

func CurrentMaxLibraryVersion() LibraryVersion

CurrentMaxLibraryVersion reports the max lib version. Update it when a new version was added.

func NewLibraryVersion

func NewLibraryVersion(b byte) (LibraryVersion, error)

func (*LibraryVersion) UnmarshalJSON added in v0.10.3

func (lv *LibraryVersion) UnmarshalJSON(data []byte) error

type LongNode

type LongNode struct {
	Value int64
}

func NewLongNode

func NewLongNode(v int64) *LongNode

func (*LongNode) SetBlock

func (*LongNode) SetBlock(Node)

type NativeFunction

type NativeFunction string

func (NativeFunction) Name

func (name NativeFunction) Name() string

func (NativeFunction) Type

func (name NativeFunction) Type() string

type Node

type Node interface {
	SetBlock(node Node)
	// contains filtered or unexported methods
}

type PropertyNode

type PropertyNode struct {
	Name   string
	Object Node
}

func NewPropertyNode

func NewPropertyNode(name string, object Node) *PropertyNode

func (*PropertyNode) SetBlock

func (*PropertyNode) SetBlock(Node)

type ReferenceNode

type ReferenceNode struct {
	Name string
}

func NewReferenceNode

func NewReferenceNode(name string) *ReferenceNode

func (*ReferenceNode) SetBlock

func (*ReferenceNode) SetBlock(Node)

type StringNode

type StringNode struct {
	Value string
}

func NewStringNode

func NewStringNode(v string) *StringNode

func (*StringNode) SetBlock

func (*StringNode) SetBlock(Node)

type Tree

type Tree struct {
	Digest       [32]byte
	ContentType  ContentType
	LibVersion   LibraryVersion
	HasBlockV2   bool
	Meta         meta.DApp
	Declarations []Node
	Functions    []Node
	Verifier     Node
}

func NewTree

func NewTree(content ContentType, library LibraryVersion) *Tree

func (*Tree) HasVerifier

func (t *Tree) HasVerifier() bool

func (*Tree) IsDApp

func (t *Tree) IsDApp() bool

type UserFunction

type UserFunction string

func (UserFunction) Name

func (name UserFunction) Name() string

func (UserFunction) Type

func (name UserFunction) Type() string

Jump to

Keyboard shortcuts

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