-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFomlFilter.php
executable file
·53 lines (46 loc) · 1.21 KB
/
FomlFilter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
class FomlFilter
{
public $children = array();
public $node;
public $arg;
// $Node is an instance of parent FomlFilterNode.
// it is important because it contains a FomlRenderState
// instance that indicates the current output mode of this
// document.
// REVISIT - this expression should be evaluated
// in the eval context where all variables are available.
function __construct($Node, $Arg)
{
$this->node = $Node;
$this->arg = $Arg;
}
function RenderPrefix()
{
}
function RenderSuffix()
{
}
function Render()
{
$this->RenderPrefix();
foreach ($this->children as $child) {
$child->Render();
}
$this->RenderSuffix();
}
/*
* $Children is an array of FomlParseTree.
* The default behaviour here is just to Generate FomlNodes
* for each child, but some filters might like to
* override this method to handle their children as plain text.
*/
function AddChildren($Children)
{
// Generate and add children to the node.
foreach ($Children as $child) {
$this->children[] = $child->Generate();
}
}
}
?>