compiler

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 1, 2025 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler struct {
	Config       interfaces.ProjectConfig
	ProjectRoot  string
	Namespace    string
	DatapackRoot string
	Headers      []interfaces.DatapackHeader

	expressions.ExprVisitor
	statements.StmtVisitor

	LoadFuncName string
	TickFuncName string
	// contains filtered or unexported fields
}

func NewCompiler

func NewCompiler(
	config interfaces.ProjectConfig,
	projectRoot string,
	headers []interfaces.DatapackHeader,
	libs embed.FS,
) *Compiler

func (*Compiler) Compare

func (c *Compiler) Compare(expr expressions.BinaryExpr, ra string, rb string, rx string) string

func (*Compiler) Compile

func (c *Compiler) Compile(program parser.Program)

func (*Compiler) VisitBinary

func (c *Compiler) VisitBinary(expr expressions.BinaryExpr) string

func (*Compiler) VisitBlock

func (c *Compiler) VisitBlock(stmt statements.BlockStmt) string

func (*Compiler) VisitExpression

func (c *Compiler) VisitExpression(stmt statements.ExpressionStmt) string

func (*Compiler) VisitFieldAccess

func (c *Compiler) VisitFieldAccess(expr expressions.FieldAccessExpr) string

func (*Compiler) VisitFunctionCall

func (c *Compiler) VisitFunctionCall(expr expressions.FunctionCallExpr) string

func (*Compiler) VisitFunctionDeclaration

func (c *Compiler) VisitFunctionDeclaration(stmt statements.FunctionDeclarationStmt) string

func (*Compiler) VisitGrouping

func (c *Compiler) VisitGrouping(expr expressions.GroupingExpr) string

func (*Compiler) VisitIf

func (c *Compiler) VisitIf(stmt statements.IfStmt) string

func (*Compiler) VisitList

func (c *Compiler) VisitList(expr expressions.ListExpr) string

func (*Compiler) VisitLiteral

func (c *Compiler) VisitLiteral(expr expressions.LiteralExpr) string

func (*Compiler) VisitLogical

func (c *Compiler) VisitLogical(expr expressions.LogicalExpr) string

func (*Compiler) VisitReturn

func (c *Compiler) VisitReturn(stmt statements.ReturnStmt) string

func (*Compiler) VisitSlice

func (c *Compiler) VisitSlice(expr expressions.SliceExpr) string

func (*Compiler) VisitStruct added in v0.0.14

func (c *Compiler) VisitStruct(expr expressions.StructExpr) string

func (*Compiler) VisitStructDeclaration

func (c *Compiler) VisitStructDeclaration(stmt statements.StructDeclarationStmt) string

func (*Compiler) VisitUnary

func (c *Compiler) VisitUnary(expr expressions.UnaryExpr) string

func (*Compiler) VisitVariable

func (c *Compiler) VisitVariable(expr expressions.VariableExpr) string

func (*Compiler) VisitVariableAssignment

func (c *Compiler) VisitVariableAssignment(stmt statements.VariableAssignmentStmt) string

func (*Compiler) VisitVariableDeclaration

func (c *Compiler) VisitVariableDeclaration(stmt statements.VariableDeclarationStmt) string

type TypedIdentifier

type TypedIdentifier struct {
	Name string
	Type types.ValueType
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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