ast

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump added in v1.5.0

func Dump(node Node) string

func Walk

func Walk(node *Node, visitor Visitor)

Types

type ArrayNode

type ArrayNode struct {
	Base
	Nodes []Node
}

type Base added in v1.5.0

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

func Loc added in v1.5.0

func Loc(l file.Location) Base

func (*Base) Location added in v1.5.0

func (n *Base) Location() file.Location

func (*Base) SetLocation added in v1.5.0

func (n *Base) SetLocation(loc file.Location)

func (*Base) SetType added in v1.5.0

func (n *Base) SetType(t reflect.Type)

func (*Base) Type added in v1.5.0

func (n *Base) Type() reflect.Type

type BinaryNode

type BinaryNode struct {
	Base
	Operator string
	Left     Node
	Right    Node
}

type BoolNode

type BoolNode struct {
	Base
	Value bool
}

type BuiltinNode

type BuiltinNode struct {
	Base
	Name      string
	Arguments []Node
}

type ClosureNode

type ClosureNode struct {
	Base
	Node Node
}

type ConditionalNode

type ConditionalNode struct {
	Base
	Cond Node
	Exp1 Node
	Exp2 Node
}

type ConstantNode

type ConstantNode struct {
	Base
	Value interface{}
}

type FloatNode

type FloatNode struct {
	Base
	Value float64
}

type FunctionNode

type FunctionNode struct {
	Base
	Name      string
	Arguments []Node
	Fast      bool
}

type IdentifierNode

type IdentifierNode struct {
	Base
	Value string
}

type IndexNode

type IndexNode struct {
	Base
	Node  Node
	Index Node
}

type IntegerNode

type IntegerNode struct {
	Base
	Value int
}

type MapNode

type MapNode struct {
	Base
	Pairs []Node
}

type MatchesNode

type MatchesNode struct {
	Base
	Regexp *regexp.Regexp
	Left   Node
	Right  Node
}

type MethodNode

type MethodNode struct {
	Base
	Node      Node
	Method    string
	Arguments []Node
}

type NilNode

type NilNode struct {
	Base
}

type Node

type Node interface {
	Location() file.Location
	SetLocation(file.Location)
	Type() reflect.Type
	SetType(reflect.Type)
}

Node represents items of abstract syntax tree.

type PairNode

type PairNode struct {
	Base
	Key   Node
	Value Node
}

type PointerNode

type PointerNode struct {
	Base
}

type PropertyNode

type PropertyNode struct {
	Base
	Node     Node
	Property string
}

type SliceNode

type SliceNode struct {
	Base
	Node Node
	From Node
	To   Node
}

type StringNode

type StringNode struct {
	Base
	Value string
}

type UnaryNode

type UnaryNode struct {
	Base
	Operator string
	Node     Node
}

type Visitor

type Visitor interface {
	Enter(node *Node)
	Exit(node *Node)
}

Jump to

Keyboard shortcuts

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