Documentation
¶
Index ¶
- func DefaultRegistery()
- func Eval(tokenMap map[int]*tokenizer.Token)
- func NewActionList(acts ...*Action) *map[string]*Action
- func NewArgs(args ...string) map[string]VTYPE
- func NewRockyFunction()
- func NewVariableList(vars ...*Variable) *map[string]*Variable
- func RegisterFunction(function *Function)
- func TestEval(tokenMap map[int]*tokenizer.Token)
- type Action
- type Class
- type Function
- type Mathematical
- type VTYPE
- type Variable
- type VariableRegistrar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewActionList ¶
func NewRockyFunction ¶
func NewRockyFunction()
func NewVariableList ¶
Types ¶
type Function ¶
type Function struct {
Name string
Args map[string]VTYPE
VariableList map[string]*Variable
ActionList map[string]*Action
Executable func(function *Function) bool
}
func NewFunction ¶
func (*Function) SetVariableList ¶
type Mathematical ¶
func NewMathematical ¶
func NewMathematical(equation string) *Mathematical
type VTYPE ¶
type VTYPE int
TOKEN - Custom type to hold value for token type
const ( STRING VTYPE = iota + 1 // EnumIndex = 1 INT // EnumIndex = 2 CLASS // EnumIndex = 3 DOUBLE // EnumIndex = 4 NONE // EnumIndex = 3 )
Declare related constants for each Token type starting with index 1
func VTypeFromString ¶
type VariableRegistrar ¶
type VariableRegistrar struct {
// contains filtered or unexported fields
}
func NewVariableRegistrar ¶
func NewVariableRegistrar() *VariableRegistrar
func (*VariableRegistrar) GetVariable ¶
func (varR *VariableRegistrar) GetVariable(name string) *Variable
Get a Variable
func (*VariableRegistrar) RegisterVariable ¶
func (varR *VariableRegistrar) RegisterVariable(variable *Variable)
Function to register new variable
Click to show internal directories.
Click to hide internal directories.