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) string
func (BinaryExpr) ExprType ¶ added in v0.0.8
func (b BinaryExpr) ExprType() ExprType
func (BinaryExpr) ReturnType ¶
func (b BinaryExpr) ReturnType() types.ValueType
type Expr ¶
type Expr interface {
Accept(v ExprVisitor) string
ExprType() ExprType
ReturnType() types.ValueType
}
type ExprType ¶
type ExprType string
const ( BinaryExprType ExprType = "Binary" GroupingExprType ExprType = "Grouping" LiteralExprType ExprType = "Literal" UnaryExprType ExprType = "Unary" FieldAccessExprType ExprType = "FieldAccess" VariableExprType ExprType = "Variable" FunctionCallExprType ExprType = "FunctionCall" LogicalExprType ExprType = "Logical" SliceExprType ExprType = "SliceString" ListExprType ExprType = "List" StructExprType ExprType = "Struct" )
type ExprVisitor ¶
type ExprVisitor interface {
VisitBinary(b BinaryExpr) string
VisitGrouping(g GroupingExpr) string
VisitLiteral(l LiteralExpr) string
VisitUnary(u UnaryExpr) string
VisitVariable(v VariableExpr) string
VisitFieldAccess(v FieldAccessExpr) string
VisitFunctionCall(f FunctionCallExpr) string
VisitLogical(l LogicalExpr) string
VisitSlice(s SliceExpr) string
VisitList(s ListExpr) string
VisitStruct(s StructExpr) string
}
type FieldAccessExpr ¶ added in v0.0.8
type FieldAccessExpr struct {
Expr
interfaces.SourceLocation
Source Expr
Field tokens.Token
Type types.ValueType
}
func (FieldAccessExpr) Accept ¶ added in v0.0.8
func (v FieldAccessExpr) Accept(visitor ExprVisitor) string
func (FieldAccessExpr) ExprType ¶ added in v0.0.8
func (v FieldAccessExpr) ExprType() ExprType
func (FieldAccessExpr) ReturnType ¶ added in v0.0.8
func (v FieldAccessExpr) ReturnType() types.ValueType
type FunctionCallExpr ¶
type FunctionCallExpr struct {
Expr
interfaces.SourceLocation
Name tokens.Token
Arguments []Expr
Type types.ValueType
}
func (FunctionCallExpr) Accept ¶
func (f FunctionCallExpr) Accept(visitor ExprVisitor) string
func (FunctionCallExpr) ExprType ¶ added in v0.0.8
func (f FunctionCallExpr) ExprType() ExprType
func (FunctionCallExpr) ReturnType ¶
func (f FunctionCallExpr) ReturnType() types.ValueType
type GroupingExpr ¶
type GroupingExpr struct {
Expr
interfaces.SourceLocation
Expression Expr
}
func (GroupingExpr) Accept ¶
func (g GroupingExpr) Accept(v ExprVisitor) string
func (GroupingExpr) ExprType ¶ added in v0.0.8
func (g GroupingExpr) ExprType() ExprType
func (GroupingExpr) ReturnType ¶
func (g GroupingExpr) ReturnType() types.ValueType
type ListExpr ¶ added in v0.0.7
type ListExpr struct {
Expr
interfaces.SourceLocation
Elements []Expr
ValueType types.ValueType
}
func (ListExpr) Accept ¶ added in v0.0.7
func (l ListExpr) Accept(v ExprVisitor) string
func (ListExpr) ReturnType ¶ added in v0.0.7
type LiteralExpr ¶
type LiteralExpr struct {
Expr
interfaces.SourceLocation
Value string
ValueType types.ValueType
}
func (LiteralExpr) Accept ¶
func (l LiteralExpr) Accept(v ExprVisitor) string
func (LiteralExpr) ExprType ¶ added in v0.0.8
func (l LiteralExpr) ExprType() ExprType
func (LiteralExpr) ReturnType ¶
func (l LiteralExpr) ReturnType() types.ValueType
type LogicalExpr ¶
type LogicalExpr struct {
Left Expr
Operator tokens.Token
Right Expr
interfaces.SourceLocation
Expr
}
func (LogicalExpr) Accept ¶
func (l LogicalExpr) Accept(v ExprVisitor) string
func (LogicalExpr) ExprType ¶ added in v0.0.8
func (l LogicalExpr) ExprType() ExprType
func (LogicalExpr) ReturnType ¶
func (l LogicalExpr) ReturnType() types.ValueType
type SliceExpr ¶
type SliceExpr struct {
StartIndex Expr
EndIndex Expr
TargetExpr Expr
interfaces.SourceLocation
Expr
}
func (SliceExpr) Accept ¶
func (s SliceExpr) Accept(v ExprVisitor) string
func (SliceExpr) ReturnType ¶
type StructExpr ¶ added in v0.0.14
type StructExpr struct {
Expr
interfaces.SourceLocation
Args []Expr
StructType types.StructTypeStruct
}
func (StructExpr) Accept ¶ added in v0.0.14
func (s StructExpr) Accept(v ExprVisitor) string
func (StructExpr) ExprType ¶ added in v0.0.14
func (s StructExpr) ExprType() ExprType
func (StructExpr) ReturnType ¶ added in v0.0.14
func (s StructExpr) ReturnType() types.ValueType
type UnaryExpr ¶
type UnaryExpr struct {
Expr
interfaces.SourceLocation
Operator tokens.Token
Expression Expr
}
func (UnaryExpr) Accept ¶
func (u UnaryExpr) Accept(v ExprVisitor) string
func (UnaryExpr) ReturnType ¶
type VariableExpr ¶
type VariableExpr struct {
Expr
interfaces.SourceLocation
Name tokens.Token
Type types.ValueType
}
func (VariableExpr) Accept ¶
func (v VariableExpr) Accept(visitor ExprVisitor) string
func (VariableExpr) ExprType ¶ added in v0.0.8
func (v VariableExpr) ExprType() ExprType
func (VariableExpr) ReturnType ¶
func (v VariableExpr) ReturnType() types.ValueType
Click to show internal directories.
Click to hide internal directories.