[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Text/reST/ -> Parser.php (sommaire)

(pas de description)

Poids: 776 lignes (26 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 2 classes

Text_reST_Parser:: (21 méthodes):
  Text_reST_Parser()
  parse()
  _makeNode()
  _checkAdornment()
  _parseInline()
  _parseLink()
  _normalizeName()
  _parseDirective()
  _parseLiteralBlock()
  _getLine()
  _next()
  _ensureLines()
  _queueAnonymousReference()
  _queueAnonymousDefinition()
  _mergeNodeProperties()
  _putNamedReference()
  _putNamedDefinition()
  _pushState()
  _getStateLevel()
  _popToLevel()
  _pop()

Text_reST_Parser_state:: (1 méthode):
  Text_reST_Parser_state()


Classe: Text_reST_Parser  - X-Ref

The Text_reST_Parser:: class implements a parser for reStructuredText
documents.

$Horde: framework/Text_reST/reST/Parser.php,v 1.8.2.8 2006/01/01 21:28:39 jan Exp $

Copyright 2003-2006 Jason M. Felice <jfelice@cronosys.com>

See the enclosed file COPYING for license information (LGPL). If you did not
receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Text_reST_Parser()   X-Ref
Constructor.


parse($text)   X-Ref
Returns a parse tree representing a document.

param: string $text  This is the text of the document to parse.
return: Text_reST  The parse tree.

_makeNode(&$parent, $type, $props = array()   X-Ref
Pas de description

_checkAdornment($lines = array(0)   X-Ref
Checks multiple adornemnt lines in the line buffer and makes sure they
are adornments and that all are identical adornments.

param: array $lines        An array of line numbers to check if they are
param: integer $minLength  The minimum length for this adornment.  The
return: boolean  Whether this line is an adornment which matches the

_parseInline(&$node, $text)   X-Ref
Pas de description

_parseLink(&$node, $text, $anonymous = false)   X-Ref
Parses an anonymous or named link.

param: Text_reST           The parent node for the link.
param: string $text        The text to parse.
param: boolean $anonymous  Whether this is an anonymous link.
return: Text_reST  The new link node.

_normalizeName($name)   X-Ref
Normalizes an object name.
This means that we lowercase it and normalize any whitespace in it.

param: string $name  A name to normalize.
return: string  The normalized name.

_parseDirective($text)   X-Ref
Parses and executes a `..' directive.

param: string $text  A directive to execute, less the leading `.. '.

_parseLiteralBlock()   X-Ref
Skips blank lines until we find one we can get the indentation level
from, then, gathers lines until we have a different level.


_getLine()   X-Ref
Retrieves the next line from a block of text.

We replace tabs with 8 spaces.


_next()   X-Ref
Bumps to the next line in the input.


_ensureLines($count = 1)   X-Ref
Makes sure there is a certain number of lines at minimum in the line
buffer.

param: integer $count  This is the number of lines which must be in the
return: boolean  Whether or not we succeeded.  We can fail at

_queueAnonymousReference(&$node, $type)   X-Ref
Since anonymous references and definitions (e.g. footnotes, links) do
not need to be defined "in lockstep" according to the spec, we create
the partial parse node in both places and use this nifty system to
queue or merge in each place.  Note that the reference is the "master"
node.  The definition gets thrown away since it really isn't in the
parse tree anyway.

param: object &$node  The node to queue or merge to.
param: string $type   The type of anonymous object.

_queueAnonymousDefinition(&$node, $type)   X-Ref
Handles an anonymous definition.

param: object &$node  The node to queue or merge from.
param: string $type   The type of anonymous object.

_mergeNodeProperties(&$node, &$defn)   X-Ref
Merges the properties from each node into the other node.

The node type is not changed (for the case where we have a footnote
reference and a footnote definition), but both nodes will have all
properties.

param: object &$node  The reference node.
param: object &$defn  The definition node.

_putNamedReference(&$node, $type)   X-Ref
Stores a named reference parse node in a hash so we can later merge
properties with a definition.  If we already have a definition, do
the merge now.

param: Text_reST &$node  The parse tree node.
param: string $type      The type of named reference.
return: boolean  Whether or not we successfully added the reference.

_putNamedDefinition(&$node, $type)   X-Ref
The inverse of {@link _putNamedReference()}.


_pushState(&$node, $stateType, $level)   X-Ref
Pas de description

_getStateLevel($stateType)   X-Ref
Pas de description

_popToLevel($stateType, $level)   X-Ref
Pas de description

_pop()   X-Ref
Pas de description

Classe: Text_reST_Parser_state  - X-Ref

This class represents a node on the parser's state stack.

Text_reST_Parser_state(&$node, $stateType, $level)   X-Ref
Constructor.

param: object &$node      This is the parse node associated with this
param: string $stateType  Currently only 'Section'.
param: mixed $level       This is the nesting level of this state type.



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7