Class phpDocumentorTWordParser

(line 59)

Description

WordParser
   |
   --phpDocumentorTWordParser

Located in File: /phpDocumentor/phpDocumentorTWordParser.inc

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


Classes extended from phpDocumentorTWordParser:
phpDocumentor_HighlightWordParser
Retrieve tokens from an array of tokens organized by line numbers

Class Variables

Summary:

Class Constants

Summary:

Method Detail

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)

Static Method concatTokens (line 193)

string concatTokens( array $a)

Utility function to convert a series of tokens into a string

Parameters

  • array $a: array of tokens

Info

  • return - the resulting string

Static Method tokenEquals (line 178)

bool tokenEquals( mixed $a, mixed $b)

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

Parameters

  • mixed $a: first token
  • mixed $b: second token

Info

  • return - whether or not the tokens are equal

Method addFileSource (line 278)

void addFileSource( array $word)

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

Parameters

  • array $word: full file source code

Info

Method addSource (line 300)

void addSource( array|string $word, [bool $file = false])

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.

Parameters

  • array|string $word: token to add
  • bool $file: true if this should be added to $_file_source

Info

  • uses - _set_sars()

Method backupPos (line 361)

int|void backupPos( )

Overridden in child classes as:

phpDocumentor_HighlightWordParser::backupPos()
back the word parser to the previous token as defined by $last_token

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

backs the parser up to the previous position

Info

  • return - can return a word

Method findGlobal (line 347)

void findGlobal( array $tokens)

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

Parameters

  • array $tokens: tokens that represent the global variable definition

Info

  • uses - $_global_search

Method getFileSource (line 148)

array getFileSource( )

gets the source code tokens

Info

Method getSource (line 135)

array getSource( )

Overrides : WordParser::getSource() Retrieve source code for the last function/method

loads up next set of source code

Info

  • return - source code array

Method getWord (line 218)

string|array getWord( )

Overridden in child classes as:

phpDocumentor_HighlightWordParser::getWord()
Retrieve the next token

Overrides : WordParser::getWord() Retrieve a token from the token list

Retrieve a token for the phpDocumentorTParser

Info

  • return - token from tokenizer

Method setup (line 117)

void setup( string &$input)

Overridden in child classes as:

phpDocumentor_HighlightWordParser::setup()
Initialize the parser object

Overrides : WordParser::setup() Initialize the WordParser

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

Parameters

  • string &$input: source code

Info

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary

Inherited From Class WordParser

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

WordParser::getBlock() - Unused

WordParser::getPos() - Returns the current pointer position, or 1 character after the end of the word

WordParser::getSource() - Retrieve source code for the last function/method

WordParser::getWord() - Retrieve a token from the token list

WordParser::setPos() - Set the internal cursor within the source code

WordParser::setSeperator() - Sets the list of possible separator tokens

WordParser::setup() - Initialize the WordParser

WordParser::setWhitespace() - set parser to return or strip whitespace



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