Documentation ¶
Index ¶
- Constants
- type ArrayExpression
- type AssignmentExpression
- type BinaryExpression
- type BlockStatement
- type BreakStatement
- type CallExpression
- type ClassStatement
- type ContinueStatement
- type Expression
- type ExpressionStatement
- type ExpressionVisitor
- type ForEachStatement
- type FunctionStatement
- type GetExpression
- type GroupingExpression
- type IfStatement
- type IndexExpression
- type IndexedAssignmentExpression
- type LambdaExpression
- type LiteralExpression
- type LogicalExpression
- type LoopStatement
- type MapExpression
- type MethodType
- type ReturnStatement
- type SequenceExpression
- type SetExpression
- type Statement
- type StatementVisitor
- type SuperGetExpression
- type SuperSetExpression
- type TernaryExpression
- type ThisExpression
- type UnaryExpression
- type VarStatement
- type VariableExpression
Constants ¶
View Source
const ( NOT_METHOD = iota NORMAL_METHOD STATIC_METHOD GETTER_METHOD SETTER_METHOD )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayExpression ¶
type ArrayExpression struct {
Items []Expression
}
func (*ArrayExpression) Accept ¶
func (e *ArrayExpression) Accept(v ExpressionVisitor) any
type AssignmentExpression ¶
type AssignmentExpression struct { Name *token.Token Value Expression }
func (*AssignmentExpression) Accept ¶
func (e *AssignmentExpression) Accept(v ExpressionVisitor) any
type BinaryExpression ¶
type BinaryExpression struct {
Left, Right Expression
Operator *token.Token
}
func (*BinaryExpression) Accept ¶
func (b *BinaryExpression) Accept(v ExpressionVisitor) any
type BlockStatement ¶
type BlockStatement struct {
Statements []Statement
}
func (*BlockStatement) Accept ¶
func (s *BlockStatement) Accept(v StatementVisitor)
type BreakStatement ¶
func (*BreakStatement) Accept ¶
func (s *BreakStatement) Accept(v StatementVisitor)
type CallExpression ¶
type CallExpression struct { Callee Expression Arguments []Expression ClosingParen *token.Token }
func (*CallExpression) Accept ¶
func (e *CallExpression) Accept(v ExpressionVisitor) any
type ClassStatement ¶
type ClassStatement struct { Name *token.Token Methods []*FunctionStatement Superclass *VariableExpression }
func (*ClassStatement) Accept ¶
func (s *ClassStatement) Accept(v StatementVisitor)
type ContinueStatement ¶
func (*ContinueStatement) Accept ¶
func (s *ContinueStatement) Accept(v StatementVisitor)
type Expression ¶
type Expression interface {
Accept(ExpressionVisitor) any
}
type ExpressionStatement ¶
type ExpressionStatement struct {
Expr Expression
}
func (*ExpressionStatement) Accept ¶
func (s *ExpressionStatement) Accept(v StatementVisitor)
type ExpressionVisitor ¶
type ExpressionVisitor interface { VisitBinaryExpression(*BinaryExpression) any VisitTernaryExpression(*TernaryExpression) any VisitLogicalExpression(*LogicalExpression) any VisitGroupedExpression(*GroupingExpression) any VisitUnaryExpression(*UnaryExpression) any VisitLiteralExpression(*LiteralExpression) any VisitVariableExpression(*VariableExpression) any VisitAssignmentExpression(*AssignmentExpression) any VisitCallExpression(*CallExpression) any VisitLambdaExpression(*LambdaExpression) any VisitSequenceExpression(*SequenceExpression) any VisitArrayExpression(*ArrayExpression) any VisitMapExpression(*MapExpression) any VisitIndexExpression(*IndexExpression) any VisitIndexedAssignmentExpression(*IndexedAssignmentExpression) any VisitGetExpression(*GetExpression) any VisitSetExpression(*SetExpression) any VisitThisExpression(*ThisExpression) any VisitSuperGetExpression(*SuperGetExpression) any VisitSuperSetExpression(*SuperSetExpression) any }
type ForEachStatement ¶
type ForEachStatement struct { VariableName *token.Token Array Expression Body Statement }
func (*ForEachStatement) Accept ¶
func (s *ForEachStatement) Accept(v StatementVisitor)
type FunctionStatement ¶
type FunctionStatement struct { Name *token.Token Params []*token.Token Body []Statement Kind MethodType }
func (*FunctionStatement) Accept ¶
func (s *FunctionStatement) Accept(v StatementVisitor)
type GetExpression ¶
type GetExpression struct { Object Expression Name *token.Token }
func (*GetExpression) Accept ¶
func (e *GetExpression) Accept(v ExpressionVisitor) any
type GroupingExpression ¶
type GroupingExpression struct {
Expr Expression
}
func (*GroupingExpression) Accept ¶
func (g *GroupingExpression) Accept(v ExpressionVisitor) any
type IfStatement ¶
type IfStatement struct { Condition Expression Consequence, Alternative Statement }
func (*IfStatement) Accept ¶
func (s *IfStatement) Accept(v StatementVisitor)
type IndexExpression ¶
type IndexExpression struct { Object Expression LeftIndex Expression RightIndex Expression ClosingBracket *token.Token }
func (*IndexExpression) Accept ¶
func (e *IndexExpression) Accept(v ExpressionVisitor) any
type IndexedAssignmentExpression ¶
type IndexedAssignmentExpression struct { Left *IndexExpression Value Expression }
func (*IndexedAssignmentExpression) Accept ¶
func (e *IndexedAssignmentExpression) Accept(v ExpressionVisitor) any
type LambdaExpression ¶
type LambdaExpression struct { Operator *token.Token Function *FunctionStatement }
func (*LambdaExpression) Accept ¶
func (e *LambdaExpression) Accept(v ExpressionVisitor) any
type LiteralExpression ¶
type LiteralExpression struct {
Value any
}
func (*LiteralExpression) Accept ¶
func (l *LiteralExpression) Accept(v ExpressionVisitor) any
type LogicalExpression ¶
type LogicalExpression struct {
Left, Right Expression
Operator *token.Token
}
func (*LogicalExpression) Accept ¶
func (b *LogicalExpression) Accept(v ExpressionVisitor) any
type LoopStatement ¶
type LoopStatement struct { Condition Expression Body Statement Increment Expression }
func (*LoopStatement) Accept ¶
func (s *LoopStatement) Accept(v StatementVisitor)
type MapExpression ¶
type MapExpression struct { OpeningBrace *token.Token Keys []Expression Values []Expression }
func (*MapExpression) Accept ¶
func (e *MapExpression) Accept(v ExpressionVisitor) any
type MethodType ¶
type MethodType int
type ReturnStatement ¶
type ReturnStatement struct { Keyword *token.Token Value Expression }
func (*ReturnStatement) Accept ¶
func (s *ReturnStatement) Accept(v StatementVisitor)
type SequenceExpression ¶
type SequenceExpression struct {
Items []Expression
}
func (*SequenceExpression) Accept ¶
func (e *SequenceExpression) Accept(v ExpressionVisitor) any
type SetExpression ¶
type SetExpression struct {
Object, Value Expression
Name *token.Token
}
func (*SetExpression) Accept ¶
func (e *SetExpression) Accept(v ExpressionVisitor) any
type Statement ¶
type Statement interface {
Accept(StatementVisitor)
}
type StatementVisitor ¶
type StatementVisitor interface { VisitExpressionStatement(*ExpressionStatement) VisitVarStatement(*VarStatement) VisitBlockStatement(*BlockStatement) VisitIfStatement(*IfStatement) VisitLoopStatement(*LoopStatement) VisitForEachStatement(*ForEachStatement) VisitFunctionStatement(*FunctionStatement) VisitReturnStatement(*ReturnStatement) VisitBreakStatement(*BreakStatement) VisitContinueStatement(*ContinueStatement) VisitClassStatement(*ClassStatement) }
type SuperGetExpression ¶
func (*SuperGetExpression) Accept ¶
func (e *SuperGetExpression) Accept(v ExpressionVisitor) any
type SuperSetExpression ¶
type SuperSetExpression struct {
Keyword, Method *token.Token
Value Expression
}
func (*SuperSetExpression) Accept ¶
func (e *SuperSetExpression) Accept(v ExpressionVisitor) any
type TernaryExpression ¶
type TernaryExpression struct {
Condition, Consequence, Alternative Expression
Operator *token.Token
}
func (*TernaryExpression) Accept ¶
func (e *TernaryExpression) Accept(v ExpressionVisitor) any
type ThisExpression ¶
func (*ThisExpression) Accept ¶
func (e *ThisExpression) Accept(v ExpressionVisitor) any
type UnaryExpression ¶
type UnaryExpression struct { Expr Expression Operator *token.Token }
func (*UnaryExpression) Accept ¶
func (u *UnaryExpression) Accept(v ExpressionVisitor) any
type VarStatement ¶
type VarStatement struct { Name *token.Token Initializer Expression }
func (*VarStatement) Accept ¶
func (s *VarStatement) Accept(v StatementVisitor)
type VariableExpression ¶
func (*VariableExpression) Accept ¶
func (e *VariableExpression) Accept(v ExpressionVisitor) any
Click to show internal directories.
Click to hide internal directories.