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

Class: phpDocumentorTParser

Source Location: /PhpDocumentor-1.4.0/phpDocumentor/phpDocumentorTParser.inc

Class Overview

Publisher
   |
   --Parser
      |
      --phpDocumentorTParser

Tokenizer-based parser for PHP source code


Author(s):

Version:

  • $Revision: 1.27 $

Variables

Methods


Child classes:

phpDocumentor_HighlightParser
Highlights source code using parse()

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()
Publisher::subscribe()
Adds a subscriber to the $subscriber array().

Class Details

[line 45]
Tokenizer-based parser for PHP source code


[ Top ]


Class Variables

$eventHandlers = array(
                                PARSER_EVENT_ARRAY => 'handleArray',
                                PARSER_EVENT_VAR_ARRAY => 'handleArray',
                                PARSER_EVENT_VAR_ARRAY_COMMENT => 'handleVarArrayComment',
                                PARSER_EVENT_CLASS => 'handleClass',
                                PARSER_EVENT_COMMENT => 'handleComment',
                                PARSER_EVENT_DOCBLOCK_TEMPLATE => 'handleDocBlockTemplate',
                                PARSER_EVENT_END_DOCBLOCK_TEMPLATE => 'handleEndDocBlockTemplate',
                                PARSER_EVENT_LOGICBLOCK => 'handleLogicBlock',
                                PARSER_EVENT_NOEVENTS => 'defaultHandler',
                                PARSER_EVENT_OUTPHP => 'defaultHandler',
                                PARSER_EVENT_DEFINE => 'handleDefine',
                                PARSER_EVENT_DEFINE_PARAMS => 'handleDefineParams',
                                PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS => 'handleDefineParamsParenthesis',
                                PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS => 'handleIncludeParamsParenthesis',
                                PARSER_EVENT_DOCBLOCK => 'handleDocBlock',
                                PARSER_EVENT_TAGS => 'handleTags',
                                PARSER_EVENT_DESC => 'handleDesc',
                                PARSER_EVENT_DOCKEYWORD => 'handleTag',
                                PARSER_EVENT_DOCKEYWORD_EMAIL => 'handleDockeywordEmail',
                                PARSER_EVENT_EOFQUOTE => 'handleHereDoc',
                                PARSER_EVENT_FUNCTION => 'handleFunction',
                                PARSER_EVENT_FUNCTION_PARAMS => 'handleFunctionParams',
                                PARSER_EVENT_FUNCTION_PARAM_VAR => 'handleFunctionParams',
                                PARSER_EVENT_FUNC_GLOBAL => 'handleFuncGlobal',
                                PARSER_EVENT_DEFINE_GLOBAL => 'handleGlobal',
                                PARSER_EVENT_GLOBAL_VALUE => 'handleGlobalValue',
                                PARSER_EVENT_INLINE_DOCKEYWORD => 'handleInlineDockeyword',
                                PARSER_EVENT_INCLUDE => 'handleInclude',
                                PARSER_EVENT_INCLUDE_PARAMS => 'handleIncludeParams',
                                PARSER_EVENT_QUOTE => 'handleQuote',
                                PARSER_EVENT_PHPCODE => 'handlePhpCode',
                                PARSER_EVENT_SINGLEQUOTE => 'handleSingleQuote',
                                PARSER_EVENT_STATIC_VAR => 'handleStaticVar',
                                PARSER_EVENT_STATIC_VAR_VALUE => 'handleStaticValue',
                                PARSER_EVENT_VAR => 'handleVar',
                                PARSER_EVENT_ACCESS_MODIFIER => 'handleAccessModifier',
                                PARSER_EVENT_IMPLEMENTS => 'handleImplements',
                                PARSER_EVENT_CLASS_CONSTANT => 'handleClassConstant',
    )

[line 133]


Type:   mixed


[ Top ]

$inlineTagHandlers = array(
                                '*' => 'handleDefaultInlineTag',
                                'link' => 'handleLinkInlineTag',
                                )

[line 174]


Type:   mixed


[ Top ]

$source_location =

[line 132]

relative path of the parsed file from the base parse directory

Type:   string


[ Top ]



Method Detail

phpDocumentorTParser (Constructor)   [line 179]

phpDocumentorTParser phpDocumentorTParser( )


[ Top ]

checkEventPop   [line 2352]

mixed checkEventPop( $word, $pevent)

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 popped off of the stack

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

Parameters:

   $word   — 
   $pevent   — 

[ Top ]

checkEventPush   [line 2320]

mixed checkEventPush( $word, $pevent)

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

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

Parameters:

   $word   — 
   $pevent   — 

[ Top ]

configWordParser   [line 2740]

void configWordParser( &$data)


Overridden in child classes as:

phpDocumentor_HighlightParser::configWordParser()
Give the word parser necessary data to begin a new parse

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

Parameters:

   &$data   — 

[ Top ]

getToken   [line 2373]

void getToken( $word)


Parameters:

   $word   — 

[ Top ]

parse   [line 199]

bool parse( &$parse_data, string $path, [int $base = 0], [ $packages = false], string $parse_data)

Parse a new file
  • Staticvar: integer $endrecur: used for recursion limiting if a handler for an event is not found

Overridden in child classes as:

phpDocumentor_HighlightParser::parse()
Parse a new file

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

Parameters:

string   $parse_data   — 
string   $path   — 
int   $base   —  number of directories to drop off the bottom when creating names using path
   &$parse_data   — 
   $packages   — 

[ Top ]

setupEventStates   [line 2441]

void setupEventStates( )

Creates the state arrays

[ Top ]

setupStates   [line 2384]

void setupStates( )

setup the parser tokens, and the pushEvent/popEvent arrays

Overridden in child classes as:

phpDocumentor_HighlightParser::setupStates()
Initialize all parser state variables

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


Documentation generated on Mon, 11 Mar 2019 15:08:19 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.