Exemple #1
0
 /**
  * Parses a single constant declarator.
  *
  * <code>
  * class Foo
  * {
  *     //    --------
  *     const BAR = 42;
  *     //    --------
  * }
  * </code>
  *
  * Or in a comma separated constant defintion:
  *
  * <code>
  * class Foo
  * {
  *     //    --------
  *     const BAR = 42,
  *     //    --------
  *
  *     //    --------------
  *     const BAZ = 'Foobar',
  *     //    --------------
  *
  *     //    ----------
  *     const FOO = 3.14;
  *     //    ----------
  * }
  * </code>
  *
  * @return PHP_Depend_Code_ASTConstantDeclarator
  * @since 0.9.6
  */
 private function parseConstantDeclarator()
 {
     // Remove leading comments and create a new token stack
     $this->consumeComments();
     $this->tokenStack->push();
     $token = $this->consumeToken(self::T_STRING);
     $this->consumeComments();
     $this->consumeToken(self::T_EQUAL);
     $declarator = $this->builder->buildAstConstantDeclarator($token->image);
     $declarator->setValue($this->parseStaticValue());
     return $this->setNodePositionsAndReturn($declarator);
 }