phpDocumentor phpDocumentor
WordParsers
[ class tree: phpDocumentor ] [ index: phpDocumentor ] [ all elements ]

Class: phpDocumentorTWordParser

Source Location: /phpDocumentor/phpDocumentorTWordParser.inc

Class phpDocumentorTWordParser

Class Overview

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

Located in /phpDocumentor/phpDocumentorTWordParser.inc [line 59]

WordParser
   |
   --phpDocumentorTWordParser
Author(s): Information Tags:
Version:  Release: @VER@
Copyright:  2002-2007 Gregory Beaver
Link:  http://pear.php.net/PhpDocumentor
Link:  http://www.phpdoc.org
Todo:  CS cleanup - change package to PhpDocumentor
Todo:  CS cleanup - change classname to PhpDocumentor_*
Since:  1.2
License:  LGPL

Methods

[ Top ]
Descendants
Child Class Description
phpDocumentor_HighlightWordParser Retrieve tokens from an array of tokens organized by line numbers

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From 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

[ Top ]
Method Summary
static string   concatTokens()   Utility function to convert a series of tokens into a string
static bool   tokenEquals()   Utility function to determine whether two tokens from the tokenizer are equal
void   addFileSource()   Wrapper for addSource() used to retrieve the entire source code organized by line number in setup()
void   addSource()   Generate source token arrays organized by line number
int|void   backupPos()   backs the parser up to the previous position
void   findGlobal()   Tell the phpDocumentorTWordParser to return the entire global variable if it is found.
array   getFileSource()   gets the source code tokens
array   getSource()   loads up next set of source code
string|array   getWord()   Retrieve a token for the phpDocumentorTParser
void   setup()   Uses http://www.php.net/token_get_all to tokenize the source code.

[ Top ]
Methods
static method concatTokens  [line 193]

  static string concatTokens( array $a  )

Utility function to convert a series of tokens into a string

Parameters:
array   $a:  array of tokens

API Tags:
Return:  the resulting string


[ Top ]
static method tokenEquals  [line 178]

  static 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

API Tags:
Return:  whether or not the tokens are equal


[ Top ]
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


[ Top ]
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

API Tags:
Uses:  _set_sars()


[ Top ]
backupPos  [line 361]

  int|void backupPos( )

backs the parser up to the previous position


API Tags:
Return:  can return a word


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

Redefined in descendants as:

[ Top ]
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

API Tags:
Uses:  $_global_search


[ Top ]
getFileSource  [line 148]

  array getFileSource( )

gets the source code tokens


API Tags:
Return:  source code tokens split up by line number
Usedby:  parserExampleTag::parserExampleTag() - uses to parse an example and retrieve all tokens by line number


[ Top ]
getSource  [line 135]

  array getSource( )

loads up next set of source code


API Tags:
Return:  source code array


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

[ Top ]
getWord  [line 218]

  string|array getWord( )

Retrieve a token for the phpDocumentorTParser


API Tags:
Return:  token from tokenizer


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

Redefined in descendants as:

[ Top ]
setup  [line 117]

  void setup( string &$input  )

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

Parameters:
string   &$input:  source code


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

Redefined in descendants as:

[ Top ]

Documentation generated on Tue, 06 Dec 2011 07:21:12 -0600 by phpDocumentor 1.4.4