ast

package
v1.4.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(node *Node, visitor Visitor)

Types

type ArrayNode

type ArrayNode struct {
	Nodes []Node
	// contains filtered or unexported fields
}

func (*ArrayNode) GetLocation

func (n *ArrayNode) GetLocation() file.Location

func (*ArrayNode) GetType

func (n *ArrayNode) GetType() reflect.Type

func (*ArrayNode) SetLocation

func (n *ArrayNode) SetLocation(l file.Location)

func (*ArrayNode) SetType

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

type BinaryNode

type BinaryNode struct {
	Operator string
	Left     Node
	Right    Node
	// contains filtered or unexported fields
}

func (*BinaryNode) GetLocation

func (n *BinaryNode) GetLocation() file.Location

func (*BinaryNode) GetType

func (n *BinaryNode) GetType() reflect.Type

func (*BinaryNode) SetLocation

func (n *BinaryNode) SetLocation(l file.Location)

func (*BinaryNode) SetType

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

type BoolNode

type BoolNode struct {
	Value bool
	// contains filtered or unexported fields
}

func (*BoolNode) GetLocation

func (n *BoolNode) GetLocation() file.Location

func (*BoolNode) GetType

func (n *BoolNode) GetType() reflect.Type

func (*BoolNode) SetLocation

func (n *BoolNode) SetLocation(l file.Location)

func (*BoolNode) SetType

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

type BuiltinNode

type BuiltinNode struct {
	Name      string
	Arguments []Node
	// contains filtered or unexported fields
}

func (*BuiltinNode) GetLocation

func (n *BuiltinNode) GetLocation() file.Location

func (*BuiltinNode) GetType

func (n *BuiltinNode) GetType() reflect.Type

func (*BuiltinNode) SetLocation

func (n *BuiltinNode) SetLocation(l file.Location)

func (*BuiltinNode) SetType

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

type ClosureNode

type ClosureNode struct {
	Node Node
	// contains filtered or unexported fields
}

func (*ClosureNode) GetLocation

func (n *ClosureNode) GetLocation() file.Location

func (*ClosureNode) GetType

func (n *ClosureNode) GetType() reflect.Type

func (*ClosureNode) SetLocation

func (n *ClosureNode) SetLocation(l file.Location)

func (*ClosureNode) SetType

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

type ConditionalNode

type ConditionalNode struct {
	Cond Node
	Exp1 Node
	Exp2 Node
	// contains filtered or unexported fields
}

func (*ConditionalNode) GetLocation

func (n *ConditionalNode) GetLocation() file.Location

func (*ConditionalNode) GetType

func (n *ConditionalNode) GetType() reflect.Type

func (*ConditionalNode) SetLocation

func (n *ConditionalNode) SetLocation(l file.Location)

func (*ConditionalNode) SetType

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

type ConstantNode

type ConstantNode struct {
	Value interface{}
	// contains filtered or unexported fields
}

func (*ConstantNode) GetLocation

func (n *ConstantNode) GetLocation() file.Location

func (*ConstantNode) GetType

func (n *ConstantNode) GetType() reflect.Type

func (*ConstantNode) SetLocation

func (n *ConstantNode) SetLocation(l file.Location)

func (*ConstantNode) SetType

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

type FloatNode

type FloatNode struct {
	Value float64
	// contains filtered or unexported fields
}

func (*FloatNode) GetLocation

func (n *FloatNode) GetLocation() file.Location

func (*FloatNode) GetType

func (n *FloatNode) GetType() reflect.Type

func (*FloatNode) SetLocation

func (n *FloatNode) SetLocation(l file.Location)

func (*FloatNode) SetType

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

type FunctionNode

type FunctionNode struct {
	Name      string
	Arguments []Node
	Fast      bool
	// contains filtered or unexported fields
}

func (*FunctionNode) GetLocation

func (n *FunctionNode) GetLocation() file.Location

func (*FunctionNode) GetType

func (n *FunctionNode) GetType() reflect.Type

func (*FunctionNode) SetLocation

func (n *FunctionNode) SetLocation(l file.Location)

func (*FunctionNode) SetType

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

type IdentifierNode

type IdentifierNode struct {
	Value string
	// contains filtered or unexported fields
}

func (*IdentifierNode) GetLocation

func (n *IdentifierNode) GetLocation() file.Location

func (*IdentifierNode) GetType

func (n *IdentifierNode) GetType() reflect.Type

func (*IdentifierNode) SetLocation

func (n *IdentifierNode) SetLocation(l file.Location)

func (*IdentifierNode) SetType

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

type IndexNode

type IndexNode struct {
	Node  Node
	Index Node
	// contains filtered or unexported fields
}

func (*IndexNode) GetLocation

func (n *IndexNode) GetLocation() file.Location

