ast

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayExpression

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

func (*ArrayExpression) String

func (ae *ArrayExpression) String() string

func (*ArrayExpression) TokenLiteral

func (ae *ArrayExpression) 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 BooleanExpression

type BooleanExpression struct {
	Token token.Token
	Value bool
}

func (*BooleanExpression) String

func (b *BooleanExpression) String() string

func (*BooleanExpression) TokenLiteral

func (b *BooleanExpression) TokenLiteral() string

type CallExpression

type CallExpression struct {
	Receiver       Expression
	Token          token.Token
	Method         string
	Arguments      []Expression
	Block          *BlockStatement
	BlockArguments []*Identifier
}

func (*CallExpression) String

func (ce *CallExpression) String() string

func (*CallExpression) TokenLiteral

func (ce *CallExpression) TokenLiteral() string

type ClassStatement

type ClassStatement struct {
	Token          token.Token
	Name           *Constant
	Body           *BlockStatement
	SuperClass     Expression
	SuperClassName string
}

func (*ClassStatement) String

func (cs *ClassStatement) String() string

func (*ClassStatement) TokenLiteral

func (cs *ClassStatement) TokenLiteral() string

type Constant

type Constant struct {
	Token token.Token
	Value string
}

func (*Constant) ReturnValue

func (c *Constant) ReturnValue() string

func (*Constant) String

func (c *Constant) String() string

func (*Constant) TokenLiteral

func (c *Constant) TokenLiteral() string

type DefStatement

type DefStatement struct {
	Token          token.Token
	Name           *Identifier
	Receiver       Expression
	Parameters     []*Identifier
	BlockStatement *BlockStatement
}

func (*DefStatement) String

func (ds *DefStatement) String() string

func (*DefStatement) TokenLiteral

func (ds *DefStatement) TokenLiteral() string

type Expression

type Expression interface {
	// 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 HashExpression

type HashExpression struct {
	Token token.Token
	Data  map[string]Expression
}

func (*HashExpression) String

func (he *HashExpression) String() string

func (*HashExpression) TokenLiteral

func (he *HashExpression) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Token
	Value string
}

func (*Identifier) ReturnValue

func (i *Identifier) ReturnValue() 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 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 InstanceVariable

type InstanceVariable struct {
	Token token.Token
	Value string
}

func (*InstanceVariable) ReturnValue

func (iv *InstanceVariable) ReturnValue() string

func (*InstanceVariable) String

func (iv *InstanceVariable) String() string

func (*InstanceVariable) TokenLiteral

func (iv *InstanceVariable) TokenLiteral() string

type IntegerLiteral

type IntegerLiteral struct {
	Token token.Token
	Value int
}

func (*IntegerLiteral) String

func (il *IntegerLiteral) String() string

func (*IntegerLiteral) TokenLiteral

func (il *IntegerLiteral) TokenLiteral() string

type ModuleStatement

type ModuleStatement struct {
	Token      token.Token
	Name       *Constant
	Body       *BlockStatement
	SuperClass *Constant
}

ModuleStatement represents module node in AST

func (*ModuleStatement) String

func (ms *ModuleStatement) String() string

func (*ModuleStatement) TokenLiteral

func (ms *ModuleStatement) TokenLiteral() string

TokenLiteral returns token's literal

type NextStatement added in v0.0.8

type NextStatement struct {
	Token token.Token
}

NextStatement represents "next" keyword

func (*NextStatement) String added in v0.0.8

func (ns *NextStatement) String() string

func (*NextStatement) TokenLiteral added in v0.0.8

func (ns *NextStatement) TokenLiteral() string

TokenLiteral returns token's literal

type NilExpression

type NilExpression struct {
	Token token.Token
}

NilExpression represents nil node

func (*NilExpression) String

func (n *NilExpression) String() string

String returns `nil`

func (*NilExpression) TokenLiteral

func (n *NilExpression) TokenLiteral() string

TokenLiteral returns `nil`

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
}

Program is the root node of entire AST

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 SelfExpression

type SelfExpression struct {
	Token token.Token
}

func (*SelfExpression) String

func (se *SelfExpression) String() string

func (*SelfExpression) TokenLiteral

func (se *SelfExpression) TokenLiteral() string

type Statement

type Statement interface {
	// 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 WhileStatement

type WhileStatement struct {
	Token     token.Token
	Condition Expression
	Body      *BlockStatement
}

func (*WhileStatement) String

func (ws *WhileStatement) String() string

func (*WhileStatement) TokenLiteral

func (ws *WhileStatement) TokenLiteral() string

type YieldExpression

type YieldExpression struct {
	Token     token.Token
	Arguments []Expression
}

func (*YieldExpression) String

func (ye *YieldExpression) String() string

func (*YieldExpression) TokenLiteral

func (ye *YieldExpression) TokenLiteral() string

Jump to

Keyboard shortcuts

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