<?xml version="1.0"?><phpdoc><class name="PhpdocParserCore" extends="PhpdocParserTags" undoc="false" access="private" package="PHPDoc"><file>c:/www/apache/doc2//parser/PhpdocParserCore.php</file><doc><author email="ulf.wendel@phpdoc.de">Ulf Wendel</author><inherited src="Array"/><description>Provides basic parser functions to extract doc comments, analyse tags and variabledeclarations.</description><shortdescription>Provides basic parser functions.</shortdescription><version>$Id: $</version></doc><function name="getPhpdocParagraphs" undoc="false" access="private"><doc><see type="function">extractPhpdoc()</see><see type="function">getModuleDoc()</see><parameter name="$phpcode" type="string">code to scan.</parameter><parameter name="$keywords" default="&amp;quot;none&amp;quot;" type="mixed">of one keyword or array of keywords not to scan for. Known keywords are:&#x0a;&amp;quot;classes&amp;quot;, &amp;quot;functions&amp;quot;, &amp;quot;variables&amp;quot;, &amp;quot;uses&amp;quot;, &amp;quot;consts&amp;quot;.</parameter><return name="" type="array">Hash of phpdoc elements found, indexed by &amp;quot;variables&amp;quot;, &amp;quot;functions&amp;quot;, &amp;quot;classes&amp;quot;, &amp;quot;consts&amp;quot;, &amp;quot;uses&amp;quot;.</return><description>This method is somewhat the heart of the phpdoc parser. It takes a string ofphpcode and extracts all classes, functions, class variables, uses (include and friends),and constants (define) from it. Extract does not mean that the whole class or another elementgets extracted. It does not take the code from the class definition and it&amp;apos;s openingcurly brace to the closing one. PHPDoc just extracts the class definition itself andif available a trailing doc comment. This has some drawbacks: phpdoc can&amp;apos;t handlefiles that contain more than one class it wouldn&amp;apos;t know which method/class variable belongs toa certain class. It&amp;apos;s possible to provide a workaround but phpdoc would slow down dramatically.As PHPDoc does not have a real parser but does a simple grep using a bunch of regular expressionsthere&amp;apos;re indeed more limitations. Nevertheless I doubt that you&amp;apos;ll have problems with &amp;quot;normal&amp;quot; code.The search algorithm looks pretty strange but belive me it&amp;apos;s fast. I have tried several other ways(really complex regexps &amp;gt;500 chars, preg_match_all + looking backwards for comments, ...) but none wasfaster. This one takes 13s on my machine to scan the current (14/08/2000) code (7130 lines), thebig RegExp way took more than 5 Minutes, the preg_match_all + looking backwards 52s.</description><shortdescription>Scans code for documented and undocumented phpdoc keywords (classes, functions, class variables, uses, constants).</shortdescription></doc></function><function name="getModulesAndClasses" undoc="false" access="public"><doc><see type="function">getPhpdocParagraphs()</see><parameter name="$phpcode" type="string">to scan</parameter><return name="" type="array">Hash of modules and classes found in the given code</return><description/><shortdescription>Does a quick prescan to find modules an classes.</shortdescription></doc></function><function name="getModuleDoc" undoc="false" access="private"><doc><parameter name="$phpcode" type="string">Code to scan</parameter><return name="$module" type="array"> $module[0] = array with module data,&#x0a;$module[1] = php code without the leading module doc</return><description>The syntax for modules is not final yet. The implementation and meaning of &amp;quot;module&amp;quot;might change at every time! Please do not ask for implementation details.</description><shortdescription>Tries to extract a module doc.</shortdescription></doc></function><function name="getClasses" undoc="false" access="private"><doc><parameter name="$phpcode" type="string">code to scan.</parameter><return name="$classes" type="array"> Array of classes found in the code. $classes[classname] = extends</return><description>In early versions PHPdoc parsed all the code at once which restulted in hugememory intensive hashes. Now it scans for classes, builds a classtree anddoes the parsing step by step, writing information to the destination(renderer, exporter) as soon as possible. This reduces the memory consumptiondramatically. getPhpdocParagraphs() could be used to extract the class definitionsas well but this specialized function is somewhat faster.</description><shortdescription>Returns a list of classes found in the given code.</shortdescription></doc></function><function name="extractPhpdoc" undoc="false" access="private"><doc><parameter name="$paragraph" type="string">comment to clean up.</parameter><return name="$phpdoc" type="string"/><description/><shortdescription>Strips &amp;quot;/xx&amp;quot;, &amp;quot;x/&amp;quot; and x from doc comments (x means asterix).</shortdescription></doc></function><function name="getDescription" undoc="false" access="private"><doc><parameter name="$phpdoc" type="string">comment to examine.</parameter><return name="$description" type="array"> $description[0] = short description (first line),&#x0a;$description[1] = long description (second line upto the first tag)</return><description>Every PHPDoc doc comment has the same syntax: /xx[break][x]short description[break][[x]multiple line long description[break]][[x]@list of tags[. This functionreturns an array of the short description and long description.</description><shortdescription>Extract the description from a PHPDoc doc comment.</shortdescription></doc></function><function name="getValue" undoc="false" access="private"><doc><parameter name="$code" type="string">php code to examine.</parameter><parameter name="$delimiter" type="mixed">of one delimiter or array of delimiters.</parameter><return name="" type="string">Value found in the code</return><description>There some cases where you can hardly use a regex to grep a valuebecause the value might contain unescaped charaters that end the value.Value means something like &amp;quot;array ( &amp;quot;;&amp;quot;, &amp;apos;\;&amp;apos; );&amp;quot; or &amp;quot;&amp;apos;phpdoc; &amp;apos;;&amp;quot; wherethe delimiter would be &amp;quot;;&amp;quot;.</description><shortdescription>Scans a code passage for a value.</shortdescription></doc></function><function name="getVariableTypeAndValue" undoc="false" access="private"><doc><parameter name="$code" type="string">code to analyse</parameter><parameter name="$flag_args" default="true" type="boolean">indicating the &amp;quot;type&amp;quot; of code to analyse. Optional&#x0a;function parameters and class variables have a slightly&#x0a;different syntax for arrays. By default function parameters&#x0a;are expected.</parameter><return name="$vartype" type="array"> $vartype[0] = type, $vartype[1] = value, $vartype[2] = raw value</return><description>With version 0.3 PHPDoc tries to analyse variable declarations to findtype and value. This is used to analyse class variable declarations andoptional function arguments.Note that all regular expressions in this function start with &amp;quot;^&amp;quot;. That meansyou have to do some preparations to the code snippet you&amp;apos;re passing to thisfunction.</description><shortdescription>Analyses a code snipped and returns the type and value of the first variable found.</shortdescription></doc></function><inherited src="PhpdocParserTags" type="functions"><element>analysetags</element><element>analyseseetagregs</element><element>gettags</element><element>gettagpos</element><element>checkparsererrors</element></inherited><inherited src="PhpdocParserRegExp" type="functions"><element>buildcomplexregexps</element></inherited><inherited src="PhpdocObject" type="functions"><element>setflagoutput</element><element>out</element><element>nametourl</element><element>outl</element><element>introspection</element></inherited><inherited src="PhpdocParserRegExp" type="variables"><element>$phpdoc_tags</element><element>$c_base</element><element>$c_complex</element><element>$php_base</element><element>$php_complex</element><element>$tags</element></inherited><inherited src="PhpdocObject" type="variables"><element>$err</element><element>$application</element><element>$warn</element><element>$flag_output</element></inherited><path><parent>PhpdocParserTags</parent><parent>PhpdocParserRegExp</parent><parent>PhpdocObject</parent></path><baseclass>PhpdocObject</baseclass><subclasses><subclass>PhpdocUseParser</subclass></subclasses></class></phpdoc>
