Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/cch/www/pear/PHPDoc/parser/PhpdocParser.php
PEAR Repository - PHPDoc

PhpdocParser

PhpdocObject
   |
  +-- PhpdocParserRegExp
     |
    +-- PhpdocParserTags
       |
      +-- PhpdocParserCore
         |
        +-- PhpdocUseParser
           |
          +-- PhpdocConstantParser
             |
            +-- PhpdocModuleParser
               |
              +-- PhpdocVariableParser
                 |
                +-- PhpdocFunctionParser
                   |
                  +-- PhpdocClassParser
                     |
                    +-- PhpdocParser

"Main" class of the Parser collection.

Note that a lot of communication is done by using shared instance variables.

 

private class PhpdocParser extends PhpdocClassParser

"Main" class of the Parser collection.

Note that a lot of communication is done by using shared instance variables.

Authors,
Version0.2

 

Methods inherited from PhpdocClassParser

analyseclass, analyseclassdoc

Methods inherited from PhpdocFunctionParser

analysefunction, getfunctionargs

Methods inherited from PhpdocVariableParser

analysevariable, checkvardocs

Methods inherited from PhpdocModuleParser

analysemodule, analysemoduledoc

Methods inherited from PhpdocConstantParser

checkconstantdoc, analyseconstant

Methods inherited from PhpdocUseParser

analyseuse

Methods inherited from PhpdocParserCore

getphpdocparagraphs, getmodulesandclasses, getmoduledoc, getclasses, extractphpdoc, getdescription, getvalue, getvariabletypeandvalue

Methods inherited from PhpdocParserTags

analysetags, analyseseetagregs, gettags, gettagpos, checkparsererrors

Methods inherited from PhpdocParserRegExp

buildcomplexregexps

Methods inherited from PhpdocObject

setflagoutput, out, nametourl, outl, introspection

Public Method Summary

void

PhpdocParser([ boolean $flag_output ])

Creates an instance of PhpdocWarning and calls buildComplexRegExps() to initialize the object.
boolean

preparse()

Central parsing function.
mixed

getClassTree()

Returns the data of one parentclass and all it's subclasses or false.
mixed

getModulegroup()

Returns the data of one module group.
bool

setPhpSourcecodeFiles(array $phpfiles)

Sets the list of PHP Soucecode Files to examine.

Private Method Summary

void

addModule(string $group, string $filename)

Analyses the given file and adds the result to the module list.
void

addClass(string $classname, string $filename)

Analyses the given file and adds the result to the class list.
void

addSubclasses(string $classname)

Adds recursively subclasses to the specified class.
void

findModulegroups(array $para)

Builds the hash of module groups and the module file list.
void

findClassTrees(array $para)

Builds a hash of all class trees.
array

getClassnamesToFilenames()

Returns the mapping array from classnames to filenames

Fields inherited from PhpdocClassParser

$emptyclass, $classtags

Fields inherited from PhpdocFunctionParser

$emptyfunction, $functiontags

Fields inherited from PhpdocVariableParser

$emptyvariable, $variabletags

Fields inherited from PhpdocModuleParser

$emptymodule, $moduletags

Fields inherited from PhpdocConstantParser

$emptyconstant, $constanttags

Fields inherited from PhpdocUseParser

$emptyuse, $usetags

Fields inherited from PhpdocParserRegExp

$phpdoc_tags, $c_base, $c_complex, $php_base, $php_complex, $tags

Fields inherited from PhpdocObject

$err, $flag_output, $application, $warn

Private Field Summary

string

$currentFile

Name of the file currently parsed.
array

$phpfiles

Array of PHP Sourcecode Files to examine.
array

$classnamesToFilenames

Mapping from classnames to filenames
array

$classes

Hash with the data of the current class tree (one parentclass with all children).
array

$baseclasses

List of all parentclasses found.
array

$classfiles

List of all files containing classes.
array

$classtree

Hash of all class trees.
array

$modulefiles

List of all files containing modules.
array

$modulegroups

List of all module groups.
array

$modules

Hash with the data of the current module group.
array

$packages

Hash of all packages found.
boolean

$flag_classtree

Flag indicating that getClassTree() was called.
boolean

$flag_modulegroup

Flag indicating that getModulegroup was called.
string

