|
|
File: c:/www/apache/doc2//parser/PhpdocParser.php
PHPDOC 2000/12/03 - PHPDoc
PhpdocParser
PhpdocObject | +-- PhpdocParserRegExp | +-- PhpdocParserTags | +-- PhpdocParserCore | +-- PhpdocUseParser | +-- PhpdocConstantParser | +-- PhpdocModuleParser | +-- PhpdocVariableParser | +-- PhpdocFunctionParser | +-- PhpdocClassParser | +-- PhpdocParser
"Main" class of the Parser collection.
|
private class PhpdocParser extends PhpdocClassParser
"Main" class of the Parser collection.
Note that a lot of communication is done using shared instance variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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<< |
|
true the parser prints status messages. |
|
Returns |
void |
|
preparse |
public boolean preparse( )
|
|
Central parsing function.
With version 0.3alpha PHPdoc changed the way the parser works. It does now1 1/2 parsing runs. One prescan to build the class trees and a list of modulegroups and one deep scan to extract the information. This reduces the memoryconsumption.
|
Returns |
boolean $ok |
See Also |
findModulegroups(), findClassTrees() |
|
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(), $baseclasses |
|
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 |
|
|
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 thefile list, adds the result of the parser to the module list andif necessary it adds some data to the package list.
|
Parameter |
|
string |
$group |
|
|
of the module group the parsing result gets added. |
|
|
string |
$filename |
|
|
of the file to scan. |
|
Returns |
void |
|
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 doneby findClassTrees()
|
Parameter |
|
string |
$classname |
|
|
of the class that gets added. |
|
|
string |
$filename |
|
|
of the file to scan. |
|
Returns |
void |
See Also |
addSubclasses(), $classes |
|
addSubclasses |
private void addSubclasses( string $classname )
|
|
Adds recursively subclasses to the specified class.
|
Parameter |
|
string |
$classname |
|
|
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 |
|
|
with the result of getClassesAndModules() of all files |
|
Returns |
void |
See Also |
$modulegroups, $modulefiles |
|
findClassTrees |
private void findClassTrees( array $para )
|
|
Builds a hash of all class trees.
|
Parameter |
|
array |
$para |
|
|
with the result of getClassesAndModules() of all files |
|
Returns |
void |
See Also |
findModulegroups(), $classnamesToFilenames, $classtree, $classfiles, $baseclasses |
|
getClassnamesToFilenames |
private array getClassnamesToFilenames( )
|
|
Returns the mapping array from classnames to filenames
|
Returns |
array |
See Also |
$classnamesToFilenames |
|
|
Private Field Details |
$currentFile |
private string $currentFile
>>"" <<
Name of the file currently parsed.
Instead of passing the name of the current file by argumentPHPDoc uses this slot to communicate. Yeah I know, it'sthe way methods should communicate, but it saves me a lota lot of work.
|
|
$phpfiles |
private array $phpfiles
>>array() <<
Array of PHP Sourcecode Files to examine.
The array keys hold the filenames, the array values the file content.
|
|
$classnamesToFilenames |
private array $classnamesToFilenames
>>array() <<
Mapping from classnames to filenames
|
|
$classes |
private array $classes
>>array() <<
Hash with the data of the current class tree (one parentclass with all children).
|
See Also |
$modules |
|
$baseclasses |
private array $baseclasses
>>array() <<
List of all parentclasses found.
|
|
$classfiles |
private array $classfiles
>>array() <<
List of all files containing classes.
|
|
$classtree |
private array $classtree
>>array() <<
Hash of all class trees.
|
|
$modulefiles |
private array $modulefiles
>>array() <<
List of all files containing modules.
|
|
$modulegroups |
private array $modulegroups
>>array() <<
List of all module groups.
|
|
$modules |
private array $modules
>>array() <<
Hash with the data of the current module group.
|
See Also |
$classes |
|
$packages |
private array $packages
>>array() <<
Hash of all packages found.
|
|
$flag_classtree |
private boolean $flag_classtree
>>false <<
Flag indicating that getClassTree() was called.
|
See Also |
getClassTree() |
|
$flag_modulegroup |
private boolean $flag_modulegroup
>>false <<
Flag indicating that getModulegroup was called.
|
See Also |
getModulegroup() |
|
$current_baseclass |
private string $current_baseclass
>>"" <<
Name of the base class of the current class tree.
|
See Also |
getClassTree() |
|
|
|
|
PHPDoc 1.0beta |