Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ErrorType used for error handling ErrorType interfaces.ValueType = "error" VoidType interfaces.ValueType = "void" IntType interfaces.ValueType = "int" StringType interfaces.ValueType = "str" DoubleType interfaces.ValueType = "double" ListIntType interfaces.ValueType = "list<int>" ListDoubleType interfaces.ValueType = "list<double>" ListStringType interfaces.ValueType = "list<str>" )
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() interfaces.ValueType
func (BinaryExpr) TType ¶
func (b BinaryExpr) TType() ExprType
type Expr ¶
type Expr interface {
Accept(v ExprVisitor) interface{}
TType() ExprType
ReturnType() interfaces.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 = "SliceString" ListExprType ExprType = "List" )
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{}
VisitList(s ListExpr) interface{}
}
type FunctionCallExpr ¶
type FunctionCallExpr struct {
Expr
interfaces.SourceLocation
Name tokens.Token
Arguments []Expr
Type interfaces.ValueType
}
func (FunctionCallExpr) Accept ¶
func (f FunctionCallExpr) Accept(visitor ExprVisitor) interface{}
func (FunctionCallExpr) ReturnType ¶
func (f FunctionCallExpr) ReturnType() interfaces.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() interfaces.ValueType
func (GroupingExpr) TType ¶
func (g GroupingExpr) TType() ExprType
type ListExpr ¶ added in v0.0.7
type ListExpr struct {
Expr
interfaces.SourceLocation
Elements []Expr
ValueType interfaces.ValueType
}
func (ListExpr) Accept ¶ added in v0.0.7
func (l ListExpr) Accept(v ExprVisitor) interface{}
func (ListExpr) ReturnType ¶ added in v0.0.7
func (l ListExpr) ReturnType() interfaces.ValueType
type LiteralExpr ¶
type LiteralExpr struct {
Expr
interfaces.SourceLocation
Value interface{}
ValueType interfaces.ValueType
}
func (LiteralExpr) Accept ¶
func (l LiteralExpr) Accept(v ExprVisitor) interface{}
func (LiteralExpr) ReturnType ¶
func (l LiteralExpr) ReturnType() interfaces.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() interfaces.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 ¶
func (s SliceExpr) ReturnType() interfaces.ValueType
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 ¶
func (u UnaryExpr) ReturnType() interfaces.ValueType
type VariableExpr ¶
type VariableExpr struct {
Expr
interfaces.SourceLocation
Name tokens.Token
Type interfaces.ValueType
}
func (VariableExpr) Accept ¶
func (v VariableExpr) Accept(visitor ExprVisitor) interface{}
func (VariableExpr) ReturnType ¶
func (v VariableExpr) ReturnType() interfaces.ValueType
func (VariableExpr) TType ¶
func (v VariableExpr) TType() ExprType
Click to show internal directories.
Click to hide internal directories.