compiler

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package compiler compiles a B++ AST tree into LLVM IR, which can then be compiled into extremely high-performance Assembly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFunction

func AddFunction(fn *parser.FunctionBlock) error

func Compile

func Compile(prog *parser.Program) (string, error)

func CompileArgs

func CompileArgs(stm *parser.ArgsStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileArray

func CompileArray(stm *parser.ArrayStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileBlock

func CompileBlock(stms []parser.Statement, block *ir.Block) (*ir.Block, error)

func CompileCeil

func CompileCeil(stm *parser.CeilStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileChoose

func CompileChoose(stm *parser.ChooseStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileCompare

func CompileCompare(stm *parser.ComparisonStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileConcat

func CompileConcat(stm *parser.ConcatStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileData

func CompileData(stm *parser.Data, block *ir.Block) (value.Value, *ir.Block, error)

func CompileDefine

func CompileDefine(stm *parser.DefineStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileFloor

func CompileFloor(stm *parser.FloorStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileFunctionCall

func CompileFunctionCall(stm *parser.FunctionCallStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileIf

func CompileIf(stm *parser.IfStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileIfBlock

func CompileIfBlock(stm *parser.IfBlock, block *ir.Block) (value.Value, *ir.Block, error)

func CompileIndex

func CompileIndex(stm *parser.IndexStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileMath

func CompileMath(stm *parser.MathStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileRandint

func CompileRandint(stm *parser.RandintStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileRandom

func CompileRandom(stm *parser.RandomStmt, block *ir.Block) (value.Value, *ir.Block, error)

Using this method: https://stackoverflow.com/a/64286825/11388343

func CompileRound

func CompileRound(stm *parser.RoundStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileStmt

func CompileStmt(stm parser.Statement, b *ir.Block) (value.Value, *ir.Block, error)

func CompileTypeCast

func CompileTypeCast(stm *parser.TypeCastStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileVar

func CompileVar(stm *parser.VarStmt, block *ir.Block) (value.Value, *ir.Block, error)

func CompileWhileBlock

func CompileWhileBlock(stm *parser.WhileBlock, block *ir.Block) (value.Value, *ir.Block, error)

Types

type Variable

type Variable struct {
	Val  value.Value
	Type types.Type
}

Jump to

Keyboard shortcuts

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