62 lines
1,017 B
Go
62 lines
1,017 B
Go
package ast
|
|
|
|
// THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MANUALLY EDIT
|
|
|
|
import "git.red-panda.pet/pandaware/lox-go/lexer"
|
|
|
|
type ExprVisitor interface {
|
|
VisitBinaryExpr(v *BinaryExpr) any
|
|
VisitGroupingExpr(v *GroupingExpr) any
|
|
VisitLiteralExpr(v *LiteralExpr) any
|
|
VisitUnaryExpr(v *UnaryExpr) any
|
|
}
|
|
|
|
type Expr interface {
|
|
Accept(v ExprVisitor) any
|
|
}
|
|
|
|
type BinaryExpr struct {
|
|
Left Expr
|
|
|
|
Op *lexer.Token
|
|
|
|
Right Expr
|
|
}
|
|
|
|
func (n *BinaryExpr) Accept(v ExprVisitor) any {
|
|
return v.VisitBinaryExpr(n)
|
|
}
|
|
|
|
var _ Expr = new(BinaryExpr)
|
|
|
|
type GroupingExpr struct {
|
|
Expr Expr
|
|
}
|
|
|
|
func (n *GroupingExpr) Accept(v ExprVisitor) any {
|
|
return v.VisitGroupingExpr(n)
|
|
}
|
|
|
|
var _ Expr = new(GroupingExpr)
|
|
|
|
type LiteralExpr struct {
|
|
Value any
|
|
}
|
|
|
|
func (n *LiteralExpr) Accept(v ExprVisitor) any {
|
|
return v.VisitLiteralExpr(n)
|
|
}
|
|
|
|
var _ Expr = new(LiteralExpr)
|
|
|
|
type UnaryExpr struct {
|
|
Op *lexer.Token
|
|
|
|
Right Expr
|
|
}
|
|
|
|
func (n *UnaryExpr) Accept(v ExprVisitor) any {
|
|
return v.VisitUnaryExpr(n)
|
|
}
|
|
|
|
var _ Expr = new(UnaryExpr)
|