public ParseTree(string expression) { if (string.IsNullOrWhiteSpace(expression)) { _root = new Operand(0); return; } _table = new TableOfOperations(); var tokens = expression.Split(' '); var iter = GetSequence(tokens); BuildTree(ref _root, iter); }
public override int Evaluate() => _table[_operator](_leftNode.Evaluate(), _rightNode.Evaluate());
public Operator(string op, TableOfOperations table) { _operator = op; _table = table; }