Class phpDocumentorTWordParser

Description

Like WordParser, but expects an array of tokens from the tokenizer instead of a string.

Located in /phpDocumentor/phpDocumentorTWordParser.inc (line 59)

WordParser
   |
   --phpDocumentorTWordParser
Direct descendents
Class Description
phpDocumentor_HighlightWordParser Retrieve tokens from an array of tokens organized by line numbers
Method Summary
static string concatTokens (array $a)
static bool tokenEquals (mixed $a, mixed $b)
void addFileSource (array $word)
void addSource (array|string $word, [bool $file = false])
int|void backupPos ()
void findGlobal (array $tokens)
array getFileSource ()
array getSource ()
string|array getWord ()
void setup (string &$input)
Methods
static method concatTokens (line 193)

Utility function to convert a series of tokens into a string

  • return: the resulting string
static string concatTokens (array $a)
  • array $a: array of tokens
static method tokenEquals (line 178)

Utility function to determine whether two tokens from the tokenizer are equal

  • return: whether or not the tokens are equal
static bool tokenEquals (mixed $a, mixed $b)
  • mixed $a: first token
  • mixed $b: second token
addFileSource (line 278)

Wrapper for addSource() used to retrieve the entire source code organized by line number in setup()

void addFileSource (array $word)
  • array $word: full file source code
addSource (line 300)

Generate source token arrays organized by line number

This code will split up tokens that contain "\n" and add them to the source code as separate tokens on different lines.

  • uses: _set_sars()
void addSource (array|string $word, [bool $file = false])
  • array|string $word: token to add
  • bool $file: true if this should be added to $_file_source
backupPos (line 361)

backs the parser up to the previous position

  • return: can return a word
int|void backupPos ()

Redefinition of:
WordParser::backupPos()
Backup to the previous token so that it can be retrieved again in a new context.

Redefined in descendants as:
findGlobal (line 347)

Tell the phpDocumentorTWordParser to return the entire global variable if it is found.

  • uses: $_global_search
void findGlobal (array $tokens)
  • array $tokens: tokens that represent the global variable definition
getFileSource (line 148)

gets the source code tokens

array getFileSource ()
getSource (line 135)

loads up next set of source code

  • return: source code array
array getSource ()

Redefinition of:
WordParser::getSource()
Retrieve source code for the last function/method
getWord (line 218)

Retrieve a token for the phpDocumentorTParser

  • return: token from tokenizer
string|array getWord ()

Redefinition of:
WordParser::getWord()
Retrieve a token from the token list

Redefined in descendants as:
setup (line 117)

Uses http://www.php.net/token_get_all to tokenize the source code.

void setup (string &$input)
  • string &$input: source code

Redefinition of:
WordParser::setup()
Initialize the WordParser

Redefined in descendants as:

Inherited Methods

Inherited From WordParser

WordParser::backupPos()
WordParser::getBlock()
WordParser::getPos()
WordParser::getSource()
WordParser::getWord()
WordParser::setPos()
WordParser::setSeperator()
WordParser::setup()
WordParser::setWhitespace()

Documentation generated on Mon, 05 Dec 2011 21:01:07 -0600 by phpDocumentor 1.4.4