private function DocParser::match

Attempts to match the given token with the current lookahead token. If they match, updates the lookahead token; otherwise raises a syntax error.

Parameters

int $token type of Token.:

Return value

bool True if tokens match; false otherwise.

6 calls to DocParser::match()
DocParser::Annotation in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php
Annotation ::= "@" AnnotationName ["(" [Values] ")"] AnnotationName ::= QualifiedName | SimpleName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName NameSpacePart ::= identifier…
DocParser::Arrayx in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php
Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}"
DocParser::FieldAssignment in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php
FieldAssignment ::= FieldName "=" PlainValue FieldName ::= identifier
DocParser::Identifier in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php
Identifier ::= string
DocParser::PlainValue in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php
PlainValue ::= integer | string | float | boolean | Array | Annotation

... See full list

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php, line 307

Class

DocParser
A parser for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

private function match($token) {
  if (!$this->lexer
    ->isNextToken($token)) {
    $this
      ->syntaxError($this->lexer
      ->getLiteral($token));
  }
  return $this->lexer
    ->moveNext();
}