You are here

private function DocParser::PlainValue in Plug 7

PlainValue ::= integer | string | float | boolean | Array | Annotation

Return value

mixed

3 calls to DocParser::PlainValue()
DocParser::ArrayEntry in lib/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php
ArrayEntry ::= Value | KeyValuePair KeyValuePair ::= Key ("=" | ":") PlainValue | Constant Key ::= string | integer | Constant
DocParser::FieldAssignment in lib/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php
FieldAssignment ::= FieldName "=" PlainValue FieldName ::= identifier
DocParser::Value in lib/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php
Value ::= PlainValue | FieldAssignment

File

lib/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php, line 1000

Class

DocParser
A parser for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

private function PlainValue() {
  if ($this->lexer
    ->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) {
    return $this
      ->Arrayx();
  }
  if ($this->lexer
    ->isNextToken(DocLexer::T_AT)) {
    return $this
      ->Annotation();
  }
  if ($this->lexer
    ->isNextToken(DocLexer::T_IDENTIFIER)) {
    return $this
      ->Constant();
  }
  switch ($this->lexer->lookahead['type']) {
    case DocLexer::T_STRING:
      $this
        ->match(DocLexer::T_STRING);
      return $this->lexer->token['value'];
    case DocLexer::T_INTEGER:
      $this
        ->match(DocLexer::T_INTEGER);
      return (int) $this->lexer->token['value'];
    case DocLexer::T_FLOAT:
      $this
        ->match(DocLexer::T_FLOAT);
      return (double) $this->lexer->token['value'];
    case DocLexer::T_TRUE:
      $this
        ->match(DocLexer::T_TRUE);
      return true;
    case DocLexer::T_FALSE:
      $this
        ->match(DocLexer::T_FALSE);
      return false;
    case DocLexer::T_NULL:
      $this
        ->match(DocLexer::T_NULL);
      return null;
    default:
      $this
        ->syntaxError('PlainValue');
  }
}