compiler

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: GPL-3.0 Imports: 18 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) interface{}

func (*Compiler) VisitBlock

func (c *Compiler) VisitBlock(stmt statements.BlockStmt) interface{}

func (*Compiler) VisitExpression

func (c *Compiler) VisitExpression(stmt statements.ExpressionStmt) interface{}

func (*Compiler) VisitFunctionCall

func (c *Compiler) VisitFunctionCall(expr expressions.FunctionCallExpr) interface{}

func (*Compiler) VisitFunctionDeclaration

func (c *Compiler) VisitFunctionDeclaration(stmt statements.FunctionDeclarationStmt) interface{}

func (*Compiler) VisitGrouping

func (c *Compiler) VisitGrouping(expr expressions.GroupingExpr) interface{}

func (*Compiler) VisitIf

func (c *Compiler) VisitIf(stmt statements.IfStmt) interface{}

func (*Compiler) VisitList added in v0.0.7

func (c *Compiler) VisitList(expr expressions.ListExpr) interface{}

func (*Compiler) VisitLiteral

func (c *Compiler) VisitLiteral(expr expressions.LiteralExpr) interface{}

func (*Compiler) VisitLogical

func (c *Compiler) VisitLogical(expr expressions.LogicalExpr) interface{}

func (*Compiler) VisitReturn

func (c *Compiler) VisitReturn(stmt statements.ReturnStmt) interface{}

func (*Compiler) VisitSlice

func (c *Compiler) VisitSlice(expr expressions.SliceExpr) interface{}

func (*Compiler) VisitUnary

func (c *Compiler) VisitUnary(expr expressions.UnaryExpr) interface{}

func (*Compiler) VisitVariable

func (c *Compiler) VisitVariable(expr expressions.VariableExpr) interface{}

func (*Compiler) VisitVariableAssignment

func (c *Compiler) VisitVariableAssignment(stmt statements.VariableAssignmentStmt) interface{}

func (*Compiler) VisitVariableDeclaration

func (c *Compiler) VisitVariableDeclaration(stmt statements.VariableDeclarationStmt) interface{}

type TypedIdentifier

type TypedIdentifier struct {
	Name string
	Type interfaces.ValueType
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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