Documentation
¶
Index ¶
- type AssignmentExpr
- type BinaryExpr
- type BlockStmt
- type CallExpr
- type ClassStmt
- type Expr
- type ExprVisitor
- type ExpressionStmt
- type FunctionStmt
- type GetExpr
- type GroupingExpr
- type IfStmt
- type LiteralExpr
- type LogicalExpr
- type PrintStmt
- type Printer
- func (p Printer) Print(expr Expr) (string, error)
- func (p Printer) VisitAssignmentExpr(expr *AssignmentExpr) (any, error)
- func (p Printer) VisitBinaryExpr(expr *BinaryExpr) (any, error)
- func (p Printer) VisitCallExpr(expr *CallExpr) (any, error)
- func (p Printer) VisitGetExpr(expr *GetExpr) (any, error)
- func (p Printer) VisitGroupingExpr(expr *GroupingExpr) (any, error)
- func (p Printer) VisitLiteralExpr(expr *LiteralExpr) (any, error)
- func (p Printer) VisitLogicalExpr(expr *LogicalExpr) (any, error)
- func (p Printer) VisitSetExpr(expr *SetExpr) (any, error)
- func (p Printer) VisitSuperExpr(expr *SuperExpr) (any, error)
- func (p Printer) VisitThisExpr(expr *ThisExpr) (any, error)
- func (p Printer) VisitUnaryExpr(expr *UnaryExpr) (any, error)
- func (p Printer) VisitVariableExpr(expr *VariableExpr) (any, error)
- type ReturnStmt
- type SetExpr
- type Stmt
- type StmtVisitor
- type SuperExpr
- type ThisExpr
- type UnaryExpr
- type VarStmt
- type VariableExpr
- type WhileStmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignmentExpr ¶
func (*AssignmentExpr) Accept ¶
func (a *AssignmentExpr) Accept(visitor ExprVisitor) (any, error)
type BinaryExpr ¶
func (*BinaryExpr) Accept ¶
func (b *BinaryExpr) Accept(visitor ExprVisitor) (any, error)
type ClassStmt ¶
type ClassStmt struct { Name token.Token SuperClass *VariableExpr Methods []*FunctionStmt }
type Expr ¶
type Expr interface {
Accept(ExprVisitor) (any, error)
}
type ExprVisitor ¶
type ExprVisitor interface { VisitBinaryExpr(*BinaryExpr) (any, error) VisitLogicalExpr(*LogicalExpr) (any, error) VisitGroupingExpr(*GroupingExpr) (any, error) VisitLiteralExpr(*LiteralExpr) (any, error) VisitUnaryExpr(*UnaryExpr) (any, error) VisitCallExpr(*CallExpr) (any, error) VisitGetExpr(*GetExpr) (any, error) VisitSetExpr(*SetExpr) (any, error) VisitSuperExpr(*SuperExpr) (any, error) VisitThisExpr(*ThisExpr) (any, error) VisitVariableExpr(*VariableExpr) (any, error) VisitAssignmentExpr(*AssignmentExpr) (any, error) }
type ExpressionStmt ¶
type ExpressionStmt struct {
Expression Expr
}
func (*ExpressionStmt) Accept ¶
func (e *ExpressionStmt) Accept(visitor StmtVisitor) (any, error)
type FunctionStmt ¶
func (*FunctionStmt) Accept ¶
func (f *FunctionStmt) Accept(visitor StmtVisitor) (any, error)
type GroupingExpr ¶
type GroupingExpr struct {
Expression Expr
}
func (*GroupingExpr) Accept ¶
func (g *GroupingExpr) Accept(visitor ExprVisitor) (any, error)
type LiteralExpr ¶
type LiteralExpr struct {
Value any
}
func (*LiteralExpr) Accept ¶
func (l *LiteralExpr) Accept(visitor ExprVisitor) (any, error)
type LogicalExpr ¶
func (*LogicalExpr) Accept ¶
func (l *LogicalExpr) Accept(visitor ExprVisitor) (any, error)
type Printer ¶
type Printer struct{}
func NewPrinter ¶
func NewPrinter() Printer
func (Printer) VisitAssignmentExpr ¶
func (p Printer) VisitAssignmentExpr(expr *AssignmentExpr) (any, error)
func (Printer) VisitBinaryExpr ¶
func (p Printer) VisitBinaryExpr(expr *BinaryExpr) (any, error)
func (Printer) VisitGroupingExpr ¶
func (p Printer) VisitGroupingExpr(expr *GroupingExpr) (any, error)
func (Printer) VisitLiteralExpr ¶
func (p Printer) VisitLiteralExpr(expr *LiteralExpr) (any, error)
func (Printer) VisitLogicalExpr ¶
func (p Printer) VisitLogicalExpr(expr *LogicalExpr) (any, error)
func (Printer) VisitVariableExpr ¶
func (p Printer) VisitVariableExpr(expr *VariableExpr) (any, error)
type ReturnStmt ¶
func (*ReturnStmt) Accept ¶
func (r *ReturnStmt) Accept(visitor StmtVisitor) (any, error)
type Stmt ¶
type Stmt interface {
Accept(StmtVisitor) (any, error)
}
type StmtVisitor ¶
type StmtVisitor interface { VisitBlockStmt(*BlockStmt) (any, error) VisitClassStmt(*ClassStmt) (any, error) VisitExpressionStmt(*ExpressionStmt) (any, error) VisitWhileStmt(*WhileStmt) (any, error) VisitIfStmt(*IfStmt) (any, error) VisitPrintStmt(*PrintStmt) (any, error) VisitReturnStmt(*ReturnStmt) (any, error) VisitVarStmt(*VarStmt) (any, error) VisitFunctionStmt(*FunctionStmt) (any, error) }
type VariableExpr ¶
func (*VariableExpr) Accept ¶
func (v *VariableExpr) Accept(visitor ExprVisitor) (any, error)
Click to show internal directories.
Click to hide internal directories.