private void Hold(SymbolToken val)
        {
            _heldInput.Add(val);
            if (val.Type == SymbolType.OpenBracket)
            {
                _parentheses++;
            }
            if (val.Type == SymbolType.CloseBracket)
            {
                _parentheses--;
            }

            // Unary operations are the only case where an open parenthesis
            // that applies to the negation may come as the second token.
            // Unparsed negations also count, handled below as a special case
            // (since they do not require parentheses)
            if (_heldInput.Count == 1 && val.Type.IsUnaryOperation())
            {
                return;
            }

            // be careful here: new, unparsed subtractions can be continued
            // negation tokens. Be sure to handle those!
            if (_parentheses == 0 && val.Type != SymbolType.Subtraction)
            {
                var np = new NegationProcessor(_heldInput);
                Output(np.PumpAll());
                Output(SymbolToken.CloseBracket);
                _heldInput = new List <SymbolToken>();
                _holdInput = false;
            }
        }
        protected override void Finish()
        {
            if (_heldInput.Count == 0)
            {
                return;
            }

            var np = new NegationProcessor(_heldInput);

            Output(np.PumpAll());
            Output(SymbolToken.CloseBracket);
            _parentheses = 0;
            _heldInput   = new List <SymbolToken>();
            _lastOutput  = SymbolToken.OpenBracket;
            _holdInput   = false;
        }