func (*IndexNode) GetType

func (n *IndexNode) GetType() reflect.Type

func (*IndexNode) SetLocation

func (n *IndexNode) SetLocation(l file.Location)

func (*IndexNode) SetType

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

type IntegerNode

type IntegerNode struct {
	Value int
	// contains filtered or unexported fields
}

func (*IntegerNode) GetLocation

func (n *IntegerNode) GetLocation() file.Location

func (*IntegerNode) GetType

func (n *IntegerNode) GetType() reflect.Type

func (*IntegerNode) SetLocation

func (n *IntegerNode) SetLocation(l file.Location)

func (*IntegerNode) SetType

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

type MapNode

type MapNode struct {
	Pairs []Node
	// contains filtered or unexported fields
}

func (*MapNode) GetLocation

func (n *MapNode) GetLocation() file.Location

func (*MapNode) GetType

func (n *MapNode) GetType() reflect.Type

func (*MapNode) SetLocation

func (n *MapNode) SetLocation(l file.Location)

func (*MapNode) SetType

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

type MatchesNode

type MatchesNode struct {
	Regexp *regexp.Regexp
	Left   Node
	Right  Node
	// contains filtered or unexported fields
}

func (*MatchesNode) GetLocation

func (n *MatchesNode) GetLocation() file.Location

func (*MatchesNode) GetType

func (n *MatchesNode) GetType() reflect.Type

func (*MatchesNode) SetLocation

func (n *MatchesNode) SetLocation(l file.Location)

func (*MatchesNode) SetType

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

type MethodNode

type MethodNode struct {
	Node      Node
	Method    string
	Arguments []Node
	// contains filtered or unexported fields
}

func (*MethodNode) GetLocation

func (n *MethodNode) GetLocation() file.Location

func (*MethodNode) GetType

func (n *MethodNode) GetType() reflect.Type

func (*MethodNode) SetLocation

func (n *MethodNode) SetLocation(l file.Location)

func (*MethodNode) SetType

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

type NilNode

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

func (*NilNode) GetLocation

func (n *NilNode) GetLocation() file.Location

func (*NilNode) GetType

func (n *NilNode) GetType() reflect.Type

func (*NilNode) SetLocation

func (n *NilNode) SetLocation(l file.Location)

func (*NilNode) SetType

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

type Node

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

Node represents items of abstract syntax tree.

type PairNode

type PairNode struct {
	Key   Node
	Value Node
	// contains filtered or unexported fields
}

func (*PairNode) GetLocation

func (n *PairNode) GetLocation() file.Location

func (*PairNode) GetType

func (n *PairNode) GetType() reflect.Type

func (*PairNode) SetLocation

func (n *PairNode) SetLocation(l file.Location)

func (*PairNode) SetType

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

type PointerNode

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

func (*PointerNode) GetLocation

func (n *PointerNode) GetLocation() file.Location

func (*PointerNode) GetType

func (n *PointerNode) GetType() reflect.Type

func (*PointerNode) SetLocation

func (n *PointerNode) SetLocation(l file.Location)

func (*PointerNode) SetType

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

type PropertyNode

type PropertyNode struct {
	Node     Node
	Property string
	// contains filtered or unexported fields
}

func (*PropertyNode) GetLocation

func (n *PropertyNode) GetLocation() file.Location

func (*PropertyNode) GetType

func (n *PropertyNode) GetType() reflect.Type

func (*PropertyNode) SetLocation

func (n *PropertyNode) SetLocation(l file.Location)

func (*PropertyNode) SetType

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

type SliceNode

type SliceNode struct {
	Node Node
	From Node
	To   Node
	// contains filtered or unexported fields
}

func (*SliceNode) GetLocation

func (n *SliceNode) GetLocation() file.Location

func (*SliceNode) GetType

func (n *SliceNode) GetType() reflect.Type

func (*SliceNode) SetLocation

func (n *SliceNode) SetLocation(l file.Location)

func (*SliceNode) SetType

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

type StringNode

type StringNode struct {
	Value string
	// contains filtered or unexported fields
}

func (*StringNode) GetLocation

func (n *StringNode) GetLocation() file.Location

func (*StringNode) GetType

func (n *StringNode) GetType() reflect.Type

func (*StringNode) SetLocation

func (n *StringNode) SetLocation(l file.Location)

func (*StringNode) SetType

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

type UnaryNode

type UnaryNode struct {
	Operator string
	Node     Node
	// contains filtered or unexported fields
}

func (*UnaryNode) GetLocation

func (n *UnaryNode) GetLocation() file.Location

func (*UnaryNode) GetType

func (n *UnaryNode) GetType() reflect.Type

func (*UnaryNode) SetLocation

func (n *UnaryNode) SetLocation(l file.Location)

func (*UnaryNode) SetType

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

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