void backupPos(
string
$word)
|
|
Backup to the previous token so that it can be retrieved again in a new context.
Occasionally, a word will be passed to an event handler that should be handled by another event handler. This method allows that to happen.
Overridden in child classes as:
- phpDocumentorTWordParser::backupPos()
- backs the parser up to the previous position
- phpDocumentor_HighlightWordParser::backupPos()
- back the word parser to the previous token as defined by $last_token
Parameters:
Retrieve a token from the token list
The Parser class relies upon this method to retrieve the next token. The $wordseperators array is a collection of strings that delineate tokens for the current parser state. $wordseperators is set by the parser with a call to Parser::configWordParser() every time a new parser state is reached.
For example, while parsing the source code for a class, the word
var
is a token, and
global
is not, but inside a function, the reverse is true. The parser state PARSER_STATE_CLASS has a token list that includes whitespace, code delimiters like ; and {}, and comment/DocBlock indicators
If the whitespace option has been turned off using setWhitespace(), then no whitespace is returned with tokens
{@ is of course the string containing the PHP code to be parsed, and $pos is the cursor, or current location within the parsed data. }}
Tags:
Overridden in child classes as:
- ObjectWordParser::getWord()
- phpDocumentorTWordParser::getWord()
- Retrieve a token for the phpDocumentorTParser
- phpDocumentor_HighlightWordParser::getWord()
- Retrieve the next token