Packageindex Classtrees Modulegroups Elementlist Report XML Files

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

PhpdocParserRegExp

PhpdocObject
   |
  +-- PhpdocParserRegExp

Defines all regular expressions.

 

private class PhpdocParserRegExp extends PhpdocObject

Defines all regular expressions.

This class defines all regular expressions. To make the
configuration and customization of PHPDoc as simple as
possible I decided to define all regular expressions in one class.
From a programming point of view there's no need to do so.

AuthorsUlf Wendel <ulf@redsys.de>
Version0.1

 
Direct known subclasses: PhpdocParserTags

Methods inherited from PhpdocObject

setflagoutput, out, nametourl, outl, introspection

Private Method Summary

void

buildComplexRegExps()

Builds complex regular expressions for the parser.

Fields inherited from PhpdocObject

$err, $flag_output, $application, $warn

Private Field Summary

array

$PHPDOC_TAGS

Array of phpdoc tags, indexed by the tagname.
array

$C_BASE

Basis regular expressions used to compose complex expressions to grep doc comments.
array

$C_COMPLEX

List of regular expressions used to grep complex doc comments.
array

$PHP_BASE

Basic RegExps used to analyse PHP Code.
array

$PHP_COMPLEX

List of regular expressions used to grep complex php code elements.
array

$TAGS

Array of RegExp matching the syntax of several complex tags.

Private Method Details

buildComplexRegExps

private void buildComplexRegExps( )

  Builds complex regular expressions for the parser.

PHPDoc has a small set of basic regular expressions. All complex
regular expressions are made out of the basic ones. The composition
in done in this method. Note: every derived class must
call this method in it's constructor!

Returns void

See Also $PHP_BASE, $PHP_COMPLEX, $C_BASE, $C_COMPLEX

Private Field Details

$PHPDOC_TAGS

private array $PHPDOC_TAGS

>>array( "@parameter" => '@param[eter] (object objectname|type) [$varname] [description]', "@param" => '@param[eter] (object objectname|type) [$varname] [description]', "@return" => '@return (object objectname|type) [$varname] [description]', "@access" => '@access', "@abstract" => '@abstract', "@static" => '@static', "@final" => '@final', "@throws" => '@throws exception [, exception]', "@see" => '@see (function()|$varname|(module|class)(function()|$varname)) [, (funtion()|$varname|(module|class)(function()|$varname))]', "@link" => '@link URL [description]', "@var" => '@var (object objectname|type) [$varname]', "@global" => '@global (object objectname|type) $varname [description]', "@constant" => '@const[ant] label [description]', "@const" => '@const[ant] label [description]', "@author" => '@author Name [<email>] [, Name [<email>]', "@copyright" => '@copyright description', "@version" => '@version label', "@since" => '@since label', "@deprecated" => '@deprec[ated] description', "@deprec" => '@deprec[ated] description', "@brother" => '@(brother|sister) (function()|$varname)', "@sister" => '@(brother|sister) (function()|$varname)', "@include" => '@include description', "@exclude" => '@exclude label', "@modulegroup" => '@modulegroup label', "@module" => '@module label', "@package" => '@package label', "@magic" => '@magic description', "@todo" => '@todo description' )<<


$C_BASE

private final array $C_BASE

>>array( #"block" => '/\*\*((?:(?!\*).)*(?:\n(?!\s*\*/)\s*\*(?:(?!\*/).)*)*)\*/', "module" => "[^\s]+", "module_separator" => "::", "module_tags" => "(@modulegroup|@module)", "vartype" => "(string|integer|int|long|real|double|float|boolean|bool|mixed|array|object)", "access" => "(private|public)" )<<

See Also buildComplexRegExps(), $C_COMPLEX

$C_COMPLEX

private final array $C_COMPLEX

>>array( "objectname_optional" => "", "see_var" => "", "see_function" => "", "see_moduleclass" => "", "module_doc" => "", "module_tags" => "", "module_separator" => "", "module_separator_len" => 0, "module_separator_len_neg" => 0 )<<

See Also a::a, buildComplexRegexps(), $C_BASE

$PHP_BASE

private final array $PHP_BASE

>>array ( "space" => "\s+", "space_optional" => "\s*", "break" => "[\n\r]", "php_open_long" => "<\?php\s", # zend_scanner.l use (space in our case) eighter. Might be slightly faster. "php_open_short" => "<\?", "php_open_asp" => "<%", "php_open_short_print" => "<\?=", "php_open_asp_print" => "<%=", # do not change the single quotes to double ones "label" => '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\xzf-\xff]*', "use" => "(include_once|include|require_once|require)", "assignment" => "\s*([,=])\s*", "boolean" => "(true|false)", "string" => "[^\s]+", "string_enclosed" => "(['\"])(?:\\\\\\1|[^\\1])*?\\1", "int_oct" => "[+-]?\s*0[0-7]+", "int_hex" => "[+-]?\s*0[xX][0-9A-Fa-f]+", "float" => "[+-]?\s*\d*\.\d+", "float_exponent" => "[+-]?\s*\d*(?:\.\d+)*[eE][+-]?\d+", "number" => "[+-]?\s*\d+", "array" => "array\s*\(", "empty_array" => "array\s*\(\s*\)\s*" )<<

See Also $PHP_COMPLEX

$PHP_COMPLEX

private array $PHP_COMPLEX

>>array ( "varname" => "", "functionname" => "", "classname" => "", "php_open_script" => "", "var" => "", "undoc_var" => "", "function" => "", "undoc_function" => "", "class" => "", "undoc_class" => "", "class_extends" => "", "undoc_class_extends" => "", "const" => "", "undoc_const" => "", "use" => "", "undoc_use" => "", "argument" => "", "type_boolean" => "", "type_string" => "", "type_string_enclosed" => "", "type_int_oct" => "", "type_int_hex" => "", "type_float" => "", "type_float_exponent" => "", "type_number" => "", "type_array" => "", "type_empty_array" => "" )<<

See Also buildComplexRegExps(), getVariableTypeAndValue(), getPhpdocParagraphs(), $PHP_BASE

$TAGS

private array $TAGS

>>array ( "return" => "", "var" => "", # @var, @param "global" => "", "access" => "", "module" => "", # @module, @modulegroup "const" => "", # @const, @constant "see_var" => "", # @see "see_function" => "", # @see "see_class" => "", # @see "see_module" => "", # @see "link" => "@([^\s]+)(.*)@is", # @link "brother" => "", "author" => "<\s*([a-z]([-a-z0-9_.])*@([-a-z0-9_]*\.)+[a-z]{2,})\s*>", # @author <email> part "all" => "" # list of all known tags )<<

See Also PhpdocParserObject()


Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta