Pelzini

This is the code documentation for the Pelzini project

namespace processor

Classes

Analyser

Generic language analyser. Analysers are used to tranform the language-specific tokens into a set of ParserItems

CAnalyser

Analyses the C tokens, and creates a set of ParserItem objects.

CLexer

Tokenises a C file.

CodeParserItem

Stores information about parser items that are actual source code.
Typically these parser items have authors and versions, so all of that information
is stored in this class.

Config

Stores the processor configuration

CParser

Does the complete parsing of a C file.

DatabaseOutputter

Outputs the tree to a database.

DebugOutputter

Outputs the tree to the screen

FakeNamespaceDirsTransformer

This is a transformer that does quality checks on the codebase

It checks that the documentation has the required tags. Currently the 'required tags' are only the summary

The documentation is created in a report called the check report.

JavascriptAnalyser

Analyses the javascript tokens, and creates a set of ParserItem objects.

JavascriptLexer

Tokenises a javascript file.

JavascriptParser

Does the complete parsing of a javascript file.

MetadataOutputter

Outputs the tree to a metadata file

MysqlOutputter

Outputs the tree as MySQL

Outputter

The top-level class for all outputters

ParserArgument

Represents a function argument

ParserAuthor

Represents an author of a parser item (e.g. a ParserFunction or ParserClass)

ParserClass

Stores information about a specific class

ParserConstant

Represents a constant

ParserDocument

Represents a function

ParserEnumeration

Represents an enumeration

ParserFile

Represents a file

ParserFunction

Represents a function

ParserInterface

Represents an interface

ParserItem

The top-level class of all parser items. Almost all ParserItems should extend CodeParserItem.

ParserReturn

Represents a function return type

ParserTable

Represents the contents of a @table tag

ParserThrow

Represents an exception which is thrown

ParserVariable

Represents a variable

PhpParser

This is the parser for PHP files. It converts a file from the raw PHP into a document tree

PostgresqlOutputter

Outputs the tree to a PostgreSQL database

QualityCheckTransformer

This is a transformer that does quality checks on the codebase

It checks that the documentation has the required tags. Currently the 'required tags' are only the summary

The documentation is created in a report called the check report.

SqliteOutputter

Outputs the tree to a SQLite database

Token

This class is used to represent a token that has been tokenised using a Lexer. (e.g. the JavascriptLexer)
These tokens are used to create various ParserItems, by passing them to an Analyser (e.g. the JavascriptAnalyser)

Transformer

The top-level class of all transformers.
Transformers alter the parser model before it is outputted, for creating reports, etc.

VirtualEnumerationsTransformer

This transformer converts constants that start with the same name into an enumeration of that name.

So if a file has the following constants:
  APP_VERSION
  ITEM_TYPE_APPLE
  ITEM_TYPE_ORANGE

The APPLE and ORANGE constants will become a part of the virtual enumeration ITEM_TYPE.

XmlOutputter

Outputs the tree to an xml file

Functions

get_filenames

Gets all the filenames in a directory and in the subdirectories

htmlify_check_tag

Does processing on a single HTML tag, as provided by a regex in htmlify_text

htmlify_text

This will take the provided text, and turn it into HTML
If it contains HTML, it will validate it, otherwise it
will wrap everything in a PRE

This function also removes extra spaces from the beginning of lines
but will do so in a manner that indenting is preserved

output_status

Outputs a status message

parse_doc_comment

Parses a DocBlock comment tag
Accepts the raw comment text of the comment straight from the file, including all the stars in the middle
Returns an array of tags. Each paremeter will contain an array of the tags that existed, one for each tag
The summary is returned in a 'summary' tag.

The output for a function with two param tags, a return tag and a summary will be something like the following:
array {
  ['@summary'] = '...',
  ['@param'] {
    [0] = '...',
    [1] = '...'
  },
  ['@return'] {
    [0] = '...',
  }
}

parse_tag

Processes the parsing of an individual tag

processor_autoload

Automatically loads the classes that are needed

process_javadoc_tags

Processes the javadoc tags for a specific parser item