Creates a new MathParser instance.
No configuration required — the grammar is built-in.
Evaluates a MathExpression tree to a numeric result where possible (i.e. when no unbound variables are present).
The expression to evaluate.
OptionalvariableBindings: Record<string, number>Optional map of variable name → value.
The numeric result, or null if the expression contains
unbound variables or is structurally unevaluable.
Parses an ordered array of recognition results into an expression tree. Tokens must be sorted by their bounding-box x-position (left to right).
Ordered symbol tokens from SymbolRecognition.
A ParseResult — either a valid tree or an error message.
Converts a parsed MathExpression tree to a LaTeX string.
A successfully parsed expression.
LaTeX representation, e.g. "\\frac{3}{4} + x^{2}".
Parses a token sequence from SymbolRecognition into an expression tree.