$current_baseclass

Name of the base class of the current class tree

Public Method Details

PhpdocParser

public void PhpdocParser( [ boolean $flag_output ] )

  Creates an instance of PhpdocWarning and calls buildComplexRegExps() to initialize the object.

Parameter
boolean $flag_output = >>false<<
If true the parser prints status messages.
Returns void

See Also $warn, buildComplexRegExps()

preparse

public boolean preparse( )

  Central parsing function.

With version 0.3alpha PHPdoc changed the way the parser works. It does now
1 1/2 parsing runs. One prescan to build the class trees and a list of module
groups and one deep scan to extract the information. This reduces the memory
consumption.

Returns boolean $ok

See Also findModulegroups(), findClassTrees(), getModulesAndClasses()

getClassTree

public mixed getClassTree( )

  Returns the data of one parentclass and all it's subclasses or false.

Use this function to loop through the class trees. The loop should look somewhat like:
<code>while ( $classtree = $parser->getClassTree() ) ...</code>

Returns mixed $classes

Hash with the data of the current class tree or false.

See Also getModulegroup(), %::%

getModulegroup

public mixed getModulegroup( )

  Returns the data of one module group.

Use this function to loop through the module groups. The loop should look somewhat like:
<code>while ( $modulegroup = $parser->getModulegroup() ) ...</code>.

Returns mixed $modulegroup

Hash with the data of the current class tree or false.

See Also getClassTree(), addModule(), $modulegroups

setPhpSourcecodeFiles

public bool setPhpSourcecodeFiles( array $phpfiles )

  Sets the list of PHP Soucecode Files to examine.

Parameter
array $phpfiles
Returns bool $ok


Private Method Details

addModule

private void addModule( string $group, string $filename )

  Analyses the given file and adds the result to the module list.

The function analyses the given file, unsets the file in the
file list, adds the result of the parser to the module list and
if necessary it adds some data to the package list.

Parameter
string $group
Name of the module group the parsing result gets added.
string $filename
Name of the file to scan.
Returns void

See Also getPhpdocParagraphs(), analyseModule()

addClass

private void addClass( string $classname, string $filename )

  Analyses the given file and adds the result to the class list.

The first parameter (classname) comes from the prescan done
by findClassTrees()

Parameter
string $classname
Name of the class that gets added.
string $filename
Name of the file to scan.
Returns void

See Also addSubclasses(), analyseClass(), $classes

addSubclasses

private void addSubclasses( string $classname )

  Adds recursively subclasses to the specified class.

Parameter
string $classname
Name of the class that might contain subclasses
Returns void

See Also addClass()

findModulegroups

private void findModulegroups( array $para )

  Builds the hash of module groups and the module file list.

Parameter
array $para
Hash with the result of getClassesAndModules() of all files
Returns void

See Also parse(), findClassTree(), $modulegroups, $modulefiles

findClassTrees

private void findClassTrees( array $para )

  Builds a hash of all class trees.

Parameter
array $para
Hash with the result of getClassesAndModules() of all files
Returns void

See Also parse(), findModulegroups(), $classnamesToFilenames, $classtree, $classfiles, $baseclasses

getClassnamesToFilenames

private array getClassnamesToFilenames( )

  Returns the mapping array from classnames to filenames

Returns array $this

->classnamesToFilenames

See Also c::c

Private Field Details

$currentFile

private string $currentFile

>>""<<


$phpfiles

private array $phpfiles

>>array()<<

See Also parse()

$classnamesToFilenames

private array $classnamesToFilenames

>>array()<<


$classes

private array $classes

>>array()<<

See Also m::m

$baseclasses

private array $baseclasses

>>array()<<


$classfiles

private array $classfiles

>>array()<<


$classtree

private array $classtree

>>array()<<


$modulefiles

private array $modulefiles

>>array()<<


$modulegroups

private array $modulegroups

>>array()<<


$modules

private array $modules

>>array()<<

See Also c::c

$packages

private array $packages

>>array()<<


$flag_classtree

private boolean $flag_classtree

>>false<<

See Also getClassTree()

$flag_modulegroup

private boolean $flag_modulegroup

>>false<<

See Also g::g

$current_baseclass

private string $current_baseclass

>>""<<

See Also getClassTree()


Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta