ast

package
v0.0.0-...-0e190f9 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 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 ArrayLiteral

type ArrayLiteral struct {
	Token    token.Token
	Elements []Expression
}

func (*ArrayLiteral) String

func (al *ArrayLiteral) String() string

func (*ArrayLiteral) TokenLiteral

func (al *ArrayLiteral) TokenLiteral() string

func (*ArrayLiteral) Type

func (al *ArrayLiteral) Type() token.Type

type BlockStatement

type BlockStatement struct {
	Token      token.Token // the { token
	Statements []Statement
}

func (*BlockStatement) String

func (bs *BlockStatement) String() string

func (*BlockStatement) TokenLiteral

func (bs *BlockStatement) TokenLiteral() string

func (*BlockStatement) Type

func (bs *BlockStatement) Type() token.Type

type Boolean

type Boolean struct {
	Token token.Token
	Value bool
}

func (*Boolean) String

func (b *Boolean) String() string

func (*Boolean) TokenLiteral

func (b *Boolean) TokenLiteral() string

func (*Boolean) Type

func (b *Boolean) Type() token.Type

type BreakExpression

type BreakExpression struct {
	Token token.Token
}

func (BreakExpression) String

func (b BreakExpression) String() string

func (BreakExpression) TokenLiteral

func (b BreakExpression) TokenLiteral() string

func (BreakExpression) Type

func (b BreakExpression) Type() token.Type

type CallExpression

type CallExpression struct {
	Token     token.Token // The '(' token
	Function  Expression  // Identifier or FunctionLiteral
	Arguments []Expression
}

func (*CallExpression) String

func (ce *CallExpression) String() string

func (*CallExpression) TokenLiteral

func (ce *CallExpression) TokenLiteral() string

func (*CallExpression) Type

func (ce *CallExpression) Type() token.Type

type ContinueExpression

type ContinueExpression struct {
	Token token.Token
}

func (ContinueExpression) String

func (c ContinueExpression) String() string

func (ContinueExpression) TokenLiteral

func (c ContinueExpression) TokenLiteral() string

func (ContinueExpression) Type

func (c ContinueExpression) Type() token.Type

type Expression

type Expression interface {
	Node
	// contains filtered or unexported methods
}

type ExpressionStatement

type ExpressionStatement struct {
	Token      token.Token
	Expression Expression
}

func (*ExpressionStatement) String

func (es *ExpressionStatement) String() string

func (*ExpressionStatement) TokenLiteral

func (es *ExpressionStatement) TokenLiteral() string

func (*ExpressionStatement) Type

func (es *ExpressionStatement) Type() token.Type

type FloatLiteral

type FloatLiteral struct {
	Token token.Token
	Value float64
}

func (*FloatLiteral) String

func (il *FloatLiteral) String() string

func (*FloatLiteral) TokenLiteral

func (il *FloatLiteral) TokenLiteral() string

func (*FloatLiteral) Type

func (il *FloatLiteral) Type() token.Type

type FunctionLiteral

type FunctionLiteral struct {
	Token      token.Token // The 'fn' token
	Parameters []*Identifier
	Body       *BlockStatement
}

func (*FunctionLiteral) String

func (fl *FunctionLiteral) String() string

func (*FunctionLiteral) TokenLiteral

func (fl *FunctionLiteral) TokenLiteral() string

func (*FunctionLiteral) Type

func (fl *FunctionLiteral) Type() token.Type

type HashLiteral

type HashLiteral struct {
	Token token.Token
	Pairs map[Expression]Expression
}

func (*HashLiteral) String

func (h *HashLiteral) String() string

func (*HashLiteral) TokenLiteral

func (h *HashLiteral) TokenLiteral() string

func (*HashLiteral) Type

func (h *HashLiteral) Type() token.Type

type Identifier

type Identifier struct {
	Token token.Token
	Value string
}

func (*Identifier) String

func (id *Identifier) String() string

func (*Identifier) TokenLiteral

func (id *Identifier) TokenLiteral() string

func (*Identifier) Type

func (id *Identifier) Type() token.Type

type IndexExpression

type IndexExpression struct {
	Token token.Token
	Left  Expression
	Index Expression
}

func (*IndexExpression) String

func (ie *IndexExpression) String() string

func (*IndexExpression) TokenLiteral

func (ie *IndexExpression) TokenLiteral() string

func (*IndexExpression) Type

func (ie *IndexExpression) Type() token.Type

type InfixExpression

type InfixExpression struct {
	Token    token.Token // The operator token, e.g. +
	Left     Expression
	Operator string
	Right    Expression
}

func (*InfixExpression) String

func (ie *InfixExpression) String() string

func (*InfixExpression) TokenLiteral

func (ie *InfixExpression) TokenLiteral() string

func (*InfixExpression) Type

func (ie *InfixExpression) Type() token.Type

type JikaExpression

type JikaExpression struct {
	Token       token.Token // The 'jika' token
	Condition   Expression
	Consequence *BlockStatement
	Alternative *BlockStatement
}

func (*JikaExpression) String

