ArithmeticPrimary() public method

ArithmeticPrimary ::= SingleValuedPathExpression | Literal | "(" SimpleArithmeticExpression ")" | FunctionsReturningNumerics | AggregateExpression | FunctionsReturningStrings | FunctionsReturningDatetime | IdentificationVariable
public ArithmeticPrimary ( )
Example #1
0
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->expression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->delimiter = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 /**
  * {@inheritDoc}
  */
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->firstTimeExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->secondTimeExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->dateTime1 = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->dateTime2 = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #4
0
 /**
  * @param Parser $parser
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->needle = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->haystack = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->expr1 = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->expr2 = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #6
0
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->firstDateExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->secondDateExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 public function parse(Parser $parser)
 {
     // levenshtein(str1, str2)
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->firstStringExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->secondStringExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #8
0
 /**
  * @param Parser $parser
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->string = $parser->StringPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->from = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->count = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 /**
  * Parses DQL function.
  *
  * @param Parser $parser
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->entityLocation = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->latitude = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->longitude = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #10
0
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->subject = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->search = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->replace = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 /**
  * {@inheritdoc}
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->parameters[self::VALUE_KEY] = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->parameters[self::FROM_TZ_KEY] = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->parameters[self::TO_TZ_KEY] = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #12
0
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->firstDateExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->intervalExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->unit = $parser->StringPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #13
0
 /**
  * @param Parser $parser
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->stringExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->lengthExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->padStringExpression = $parser->StringPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 public function parse(Parser $parser)
 {
     $lexer = $parser->getLexer();
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->values[] = $parser->ArithmeticPrimary();
     while (Lexer::T_COMMA === $lexer->lookahead['type']) {
         $parser->match(Lexer::T_COMMA);
         $this->values[] = $parser->ArithmeticPrimary();
     }
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #15
0
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $parser->match(\Doctrine\ORM\Query\Lexer::T_IDENTIFIER);
     $parser->match(\Doctrine\ORM\Query\Lexer::T_OPEN_PARENTHESIS);
     $this->field = $parser->ArithmeticPrimary();
     $lexer = $parser->getLexer();
     while (count($this->values) < 1 || $lexer->lookahead['type'] != \Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS) {
         $parser->match(\Doctrine\ORM\Query\Lexer::T_COMMA);
         $this->values[] = $parser->ArithmeticPrimary();
     }
     $parser->match(\Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS);
 }
 /**
  * @param Parser $parser
  */
 public function parse(Parser $parser)
 {
     $lexer = $parser->getLexer();
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->firstGeomExpression = $parser->ArithmeticPrimary();
     while (count($this->geomExpressions) < 1 || $lexer->lookahead['type'] != Lexer::T_CLOSE_PARENTHESIS) {
         $parser->match(Lexer::T_COMMA);
         $this->geomExpressions[] = $parser->ArithmeticPrimary();
     }
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 /**
  * @param Parser $parser
  */
 public function parse(Parser $parser)
 {
     $lexer = $parser->getLexer();
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->geomExpr[] = $parser->ArithmeticPrimary();
     while (count($this->geomExpr) < $this->minGeomExpr || ($this->maxGeomExpr === null || count($this->geomExpr) < $this->maxGeomExpr) && $lexer->lookahead['type'] != Lexer::T_CLOSE_PARENTHESIS) {
         $parser->match(Lexer::T_COMMA);
         $this->geomExpr[] = $parser->ArithmeticPrimary();
     }
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #18
0
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $lexer = $parser->getLexer();
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->firstExpression = $parser->ArithmeticPrimary();
     // parse second parameter if available
     if (Lexer::T_COMMA === $lexer->lookahead['type']) {
         $parser->match(Lexer::T_COMMA);
         $this->secondExpression = $parser->ArithmeticPrimary();
     }
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $parser->match(Lexer::T_IDENTIFIER);
     $lexer = $parser->getLexer();
     $this->unit = $lexer->token['value'];
     $parser->match(Lexer::T_COMMA);
     $this->firstDatetimeExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->secondDatetimeExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #20
0
 /**
  * @param \Doctrine\ORM\Query\Parser $parser
  *
  * @return void
  */
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $lexer = $parser->getLexer();
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->from_lat = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->from_lon = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->to_lat = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->to_lon = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 /**
  * @param Parser $parser
  */
 public function parse(Parser $parser)
 {
     $lexer = $parser->getLexer();
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->firstGeomExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->secondGeomExpression = $parser->ArithmeticPrimary();
     if ($lexer->lookahead['type'] == Lexer::T_COMMA) {
         $parser->match(Lexer::T_COMMA);
         $this->optionalExpression = $parser->ArithmeticPrimary();
     }
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #22
0
 /**
  * Parse the DQL
  *
  * @param \Doctrine\ORM\Query\Parser $parser
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->firstDateExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $parser->match(Lexer::T_IDENTIFIER);
     $this->intervalExpression = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_IDENTIFIER);
     /* @var $lexer Lexer */
     $lexer = $parser->getLexer();
     $this->unit = $lexer->token['value'];
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 /**
  * @param Parser $parser
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     // 2 arguments minimum
     $this->greatestArgs[] = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_COMMA);
     $this->greatestArgs[] = $parser->ArithmeticPrimary();
     while ($parser->getLexer()->isNextToken(Lexer::T_COMMA)) {
         $parser->match(Lexer::T_COMMA);
         $this->greatestArgs[] = $parser->ArithmeticPrimary();
     }
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #24
0
 /**
  * @param \Doctrine\ORM\Query\Parser $parser
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     // (2)
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     // (3)
     $this->firstValue = $parser->ArithmeticPrimary();
     // (4)
     $parser->match(Lexer::T_COMMA);
     // (5)
     $this->secondValue = $parser->ArithmeticPrimary();
     // (6)
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
     // (3)
 }
Example #25
0
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     // Do the field.
     $this->field = $parser->ArithmeticPrimary();
     // Add the strings to the values array. FIELD must
     // be used with at least 1 string not including the field.
     $lexer = $parser->getLexer();
     while (count($this->values) < 1 || $lexer->lookahead['type'] != Lexer::T_CLOSE_PARENTHESIS) {
         $parser->match(Lexer::T_COMMA);
         $this->values[] = $parser->ArithmeticPrimary();
     }
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #26
0
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     // (2)
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     // (3)
     $this->firstDateExpression = $parser->ArithmeticPrimary();
     // (4)
     $parser->match(Lexer::T_COMMA);
     // (5)
     $this->secondDateExpression = $parser->ArithmeticPrimary();
     // (6)
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
     // (3)
 }
 public function parse(\Doctrine\ORM\Query\Parser $parser)
 {
     $lexer = $parser->getLexer();
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     if ($lexer->lookahead['type'] === Lexer::T_DISTINCT) {
         $parser->match(Lexer::T_DISTINCT);
         $this->distinct = true;
     }
     $this->field = $parser->ArithmeticPrimary();
     if ($lexer->lookahead['type'] === Lexer::T_IDENTIFIER) {
         $parser->match(Lexer::T_IDENTIFIER);
         $this->separator = $parser->ArithmeticPrimary();
     }
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
 /**
  * {@inheritdoc}
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->parameters[self::PARAMETER_KEY] = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
Example #29
0
 public function parse(Query\Parser $parser)
 {
     $parser->match(Query\Lexer::T_IDENTIFIER);
     $parser->match(Query\Lexer::T_OPEN_PARENTHESIS);
     $this->arg = $parser->ArithmeticPrimary();
     $parser->match(Query\Lexer::T_CLOSE_PARENTHESIS);
 }
Example #30
0
 /**
  * {@inheritdoc}
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->parameters[self::PARAMETER_KEY] = $parser->ArithmeticPrimary();
     $parser->match(Lexer::T_AS);
     $parser->match(Lexer::T_IDENTIFIER);
     $lexer = $parser->getLexer();
     $type = $lexer->token['value'];
     if ($lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) {
         $parser->match(Lexer::T_OPEN_PARENTHESIS);
         /** @var Literal $parameter */
         $parameter = $parser->Literal();
         $parameters = array($parameter->value);
         if ($lexer->isNextToken(Lexer::T_COMMA)) {
             while ($lexer->isNextToken(Lexer::T_COMMA)) {
                 $parser->match(Lexer::T_COMMA);
                 $parameter = $parser->Literal();
                 $parameters[] = $parameter->value;
             }
         }
         $parser->match(Lexer::T_CLOSE_PARENTHESIS);
         $type .= '(' . implode(', ', $parameters) . ')';
     }
     if (!$this->checkType($type)) {
         $parser->syntaxError(sprintf('Type unsupported. Supported types are: "%s"', implode(', ', $this->supportedTypes)), $lexer->token);
     }
     $this->parameters[self::TYPE_KEY] = $type;
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }