WACT_TEMPLATE
[ class tree: WACT_TEMPLATE ] [ index: WACT_TEMPLATE ] [ all elements ]

Class: TreeBuilder

Source Location: /framework/template/compiler/treebuilder.inc.php

http://wact.sourceforge.net/index.php/TreeBuilder

Class Overview


Acts on the ComponentTree in response to events within the SourceFileParser

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

Acts on the ComponentTree in response to events within the SourceFileParser
access:  public
see:  http://wact.sourceforge.net/index.php/TreeBuilder
todo:  get rid of reference to SourceFileParser

Class Variables


$Component =

Current Component
var:  subclass of
access:  public
Type:   CompilerComponent

$ParentComponent =

Parent Component
var:  subclass of
access:  public
Type:   CompilerComponent

$variableReferencePattern =

Type:   mixed

Class Methods


constructor TreeBuilder

Constructs TreeBuilder, setting up expression parsers

TreeBuilder TreeBuilder( mixed &$ComponentRoot)

API Tags:

access:  public

method addContent

Handles the CDATA content within any tag

void addContent( string &$Locator, boolean $text)

API Tags:

access:  public

Parameters:

string   &$Locator   content of tag
boolean   $text   whether parsing of text is currently forbidden

method addProcessingInstructionNode

Deals with XML processing instructions.

PHP instructions are ignored.



void addProcessingInstructionNode( string $target, string $instruction)

API Tags:

access:  public

Parameters:

string   $target   target processor
string   $instruction   instruction

method addTextNode

Creates TextNodes for plain text

void addTextNode( string $text)

API Tags:

access:  public

Parameters:

string   $text   text to create node for

method buildAttributes

Create AttributeNodes or ArtributeVariableReferences

void buildAttributes( array $Attributes)

API Tags:

access:  private

Parameters:

array   $Attributes   attributes found in tag

method checkServerId

Make sure we never have a duplicate Server Id in the component tree we build.

Uses GetComponentTree() to fetch current instance of ComponentTree, where list of used tag ids are stored



void checkServerId( object &$Component)

API Tags:

access:  private

Parameters:

object   &$Component   current component

method closeBranch

Finishes a branch in the component tree, restoring control to the ParentComponent

void closeBranch( boolean $hasClosingTag)

API Tags:

access:  public

Parameters:

boolean   $hasClosingTag   whether current component has a closing tag

method createAttributeExpression



void &createAttributeExpression( mixed $name, mixed $expression)

method createComponent

Create a new tag component

void &createComponent( string &$TagInfo, string $tag, mixed &$Locator)

API Tags:

access:  private

Parameters:

string   &$TagInfo   class name to create component with
string   $tag   XML tag name of component

method createCompoundAttribute



void &createCompoundAttribute( mixed $name, mixed $value)

method openBranch

Prepares the tree to accept a new tag component

void openBranch( string &$TagInfo, string $tag, array $attrs, boolean $isEmpty, mixed &$Locator)

API Tags:

access:  public

Parameters:

string   &$TagInfo   class name to create component with
string   $tag   XML tag name of component
array   $attrs   attributes for tag
boolean   $isEmpty   whether the tag has contents
WACT: Copyright 2003 Procata, Inc. Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html)
Documentation generated on Sun, 28 Nov 2004 19:51:13 -0800 by phpDocumentor 1.2.3