Documentation
¶
Index ¶
- type CharLiteral
- type Expression
- type ExpressionStatement
- type FloatLiteral
- type Function
- func (f *Function) GetSymbol(name string) *Symbol
- func (f *Function) GetVariableCounts() (integerCount, floatCount int)
- func (f *Function) SetSymbol(name string, t ValueType, constant bool) *Symbol
- func (f *Function) String() string
- func (f *Function) TokenLiteral() string
- func (f *Function) ValueType() ValueType
- type Identifier
- type InfixExpression
- type IntegerLiteral
- type Node
- type PrefixExpression
- type Program
- type ReturnStatement
- type Statement
- type Symbol
- type ValueType
- type VariableDefineStatement
- type VariableUpdateStatement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CharLiteral ¶
func (*CharLiteral) String ¶
func (cl *CharLiteral) String() string
func (*CharLiteral) TokenLiteral ¶
func (cl *CharLiteral) TokenLiteral() string
func (*CharLiteral) ValueType ¶
func (fl *CharLiteral) ValueType() ValueType
type Expression ¶
type Expression interface {
Node
// contains filtered or unexported methods
}
type ExpressionStatement ¶
type ExpressionStatement struct {
Token lexer.Token
Expression Expression
}
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
func (*ExpressionStatement) ValueType ¶
func (es *ExpressionStatement) ValueType() ValueType
type FloatLiteral ¶
func (*FloatLiteral) String ¶
func (fl *FloatLiteral) String() string
func (*FloatLiteral) TokenLiteral ¶
func (fl *FloatLiteral) TokenLiteral() string
func (*FloatLiteral) ValueType ¶
func (fl *FloatLiteral) ValueType() ValueType
type Function ¶
type Function struct {
Name string
ReturnType ValueType
Statements []Statement
SymbolIndex map[string]int
Symbols []*Symbol
NextSymbolIndex int
}
func NewFunction ¶
func (*Function) GetVariableCounts ¶
func (*Function) TokenLiteral ¶
type Identifier ¶
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
func (*Identifier) ValueType ¶
func (i *Identifier) ValueType() ValueType
type InfixExpression ¶
type InfixExpression struct {
Token lexer.Token
Left Expression
Operator string
Right Expression
}
func (*InfixExpression) String ¶
func (ie *InfixExpression) String() string
func (*InfixExpression) TokenLiteral ¶
func (ie *InfixExpression) TokenLiteral() string
func (*InfixExpression) ValueType ¶
func (ie *InfixExpression) ValueType() ValueType
type IntegerLiteral ¶
func (*IntegerLiteral) String ¶
func (il *IntegerLiteral) String() string
func (*IntegerLiteral) TokenLiteral ¶
func (il *IntegerLiteral) TokenLiteral() string
func (*IntegerLiteral) ValueType ¶
func (il *IntegerLiteral) ValueType() ValueType
type PrefixExpression ¶
type PrefixExpression struct {
Token lexer.Token
Operator string
Right Expression
}
func (*PrefixExpression) String ¶
func (pe *PrefixExpression) String() string
func (*PrefixExpression) TokenLiteral ¶
func (pe *PrefixExpression) TokenLiteral() string
func (*PrefixExpression) ValueType ¶
func (pe *PrefixExpression) ValueType() ValueType
type Program ¶
func (*Program) TokenLiteral ¶
type ReturnStatement ¶
type ReturnStatement struct {
Token lexer.Token
ReturnValue Expression
}
func (*ReturnStatement) String ¶
func (rs *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (rs *ReturnStatement) TokenLiteral() string
func (*ReturnStatement) ValueType ¶
func (rs *ReturnStatement) ValueType() ValueType
type VariableDefineStatement ¶
type VariableDefineStatement struct {
Token lexer.Token
Name *Identifier
Value Expression
Type ValueType
}
func (*VariableDefineStatement) String ¶
func (vds *VariableDefineStatement) String() string
func (*VariableDefineStatement) TokenLiteral ¶
func (vds *VariableDefineStatement) TokenLiteral() string
func (*VariableDefineStatement) ValueType ¶
func (vds *VariableDefineStatement) ValueType() ValueType
type VariableUpdateStatement ¶
type VariableUpdateStatement struct {
Name *Identifier
Token lexer.Token
NewValue Expression
Operation string
}
func (*VariableUpdateStatement) String ¶
func (vus *VariableUpdateStatement) String() string
func (*VariableUpdateStatement) TokenLiteral ¶
func (vus *VariableUpdateStatement) TokenLiteral() string
func (*VariableUpdateStatement) ValueType ¶
func (vus *VariableUpdateStatement) ValueType() ValueType
Click to show internal directories.
Click to hide internal directories.