Packageindex Classtrees Modulegroups Elementlist Report XML Files

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

PhpdocParserTags

PhpdocObject
   |
  +-- PhpdocParserRegExp
     |
    +-- PhpdocParserTags

Defines all regular expressions.

 

private class PhpdocParserTags extends PhpdocParserRegExp

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: PhpdocParserCore

Methods inherited from PhpdocParserRegExp

buildcomplexregexps

Methods inherited from PhpdocObject

setflagoutput, out, nametourl, outl, introspection

Private Method Summary

array

analyseTags(array $tags, array $data, array $allowed)

Extract the value from the given tags and copy the data to the $data array if its an allowed tag
array

analyseSeeTagRegs(array $regs)

Helperfunction to analyse @see tags
array

getTags(string $phpdoc)

Extracts PHPDoc tags from a PHPDoc doc comment.
array

getTagPos(string $phpdoc, [ integer $offset ])

Find the position of the next phpdoc tag.
array

checkParserErrors(array $data, string $mode)

Takes an array filled by analyseTags() and converts the parse errors into a single error message.

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 Method Details

analyseTags

private array analyseTags( array $tags, array $data, array $allowed )

  Extract the value from the given tags and copy the data to the $data array if its an allowed tag

Parameter
array $tags
array of tags returned by getTags
array $data
array where the allowed tags and their values are copied to
array $allowed
array of allowed (recognized) tags
Returns array $data

Throws PhpdocError
See Also getTags(), analyseVariableParagraphs(), analyseFunctionParagraphs(), analyseClassParagraphs(), analyseSeeTags()

analyseSeeTagRegs

private array analyseSeeTagRegs( array $regs )

  Helperfunction to analyse

Parameter
array $regs
Array return by preg_match()
Returns array $see

[0] = error, $see[1] = data

See Also t::t, analyseTags()

getTags

private array getTags( string $phpdoc )

  Extracts PHPDoc tags from a PHPDoc doc comment.

Parameter
string $phpdoc
Doc comment.
Returns array

List of tags ordered by their appearance containing the
tag name and it's (unparsed) value.

See Also getTagPos()

getTagPos

private array getTagPos( string $phpdoc, [ integer $offset ] )

  Find the position of the next phpdoc tag.

Parameter
string $phpdoc
integer $offset = >>0<<
Returns array $t

0 => tag, 1 => offset

See Also findTags()

checkParserErrors

private array checkParserErrors( array $data, string $mode )

  Takes an array filled by analyseTags() and converts the parse errors into a single error message.

Checks for [syntaxerror], [notallowed] and [unknown] entries in the data hash,
converts them into an error message and unsets the indizes. The function
returns a hash containing the aggregates error message and the modified
data hash.

Parameter
array $data
string $mode
Keyword where the data hash comes from eg. function/class...
Returns array

array( $error_msg, $data )



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta