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


Tutorials/Manuals:
Package-level: Files:
actions.php
bug-560532.php
bug-772441.php
builder.php
Classes.inc
clone.inc.php
clone5.inc.php
common.inc.php
config.php
EventStack.inc
file_dialog.php
HighlightParserTests.php
IntermediateParser.inc
IntermediateParserTests.php
Io.inc
new_phpdoc.php
ParserClassTests.php
ParserDescCleanup.inc
ParserPageTests.php
phpdoc.inc
phpdoc.php
phpDocumentorSetupTests.php
phpDocumentorTParserTests.php
ProceduralPages.inc
Publisher.inc
Setup.inc.php
top.php
utilities.php

subpackage DescHTML
DescHTML.inc

subpackage DocBlockTags
DocBlockTags.inc

subpackage Errors
Errors.inc

subpackage InlineTags
InlineTags.inc

subpackage Links
LinkClasses.inc

subpackage ParserData
ParserData.inc

subpackage ParserDocBlock
ParserDocBlock.inc

subpackage ParserElements
ParserElements.inc

subpackage Parsers
Beautifier.php
HighlightParser.inc
Parser.inc
phpDocumentorTParser.inc
Tokenizer.php
TutorialHighlightParser.inc
XMLpackagePageParser.inc

subpackage setup
find_phpdoc.php

subpackage Tutorial
PackagePageElements.inc

subpackage WordParsers
phpDocumentorTWordParser.inc
WordParser.inc

Classes:
Parsers
Parser
parserDescParser
phpDocumentorTParser
phpDocumentor_HighlightParser
phpDocumentor_HighlightWordParser
phpDocumentor_peardoc2_XML_Beautifier
phpDocumentor_TutorialHighlightParser
phpDocumentor_XML_Beautifier_Tokenizer
ppageParser
XMLPackagePageParser
bug_772441
Classes
EventStack
Io
phpDocumentor_IntermediateParser
phpDocumentor_setup
ProceduralPages
Publisher
tests_HighlightParserTests
tests_IntermediateParserTests
tests_ParserClassTests
tests_ParserPageTests
tests_phpDocumentorSetupTests
tests_phpDocumentorTParserTests
DescHTML
parserB
parserBr
parserCode
parserDescVar
parserI
parserKbd
parserList
parserPre
parserSamp
DocBlockTags
parserAccessTag
parserExampleTag
parserFileSourceTag
parserLicenseTag
parserLinkTag
parserMethodTag
parserNameTag
parserParamTag
parserPropertyReadTag
parserPropertyTag
parserPropertyWriteTag
parserReturnTag
parserSeeTag
parserStaticvarTag
parserTag
parserTutorialTag
parserUsedByTag
parserUsesTag
parserVarTag
Errors
ErrorTracker
RecordError
RecordWarning
InlineTags
parserExampleInlineTag
parserIdInlineTag
parserInheritdocInlineTag
parserInlineTag
parserLinkInlineTag
parserSourceInlineTag
parserTocInlineTag
parserTutorialInlineTag
Links
abstractLink
classLink
constLink
defineLink
functionLink
globalLink
methodLink
pageLink
tutorialLink
varLink
Tutorial
parserCData
parserEntity
parserXMLDocBookTag
ParserData
parserBase
parserData
parserPage
parserStringWithInlineTags
WordParsers
ObjectWordParser
phpDocumentorTWordParser
WordParser
ParserDocBlock
parserDesc
parserDocBlock
ParserElements
parserClass
parserConst
parserDefine
parserElement
parserFunction
parserGlobal
parserInclude
parserMethod
parserPackagePage
parserTutorial
parserVar

Class: WordParser

Source Location: /phpDocumentor/WordParser.inc

Class Overview


Retrieves tokens from source code for use by the Parser


Author(s):

Version:

  • Release: @VER@

Copyright:

  • 2000-2007 Joshua Eichorn

