Methods |
public __construct(array $options = []) Creates a Lexer.
|
public getNextToken( $value = NULL, $startAttributes = NULL, $endAttributes = NULL) : int Fetches the next token. The available attributes are determined by the 'usedAttributes' option, which can
|
public getTokens() : array Returns the token array for current code. The token array is in the same format as provided by the
|
public handleHaltCompiler() : string Handles __halt_compiler() by returning the text after it.
|
public startLexing(string $code, ?PhpParser Initializes the lexer for lexing the provided source code. This function does not throw if lexing errors occur. Instead, errors may be retrieved using
|
Properties |
protected $code = NULL |
protected $dropTokens = NULL |
protected $filePos = NULL |
protected $identifierTokens = NULL |
protected $line = NULL |
protected $pos = NULL |
protected $prevCloseTagHasNewline = NULL |
protected $tokenMap = NULL |
protected $tokens = NULL |
Methods |
protected createTokenMap() : array Creates the token map. The token map maps the PHP internal token identifiers
|
protected postprocessTokens(PhpParser |
Properties |
private $attributeCommentsUsed = NULL |
private $attributeEndFilePosUsed = NULL |
private $attributeEndLineUsed = NULL |
private $attributeEndTokenPosUsed = NULL |
private $attributeStartFilePosUsed = NULL |
private $attributeStartLineUsed = NULL |
private $attributeStartTokenPosUsed = NULL |
Methods |
private createIdentifierTokenMap() : array |
private defineCompatibilityTokens() |
private handleInvalidCharacterRange( $start, $end, $line, PhpParser |
private isUnterminatedComment( $token) : bool Check whether comment token is unterminated.
|