Documentation
¶
Index ¶
- Constants
- type Compiler
- func (c *Compiler) Compile(program parser.Program) error
- func (c *Compiler) VisitBinary(b expressions.BinaryExpr) interfaces.IRCode
- func (c *Compiler) VisitBlock(stmt statements.BlockStmt) interfaces.IRCode
- func (c *Compiler) VisitExpression(stmt statements.ExpressionStmt) interfaces.IRCode
- func (c *Compiler) VisitFieldAccess(v expressions.FieldAccessExpr) interfaces.IRCode
- func (c *Compiler) VisitFunctionCall(f expressions.FunctionCallExpr) interfaces.IRCode
- func (c *Compiler) VisitFunctionDeclaration(stmt statements.FunctionDeclarationStmt) interfaces.IRCode
- func (c *Compiler) VisitGrouping(g expressions.GroupingExpr) interfaces.IRCode
- func (c *Compiler) VisitIf(stmt statements.IfStmt) interfaces.IRCode
- func (c *Compiler) VisitList(s expressions.ListExpr) interfaces.IRCode
- func (c *Compiler) VisitLiteral(l expressions.LiteralExpr) interfaces.IRCode
- func (c *Compiler) VisitLogical(l expressions.LogicalExpr) interfaces.IRCode
- func (c *Compiler) VisitReturn(stmt statements.ReturnStmt) interfaces.IRCode
- func (c *Compiler) VisitScore(stmt statements.ScoreStmt) interfaces.IRCode
- func (c *Compiler) VisitSetReturnFlag(stmt statements.SetReturnFlagStmt) interfaces.IRCode
- func (c *Compiler) VisitSlice(s expressions.SliceExpr) interfaces.IRCode
- func (c *Compiler) VisitStruct(s expressions.StructExpr) interfaces.IRCode
- func (c *Compiler) VisitStructDeclaration(stmt statements.StructDeclarationStmt) interfaces.IRCode
- func (c *Compiler) VisitUnary(u expressions.UnaryExpr) interfaces.IRCode
- func (c *Compiler) VisitVariable(v expressions.VariableExpr) interfaces.IRCode
- func (c *Compiler) VisitVariableAssignment(stmt statements.VariableAssignmentStmt) interfaces.IRCode
- func (c *Compiler) VisitVariableDeclaration(stmt statements.VariableDeclarationStmt) interfaces.IRCode
- func (c *Compiler) VisitWhile(stmt statements.WhileStmt) interfaces.IRCode
Constants ¶
View Source
const ( RX = "$RX" RA = "$RA" RB = "$RB" RET = "$RET" // Function return value RETF = "$RETF" // Early return flag CALL = "$CALL" VarPath = "vars" ArgPath = "args" StructPath = "structs" MaxCallCounter = 65536 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler struct {
expressions.ExprVisitor
statements.StmtVisitor
Namespace string
Scope string
DatapackRoot string
Config interfaces.ProjectConfig
Structs map[string]statements.StructDeclarationStmt
RX string
RA string
RB string
RET string
CALL string
VarPath string
ArgPath string
StructPath string
// contains filtered or unexported fields
}
func NewCompiler ¶
func NewCompiler( config interfaces.ProjectConfig, headers []interfaces.DatapackHeader, libs embed.FS, ) *Compiler
func (*Compiler) VisitBinary ¶
func (c *Compiler) VisitBinary(b expressions.BinaryExpr) interfaces.IRCode
func (*Compiler) VisitBlock ¶
func (c *Compiler) VisitBlock(stmt statements.BlockStmt) interfaces.IRCode
func (*Compiler) VisitExpression ¶
func (c *Compiler) VisitExpression(stmt statements.ExpressionStmt) interfaces.IRCode
func (*Compiler) VisitFieldAccess ¶
func (c *Compiler) VisitFieldAccess(v expressions.FieldAccessExpr) interfaces.IRCode
func (*Compiler) VisitFunctionCall ¶
func (c *Compiler) VisitFunctionCall(f expressions.FunctionCallExpr) interfaces.IRCode
func (*Compiler) VisitFunctionDeclaration ¶
func (c *Compiler) VisitFunctionDeclaration(stmt statements.FunctionDeclarationStmt) interfaces.IRCode
func (*Compiler) VisitGrouping ¶
func (c *Compiler) VisitGrouping(g expressions.GroupingExpr) interfaces.IRCode
func (*Compiler) VisitIf ¶
func (c *Compiler) VisitIf(stmt statements.IfStmt) interfaces.IRCode
func (*Compiler) VisitList ¶
func (c *Compiler) VisitList(s expressions.ListExpr) interfaces.IRCode
func (*Compiler) VisitLiteral ¶
func (c *Compiler) VisitLiteral(l expressions.LiteralExpr) interfaces.IRCode
func (*Compiler) VisitLogical ¶
func (c *Compiler) VisitLogical(l expressions.LogicalExpr) interfaces.IRCode
func (*Compiler) VisitReturn ¶
func (c *Compiler) VisitReturn(stmt statements.ReturnStmt) interfaces.IRCode
func (*Compiler) VisitScore ¶ added in v0.1.0
func (c *Compiler) VisitScore(stmt statements.ScoreStmt) interfaces.IRCode
func (*Compiler) VisitSetReturnFlag ¶ added in v0.1.0
func (c *Compiler) VisitSetReturnFlag(stmt statements.SetReturnFlagStmt) interfaces.IRCode
func (*Compiler) VisitSlice ¶
func (c *Compiler) VisitSlice(s expressions.SliceExpr) interfaces.IRCode
func (*Compiler) VisitStruct ¶ added in v0.0.14
func (c *Compiler) VisitStruct(s expressions.StructExpr) interfaces.IRCode
func (*Compiler) VisitStructDeclaration ¶
func (c *Compiler) VisitStructDeclaration(stmt statements.StructDeclarationStmt) interfaces.IRCode
func (*Compiler) VisitUnary ¶
func (c *Compiler) VisitUnary(u expressions.UnaryExpr) interfaces.IRCode
func (*Compiler) VisitVariable ¶
func (c *Compiler) VisitVariable(v expressions.VariableExpr) interfaces.IRCode
func (*Compiler) VisitVariableAssignment ¶
func (c *Compiler) VisitVariableAssignment(stmt statements.VariableAssignmentStmt) interfaces.IRCode
func (*Compiler) VisitVariableDeclaration ¶
func (c *Compiler) VisitVariableDeclaration(stmt statements.VariableDeclarationStmt) interfaces.IRCode
func (*Compiler) VisitWhile ¶ added in v0.1.0
func (c *Compiler) VisitWhile(stmt statements.WhileStmt) interfaces.IRCode
Click to show internal directories.
Click to hide internal directories.