Class phpDocumentor_HighlightParser

Description

Highlights source code using parse()

Located in /phpDocumentor/HighlightParser.inc (line 226)

Publisher
   |
   --Parser
      |
      --phpDocumentorTParser
         |
         --phpDocumentor_HighlightParser
Method Summary
void configWordParser (array &$data)
void newLineNum ()
bool parse (array &$parse_data, Converter &$converter, [bool $inlinesourceparse = false], [string|false $class = false], [false|integer $linenum = false], [false|string $filesourcepath = false])
void setLineNum (int $num)
void setupStates (bool $inlinesourceparse, false|string $class)
Variables
Methods
Constructor phpDocumentor_HighlightParser (line 2322)

Initialize the $tokenpushEvent, $wordpushEvent arrays

void phpDocumentor_HighlightParser ()
configWordParser (line 2231)

Give the word parser necessary data to begin a new parse

void configWordParser (array &$data)
  • array &$data: all tokens separated by line number

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

wraps the current line (via the converter) and resets it to empty

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

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 (array &$parse_data, Converter &$converter, [bool $inlinesourceparse = false], [string|false $class = false], [false|integer $linenum = false], [false|string $filesourcepath = false])
  • array &$parse_data: the parse data
  • Converter &$converter: the converter object
  • bool $inlinesourceparse: whether this data is from an inline {@source} tag
  • string|false $class: if a string, it is the name of the class whose method we are parsing containing a {@source} tag
  • false|integer $linenum: starting line number from {@source linenum}
  • false|string $filesourcepath: full path to file with @filesource tag, if this is a @filesource parse

Redefinition of:
phpDocumentorTParser::parse()
Parse a new file
setLineNum (line 365)

Start the parsing at a certain line number

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

Initialize all parser state variables

void setupStates (bool $inlinesourceparse, false|string $class)
  • bool $inlinesourceparse: true if we are highlighting an inline {@source} tag's output
  • false|string $class: 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 phpDocumentorTParser

phpDocumentorTParser::phpDocumentorTParser()
phpDocumentorTParser::parse()

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:44:00 -0600 by phpDocumentor 1.4.4