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

Class: phpDocumentor_HighlightParser

Source Location: /phpDocumentor/HighlightParser.inc

Class phpDocumentor_HighlightParser

Class Overview

Highlights source code using parse()

Located in /phpDocumentor/HighlightParser.inc [line 180]

Publisher
   |
   --Parser
      |
      --phpDocumentorTParser
         |
         --phpDocumentor_HighlightParser
Author(s): API Tags:
Usedby:  parserFileSourceTag::ConvertSource() - highlights source code
Usedby:  parserExampleTag::ConvertSource() - highlights source code
Usedby:  parserExampleInlineTag::arrayConvert() - Parses the tokenized source
Usedby:  parserSourceInlineTag::arrayConvert() - Parses the tokenized source

Information Tags:
Version:  $Revision: 1.18 $

Methods

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

Inherited From phpDocumentorTParser

phpDocumentorTParser::$inlineTagHandlers
phpDocumentorTParser::$source_location

Inherited From Publisher

Publisher::$subscriber

Inherited From phpDocumentorTParser

phpDocumentorTParser::phpDocumentorTParser()
phpDocumentorTParser::checkEventPop()
this function checks whether parameter $word is a token for popping the current event off of the Event Stack.
phpDocumentorTParser::checkEventPush()
this function checks whether parameter $word is a token for pushing a new event onto the Event Stack.
phpDocumentorTParser::configWordParser()
phpDocumentorTParser::getToken()
phpDocumentorTParser::parse()
Parse a new file
phpDocumentorTParser::setupEventStates()
Creates the state arrays
phpDocumentorTParser::setupStates()
setup the parser tokens, and the pushEvent/popEvent arrays

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

Inherited From Publisher

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

[ Top ]
Method Summary
phpDocumentor_HighlightParser   phpDocumentor_HighlightParser()   Initialize the $tokenpushEvent, $wordpushEvent arrays
void   configWordParser()   Give the word parser necessary data to begin a new parse
void   newLineNum()  
bool   parse()   Parse a new file
void   setLineNum()   Start the parsing at a certain line number
void   setupStates()   Initialize all parser state variables
void   _retrieveType()  

[ Top ]
Methods
Constructor phpDocumentor_HighlightParser  [line 2098]

  phpDocumentor_HighlightParser phpDocumentor_HighlightParser( )

Initialize the $tokenpushEvent, $wordpushEvent arrays



[ Top ]
configWordParser  [line 2014]

  void configWordParser( array &$data  )

Give the word parser necessary data to begin a new parse

Parameters:
array   &$data:  all tokens separated by line number

API Tags:
Usedby:  phpDocumentor_HighlightParser::parse() - pass $parse_data to prepare retrieval of tokens


Redefinition of:
phpDocumentorTParser::configWordParser()

[ Top ]
newLineNum  [line 286]

  void newLineNum( )


API Tags:
Uses:  Converter::SourceLine() - encloses $_line in a converter-specific format


[ Top ]
parse  [line 335]

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

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.

Parameters:
array   $parse_data: 
Converter   $converter: 
boolean   $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
   &$parse_data: 
   &$converter: 

API Tags:
Staticvar:  integer $endrecur: used for recursion limiting if a handler for an event is not found
Uses:  phpDocumentor_HighlightParser::setupStates() - initialize parser state variables
Uses:  phpDocumentor_HighlightParser::configWordParser() - pass $parse_data to prepare retrieval of tokens


Redefinition of:
phpDocumentorTParser::parse()
Parse a new file

[ Top ]
setLineNum  [line 298]

  void setLineNum( $num  )

Start the parsing at a certain line number

Parameters:
   $num: 


[ Top ]
setupStates  [line 2027]

  void setupStates( boolean $inlinesourceparse, false|string $class  )

Initialize all parser state variables

Parameters:
boolean   $inlinesourceparse:  true if we are highlighting an inline {@source} tag's output
false|string   $class:  name of class we are going to start from

API Tags:
Usedby:  phpDocumentor_HighlightParser::parse() - initialize parser state variables
Uses:  $_wp - sets to a new phpDocumentor_HighlightWordParser


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

[ Top ]
_retrieveType  [line 1664]

  void _retrieveType( $value, $state, $checkforvar  )

Parameters:
   $value: 
   $state: 
   $checkforvar: 


[ Top ]

Documentation generated on Tue, 24 Oct 2006 09:23:07 -0500 by phpDocumentor 1.3.1