Document: ezcDocumentRstVisitor
[ ]
[ Conversion ]
[ ]
[ ]
[ ]
[ ]
Class: ezcDocumentRstVisitor
|
Abstract visitor base for RST documents represented by the parser AST. [
source]
Descendents
Constants
DUBLICATE
= 4
|
Dublicate reference target. Will throw an error on use. |
UNUSED
= 1
|
Unused reference target |
USED
= 2
|
Used reference target |
Member Variables
|
protected int |
$anonymousReferenceCounter
= 0
Index of last requested anonymous reference target. |
|
protected array |
$anonymousReferences
= array()
Collected anonymous externals reference targets |
|
protected ezcDocumentRstDocumentNode |
$ast
Reference to the AST root node. |
|
protected array |
$footnoteCounter
= array( 0 )
Label dependant foot note counters for footnote auto enumeration. |
|
protected array |
$footnotes
= array()
List with footnotes for later rendering. |
|
protected array |
$namedExternalReferences
= array()
Collected named external reference targets |
|
protected string |
$path
Location of the currently processed RST file, relevant for inclusion. |
|
protected array |
$references
= array()
Collected refrence targets. |
|
protected ezcDocumentRst |
$rst
RST document handler |
|
protected array |
$substitutions
= array()
Collected substitutions. |
Method Summary
Methods
addFootnote
Add footnote
Parameters
aggregateListItems
Aggregate list items
Aggregate list items into lists. In RST there are only list items, which are aggregated to lists depending on their bullet type. The related list items are aggregated into one list.
Parameters
calculateId
string calculateId(
string
$string )
Get a valid identifier string
Get a valid identifier string from an arbritrary string.
Parameters
| Name |
Type |
Description |
$string |
string |
|
compareListType
Compare two list items
Check if the given list item may be a successor in the same list, as the last item in the list. Returns the boolean status o the check.
Parameters
__construct
Create visitor from RST document handler.
Parameters
getAnonymousReferenceTarget
string getAnonymousReferenceTarget(
)
Get anonymous reference target
Get the target URL of an anonomyous reference target.
getNamedExternalReference
string getNamedExternalReference(
string
$name )
Return named external reference target
Get the target value of a named external reference.
Parameters
| Name |
Type |
Description |
$name |
string |
|
hasReferenceTarget
string hasReferenceTarget(
string
$string )
Check for internal reference target
Returns the target name, when an internal reference target exists and sets it to used, and false otherwise. For dublicate reference targets and missing reference targets an error will be triggered.
Parameters
| Name |
Type |
Description |
$string |
string |
|
nodeToString
Transform a node tree into a string
Transform a node tree, with all its subnodes into a string by only getting the textuual contents from ezcDocumentRstTextLineNode objects.
Parameters
preProcessAst
Pre process AST
Performs multiple preprocessing steps on the AST:
Collect all possible reference targets in the AST to know the actual destianation for references while decorating. The references are stored in an internal structure and you may request the actual link by using the getReferenceTarget() method.
Aggregate list items into lists. In RST there are only list items, which are aggregated to lists depending on their bullet type. The related list items are aggregated into one list.
Parameters
substitute
void substitute(
string
$string )
Get substitution contents
Parameters
| Name |
Type |
Description |
$string |
string |
|
tokenListToString
string tokenListToString(
$tokens )
Get string from token list.
Parameters
| Name |
Type |
Description |
$tokens |
array |
|
triggerError
void triggerError(
int
$level, string
$message, string
$file, [int
$line = null], [int
$position = null] )
Trigger visitor error
Emit a vistitor error, and convert it to an exception depending on the error reporting settings.
Parameters
| Name |
Type |
Description |
$level |
int |
|
$message |
string |
|
$file |
string |
|
$line |
int |
|
$position |
int |
|
visit
mixed visit(
$ast )
Docarate RST AST
Visit the RST abstract syntax tree.
Parameters
| Name |
Type |
Description |
$ast |
ezcDocumentRstDocumentNode |
|
Redefined in descendants as
visitChildren
Visit children
Just recurse into node and visit its children, ignoring the actual node.
Parameters
Redefined in descendants as
visitSubstitutionReference
Visit substitution reference node
Parameters
Redefined in descendants as
visitText
Visit text node
Parameters
Redefined in descendants as
Last updated: Wed, 18 Jun 2008