Document: ezcDocumentWikiVisitor
[ ]
[ Conversion ] [ Styles ]
[ ]
[ ]
[ ]
[ ]
Class: ezcDocumentWikiVisitor
|
Abstract visitor base for Wiki documents represented by the parser AST. [
source]
Implemented Interfaces
Descendents
Member Variables
Method Summary
|
public void |
__construct(
$document, $path )
Create visitor from Wiki document handler. |
|
protected void |
addFootnote(
$node )
Add footnote |
|
public array |
getErrors(
)
Return list of errors occured during visiting the document. |
|
public ezcDocumentWikiFootnoteNode |
hasFootnoteTarget(
$number, $node )
Check for internal footnote reference target |
|
protected string |
nodeListToString(
$nodes )
Node list to string |
|
protected string |
nodeToString(
$node )
Transform a node tree into a string |
|
protected void |
preProcessAst(
$node )
Pre process AST |
|
public void |
triggerError(
$level, $message, [$file = null], [$line = null], [$position = null] )
Trigger visitor error |
|
public mixed |
visit(
$ast )
Docarate Wiki AST |
|
protected void |
visitChildren(
$root, $node )
Visit children |
|
protected void |
visitText(
$root, $node )
Visit text node |
Methods
__construct
Create visitor from Wiki document handler.
Parameters
addFootnote
Add footnote
Parameters
getErrors
array getErrors(
)
Return list of errors occured during visiting the document.
May be an empty array, if on errors occured, or a list of ezcDocumentVisitException objects.
hasFootnoteTarget
Check for internal footnote reference target
Returns the target name, when an internal reference target exists and sets it to used, and false otherwise.
Parameters
nodeListToString
string nodeListToString(
$nodes )
Node list to string
Extract the contents of a node list and return a single string for the array of nodes.
Parameters
| Name |
Type |
Description |
$nodes |
array |
|
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 ezcDocumentWikiTextLineNode 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 Wiki 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
triggerError
void triggerError(
int
$level, string
$message, [string
$file = null], [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
Docarate Wiki AST
Visit the Wiki abstract syntax tree.
Parameters
Redefined in descendants as
visitChildren
Visit children
Just recurse into node and visit its children, ignoring the actual node.
Parameters
visitText
Visit text node
Parameters
Last updated: Tue, 01 Sep 2009