Class phpDocumentor_TutorialHighlightParser

Description

Highlights source code using parse()

Located in /phpDocumentor/TutorialHighlightParser.inc (line 69)

Publisher
   |
   --Parser
      |
      --phpDocumentor_TutorialHighlightParser
Method Summary
 phpDocumentor_TutorialHighlightParser phpDocumentor_TutorialHighlightParser ()
 mixed checkEventPop (string|array $word, integer $pevent)
 mixed checkEventPush (string|array $word, integer $pevent)
 void configWordParser (integer $e)
 string|int getParserEventName (int $value)
 void newLineNum ()
 bool parse (string $parse_data, Converter &$converter, [false|string $filesourcepath = false], [false|integer $linenum = false])
 void setLineNum (int $num)
 void setupStates (bool|string $parsedata)
Variables

Inherited Variables

Inherited from Publisher

Publisher::$subscriber
Methods
Constructor phpDocumentor_TutorialHighlightParser (line 423)

Initialize the $tokenpushEvent, $wordpushEvent arrays

phpDocumentor_TutorialHighlightParser phpDocumentor_TutorialHighlightParser ()
checkEventPop (line 380)

This function checks whether parameter $word is a token for popping the current event off of the Event Stack.

  • return: returns false, or the event number
  • todo: CS cleanup - PHPCS needs to recognize docblock template tags
mixed checkEventPop (string|array $word, integer $pevent)
  • string|array $word: token value
  • integer $pevent: parser event from Parser.inc

Redefinition of:
Parser::checkEventPop()
this function checks whether parameter $word is a token for popping the current event off of the Event Stack.
checkEventPush (line 358)

This function checks whether parameter $word is a token for pushing a new event onto the Event Stack.

  • return: returns false, or the event number
  • todo: CS cleanup - PHPCS needs to recognize docblock template tags
mixed checkEventPush (string|array $word, integer $pevent)
  • string|array $word: token value
  • integer $pevent: parser event from Parser.inc

Redefinition of:
Parser::checkEventPush()
this function checks whether parameter $word is a token for pushing a new event onto the Event Stack.
configWordParser (line 341)

Tell the parser's WordParser $wp to set up tokens to parse words by.

Tokens are word separators. In English, a space or punctuation are examples of tokens. In PHP, a token can be a ;, a parenthesis, or even the word "function"

void configWordParser (integer $e)
  • integer $e: an event number

Redefinition of:
Parser::configWordParser()
tell the parser's WordParser $wp to set up tokens to parse words by.
getParserEventName (line 508)

searches for a parser event name based on its number

  • return: the event name, or the original value
string|int getParserEventName (int $value)
  • int $value: the event number

Redefinition of:
Parser::getParserEventName()
Debugging function, takes an event number and attempts to return its name
newLineNum (line 115)

advances output to a new line

  • uses: Converter::SourceLine() - encloses $_line in a converter-specific format
void newLineNum ()
parse (line 166)

Parse a new file

The parse() method is a do...while() loop that retrieves tokens one by one from the $_event_stack, and uses the token event array set up by the class constructor to call event handlers.

The event handlers each process the tokens passed to them, and use the _addoutput() method to append the processed tokens to the $_line variable. The word parser calls newLineNum() every time a line is reached.

In addition, the event handlers use special linking functions _link() and its cousins (_classlink(), etc.) to create in-code hyperlinks to the documentation for source code elements that are in the source code.

bool parse (string $parse_data, Converter &$converter, [false|string $filesourcepath = false], [false|integer $linenum = false])
  • string $parse_data: blah
  • Converter &$converter: blah
  • false|string $filesourcepath: full path to file with @filesource tag, if this is a @filesource parse
  • false|integer $linenum: starting line number from {@source linenum}

Redefinition of:
Parser::parse()
Parse a new file
setLineNum (line 130)

Start the parsing at a certain line number

void setLineNum (int $num)
  • int $num: the line number
setupStates (line 403)

Initialize all parser state variables

void setupStates (bool|string $parsedata)
  • bool|string $parsedata: true if we are highlighting an inline {@source} tag's output, or the name of class we are going to start from

Redefinition of:
Parser::setupStates()
setup the parser tokens, and the pushEvent/popEvent arrays

Inherited Methods

Inherited From Parser

 Parser::Parser()
 Parser::categoryTagHandler()
 Parser::checkEventPop()
 Parser::checkEventPush()
 Parser::configWordParser()
 Parser::defaultTagHandler()
 Parser::endTag()
 Parser::exampleTagHandler()
 Parser::getParserEventName()
 Parser::globalTagHandler()
 Parser::invalidTagHandler()
 Parser::packageTagHandler()
 Parser::paramTagHandler()
 Parser::parse()
 Parser::propertyTagHandler()
 Parser::returnTagHandler()
 Parser::setupStates()
 Parser::staticvarTagHandler()
 Parser::usesTagHandler()
 Parser::varTagHandler()

Inherited From Publisher

 Publisher::publishEvent()
 Publisher::subscribe()

Documentation generated on Mon, 05 Dec 2011 21:40:30 -0600 by phpDocumentor 1.4.4