ast

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: EPL-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindingNode

type BindingNode struct {
	Name       *lang.Symbol
	Init       *Node
	Local      lang.Keyword
	ArgID      int
	IsVariadic bool
}

type CaseNode

type CaseNode struct {
	Test    *Node
	Nodes   []*Node
	Default *Node
}

type CaseNodeNode

type CaseNodeNode struct {
	Tests []*Node
	Then  *Node
}

type CatchNode

type CatchNode struct {
	Class *Node
	Local *Node
	Body  *Node
}

type ConstNode

type ConstNode struct {
	Type  lang.Keyword
	Value interface{}
	Meta  *Node
}

type DefNode

type DefNode struct {
	Name *lang.Symbol
	Var  *lang.Var
	Meta *Node
	Init *Node
	Doc  interface{}
}

type DoNode

type DoNode struct {
	Statements []*Node
	Ret        *Node
	IsBody     bool
}

type FnMethodNode

type FnMethodNode struct {
	Params     []*Node
	FixedArity int
	Body       *Node
	LoopID     *lang.Symbol
	IsVariadic bool
}

type FnNode

type FnNode struct {
	IsVariadic    bool
	MaxFixedArity int
	Methods       []*Node
	Once          bool
	Local         *Node
}

type GoBuiltinNode

type GoBuiltinNode struct {
	Sym   *lang.Symbol
	Value interface{}
}

type GoNode

type GoNode struct {
	Invoke *Node
}

type HostCallNode

type HostCallNode struct {
	Target *Node
	Method *lang.Symbol
	Args   []*Node
}

type HostFieldNode

type HostFieldNode struct {
	Target *Node
	Field  *lang.Symbol
}

type HostInteropNode

type HostInteropNode struct {
	Target *Node
	MOrF   *lang.Symbol
}

type IfNode

type IfNode struct {
	Test *Node
	Then *Node
	Else *Node
}

type InvokeNode

type InvokeNode struct {
	Meta lang.IPersistentMap
	Fn   *Node
	Args []*Node
}

type LetFnNode

type LetFnNode struct {
	Bindings []*Node
	Body     *Node
}

type LetNode

type LetNode struct {
	Body     *Node
	Bindings []*Node
	LoopID   *lang.Symbol
}

type LocalNode

type LocalNode struct {
	Name       *lang.Symbol
	Local      lang.Keyword
	ArgID      int
	IsVariadic bool
}

type MapNode

type MapNode struct {
	Keys []*Node
	Vals []*Node
}

type MaybeClassNode

type MaybeClassNode struct {
	Class interface{}
}

type MaybeHostFormNode

type MaybeHostFormNode struct {
	Class string
	Field *lang.Symbol
}

type NewNode

type NewNode struct {
	Class *Node
	Args  []*Node
}

type Node

type Node struct {
	// Benchmarking shows that switching on an integer op is faster
	// than type switching on a polymorphic interface or calling a
	// polymorphic method.
	Op NodeOp

	Form     interface{}
	RawForms []interface{}

	Env lang.IPersistentMap

	// Sub is a pointer to an Op-specific struct.
	Sub interface{}

	IsLiteral    bool
	IsAssignable bool
}

func MakeNode

func MakeNode(op NodeOp, form interface{}) *Node

type NodeOp

type NodeOp int32
const (
	OpUnknown NodeOp = iota
	OpConst
	OpDef
	OpSetBang
	OpMaybeClass
	OpWithMeta
	OpFn
	OpFnMethod
	OpMap
	OpVector
	OpSet
	OpDo
	OpLet
	OpLetFn
	OpLoop
	OpInvoke
	OpQuote
	OpVar
	OpLocal
	OpBinding
	OpHostCall
	OpHostInterop
	OpHostField
	OpMaybeHostForm
	OpGoBuiltin
	OpGo
	OpIf
	OpCase
	OpCaseNode
	OpTheVar
	OpRecur
	OpNew
	OpTry
	OpCatch
	OpThrow
)

type QuoteNode

type QuoteNode struct {
	Expr *Node
}

type RecurNode

type RecurNode struct {
	Exprs  []*Node
	LoopID *lang.Symbol
}

type SetBangNode

type SetBangNode struct {
	Target *Node
	Val    *Node
}

type SetNode

type SetNode struct {
	Items []*Node
}

type TheVarNode

type TheVarNode struct {
	Var *lang.Var
}

type ThrowNode

type ThrowNode struct {
	Exception *Node
}

type TryNode

type TryNode struct {
	Body    *Node
	Catches []*Node
	Finally *Node
}

type VarNode

type VarNode struct {
	Var  *lang.Var
	Meta lang.IPersistentMap
}

type VectorNode

type VectorNode struct {
	Items []*Node
}

type WithMetaNode

type WithMetaNode struct {
	Expr *Node
	Meta *Node
}

Jump to

Keyboard shortcuts

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