/** * @param Lexer $lexer * @param char $char */ public function input(Lexer $lexer, $char) { if ($this->escaping) { $this->buffer .= $char; $this->escaping = false; } else { if ($char == "'") { $lexer->pushOperand(new TokenLiteral($this->buffer)); $this->closed = true; } else { if ($char == '\\') { $this->escaping = true; } else { if ($this->closed) { if ($char == ',') { $lexer->incrementLastFunctionArity(); $lexer->setStateEmpty(); } else { if ($char == ')') { $lexer->closeParenthesis(); } else { if (self::isBlank($char)) { } else { if ($char == '+' || $char == '-') { $lexer->pushOperator(new TokenPlusMinus($char)); } else { if ($char == '=' || $char == '!') { $lexer->setStateComparison($char); } else { if ($char == '*') { $lexer->pushOperator(new TokenMul()); } else { if ($char == ']') { $lexer->closeSquareBracket(); } else { $this->throwError($lexer, $char); } } } } } } } } else { $this->buffer .= $char; } } } } }
/** * @param Lexer $lexer * @param char $char */ public function input(Lexer $lexer, $char) { if (self::isBlank($char)) { } else { if ($char == '+' || $char == '-') { $lexer->pushOperator(new TokenPlusMinus($char)); } else { if ($char == '*') { $lexer->pushOperator(new TokenMul()); } else { if ($char == '!') { $lexer->setStateComparison($char); } else { if ($char == '=') { $lexer->setStateComparison($char); } else { if (self::isAlpha($char)) { $lexer->setStateSymbol($char); } else { if ($char == ')') { $lexer->closeParenthesis(); } else { if ($char == ']') { $lexer->closeSquareBracket(); } else { if ($char == ',') { $lexer->incrementLastFunctionArity(); } else { $this->throwError($lexer, $char); } } } } } } } } } }