PHP Class PDepend\Source\Language\PHP\PHPTokenizerInternal

Inheritance: implements PDepend\Source\Tokenizer\Tokenizer
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

getSourceFile() public méthode

Returns the name of the source file.
public getSourceFile ( ) : ASTCompilationUnit
Résultat PDepend\Source\AST\ASTCompilationUnit

next() public méthode

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
Résultat PDepend\Source\Tokenizer\Token | integer

peek() public méthode

Returns the next token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_EOF} if there is no next token.
public peek ( ) : integer
Résultat integer

peekNext() public méthode

Returns the type of next token, after the current token. This method ignores all comments between the current and the next token.
Since: 0.9.12
public peekNext ( ) : integer
Résultat integer

prev() public méthode

Returns the previous token type or {@link \PDepend\Source\Tokenizer\Tokenizer::T_BOF} if there is no previous token.
public prev ( ) : integer
Résultat integer

setSourceFile() public méthode

Sets a new php source file.
public setSourceFile ( string $sourceFile ) : void
$sourceFile string A php source file.
Résultat void

Property Details

$alternativeMap protected_oe static_oe property

BuilderContext sensitive alternative mappings.
protected static array(integer=>array) $alternativeMap
Résultat array(integer=>array)

$count protected_oe property

Count of all tokens.
protected int $count
Résultat integer

$index protected_oe property

Internal stream pointer index.
protected int $index
Résultat integer

$literalMap protected_oe static_oe property

Mapping between php internal text tokens an php depend numeric tokens.
protected static array(string=>integer) $literalMap
Résultat array(string=>integer)

$reductionMap protected_oe static_oe property

protected static $reductionMap

$sourceFile protected_oe property

The source file instance.
protected ASTCompilationUnit,PDepend\Source\AST $sourceFile
Résultat PDepend\Source\AST\ASTCompilationUnit

$substituteTokens protected_oe static_oe property

protected static array(mixed=>array) $substituteTokens
Résultat array(mixed=>array)

$tokenMap protected_oe static_oe property

Mapping between php internal tokens and php depend tokens.
protected static array(integer=>integer) $tokenMap
Résultat array(integer=>integer)

$tokens protected_oe property

Prepared token list.
protected Token[],PDepend\Source\Tokenizer $tokens
Résultat PDepend\Source\Tokenizer\Token[]