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:
- ok, no error
- invalid number
- unknown binary operator
- unknown unary operator
- unknown token
- unexpected end of expression
- finished before the end of string
- unmatched '('
- unmatched ')'
- unknown variable
- error from eTreeInsert (internal error, this shouldn't happen)
- wrong arguments