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

Class: phpDocumentor_TutorialHighlightParser

Source Location: /phpDocumentor/TutorialHighlightParser.inc

Class Overview

Publisher
   |
   --Parser
      |
      --phpDocumentor_TutorialHighlightParser

Highlights source code using parse()


Author(s):

Version:

  • Release: @VER@

Copyright:

  • 2003-2007 Gregory Beaver

Methods


Inherited Variables

Inherited Methods

Class: Parser

Parser::Parser()
Set up invariant parsing variables
Parser::categoryTagHandler()
handles @category
Parser::checkEventPop()
this function checks whether parameter $word is a token for popping the current event off of the Event Stack.
Parser::checkEventPush()
this function checks whether parameter $word is a token for pushing a new event onto the Event Stack.
Parser::configWordParser()
tell the parser's WordParser $wp to set up tokens to parse words by.
Parser::defaultTagHandler()
Handles all standard tags that only have a description
Parser::endTag()
Called to clean up at the end of parsing a @tag in a docblock
Parser::exampleTagHandler()
handles @example
Parser::getParserEventName()
Debugging function, takes an event number and attempts to return its name
Parser::globalTagHandler()
handles @global
Parser::invalidTagHandler()
Handles tags like '@filesource' that only work in PHP 4.3.0+
Parser::packageTagHandler()
handles @package
Parser::paramTagHandler()
handles @param
Parser::parse()
Parse a new file
Parser::propertyTagHandler()
Handles @property(-read or -write) and @method magic tag
Parser::returnTagHandler()
handles @return
Parser::setupStates()
setup the parser tokens, and the pushEvent/popEvent arrays
Parser::staticvarTagHandler()
handles @staticvar
Parser::usesTagHandler()
handles @uses
Parser::varTagHandler()
handles @var

Class: Publisher

Publisher::publishEvent()
Publish an event
Publisher::subscribe()
Adds a subscriber to the $subscriber array().

Class Details

[line 69]
Highlights source code using parse()



Tags:

author:  Gregory Beaver <cellog@php.net>
version:  Release: @VER@
copyright:  2003-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_*
license:  LGPL


[ Top ]


Class Methods


constructor phpDocumentor_TutorialHighlightParser [line 423]

phpDocumentor_TutorialHighlightParser phpDocumentor_TutorialHighlightParser( )

Initialize the $tokenpushEvent, $wordpushEvent arrays



[ Top ]

method checkEventPop [line 380]

mixed checkEventPop( string|array $word, integer $pevent)

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



Tags:

return:  returns false, or the event number
todo:  CS cleanup - PHPCS needs to recognize docblock template tags


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

Parameters:

string|array   $word   token value
integer   $pevent   parser event from Parser.inc

[ Top ]

method checkEventPush [line 358]

mixed checkEventPush( string|array $word, integer $pevent)

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



Tags:

return:  returns false, or the event number
todo:  CS cleanup - PHPCS needs to recognize docblock template tags


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

Parameters:

string|array   $word   token value
integer   $pevent   parser event from Parser.inc

[ Top ]

method configWordParser [line 341]

void configWordParser( integer $e)

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"




Tags:

see:  WordParser
usedby:  phpDocumentor_TutorialHighlightParser::parse() - pass $parse_data to prepare retrieval of tokens


Overrides Parser::configWordParser() (tell the parser's WordParser $wp to set up tokens to parse words by.)

Parameters:

integer   $e   an event number

[ Top ]

method getParserEventName [line 508]

string|int getParserEventName( int $value)

searches for a parser event name based on its number



Tags:

return:  the event name, or the original value


Overrides Parser::getParserEventName() (Debugging function, takes an event number and attempts to return its name)

Parameters:

int   $value   the event number

[ Top ]

method newLineNum [line 115]

void newLineNum( )

advances output to a new line



Tags:

uses:  Converter::SourceLine() - encloses $_line in a converter-specific format


[ Top ]

method parse [line 166]

bool parse( string $parse_data, Converter &$converter, [false|string $filesourcepath = false], [false|integer $linenum = false])

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.




Tags:

staticvar:  integer $endrecur: used for recursion limiting if a handler for an event is not found
todo:  CS cleanup - unable to get function signature below 85char wide
uses:  phpDocumentor_TutorialHighlightParser::setupStates() - initialize parser state variables
uses:  phpDocumentor_TutorialHighlightParser::configWordParser() - pass $parse_data to prepare retrieval of tokens


Overrides Parser::parse() (Parse a new file)

Parameters:

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}

[ Top ]

method setLineNum [line 130]

void setLineNum( int $num)

Start the parsing at a certain line number



Parameters:

int   $num   the line number

[ Top ]

method setupStates [line 403]

void setupStates( bool|string $parsedata)

Initialize all parser state variables



Tags:

usedby:  phpDocumentor_TutorialHighlightParser::parse() - initialize parser state variables
uses:  $_wp - sets to a new phpDocumentor_HighlightWordParser


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

Parameters:

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

[ Top ]


Documentation generated on Tue, 06 Dec 2011 07:15:10 -0600 by phpDocumentor 1.4.4