UNPKG

nerdamer-ts

Version:

javascript light-weight symbolic math expression evaluator

20 lines (19 loc) 828 B
/** * This is the method that triggers the parsing of the string. It generates a parse tree but processes * it right away. The operator functions are called when their respective operators are reached. For instance * + with cause this.add to be called with the left and right hand values. It works by walking along each * character of the string and placing the operators on the stack and values on the output. When an operator * having a lower order than the last is reached then the stack is processed from the last operator on the * stack. * @param {String} token */ import { Token } from './Token'; export declare class Node { type: string; value: string; left?: Node; right?: Node; constructor(token: Token | Node); toString(): string; toHTML(depth?: number, indent?: number): string; }