/** * @param Lexer $lexer * @param char $char */ public function input(Lexer $lexer, $char) { if ($char == "'") { $lexer->setStateString(); } else { if (self::isAlpha($char)) { $lexer->setStateSymbol($char); } else { if ($char == '-' || $char == '+') { $lexer->pushOperator(new TokenUnarySign($char)); } else { if (self::isDigit($char)) { $lexer->setStateInteger($char); } else { if ($char == '(') { $lexer->pushOperator(new TokenLParen()); } else { if ($char == '*') { $lexer->pushOperator(new TokenMul()); } else { if ($char == ')') { $lexer->closeParenthesis(); } else { if ($char == ',') { $lexer->incrementLastFunctionArity(); } else { if ($char == '/') { $lexer->pushPath(new PathElementRoot()); } else { if ($char == '.') { $lexer->setStateDot(); } else { if (self::isBlank($char)) { } else { $this->throwError($lexer, $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); } } } } } } } } } }