PHP Class PDepend\Source\Language\PHP\PHPTokenizerInternal

Inheritance: implements PDepend\Source\Tokenizer\Tokenizer
Mostrar archivo Open project: horde/horde Class Usage Examples

Protected Properties

Property 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.

Public Methods

Method 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

Method 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 method

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

next() public method

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
return PDepend\Source\Tokenizer\Token | integer

peek() public method

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

peekNext() public method

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
return integer

prev() public method

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

setSourceFile() public method

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

Property Details

$alternativeMap protected_oe static_oe property

BuilderContext sensitive alternative mappings.
protected static array(integer=>array) $alternativeMap
return array(integer=>array)

$count protected_oe property

Count of all tokens.
protected int $count
return integer

$index protected_oe property

Internal stream pointer index.
protected int $index
return integer

$literalMap protected_oe static_oe property

Mapping between php internal text tokens an php depend numeric tokens.
protected static array(string=>integer) $literalMap
return 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
return PDepend\Source\AST\ASTCompilationUnit

$substituteTokens protected_oe static_oe property

protected static array(mixed=>array) $substituteTokens
return array(mixed=>array)

$tokenMap protected_oe static_oe property

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

$tokens protected_oe property

Prepared token list.
protected Token[],PDepend\Source\Tokenizer $tokens
return PDepend\Source\Tokenizer\Token[]