Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assgin ¶
type Assgin struct { Token Token Value Experssion }
has variable being assigned to, and an expression for the new value
func (Assgin) Accept ¶
func (a Assgin) Accept(visitor ExpressionVisitor) (interface{}, error)
type Binary ¶
type Binary struct { Experssion Left Experssion Right Experssion Operator Token }
func (Binary) Accept ¶
func (b Binary) Accept(visitor ExpressionVisitor) (interface{}, error)
type Call ¶
type Call struct { Callee Experssion Parenth Token Args []Experssion }
stores the callee expression and a list of expressions for the arguments. It also stores the token for the closing parenthesis. it use that token’s location when it report a runtime error caused by a function call.
func (Call) Accept ¶
func (c Call) Accept(visitor ExpressionVisitor) (interface{}, error)
type Experssion ¶
type Experssion interface {
Accept(ExpressionVisitor) (interface{}, error)
}
type ExpressionVisitor ¶
type ExpressionVisitor interface { VisitBinary(Binary) (interface{}, error) VisitGrouping(Grouping) (interface{}, error) VisitLiteral(Literal) (interface{}, error) VisitUnary(Unary) (interface{}, error) VisitVairable(Variable) (interface{}, error) VisitAssgin(Assgin) (interface{}, error) VisitLogical(Logical) (interface{}, error) VisitCall(Call) (interface{}, error) VisitPropertyAccess(PropertyAccess) (interface{}, error) VisitPropertyAssignment(PropertyAssignment) (interface{}, error) VisitThis(This) (interface{}, error) VisitSuper(Super) (interface{}, error) }
type Grouping ¶
type Grouping struct {
Expr Experssion
}
func (Grouping) Accept ¶
func (g Grouping) Accept(visitor ExpressionVisitor) (interface{}, error)
type Literal ¶
type Literal struct { Experssion Value interface{} }
func (Literal) Accept ¶
func (l Literal) Accept(visitor ExpressionVisitor) (interface{}, error)
type Logical ¶
type Logical struct { Left Experssion Right Experssion Operator Token }
represent 'and', 'or' operators
func (Logical) Accept ¶
func (l Logical) Accept(visitor ExpressionVisitor) (interface{}, error)
type PropertyAccess ¶
type PropertyAccess struct { Name Token Obj Experssion }
func (PropertyAccess) Accept ¶
func (p PropertyAccess) Accept(visitor ExpressionVisitor) (interface{}, error)
type PropertyAssignment ¶
type PropertyAssignment struct { Name Token Obj Experssion Value Experssion }
func (PropertyAssignment) Accept ¶
func (p PropertyAssignment) Accept(visitor ExpressionVisitor) (interface{}, error)
type Super ¶
func (Super) Accept ¶
func (s Super) Accept(visitor ExpressionVisitor) (interface{}, error)
type This ¶
type This struct {
Keywork Token
}
func (This) Accept ¶
func (t This) Accept(visitor ExpressionVisitor) (interface{}, error)
type Unary ¶
type Unary struct { Experssion Right Experssion Operator Token }
func (Unary) Accept ¶
func (u Unary) Accept(visitor ExpressionVisitor) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.