Documentation
¶
Index ¶
- type ArrayExpression
- type BlockStatement
- type BooleanExpression
- type CallExpression
- type ClassStatement
- type Constant
- type DefStatement
- type Expression
- type ExpressionStatement
- type HashExpression
- type Identifier
- type IfExpression
- type InfixExpression
- type InstanceVariable
- type IntegerLiteral
- type ModuleStatement
- type NilExpression
- type PrefixExpression
- type Program
- type ReturnStatement
- type SelfExpression
- type Statement
- type StringLiteral
- type WhileStatement
- type YieldExpression
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 ¶
func (*BlockStatement) String ¶
func (bs *BlockStatement) String() string
func (*BlockStatement) TokenLiteral ¶
func (bs *BlockStatement) TokenLiteral() string
type BooleanExpression ¶
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 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 ¶
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 ¶
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 ¶
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 NilExpression ¶
NilExpression represents nil node
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) TokenLiteral ¶
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 ¶
func (*SelfExpression) String ¶
func (se *SelfExpression) String() string
func (*SelfExpression) TokenLiteral ¶
func (se *SelfExpression) TokenLiteral() string
type StringLiteral ¶
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
Click to show internal directories.
Click to hide internal directories.