You are here

public function AbstractLexer::moveNext in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_annotation_discovery/lib/Doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php \Doctrine\Common\Lexer\AbstractLexer::moveNext()

Moves to the next token in the input string.

A token is an associative array containing three items:

  • 'value' : the string value of the token in the input string
  • 'type' : the type of the token (identifier, numeric, string, input parameter, none)
  • 'position' : the position of the token in the input string

Return value

array|null the next token; null if there is no more tokens left

1 call to AbstractLexer::moveNext()
AbstractLexer::skipUntil in modules/providers/service_container_annotation_discovery/lib/Doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php
Tells the lexer to skip input tokens until it sees a token with the given value.

File

modules/providers/service_container_annotation_discovery/lib/Doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php, line 134

Class

AbstractLexer
Base class for writing simple lexers, i.e. for creating small DSLs.

Namespace

Doctrine\Common\Lexer

Code

public function moveNext() {
  $this->peek = 0;
  $this->token = $this->lookahead;
  $this->lookahead = isset($this->tokens[$this->position]) ? $this->tokens[$this->position++] : null;
  return $this->lookahead !== null;
}