mathjslab
Version:
MathJSLab - An interpreter with language syntax like MATLAB®/Octave, ISBN 978-65-00-82338-7.
19 lines (18 loc) • 963 B
TypeScript
import * as AST from './AST';
import type { AliasFunction, BuiltInFunctionTable, BuiltInFunctionTableEntry } from './Evaluator';
declare class SymbolTable {
variableTable: Record<string, AST.NodeExpr>;
functionTable: Record<string, AST.NodeFunction>;
builtInTable: BuiltInFunctionTable;
aliasName: AliasFunction;
parent: SymbolTable | null;
child: SymbolTable[];
scope: string | null;
constructor(builtInTable: BuiltInFunctionTable, aliasName: AliasFunction, parent?: SymbolTable | null, scope?: string | null, node?: any);
lookupVariable(id: string): [AST.NodeExpr, string | null] | null;
insertVariable(id: string, expression: AST.NodeExpr): [AST.NodeExpr, string | null];
lookupFunction(id: string): [AST.NodeFunction | BuiltInFunctionTableEntry, string | null] | null;
insertFunction(id: string, entry: AST.NodeFunction): [AST.NodeFunction, string | null];
}
export { SymbolTable };
export default SymbolTable;