Documentation
¶
Index ¶
- func Indent(val string) string
- type AllocDynamic
- type AllocStatic
- type Array
- type ArrayIndex
- type ArrayLength
- type Cast
- type Compare
- type Concat
- type CondJmp
- type Const
- type Function
- type FunctionCall
- type GetArg
- type GetMemory
- type GetMemoryDynamic
- type GetParam
- type IR
- func (i *IR) AddFunction(fn *parser.FunctionBlock) error
- func (i *IR) AddInstruction(instr Instruction) int
- func (i *IR) AddStmt(stmt parser.Statement) (int, error)
- func (i *IR) AddStmtTop(stmt parser.Statement) (int, error)
- func (i *IR) GetInstruction(index int) Instruction
- func (i *IR) Index() int
- func (i *IR) Load(f io.Reader) error
- func (i *IR) Save(f io.Writer) error
- func (i *IR) SetCondJmpPoint(index int, targetTrue int, targetFalse int)
- func (i *IR) SetJmpPoint(index int, target int)
- func (i *IR) String() string
- type Instruction
- type Jmp
- type JmpPoint
- type Math
- type MathFunction
- type MathFunctionType
- type PHI
- type Print
- type RandFloat
- type RandInt
- type SetMemory
- type SetMemoryDynamic
- type StringIndex
- type StringLength
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AllocDynamic ¶
Dynamic types
func (*AllocDynamic) String ¶
func (a *AllocDynamic) String() string
func (*AllocDynamic) Type ¶
func (a *AllocDynamic) Type() Type
type AllocStatic ¶
type AllocStatic struct {
Typ Type
}
Memory instructions
func (*AllocStatic) String ¶
func (a *AllocStatic) String() string
func (*AllocStatic) Type ¶
func (a *AllocStatic) Type() Type
type ArrayIndex ¶
NOTE: Index is an instruction index
func (*ArrayIndex) String ¶
func (i *ArrayIndex) String() string
func (*ArrayIndex) Type ¶
func (i *ArrayIndex) Type() Type
type ArrayLength ¶
type ArrayLength struct {
Val int
}
func (*ArrayLength) String ¶
func (a *ArrayLength) String() string
func (*ArrayLength) Type ¶
func (a *ArrayLength) Type() Type
type Compare ¶
type Function ¶
type Function struct {
ParTypes []Type
Ret int
Instructions []Instruction
}
type FunctionCall ¶
func (*FunctionCall) String ¶
func (f *FunctionCall) String() string
func (*FunctionCall) Type ¶
func (f *FunctionCall) Type() Type
type GetMemoryDynamic ¶
func (*GetMemoryDynamic) String ¶
func (s *GetMemoryDynamic) String() string
func (*GetMemoryDynamic) Type ¶
func (s *GetMemoryDynamic) Type() Type
type IR ¶
type IR struct {
Instructions []Instruction
Functions []Function
Fns map[string]int
// contains filtered or unexported fields
}
func (*IR) AddFunction ¶
func (i *IR) AddFunction(fn *parser.FunctionBlock) error
func (*IR) AddInstruction ¶
func (i *IR) AddInstruction(instr Instruction) int
func (*IR) GetInstruction ¶
func (i *IR) GetInstruction(index int) Instruction
func (*IR) SetCondJmpPoint ¶
func (*IR) SetJmpPoint ¶
type Instruction ¶
type MathFunction ¶
type MathFunction struct {
Op MathFunctionType
Val int
Typ Type
}
func (*MathFunction) String ¶
func (m *MathFunction) String() string
func (*MathFunction) Type ¶
func (m *MathFunction) Type() Type
type MathFunctionType ¶
type MathFunctionType int
const ( FLOOR MathFunctionType = iota CEIL ROUND )
func (MathFunctionType) String ¶
func (m MathFunctionType) String() string
type SetMemoryDynamic ¶
func (*SetMemoryDynamic) String ¶
func (s *SetMemoryDynamic) String() string
func (*SetMemoryDynamic) Type ¶
func (s *SetMemoryDynamic) Type() Type
type StringIndex ¶
NOTE: Index is an instruction index
func (*StringIndex) String ¶
func (i *StringIndex) String() string
func (*StringIndex) Type ¶
func (i *StringIndex) Type() Type
type StringLength ¶
type StringLength struct {
Val int
}
func (*StringLength) String ¶
func (a *StringLength) String() string
func (*StringLength) Type ¶
func (a *StringLength) Type() Type
Click to show internal directories.
Click to hide internal directories.