@@ 592-600 (lines=9) @@ | ||
589 | * |
|
590 | * @return Token|integer |
|
591 | */ |
|
592 | public function next() |
|
593 | { |
|
594 | $this->tokenize(); |
|
595 | ||
596 | if ($this->index < $this->count) { |
|
597 | return $this->tokens[$this->index++]; |
|
598 | } |
|
599 | return self::T_EOF; |
|
600 | } |
|
601 | ||
602 | /** |
|
603 | * Returns the next token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if |
|
@@ 608-616 (lines=9) @@ | ||
605 | * |
|
606 | * @return integer |
|
607 | */ |
|
608 | public function peek() |
|
609 | { |
|
610 | $this->tokenize(); |
|
611 | ||
612 | if (isset($this->tokens[$this->index])) { |
|
613 | return $this->tokens[$this->index]->type; |
|
614 | } |
|
615 | return self::T_EOF; |
|
616 | } |
|
617 | ||
618 | /** |
|
619 | * Returns the type of next token, after the current token. This method |
|
@@ 642-650 (lines=9) @@ | ||
639 | * |
|
640 | * @return integer |
|
641 | */ |
|
642 | public function prev() |
|
643 | { |
|
644 | $this->tokenize(); |
|
645 | ||
646 | if ($this->index > 1) { |
|
647 | return $this->tokens[$this->index - 2]->type; |
|
648 | } |
|
649 | return self::T_BOF; |
|
650 | } |
|
651 | ||
652 | /** |
|
653 | * This method takes an array of tokens returned by <b>token_get_all()</b> |