func (je *JikaExpression) String() string

func (*JikaExpression) TokenLiteral

func (je *JikaExpression) TokenLiteral() string

func (*JikaExpression) Type

func (je *JikaExpression) Type() token.Type

type KonstStatement

type KonstStatement struct {
	Token token.Token
	Name  *Identifier
	Value Expression
}

func (*KonstStatement) String

func (ks *KonstStatement) String() string

func (*KonstStatement) TokenLiteral

func (ks *KonstStatement) TokenLiteral() string

func (*KonstStatement) Type

func (ks *KonstStatement) Type() token.Type

type LoopLiteral

type LoopLiteral struct {
	Token token.Token
	KV    []*Identifier
	Iter  *Identifier
	Body  *BlockStatement
}

func (LoopLiteral) String

func (l LoopLiteral) String() string

func (LoopLiteral) TokenLiteral

func (l LoopLiteral) TokenLiteral() string

func (LoopLiteral) Type

func (l LoopLiteral) Type() token.Type

type MethodCallExpression

type MethodCallExpression struct {
	Token  token.Token
	Object Expression
	Call   Expression
}

func (*MethodCallExpression) String

func (mc *MethodCallExpression) String() string

func (*MethodCallExpression) TokenLiteral

func (mc *MethodCallExpression) TokenLiteral() string

func (*MethodCallExpression) Type

func (mc *MethodCallExpression) Type() token.Type

type NihilLiteral

type NihilLiteral struct {
	Token token.Token
}

func (*NihilLiteral) String

func (n *NihilLiteral) String() string

func (*NihilLiteral) TokenLiteral

func (n *NihilLiteral) TokenLiteral() string

func (*NihilLiteral) Type

func (n *NihilLiteral) Type() token.Type

type Node

type Node interface {
	TokenLiteral() string
	String() string
	Type() token.Type
}

type PilahExpression

type PilahExpression struct {
	Token      token.Token
	Target     *ExpressionStatement
	Conditions []*ExpressionStatement
	Values     []Expression
}

func (*PilahExpression) String

func (pl *PilahExpression) String() string

func (*PilahExpression) TokenLiteral

func (pl *PilahExpression) TokenLiteral() string

func (*PilahExpression) Type

func (pl *PilahExpression) Type() token.Type

type PilihStatement

type PilihStatement struct {
	Token       token.Token
	ReturnValue Expression
}

func (*PilihStatement) String

func (ps *PilihStatement) String() string

func (*PilihStatement) TokenLiteral

func (ps *PilihStatement) TokenLiteral() string

func (*PilihStatement) Type

func (ps *PilihStatement) Type() token.Type

type Pipe

type Pipe struct {
	Token token.Token
	Left  Expression
	Right Expression
}

func (*Pipe) String

func (p *Pipe) String() string

func (*Pipe) TokenLiteral

func (p *Pipe) TokenLiteral() string

func (*Pipe) Type

func (p *Pipe) Type() token.Type

type PrefixExpression

type PrefixExpression struct {
	Token    token.Token // The prefix token, e.g. !
	Operator string
	Right    Expression
}

func (*PrefixExpression) String

func (pe *PrefixExpression) String() string

func (*PrefixExpression) TokenLiteral

func (pe *PrefixExpression) TokenLiteral() string

func (*PrefixExpression) Type

func (pe *PrefixExpression) Type() token.Type

type Program

type Program struct {
	Statements []Statement
}

func (*Program) String

func (p *Program) String() string

func (*Program) TokenLiteral

func (p *Program) TokenLiteral() string

func (*Program) Type

func (p *Program) Type() token.Type

type RegExLiteral

type RegExLiteral struct {
	Token token.Token
	Value string
}

func (*RegExLiteral) String

func (rel *RegExLiteral) String() string

func (*RegExLiteral) TokenLiteral

func (rel *RegExLiteral) TokenLiteral() string

func (*RegExLiteral) Type

func (rel *RegExLiteral) Type() token.Type

type Statement

type Statement interface {
	Node
	// contains filtered or unexported methods
}

type StringLiteral

type StringLiteral struct {
	Token token.Token
	Value string
}

func (*StringLiteral) String

func (sl *StringLiteral) String() string

func (*StringLiteral) TokenLiteral

func (sl *StringLiteral) TokenLiteral() string

func (*StringLiteral) Type

func (sl *StringLiteral) Type() token.Type

type VarStatement

type VarStatement struct {
	Token token.Token
	Name  *Identifier
	Value Expression
}

func (*VarStatement) String

func (vs *VarStatement) String() string

func (*VarStatement) TokenLiteral

func (vs *VarStatement) TokenLiteral() string

func (*VarStatement) Type

func (vs *VarStatement) Type() token.Type

type Wildcard

type Wildcard struct {
	Token token.Token
}

func (*Wildcard) String

func (w *Wildcard) String() string

func (*Wildcard) TokenLiteral

func (w *Wildcard) TokenLiteral() string

func (*Wildcard) Type

func (w *Wildcard) Type() token.Type

Jump to

Keyboard shortcuts

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