PHP_Parser_Tokenizer
public class PHP_Parser_Tokenizer
Field Summary | |
---|---|
int | Total Number of tokens. |
private mixed | |
private string | String of global variable to search forphpDocumentor-specific usage, extracted from documentation's @global tag |
private mixed | Tokenizing options |
private mixed | |
private mixed | |
boolean | Debugging on/off |
string | The string of the last Comment Token |
int | ID of the last Comment Token |
int | ID of the last Comment Token |
string | The string of the last Comment Token |
int | Current line. |
int | Current token position. |
int | The current token (either a ord(';') or token numer - see php tokenizer. |
mixed | |
array | Tokens - array of all the tokens. |
string | The value associated with a token - eg. |
string | The value associated with a token plus preceding whitespace, if anyThis is only filled if whitespace attachment is turned on, for performance reasons |
Constructor Summary | |
---|---|
PHP_Parser_Tokenizer(mixed data, mixed docparser, string PHP) ConstructorLoad the tokenizer - with a string to tokenize. |
Method Summary | |
---|---|
private void | Helper function for advance(), parses and publishes doc comments as necessary |
private void | _setGlobalSearch(mixed var, string ) |
boolean | advance() The main advance call required by the parser return true if a token is available, false if no more are available. |
array | get the last comment block (and reset it) |
void | getValue() |
string | Return the whitespace (if any) that preceded the current token |
void | globalSearch(mixed var, string global) Compare global variable to search value, to see if we've found a variable that must be documented |
void | |
void | handleMessage(mixed msg, MsgServer_Msg ) |
string | return something useful, when a parse error occurs. |
void | |
void | |
void |
public int $N
Total Number of tokens.
private mixed $_docParser
private string $_globalSearch = false
String of global variable to search for
phpDocumentor-specific usage, extracted from documentation's @global tag
private mixed $_options
Tokenizing options
private mixed $_trackingWhitespace
private mixed $_whitespace
public boolean $debug = false
Debugging on/off
public string $lastComment
The string of the last Comment Token
public int $lastCommentLine
ID of the last Comment Token
public int $lastCommentToken
ID of the last Comment Token
public string $lastParsedComment
The string of the last Comment Token
public int $line
Current line.
public int $pos = -1
Current token position.
public int $token
The current token (either a ord(';') or token numer - see php tokenizer.
public mixed $tokenValue
public array $tokens
Tokens - array of all the tokens.
public string $value
The value associated with a token - eg. for T_STRING it's the string
public string $valueWithWhitespace
The value associated with a token plus preceding whitespace, if any
This is only filled if whitespace attachment is turned on, for performance reasons
public PHP_Parser_Tokenizer(mixed data, mixed docparser, string PHP)
Constructor
Load the tokenizer - with a string to tokenize. tidies up array, sets vars pos, line, N and tokens
private void _handleDocumentation()
Helper function for advance(), parses and publishes doc comments as necessary
private void _setGlobalSearch(mixed var, string )
public boolean advance()
The main advance call required by the parser
return true if a token is available, false if no more are available. skips stuff that is not a valid token stores lastcomment, lastcommenttoken
public array getLastComment()
get the last comment block (and reset it)
public void getValue()
public string getWhitespace()
Return the whitespace (if any) that preceded the current token
public void globalSearch(mixed var, string global)
Compare global variable to search value, to see if we've found a variable that must be documented
public void haltLexing()
public void handleMessage(mixed msg, MsgServer_Msg )
public string parseError()
return something useful, when a parse error occurs.
used to build error messages if the parser fails, and needs to know the line number..
public void releaseInstance()
public void stopTrackingWhitespace()
public void trackWhitespace()
The tokenizer wrapper for parser - implements the 'standard?' yylex interface
2 main methods:
$value
- sets$token
uses a few flags like: -
$line
- current line number -$pos
- current token id -$N
- total no. of tokens