Documentation
¶
Index ¶
- func GetVarList(expr interfaces.Expression) []string
- type Parser
- func (p *Parser) AddFunction(f funcs.FuncType, s string)
- func (p *Parser) Evaluate(vars map[string]decimal.Decimal) (decimal.Decimal, error)
- func (p *Parser) GetFunctions() [funcs.LevelsOfPriorities]map[string]funcs.FuncType
- func (p *Parser) Parse(str string) (interfaces.Expression, error)
- func (p *Parser) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetVarList ¶
func GetVarList(expr interfaces.Expression) []string
GetVarList - return list of variables which are used in the expression
Types ¶
type Parser ¶
type Parser struct { Operators [funcs.LevelsOfPriorities]map[string]funcs.FuncType Expression interfaces.Expression }
Parser - context structure, which contains user-defined function
func NewParser ¶
func NewParser() *Parser
NewParser - create a Parser object with default set of operators and functions
func (*Parser) AddFunction ¶
AddFunction - add user's function and it string representation
func (*Parser) GetFunctions ¶
func (*Parser) Parse ¶
func (p *Parser) Parse(str string) (interfaces.Expression, error)
Parse - parsing a string format math expression, return Exp tree
Click to show internal directories.
Click to hide internal directories.