Methods


Child classes:

ObjectWordParser
Like WordParser but designed to handle an array with strings and
phpDocumentorTWordParser
Like WordParser, but expects an array of tokens from the tokenizer instead of a string.

Class Details

[line 56]
Retrieves tokens from source code for use by the Parser



Tags:

author: Joshua Eichorn <[email protected]>
version: Release: @VER@
copyright: 2000-2007 Joshua Eichorn
see: Parser
todo: CS cleanup - change package to PhpDocumentor
license: LGPL


[ Top ]


Class Methods


method backupPos [line 346]

void backupPos( string $word)

Backup to the previous token so that it can be retrieved again in a new context.

Occasionally, a word will be passed to an event handler that should be handled by another event handler. This method allows that to happen.




Overridden in child classes as:

phpDocumentorTWordParser::backupPos()
backs the parser up to the previous position
phpDocumentor_HighlightWordParser::backupPos()
back the word parser to the previous token as defined by $last_token

Parameters:

string $word token to back up to

[ Top ]

method getBlock [line 305]

string getBlock( integer $start, integer $len)

Unused

  1. function getBlock ($start, $len)
  2. {
  3. return substr ($this->data, $start, $len);
  4. }




Tags:

return: the requested block of characters


Parameters:

integer $start starting position
integer $len length of block to retrieve

[ Top ]

method getPos [line 290]

int getPos( )

Returns the current pointer position, or 1 character after the end of the word



Tags:

return: the position


[ Top ]

method getSource [line 149]

string getSource( )

Retrieve source code for the last function/method



Overridden in child classes as:

phpDocumentorTWordParser::getSource()
loads up next set of source code

[ Top ]

method getWord [line 206]

string|false getWord( )

Retrieve a token from the token list

The Parser class relies upon this method to retrieve the next token. The $wordseperators array is a collection of strings that delineate tokens for the current parser state. $wordseperators is set by the parser with a call to Parser::configWordParser() every time a new parser state is reached.

For example, while parsing the source code for a class, the word

  1. var
is a token, and
  1. global
is not, but inside a function, the reverse is true. The parser state PARSER_STATE_CLASS has a token list that includes whitespace, code delimiters like ; and {}, and comment/DocBlock indicators

If the whitespace option has been turned off using setWhitespace(), then no whitespace is returned with tokens

{@ is of course the string containing the PHP code to be parsed, and $pos is the cursor, or current location within the parsed data. }}




Tags:

return: the next token, an empty string if there are no token separators in the $wordseperators array, or false if the end of input has been reached


Overridden in child classes as:

ObjectWordParser::getWord()
phpDocumentorTWordParser::getWord()
Retrieve a token for the phpDocumentorTParser
phpDocumentor_HighlightWordParser::getWord()
Retrieve the next token

[ Top ]

method setPos [line 330]

void setPos( integer $pos)

Set the internal cursor within the source code



Parameters:

integer $pos the position

[ Top ]

method setSeperator [line 318]

void setSeperator( array &$seps)

Sets the list of possible separator tokens



Tags:

uses: $wordseperators


Parameters:

array &$seps array of strings that separate tokens

[ Top ]

method setup [line 132]

void setup( string &$input)

Initialize the WordParser



Overridden in child classes as:

ObjectWordParser::setup()
Set the word parser to go.
phpDocumentorTWordParser::setup()
Uses http://www.php.net/token_get_all to tokenize the source code.
phpDocumentor_HighlightWordParser::setup()
Initialize the parser object

Parameters:

string &$input source code

[ Top ]

method setWhitespace [line 360]

void setWhitespace( [boolean $val = false])

set parser to return or strip whitespace



Parameters:

boolean $val flag to return or strip whitespace

[ Top ]


Documentation generated on 2011年12月06日 07:15:11 -0600 by phpDocumentor 1.4.4

AltStyle によって変換されたページ (->オリジナル) /