ast

package
v0.0.0-...-9edbcb8 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessExpression

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

func (*AccessExpression) String

func (fe *AccessExpression) String() string

func (*AccessExpression) TokenLiteral

func (fe *AccessExpression) TokenLiteral() string

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

type AssignStatement

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

func (*AssignStatement) String

func (as *AssignStatement) String() string

func (*AssignStatement) TokenLiteral

func (as *AssignStatement) TokenLiteral() string

type BlockStatement

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

func (*BlockStatement) String

func (bs *BlockStatement) String() string

func (*BlockStatement) TokenLiteral

func (bs *BlockStatement) TokenLiteral() string

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

type BreakStatement

type BreakStatement struct {
	Token token.Token
}

func (*BreakStatement) String

func (bs *BreakStatement) String() string

func (*BreakStatement) TokenLiteral

func (bs *BreakStatement) TokenLiteral() string

type CallExpression

type CallExpression struct {
	Token     token.Token // '('
	Function  Expression  // identifier or function literal
	Arguments []Expression
}

func (*CallExpression) String

func (ce *CallExpression) String() string

func (*CallExpression) TokenLiteral

func (ce *CallExpression) TokenLiteral() string

type DoWhileExpression

type DoWhileExpression struct {
	Token     token.Token
	Condition Expression
	Block     *BlockStatement
}

func (*DoWhileExpression) String

func (we *DoWhileExpression) String() string

func (*DoWhileExpression) TokenLiteral

func (we *DoWhileExpression) TokenLiteral() string

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

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

type FunctionLiteral

type FunctionLiteral struct {
	Token      token.Token
	Parameters []*Identifier
	Body       *BlockStatement
	Name       string
}

func (*FunctionLiteral) String

func (fl *FunctionLiteral) String() string

func (*FunctionLiteral) TokenLiteral

func (fl *FunctionLiteral) TokenLiteral() string

type FunctionStatement

type FunctionStatement struct {
	Token      token.Token
	Name       *Identifier
	Parameters []*Identifier
	Body       *BlockStatement
}

func (*FunctionStatement) String

func (fs *FunctionStatement) String() string

func (*FunctionStatement) TokenLiteral

func (fs *FunctionStatement) TokenLiteral() string

type HashMapLiteral

type HashMapLiteral struct {
	Token token.Token // '{'
	Pairs map[Expression]Expression
}

func (*HashMapLiteral) String

func (hl *HashMapLiteral) String() string

func (*HashMapLiteral) TokenLiteral

func (hl *HashMapLiteral) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Token
	Value string
}

func (*Identifier) String

func (i *Identifier) String() string

func (*Identifier) TokenLiteral

func (i *Identifier) TokenLiteral() string

type IfExpression

type IfExpression struct {
	Token       token.Token
	Condition   []Expression
	Consequence []*BlockStatement
	Alternative *BlockStatement
}

func (*IfExpression) String

func (ie *IfExpression) String() string

func (*IfExpression) TokenLiteral

func (ie *IfExpression) TokenLiteral() string

type ImmediateIfExpression

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

func (*ImmediateIfExpression) String

func (iif *ImmediateIfExpression) String() string

func (*ImmediateIfExpression) TokenLiteral

func (iif *ImmediateIfExpression) TokenLiteral() string

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

type InfixExpression

type InfixExpression struct {
	Token    token.Token
	Left     Expression
	Operator string
	Right    Expression
}

func (*InfixExpression) String

func (ie *InfixExpression) String() string

func (*InfixExpression) TokenLiteral

func (ie *InfixExpression) TokenLiteral() string

type IntegerLiteral

type IntegerLiteral struct {
	Token token.Token
	Value int64
}

func (*IntegerLiteral) String

func (il *IntegerLiteral) String() string

func (*IntegerLiteral) TokenLiteral

func (il *IntegerLiteral) TokenLiteral() string

type Node

type Node interface {
	TokenLiteral() string
	String() string
}

type OperAssignStatement

type OperAssignStatement struct {
	Token    token.Token
	Name     *Identifier
	Operator string
	Value    Expression
}

func (*OperAssignStatement) String

func (oa *OperAssignStatement) String() string

func (*OperAssignStatement) TokenLiteral

func (oa *OperAssignStatement) TokenLiteral() string

type PrefixExpression

type PrefixExpression struct {
	Token    token.Token
	Operator string
	Right    Expression
}

func (*PrefixExpression) String

func (pe *PrefixExpression) String() string

func (*PrefixExpression) TokenLiteral

func (pe *PrefixExpression) TokenLiteral() string

type Program

type Program struct {
	Statements []Statement
}

func (*Program) String

func (p *Program) String() string

func (*Program) TokenLiteral

func (p *Program) TokenLiteral() string

type ReturnStatement

type ReturnStatement struct {
	Token       token.Token
	ReturnValue Expression
}

func (*ReturnStatement) String

func (rs *ReturnStatement) String() string

func (*ReturnStatement) TokenLiteral

func (rs *ReturnStatement) TokenLiteral() string

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

type TypeDeclare

type TypeDeclare struct {
	Package *Identifier
	Name    *Identifier
}

func (*TypeDeclare) String

func (td *TypeDeclare) String() string

func (*TypeDeclare) TokenLiteral

func (td *TypeDeclare) TokenLiteral() string

type VarStatement

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

func (*VarStatement) String

func (ls *VarStatement) String() string

func (*VarStatement) TokenLiteral

func (ls *VarStatement) TokenLiteral() string

type WhileExpression

type WhileExpression struct {
	Token     token.Token
	Condition Expression
	Block     *BlockStatement
}

func (*WhileExpression) String

func (we *WhileExpression) String() string

func (*WhileExpression) TokenLiteral

func (we *WhileExpression) TokenLiteral() string

Jump to

Keyboard shortcuts

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