Ejemplo n.º 1
0
 /**
  * This method parses a conditional-expression.
  *
  * <code>
  *         --------------
  * $foo = ($bar ? 42 : 23);
  *         --------------
  * </code>
  *
  * @return PHP_Depend_Code_ASTConditionalExpression
  * @since 0.9.8
  */
 private function parseConditionalExpression()
 {
     $this->tokenStack->push();
     $this->consumeToken(self::T_QUESTION_MARK);
     $expr = $this->builder->buildAstConditionalExpression();
     if (($child = $this->parseOptionalExpression()) != null) {
         $expr->addChild($child);
     }
     $this->consumeToken(self::T_COLON);
     $expr->addChild($this->parseExpression());
     return $this->setNodePositionsAndReturn($expr);
 }