Documentation
¶
Overview ¶
Package ast implements functions to abstract syntax tree.
Index ¶
- type Array
- type As
- type Assign
- type BlockStatement
- type Boolean
- type Break
- type Continue
- type Dictionary
- type Expression
- type ExpressionList
- type ExpressionStatement
- type Float
- type Function
- type FunctionCall
- type FunctionParameter
- type Identifier
- type IdentifierList
- type If
- type InfixExpression
- type Integer
- type Is
- type Match
- type MatchWhen
- type Module
- type ModuleAccess
- type Nil
- type Node
- type Pipe
- type PlaceHolder
- type PrefixExpression
- type Program
- type Repeat
- type Return
- type Statement
- type String
- type Subscript
- type Symbol
- type Use
- type Val
- type Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Token token.Token
List *ExpressionList
}
func (*Array) Expression ¶
func (a *Array) Expression()
func (*Array) TokenLiteral ¶
func (*Array) TokenPosition ¶
type As ¶
type As struct {
Token token.Token
Left Expression
Right *Identifier
}
func (*As) Expression ¶
func (a *As) Expression()
func (*As) TokenLiteral ¶
func (*As) TokenPosition ¶
type Assign ¶
type Assign struct {
Token token.Token
Operator string
Name Expression
Right Expression
}
func (*Assign) Expression ¶
func (a *Assign) Expression()
func (*Assign) TokenLiteral ¶
func (*Assign) TokenPosition ¶
type BlockStatement ¶
func (*BlockStatement) Check ¶
func (a *BlockStatement) Check() string
func (*BlockStatement) Statement ¶
func (a *BlockStatement) Statement()
func (*BlockStatement) TokenLiteral ¶
func (a *BlockStatement) TokenLiteral() string
func (*BlockStatement) TokenPosition ¶
func (a *BlockStatement) TokenPosition() token.Position
type Boolean ¶
func (*Boolean) Expression ¶
func (a *Boolean) Expression()
func (*Boolean) TokenLiteral ¶
func (*Boolean) TokenPosition ¶
type Dictionary ¶
type Dictionary struct {
Token token.Token
Pairs map[Expression]Expression
}
func (*Dictionary) Check ¶
func (a *Dictionary) Check() string
func (*Dictionary) Expression ¶
func (a *Dictionary) Expression()
func (*Dictionary) TokenLiteral ¶
func (a *Dictionary) TokenLiteral() string
func (*Dictionary) TokenPosition ¶
func (a *Dictionary) TokenPosition() token.Position
type Expression ¶
type Expression interface {
Node
Expression()
}
type ExpressionList ¶
type ExpressionList struct {
Token token.Token
Elements []Expression
}
func (*ExpressionList) Check ¶
func (a *ExpressionList) Check() string
func (*ExpressionList) Expression ¶
func (a *ExpressionList) Expression()
func (*ExpressionList) TokenLiteral ¶
func (a *ExpressionList) TokenLiteral() string
func (*ExpressionList) TokenPosition ¶
func (a *ExpressionList) TokenPosition() token.Position
type ExpressionStatement ¶
type ExpressionStatement struct {
Token token.Token
Expression Expression
}
func (*ExpressionStatement) Check ¶
func (a *ExpressionStatement) Check() string
func (*ExpressionStatement) Statement ¶
func (a *ExpressionStatement) Statement()
func (*ExpressionStatement) TokenLiteral ¶
func (a *ExpressionStatement) TokenLiteral() string
func (*ExpressionStatement) TokenPosition ¶
func (a *ExpressionStatement) TokenPosition() token.Position
type Float ¶
func (*Float) Expression ¶
func (a *Float) Expression()
func (*Float) TokenLiteral ¶
func (*Float) TokenPosition ¶
type Function ¶
type Function struct {
Token token.Token
Parameters []*FunctionParameter
Body *BlockStatement
ReturnType *Identifier
Variadic bool
}
func (*Function) Expression ¶
func (a *Function) Expression()
func (*Function) TokenLiteral ¶
func (*Function) TokenPosition ¶
type FunctionCall ¶
type FunctionCall struct {
Token token.Token
Function Expression
Arguments *ExpressionList
}
func (*FunctionCall) Check ¶
func (a *FunctionCall) Check() string
func (*FunctionCall) Expression ¶
func (a *FunctionCall) Expression()
func (*FunctionCall) TokenLiteral ¶
func (a *FunctionCall) TokenLiteral() string
func (*FunctionCall) TokenPosition ¶
func (a *FunctionCall) TokenPosition() token.Position
type FunctionParameter ¶
type FunctionParameter struct {
Token token.Token
Name *Identifier
Type *Identifier
Default Expression
}
func (*FunctionParameter) Check ¶
func (a *FunctionParameter) Check() string
func (*FunctionParameter) Expression ¶
func (a *FunctionParameter) Expression()
func (*FunctionParameter) TokenLiteral ¶
func (a *FunctionParameter) TokenLiteral() string
func (*FunctionParameter) TokenPosition ¶
func (a *FunctionParameter) TokenPosition() token.Position
type Identifier ¶
func (*Identifier) Check ¶
func (a *Identifier) Check() string
func (*Identifier) Expression ¶
func (a *Identifier) Expression()
func (*Identifier) TokenLiteral ¶
func (a *Identifier) TokenLiteral() string
func (*Identifier) TokenPosition ¶
func (a *Identifier) TokenPosition() token.Position
type IdentifierList ¶
type IdentifierList struct {
Token token.Token
Elements []*Identifier
}
func (*IdentifierList) Check ¶
func (a *IdentifierList) Check() string
func (*IdentifierList) Statement ¶
func (a *IdentifierList) Statement()
func (*IdentifierList) TokenLiteral ¶
func (a *IdentifierList) TokenLiteral() string
func (*IdentifierList) TokenPosition ¶
func (a *IdentifierList) TokenPosition() token.Position
type If ¶
type If struct {
Token token.Token
Condition Expression
Then *BlockStatement
Else *BlockStatement
}
func (*If) Expression ¶
func (a *If) Expression()
func (*If) TokenLiteral ¶
func (*If) TokenPosition ¶
type InfixExpression ¶
type InfixExpression struct {
Token token.Token
Left Expression
Operator string
Right Expression
}
func (*InfixExpression) Check ¶
func (a *InfixExpression) Check() string
func (*InfixExpression) Expression ¶
func (a *InfixExpression) Expression()
func (*InfixExpression) TokenLiteral ¶
func (a *InfixExpression) TokenLiteral() string
func (*InfixExpression) TokenPosition ¶
func (a *InfixExpression) TokenPosition() token.Position
type Integer ¶
func (*Integer) Expression ¶
func (a *Integer) Expression()
func (*Integer) TokenLiteral ¶
func (*Integer) TokenPosition ¶
type Is ¶
type Is struct {
Token token.Token
Left Expression
Right *Identifier
}
func (*Is) Expression ¶
func (a *Is) Expression()
func (*Is) TokenLiteral ¶
func (*Is) TokenPosition ¶
type Match ¶
type Match struct {
Token token.Token
Control Expression
Whens []*MatchWhen
Else *BlockStatement
}
func (*Match) Expression ¶
func (a *Match) Expression()
func (*Match) TokenLiteral ¶
func (*Match) TokenPosition ¶
type MatchWhen ¶
type MatchWhen struct {
Token token.Token
Values *ExpressionList
Body *BlockStatement
}
func (*MatchWhen) Expression ¶
func (a *MatchWhen) Expression()
func (*MatchWhen) TokenLiteral ¶
func (*MatchWhen) TokenPosition ¶
type Module ¶
type Module struct {
Token token.Token
Name *Identifier
Body *BlockStatement
}
func (*Module) Expression ¶
func (a *Module) Expression()
func (*Module) TokenLiteral ¶
func (*Module) TokenPosition ¶
type ModuleAccess ¶
type ModuleAccess struct {
Token token.Token
Object *Identifier
Parameter *Identifier
}
func (*ModuleAccess) Check ¶
func (a *ModuleAccess) Check() string
func (*ModuleAccess) Expression ¶
func (a *ModuleAccess) Expression()
func (*ModuleAccess) TokenLiteral ¶
func (a *ModuleAccess) TokenLiteral() string
func (*ModuleAccess) TokenPosition ¶
func (a *ModuleAccess) TokenPosition() token.Position
type Nil ¶
func (*Nil) Expression ¶
func (a *Nil) Expression()
func (*Nil) TokenLiteral ¶
func (*Nil) TokenPosition ¶
type Pipe ¶
type Pipe struct {
Token token.Token
Left Expression
Right Expression
}
func (*Pipe) Expression ¶
func (a *Pipe) Expression()
func (*Pipe) TokenLiteral ¶
func (*Pipe) TokenPosition ¶
type PlaceHolder ¶
func (*PlaceHolder) Check ¶
func (a *PlaceHolder) Check() string
func (*PlaceHolder) Expression ¶
func (a *PlaceHolder) Expression()
func (*PlaceHolder) TokenLiteral ¶
func (a *PlaceHolder) TokenLiteral() string
func (*PlaceHolder) TokenPosition ¶
func (a *PlaceHolder) TokenPosition() token.Position
type PrefixExpression ¶
type PrefixExpression struct {
Token token.Token
Operator string
Right Expression
}
func (*PrefixExpression) Check ¶
func (a *PrefixExpression) Check() string
func (*PrefixExpression) Expression ¶
func (a *PrefixExpression) Expression()
func (*PrefixExpression) TokenLiteral ¶
func (a *PrefixExpression) TokenLiteral() string
func (*PrefixExpression) TokenPosition ¶
func (a *PrefixExpression) TokenPosition() token.Position
type Program ¶
type Program struct {
Statements []Statement
}
func (*Program) TokenLiteral ¶
func (*Program) TokenPosition ¶
type Repeat ¶
type Repeat struct {
Token token.Token
Arguments *IdentifierList
Enumerable Expression
Body *BlockStatement
}
func (*Repeat) Expression ¶
func (a *Repeat) Expression()
func (*Repeat) TokenLiteral ¶
func (*Repeat) TokenPosition ¶
type Return ¶
type Return struct {
Token token.Token
Value Expression
}
func (*Return) TokenLiteral ¶
func (*Return) TokenPosition ¶
type String ¶
type String struct {
Token token.Token
Value string
Interpolated map[string]Expression
}
func (*String) Expression ¶
func (a *String) Expression()
func (*String) TokenLiteral ¶
func (*String) TokenPosition ¶
type Subscript ¶
type Subscript struct {
Token token.Token
Left Expression
Index Expression
}
func (*Subscript) Expression ¶
func (a *Subscript) Expression()
func (*Subscript) TokenLiteral ¶
func (*Subscript) TokenPosition ¶
type Symbol ¶
func (*Symbol) Expression ¶
func (a *Symbol) Expression()
func (*Symbol) TokenLiteral ¶
func (*Symbol) TokenPosition ¶
type Use ¶
func (*Use) Expression ¶
func (a *Use) Expression()
func (*Use) TokenLiteral ¶
func (*Use) TokenPosition ¶
type Val ¶
type Val struct {
Token token.Token
Name *Identifier
Value Expression
}
func (*Val) Expression ¶
func (a *Val) Expression()
func (*Val) TokenLiteral ¶
func (*Val) TokenPosition ¶
type Var ¶
type Var struct {
Token token.Token
Name *Identifier
Value Expression
}
func (*Var) Expression ¶
func (a *Var) Expression()
func (*Var) TokenLiteral ¶
func (*Var) TokenPosition ¶
Click to show internal directories.
Click to hide internal directories.