Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryExpr ¶
type BinaryExpr struct {
Expr
interfaces.SourceLocation
Left Expr
Operator tokens.Token
Right Expr
}
func (BinaryExpr) Accept ¶
func (b BinaryExpr) Accept(v ExprVisitor) interface{}
func (BinaryExpr) ReturnType ¶
func (b BinaryExpr) ReturnType() ValueType
func (BinaryExpr) TType ¶
func (b BinaryExpr) TType() ExprType
type Expr ¶
type Expr interface {
Accept(v ExprVisitor) interface{}
TType() ExprType
ReturnType() ValueType
}
type ExprType ¶
type ExprType string
const ( BinaryExprType ExprType = "Binary" GroupingExprType ExprType = "Grouping" LiteralExprType ExprType = "Literal" UnaryExprType ExprType = "Unary" VariableExprType ExprType = "Variable" FunctionCallExprType ExprType = "FunctionCall" LogicalExprType ExprType = "Logical" SliceExprType ExprType = "Slice" )
type ExprVisitor ¶
type ExprVisitor interface {
VisitBinary(b BinaryExpr) interface{}
VisitGrouping(g GroupingExpr) interface{}
VisitLiteral(l LiteralExpr) interface{}
VisitUnary(u UnaryExpr) interface{}
VisitVariable(v VariableExpr) interface{}
VisitFunctionCall(f FunctionCallExpr) interface{}
VisitLogical(l LogicalExpr) interface{}
VisitSlice(s SliceExpr) interface{}
}
type FunctionCallExpr ¶
type FunctionCallExpr struct {
Expr
interfaces.SourceLocation
Name tokens.Token
Arguments []Expr
Type ValueType
}
func (FunctionCallExpr) Accept ¶
func (f FunctionCallExpr) Accept(visitor ExprVisitor) interface{}
func (FunctionCallExpr) ReturnType ¶
func (f FunctionCallExpr) ReturnType() ValueType
func (FunctionCallExpr) TType ¶
func (f FunctionCallExpr) TType() ExprType
type GroupingExpr ¶
type GroupingExpr struct {
Expr
interfaces.SourceLocation
Expression Expr
}
func (GroupingExpr) Accept ¶
func (g GroupingExpr) Accept(v ExprVisitor) interface{}
func (GroupingExpr) ReturnType ¶
func (g GroupingExpr) ReturnType() ValueType
func (GroupingExpr) TType ¶
func (g GroupingExpr) TType() ExprType
type LiteralExpr ¶
type LiteralExpr struct {
Expr
interfaces.SourceLocation
Value interface{}
ValueType ValueType
}
func (LiteralExpr) Accept ¶
func (l LiteralExpr) Accept(v ExprVisitor) interface{}
func (LiteralExpr) ReturnType ¶
func (l LiteralExpr) ReturnType() ValueType
func (LiteralExpr) TType ¶
func (l LiteralExpr) TType() ExprType
type LogicalExpr ¶
type LogicalExpr struct {
Left Expr
Operator tokens.Token
Right Expr
interfaces.SourceLocation
Expr
}
func (LogicalExpr) Accept ¶
func (l LogicalExpr) Accept(v ExprVisitor) interface{}
func (LogicalExpr) ReturnType ¶
func (l LogicalExpr) ReturnType() ValueType
func (LogicalExpr) TType ¶
func (l LogicalExpr) TType() ExprType
type SliceExpr ¶
type SliceExpr struct {
StartIndex Expr
EndIndex Expr
TargetExpr Expr
interfaces.SourceLocation
Expr
}
func (SliceExpr) Accept ¶
func (s SliceExpr) Accept(v ExprVisitor) interface{}
func (SliceExpr) ReturnType ¶
type UnaryExpr ¶
type UnaryExpr struct {
Expr
interfaces.SourceLocation
Operator tokens.Token
Expression Expr
}
func (UnaryExpr) Accept ¶
func (u UnaryExpr) Accept(v ExprVisitor) interface{}
func (UnaryExpr) ReturnType ¶
type VariableExpr ¶
type VariableExpr struct {
Expr
interfaces.SourceLocation
Name tokens.Token
Type ValueType
}
func (VariableExpr) Accept ¶
func (v VariableExpr) Accept(visitor ExprVisitor) interface{}
func (VariableExpr) ReturnType ¶
func (v VariableExpr) ReturnType() ValueType
func (VariableExpr) TType ¶
func (v VariableExpr) TType() ExprType
Click to show internal directories.
Click to hide internal directories.