Parses expression and returns a pointer to an expression tree
The function parses the string pointed to by s and builds an expression tree.Anything that is neither a number nor a known operator is treated as a variable. New (previously unknown) variables are added to the v structure when newvars is true (greater than zero). Otherwise only known variables are accepted.
When no longer needed, the tree should be destroyed, and thus its memory freed, with eTreeDestroy().
Error value in *err SHOULD ALWAYS be checked. There are following error values:
- EOK
- ok, no error
- ENUMBER
- invalid number
- EBINOP
- unknown binary operator
- EUNOP
- unknown unary operator
- EUNKNOWN
- unknown token
- EEND
- unexpected end of expression
- EEARLY
- finished before the end of string
- EPARENO
- unmatched '('
- EPARENC
- unmatched ')'
- EVAR
- unknown variable
- ETREE
- error from eTreeInsert (internal error, this shouldn't happen)
- EARG
- wrong arguments