Documentation ¶
Overview ¶
Package membuild converts a B++ AST tree into a series of lambdas which can then be executed.
Index ¶
- type Data
- type Function
- type Instruction
- func ArgsStmt(p *Program, stm *parser.ArgsStmt) (Instruction, error)
- func ArrayStmt(p *Program, stm *parser.ArrayStmt) (Instruction, error)
- func BuildStmt(p *Program, stmt parser.Statement) (Instruction, error)
- func CeilStmt(p *Program, stm *parser.CeilStmt) (Instruction, error)
- func ChooseStmt(p *Program, stm *parser.ChooseStmt) (Instruction, error)
- func CompareStmt(p *Program, stm *parser.ComparisonStmt) (Instruction, error)
- func ConcatStmt(p *Program, stm *parser.ConcatStmt) (Instruction, error)
- func DefineStmt(p *Program, stm *parser.DefineStmt) (Instruction, error)
- func FloorStmt(p *Program, stm *parser.FloorStmt) (Instruction, error)
- func FunctionBlock(p *Program, stm *parser.FunctionBlock) (Instruction, error)
- func FunctionCallStmt(p *Program, stm *parser.FunctionCallStmt) (Instruction, error)
- func IfBlock(p *Program, stm *parser.IfBlock) (Instruction, error)
- func IfStmt(p *Program, stm *parser.IfStmt) (Instruction, error)
- func ImportStmt(p *Program, stm *parser.ImportStmt) (Instruction, error)
- func IndexStmt(p *Program, stm *parser.IndexStmt) (Instruction, error)
- func MathStmt(p *Program, stm *parser.MathStmt) (Instruction, error)
- func RandintStmt(p *Program, stm *parser.RandintStmt) (Instruction, error)
- func RandomStmt(p *Program, stm *parser.RandomStmt) (Instruction, error)
- func RoundStmt(p *Program, stm *parser.RoundStmt) (Instruction, error)
- func TypeCastStmt(p *Program, stm *parser.TypeCastStmt) (Instruction, error)
- func VarStmt(p *Program, stm *parser.VarStmt) (Instruction, error)
- func WhileBlock(p *Program, stm *parser.WhileBlock) (Instruction, error)
- type Program
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
Data represents a value in B++
func NewBlankData ¶
func NewBlankData() Data
NewBlankData is a utility function to create a valid NULL value
func ParserDataToData ¶
ParserDataToData converts parser's Data format to membuild's Data format
type Function ¶
type Function struct { Body []Instruction Name string Type parser.FunctionType Return Instruction }
Function stores the data for a compiled function.
type Instruction ¶
Instruction stores the data for an instruction, or a callable B++ expression
func ArgsStmt ¶
func ArgsStmt(p *Program, stm *parser.ArgsStmt) (Instruction, error)
ArgsStmt compiles an ARGS statement
func ArrayStmt ¶
func ArrayStmt(p *Program, stm *parser.ArrayStmt) (Instruction, error)
ArrayStmt compiles an ARRAY definition
func BuildStmt ¶
func BuildStmt(p *Program, stmt parser.Statement) (Instruction, error)
BuildStmt compiles a statement
func CeilStmt ¶
func CeilStmt(p *Program, stm *parser.CeilStmt) (Instruction, error)
CeilStmt compiles a CEIL statement
func ChooseStmt ¶
func ChooseStmt(p *Program, stm *parser.ChooseStmt) (Instruction, error)
ChooseStmt compiles a CHOOSE statement
func CompareStmt ¶
func CompareStmt(p *Program, stm *parser.ComparisonStmt) (Instruction, error)
CompareStmt compiles a COMPARE statement
func ConcatStmt ¶
func ConcatStmt(p *Program, stm *parser.ConcatStmt) (Instruction, error)
ConcatStmt compiles a CONCAT statement
func DefineStmt ¶
func DefineStmt(p *Program, stm *parser.DefineStmt) (Instruction, error)
DefineStmt compiles a DEFINE statement
func FloorStmt ¶
func FloorStmt(p *Program, stm *parser.FloorStmt) (Instruction, error)
FloorStmt compiles a FLOOR statement
func FunctionBlock ¶
func FunctionBlock(p *Program, stm *parser.FunctionBlock) (Instruction, error)
FunctionBlock compiles a FUNCTION block.
func FunctionCallStmt ¶
func FunctionCallStmt(p *Program, stm *parser.FunctionCallStmt) (Instruction, error)
FunctionCallStmt compiles a function call
func IfBlock ¶
func IfBlock(p *Program, stm *parser.IfBlock) (Instruction, error)
IfBlock compiles an if block (IFB)
func IfStmt ¶
func IfStmt(p *Program, stm *parser.IfStmt) (Instruction, error)
IfStmt compiles an IF statement
func ImportStmt ¶
func ImportStmt(p *Program, stm *parser.ImportStmt) (Instruction, error)
ImportStmt compiles an IMPORT statement
func IndexStmt ¶
func IndexStmt(p *Program, stm *parser.IndexStmt) (Instruction, error)
IndexStmt compiles an INDEX statement
func MathStmt ¶
func MathStmt(p *Program, stm *parser.MathStmt) (Instruction, error)
MathStmt compiles a MATH statement
func RandintStmt ¶
func RandintStmt(p *Program, stm *parser.RandintStmt) (Instruction, error)
RandintStmt compiles a RANDINT statement
func RandomStmt ¶
func RandomStmt(p *Program, stm *parser.RandomStmt) (Instruction, error)
RandomStmt compiles a RANDOM statement
func RoundStmt ¶
func RoundStmt(p *Program, stm *parser.RoundStmt) (Instruction, error)
RoundStmt compiles a ROUND statement
func TypeCastStmt ¶
func TypeCastStmt(p *Program, stm *parser.TypeCastStmt) (Instruction, error)
TypeCastStmt compiles a type-cast statement
func VarStmt ¶
func VarStmt(p *Program, stm *parser.VarStmt) (Instruction, error)
VarStmt compiles a VAR statement
func WhileBlock ¶
func WhileBlock(p *Program, stm *parser.WhileBlock) (Instruction, error)
WhileBlock compiles a WHILE block