PHP Класс PDepend\Source\Language\PHP\PHPTokenizerInternal

Наследование: implements PDepend\Source\Tokenizer\Tokenizer
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$alternativeMap array(integer=>array) BuilderContext sensitive alternative mappings.
$count integer Count of all tokens.
$index integer Internal stream pointer index.
$literalMap array(string=>integer) Mapping between php internal text tokens an php depend numeric tokens.
$reductionMap
$sourceFile PDepend\Source\AST\ASTCompilationUnit The source file instance.
$substituteTokens array(mixed=>array)
$tokenMap array(integer=>integer) Mapping between php internal tokens and php depend tokens.
$tokens PDepend\Source\Tokenizer\Token[] Prepared token list.

Открытые методы

Метод Описание
getSourceFile ( ) : ASTCompilationUnit Returns the name of the source file.
next ( ) : PDepend\Source\Tokenizer\Token | integer Returns the next token or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if there is no next token.
peek ( ) : integer Returns the next token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if there is no next token.
peekNext ( ) : integer Returns the type of next token, after the current token. This method ignores all comments between the current and the next token.
prev ( ) : integer Returns the previous token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_BOF} if there is no previous token.
setSourceFile ( string $sourceFile ) : void Sets a new php source file.

Приватные методы

Метод Описание
consumeNonePhpTokens ( array &$tokens ) : string This method fetches all tokens until an opening php tag was found and it returns the collected content. The returned value will be null if there was no none php token.
generateUnknownToken ( string $token ) : array(integer Generates a dummy/temp token for unknown string literals.
substituteTokens ( array $tokens ) : array(array) This method takes an array of tokens returned by token_get_all() and substitutes some of the tokens with those required by PDepend's parser implementation.
tokenize ( ) : void Tokenizes the content of the source file with {@link token_get_all()} and filters this token stream.

Описание методов

getSourceFile() публичный Метод

Returns the name of the source file.
public getSourceFile ( ) : ASTCompilationUnit
Результат PDepend\Source\AST\ASTCompilationUnit

next() публичный Метод

Returns the next token or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if there is no next token.
public next ( ) : PDepend\Source\Tokenizer\Token | integer
Результат PDepend\Source\Tokenizer\Token | integer

peek() публичный Метод

Returns the next token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if there is no next token.
public peek ( ) : integer
Результат integer

peekNext() публичный Метод

Returns the type of next token, after the current token. This method ignores all comments between the current and the next token.
С версии: 0.9.12
public peekNext ( ) : integer
Результат integer

prev() публичный Метод

Returns the previous token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_BOF} if there is no previous token.
public prev ( ) : integer
Результат integer

setSourceFile() публичный Метод

Sets a new php source file.
public setSourceFile ( string $sourceFile ) : void
$sourceFile string A php source file.
Результат void

Описание свойств

$alternativeMap защищенное статическое свойство

BuilderContext sensitive alternative mappings.
protected static array(integer=>array) $alternativeMap
Результат array(integer=>array)

$count защищенное свойство

Count of all tokens.
protected int $count
Результат integer

$index защищенное свойство

Internal stream pointer index.
protected int $index
Результат integer

$literalMap защищенное статическое свойство

Mapping between php internal text tokens an php depend numeric tokens.
protected static array(string=>integer) $literalMap
Результат array(string=>integer)

$reductionMap защищенное статическое свойство

protected static $reductionMap

$sourceFile защищенное свойство

The source file instance.
protected ASTCompilationUnit,PDepend\Source\AST $sourceFile
Результат PDepend\Source\AST\ASTCompilationUnit

$substituteTokens защищенное статическое свойство

protected static array(mixed=>array) $substituteTokens
Результат array(mixed=>array)

$tokenMap защищенное статическое свойство

Mapping between php internal tokens and php depend tokens.
protected static array(integer=>integer) $tokenMap
Результат array(integer=>integer)

$tokens защищенное свойство

Prepared token list.
protected Token[],PDepend\Source\Tokenizer $tokens
Результат PDepend\Source\Tokenizer\Token[]