interfaces

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author added in v0.0.5

type Author struct {
	Name  string
	Email string
}

func (Author) String added in v0.0.5

func (a Author) String() string

type DatapackHeader added in v0.0.3

type DatapackHeader struct {
	Namespace   string `json:"namespace"`
	Definitions struct {
		Functions []struct {
			Name string `json:"name"`
			Args []struct {
				Name string `json:"name"`
				Type string `json:"type"`
			} `json:"args"`
			ReturnType string `json:"returnType"`
		} `json:"functions"`
	} `json:"definitions"`
}

type Function added in v0.1.0

type Function interface {
	GetName() string
	GetCode() IRCode
	ToString() string
	ToMCFunction() string
}

type FunctionDefinition added in v0.1.0

type FunctionDefinition struct {
	Name       string
	Parameters []TypedIdentifier
	ReturnType types.ValueType
}

type IRCode added in v0.1.0

type IRCode interface {
	ToString() string
	ToMCCode() string
	Len() int
	Extend(IRCode) IRCode
	AddInstruction(Instruction) IRCode

	GetInstructions() []Instruction
	SetInstructions([]Instruction)
	GetNamespace() string
	GetStorage() string

	Call(funcName string) IRCode
	CallWithArgs(funcName, argPath string) IRCode
	Branch(branchName, funcName string) IRCode
	Exec(mcCommand string) IRCode
	ExecReg(varName string) IRCode
	Raw(mcCommand string) IRCode

	IntAdd(x, y, to string) IRCode
	IntSub(x, y, to string) IRCode
	IntMul(x, y, to string) IRCode
	IntDiv(x, y, to string) IRCode
	IntMod(x, y, to string) IRCode
	DoubleAdd(x, y, to string) IRCode
	DoubleSub(x, y, to string) IRCode
	DoubleMul(x, y, to string) IRCode
	DoubleDiv(x, y, to string) IRCode
	DoubleMod(x, y, to string) IRCode
	DoubleSqrt(x, to string) IRCode
	DoubleCos(x, to string) IRCode
	DoubleSin(x, to string) IRCode
	DoubleTan(x, to string) IRCode
	DoubleAcos(x, to string) IRCode
	DoubleAsin(x, to string) IRCode
	DoubleAtan(x, to string) IRCode
	DoubleAtan2(x, y, to string) IRCode
	DoubleFloor(x, to string) IRCode
	DoubleCeil(x, to string) IRCode
	DoubleRound(x, to string) IRCode

	XSet(storage, path string, value nbt.Value) IRCode
	Set(path string, value nbt.Value) IRCode
	SetVar(name string, value nbt.Value) IRCode
	SetArg(funcName, argName string, value nbt.Value) IRCode

	SetArgs(funcName string, value nbt.Compound) IRCode
	XCopy(storageFrom, from, storageTo, to string) IRCode
	Copy(from, to string) IRCode
	CopyVar(from, to string) IRCode
	CopyArg(varName, funcName, argName string) IRCode
	XRemove(storage, path string) IRCode
	Remove(path string) IRCode
	RemoveVar(name string) IRCode
	RemoveArg(funcName, argName string) IRCode
	XLoad(path, score string) IRCode
	Load(path, score string) IRCode
	Store(score, path string) IRCode
	Score(target string, score *nbt.Int) IRCode
	MathOp(operator string) IRCode
	Ret() IRCode
	Size(source, res string) IRCode
	Func(name string) IRCode
	AppendSet(listPath string, value nbt.Value) IRCode
	AppendCopy(listPath, valuePath string) IRCode
	MakeIndex(valuePath, res string) IRCode
	IntCompare(regRa, regRb string, operator TokenType, res string) IRCode
	DoubleCompare(regRa, regRb string, operator TokenType, res string) IRCode
	If(condVar string, code IRCode) IRCode
	Unless(condVar string, code IRCode) IRCode
	ExceptionString(message string) IRCode
	ExceptionFormat(messageParts ...nbt.Value) IRCode

	PathGet(obj, path, to string) IRCode
	PathSet(obj, path, valuePath string) IRCode
	PathDelete(obj, path string) IRCode

	StringConcat(a, b, res string) IRCode
	StringCompare(a, b, res string) IRCode
	StringSlice(stringVar, startIndex, endIndex, res string) IRCode

	StructGet(structPath, field, dataPath string) IRCode
	StructSet(dataPath, field, structPath string) IRCode

	XTrace(name, storage, path string) IRCode
	Trace(name, path string) IRCode
	TraceVar(name, varName string) IRCode
	TraceArg(name, funcName, argName string) IRCode
	TraceScore(name, score string) IRCode
}

type Instruction added in v0.1.0

type Instruction interface {
	ToString() string
	ToMCCommand() string

	GetType() InstructionType
	GetArgs() []string
}

type InstructionType added in v0.1.0

type InstructionType string

type McTag added in v0.1.0

type McTag struct {
	Name   string   `json:"-"`
	Values []string `json:"values"`
}

type PackMcMeta added in v0.2.1

type PackMcMeta struct {
	Pack PackMcMetaPack `json:"pack"`
	Meta PackMcMetaMeta `json:"meta"`
}

type PackMcMetaMeta added in v0.2.1

type PackMcMetaMeta struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type PackMcMetaPack added in v0.2.1

type PackMcMetaPack struct {
	Description string                `json:"description"`
	PackFormat  packformat.PackFormat `json:"pack_format"`
}

type Project added in v0.0.6

type Project struct {
	Name        string   `toml:"name"`
	Namespace   string   `toml:"namespace"`
	Authors     []string `toml:"authors"`
	Entrypoint  string   `toml:"entrypoint"`
	Version     string   `toml:"version"`
	Description string   `toml:"description"`
}

type ProjectConfig

type ProjectConfig struct {
	CleanBeforeInit bool    `toml:"cleanBeforeInit"`
	Debug           bool    `toml:"debug"`
	Project         Project `toml:"Project"`
	Dependencies    struct {
		Headers []string
	} `toml:"-"`
	OutputDir string `toml:"-"`
}

type SourceLocation

type SourceLocation struct {
	File string
	Row  int
	Col  int
}

func (SourceLocation) ToString added in v0.1.0

func (l SourceLocation) ToString() string

type TokenType added in v0.1.0

type TokenType int

type TypedIdentifier added in v0.1.0

type TypedIdentifier struct {
	Name string
	Type types.ValueType
}

Jump to

Keyboard shortcuts

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