compiler

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2025 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

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 {
	Namespace    string
	Scope        string
	DatapackRoot string
	Config       interfaces.ProjectConfig
	// contains filtered or unexported fields
}

func NewCompiler

func NewCompiler(
	config interfaces.ProjectConfig,
	libs embed.FS,
) *Compiler

func (*Compiler) Compile

func (c *Compiler) Compile(sourceAst ast.Source, symbols *symbol.Table) error

func (*Compiler) VisitBinary

func (c *Compiler) VisitBinary(b *ast.BinaryExpr) any

func (*Compiler) VisitBlock

func (c *Compiler) VisitBlock(stmt ast.BlockStmt) any

func (*Compiler) VisitCall added in v0.2.0

func (c *Compiler) VisitCall(f *ast.CallExpr) any

func (*Compiler) VisitDotAccess added in v0.2.0

func (c *Compiler) VisitDotAccess(v *ast.DotAccessExpr) any

func (*Compiler) VisitExec added in v0.2.0

func (c *Compiler) VisitExec(stmt ast.ExecStmt) any

func (*Compiler) VisitExpression

func (c *Compiler) VisitExpression(stmt ast.ExpressionStmt) any

func (*Compiler) VisitFunctionDeclaration

func (c *Compiler) VisitFunctionDeclaration(stmt ast.FunctionDeclarationStmt) any

func (*Compiler) VisitGrouping

func (c *Compiler) VisitGrouping(g *ast.GroupingExpr) any

func (*Compiler) VisitIf

func (c *Compiler) VisitIf(stmt ast.IfStmt) any

func (*Compiler) VisitImport added in v0.2.0

func (c *Compiler) VisitImport(_ ast.ImportStmt) any

func (*Compiler) VisitList

func (c *Compiler) VisitList(s *ast.ListExpr) any

func (*Compiler) VisitLiteral

func (c *Compiler) VisitLiteral(l *ast.LiteralExpr) any

func (*Compiler) VisitLogical

func (c *Compiler) VisitLogical(l *ast.LogicalExpr) any

func (*Compiler) VisitReturn

func (c *Compiler) VisitReturn(stmt ast.ReturnStmt) any

func (*Compiler) VisitSetReturnFlag added in v0.1.0

func (c *Compiler) VisitSetReturnFlag(_ ast.SetReturnFlagStmt) any

func (*Compiler) VisitSlice

func (c *Compiler) VisitSlice(s *ast.SliceExpr) any

func (*Compiler) VisitStructDeclaration

func (c *Compiler) VisitStructDeclaration(stmt ast.StructDeclarationStmt) any

func (*Compiler) VisitUnary

func (c *Compiler) VisitUnary(u *ast.UnaryExpr) any

func (*Compiler) VisitVariable

func (c *Compiler) VisitVariable(v *ast.VariableExpr) any

func (*Compiler) VisitVariableAssignment

func (c *Compiler) VisitVariableAssignment(stmt ast.VariableAssignmentStmt) any

func (*Compiler) VisitVariableDeclaration

func (c *Compiler) VisitVariableDeclaration(stmt ast.VariableDeclarationStmt) any

func (*Compiler) VisitWhile added in v0.1.0

func (c *Compiler) VisitWhile(_ ast.WhileStmt) any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL