Class: phpDocumentorTWordParser

Source Location: /phpDocumentor/phpDocumentorTWordParser.inc

Class Overview [line 59]

WordParser
   |
   --phpDocumentorTWordParser

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

Author(s):

Version:

  • Release: @VER@

Copyright:

  • 2002-2007 Gregory Beaver

Variables

Constants

Methods


Child classes:

phpDocumentor_HighlightWordParser
Retrieve tokens from an array of tokens organized by line numbers

Inherited Variables

Inherited Constants

Inherited Methods

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


Class Details

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

Tags:

[ Top ]


Class Variables


Class Methods

static concatTokens

static string concatTokens( array $a)

[line 193]

Utility function to convert a series of tokens into a string

Tags:

  • return - the resulting string

Parameters:

  • array $a - array of tokens

[ Top ]

static tokenEquals

static bool tokenEquals( mixed $a, mixed $b)

[line 178]

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

Tags:

  • return - whether or not the tokens are equal

Parameters:

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

[ Top ]

addFileSource

void addFileSource( array $word)

[line 278]

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

Parameters:

  • array $word - full file source code

[ Top ]

addSource

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

[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.

Tags:

  • uses - _set_sars()

Parameters:

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

[ Top ]

backupPos

int|void backupPos( )

[line 361]

backs the parser up to the previous position

Tags:

  • return - can return a word

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.)

Parameters:

[ Top ]

findGlobal

void findGlobal( array $tokens)

[line 347]

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

Tags:

  • uses - $_global_search

Parameters:

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

[ Top ]

getFileSource

array getFileSource( )

[line 148]

gets the source code tokens

Tags:

Parameters:

[ Top ]

getSource

array getSource( )

[line 135]

loads up next set of source code

Tags:

  • return - source code array

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

Parameters:

[ Top ]

getWord

string|array getWord( )

[line 218]

Retrieve a token for the phpDocumentorTParser

Tags:

  • return - token from tokenizer

Overridden in child classes as:

phpDocumentor_HighlightWordParser::getWord()
Retrieve the next token

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

Parameters:

[ Top ]

setup

void setup( string &$input)

[line 117]

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

Overridden in child classes as:

phpDocumentor_HighlightWordParser::setup()
Initialize the parser object

Overrides WordParser::setup() (Initialize the WordParser)

Parameters:

  • string &$input - source code

[ Top ]


Class Constants


Documentation generated on Tue, 06 Dec 2011 07:08:46 -0600 by phpDocumentor 1.4.4