Author: rb Date: Wed Jun 20 15:08:13 2007 New Revision: 5485 Log: - More documentation fixes.
Modified: trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php trunk/Template/src/parsers/tst_to_tst/implementations/tst_walker.php trunk/Template/src/syntax_trees/tst/interfaces/modifying_operator_tst.php trunk/Template/src/syntax_trees/tst/interfaces/text_tst.php Modified: trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php ============================================================================== --- trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php [iso-8859-1] (original) +++ trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php [iso-8859-1] Wed Jun 20 15:08:13 2007 @@ -117,13 +117,6 @@ */ protected $declaredVariables = array(); - - /** - * - */ - protected $charset = false; - - /** * Initialize the transformer, after this send this object to the accept() method on a node. * @@ -139,6 +132,9 @@ $this->delimCounterVar = new ezcTemplateOutputVariableManager( 0 ); } + /** + * Destructor + */ public function __destruct() { } @@ -258,6 +254,19 @@ return $node; } + /** + * Transforsm the astNode tree so that every Node has only 2 children. + * See the translation from TST to AST in the example below: + * <code> + * Template: {a * b * c} + * TST: Multiply(a,b,c) + * AST: Multiply(a, Multiply(b,c) ) + * </code> + * + * @param ezcTemplateOperatorTstNode $type + * @param ezcTemplateOperatorAstNode $astNode + * @param bool $addParenthesis + */ private function createMultiBinaryOperatorAstNode( $type, ezcTemplateOperatorAstNode $astNode, $addParenthesis = true ) { $this->allowArrayAppend =false; // TODO: check this line. @@ -287,6 +296,13 @@ } + /** + * Creates an unary operator. + * + * @param ezcTemplateOperatorTstNode $type + * @param ezcTemplateOperatorAstNode $astNode + * @param bool $addParenthesis + */ private function createUnaryOperatorAstNode( $type, ezcTemplateOperatorAstNode $astNode, $addParenthesis = true ) { $astNode->appendParameter( $type->parameters[0]->accept( $this ) ); @@ -462,6 +478,12 @@ } } + /** + * Adds recursively the '->' operator. + * + * @param ezcTemplateOperatorTstNode $type + * @param int $currentParameterNumber + */ private function appendReferenceOperatorRecursively( ezcTemplateOperatorTstNode $type, $currentParameterNumber = 0) { $this->allowArrayAppend = false; @@ -490,6 +512,15 @@ return $node; } + /** + * Adds recursively the function call. + * + * @param ezcTemplateOperatorTstNode $type + * @param string $functionName + * @param bool $checkNonArray + * @param int $currentParameterNumber + * @return ezcTemplateAstNode + */ private function appendFunctionCallRecursively( ezcTemplateOperatorTstNode $type, $functionName, $checkNonArray = false, $currentParameterNumber = 0) { $paramAst = array(); @@ -531,6 +562,8 @@ /** * Prepare for the program run. * Caching uses this method as well. + * + * @return void */ protected function prepareProgram() { @@ -548,6 +581,7 @@ * Note: This is the first node in the TST tree. * * @see handleProgramHeader() + * @param ezcTemplateProgramTstNode $type * @return ezcTemplateAstNode */ public function visitProgramTstNode( ezcTemplateProgramTstNode $type ) @@ -582,6 +616,9 @@ } /** + * Visits the CustomBlockTstNode + * + * @param ezcTemplateCustomBlockTstNode $type * @return ezcTemplateAstNode */ public function visitCustomBlockTstNode( ezcTemplateCustomBlockTstNode $type ) @@ -672,39 +709,14 @@ } } - /* + /** + * Return NOP. + * + * @param ezcTemplateCacheTstNode $type + * @return ezcTemplateNopAstNode + */ public function visitCacheTstNode( ezcTemplateCacheTstNode $type ) { - if ( $type->type == ezcTemplateCacheTstNode::TYPE_TEMPLATE_CACHE ) - { - // Modify the root node. - $this->programNode->cacheTemplate = true; - - foreach ( $type->keys as $key ) - { - // Translate the 'old' variableName to the new name. - $k = $key->accept($this); - $this->programNode->cacheKeys[] = $k->name; - } - - // And translate the ttl. - if ( $type->ttl != null ) - { - $this->programNode->ttl = $type->ttl->accept($this); - } - - return new ezcTemplateNopAstNode(); - } - } - */ - - /** - * Return NOP. - * - * @return ezcTemplateNopAstNode - */ - public function visitCacheTstNode( ezcTemplateCacheTstNode $type ) - { return new ezcTemplateNopAstNode(); } @@ -712,6 +724,7 @@ /** * Skips the dynamic block and process the statements inside. * + * @param ezcTemplateDynamicBlockTstNode $node * @return array(ezcTemplateAstNode) */ public function visitDynamicBlockTstNode( ezcTemplateDynamicBlockTstNode $node ) @@ -723,6 +736,7 @@ /** * Skips the cache block and process the statements inside. * + * @param ezcTemplateCacheBlockTstNode $node * @return array(ezcTemplateAstNode) */ public function visitCacheBlockTstNode( ezcTemplateCacheBlockTstNode $node ) @@ -733,6 +747,9 @@ /** + * visits the cycle + * + * @param ezcTemplateCycleControlTstNode $cycle * @return ezcTemplateAstNode */ public function visitCycleControlTstNode( ezcTemplateCycleControlTstNode $cycle ) @@ -759,6 +776,9 @@ } /** + * visitCharsetTstNode + * + * @param ezcTemplateCharsetTstNode $node * @return ezcTemplateNopAstNode */ public function visitCharsetTstNode( ezcTemplateCharsetTstNode $node ) @@ -769,6 +789,9 @@ /** + * visitLiteralBlockTstNode + * + * @param ezcTemplateLiteralBlockTstNode $type * @return ezcTemplateAstNode */ public function visitLiteralBlockTstNode( ezcTemplateLiteralBlockTstNode $type ) @@ -777,6 +800,9 @@ } /** + * visitEmptyBlockTstNode + * + * @param ezcTemplateEmptyBlockTstNode $type * @return ezcTemplateAstNode */ public function visitEmptyBlockTstNode( ezcTemplateEmptyBlockTstNode $type ) @@ -785,6 +811,9 @@ } /** + * visitParenthesisTstNode + * + * @param ezcTemplateParenthesisTstNode $type * @return ezcTemplateAstNode */ public function visitParenthesisTstNode( ezcTemplateParenthesisTstNode $type ) @@ -796,6 +825,9 @@ } /** + * visitOutputBlockTstNode + * + * @param ezcTemplateOutputBlockTstNode $type * @return ezcTemplateAstNode */ public function visitOutputBlockTstNode( ezcTemplateOutputBlockTstNode $type ) @@ -814,6 +846,9 @@ } /** + * visitModifyingBlockTstNode + * + * @param ezcTemplateModifyingBlockTstNode $type * @return ezcTemplateAstNode */ public function visitModifyingBlockTstNode( ezcTemplateModifyingBlockTstNode $type ) @@ -829,6 +864,7 @@ * [EMAIL PROTECTED] ezcTemplateLiteralTstNode::SINGLE_QUOTE single quote} or * [EMAIL PROTECTED] ezcTemplateLiteralTstNode::DOUBLE_QUOTE double quite}. * + * @param ezcTemplateLiteralTstNode $type * @return ezcTemplateAstNode * * @see ezcTemplateStringTool::processSingleQuotedEscapes() @@ -856,6 +892,9 @@ } /** + * visitLiteralArrayTstNode + * + * @param ezcTemplateLiteralArrayTstNode $type * @return ezcTemplateAstNode */ public function visitLiteralArrayTstNode( ezcTemplateLiteralArrayTstNode $type ) @@ -881,6 +920,9 @@ } /** + * visitIdentifierTstNode + * + * @param ezcTemplateIdentifierTstNode $type * @return ezcTemplateAstNode */ public function visitIdentifierTstNode( ezcTemplateIdentifierTstNode $type ) @@ -890,6 +932,9 @@ } /** + * visitVariableTstNode + * + * @param ezcTemplateVariableTstNode $type * @return ezcTemplateAstNode */ public function visitVariableTstNode( ezcTemplateVariableTstNode $type ) @@ -913,6 +958,9 @@ } /** + * visitTextBlockTstNode + * + * @param ezcTemplateTextBlockTstNode $type * @return ezcTemplateAstNode */ public function visitTextBlockTstNode( ezcTemplateTextBlockTstNode $type ) @@ -929,6 +977,9 @@ } /** + * visitFunctionCallTstNode + * + * @param ezcTemplateFunctionCallTstNode $type * @return ezcTemplateAstNode */ public function visitFunctionCallTstNode( ezcTemplateFunctionCallTstNode $type ) @@ -971,6 +1022,9 @@ } /** + * visitDocCommentTstNode + * + * @param ezcTemplateDocCommentTstNode $type * @return ezcTemplateAstNode */ public function visitDocCommentTstNode( ezcTemplateDocCommentTstNode $type ) @@ -979,6 +1033,9 @@ } /** + * visitForeachLoopTstNode + * + * @param ezcTemplateForeachLoopTstNode $type * @return ezcTemplateAstNode */ public function visitForeachLoopTstNode( ezcTemplateForeachLoopTstNode $type ) @@ -1088,6 +1145,9 @@ } /** + * visitDelimiterTstNode + * + * @param ezcTemplateDelimiterTstNode $type * @return ezcTemplateAstNode */ public function visitDelimiterTstNode( ezcTemplateDelimiterTstNode $type ) @@ -1130,6 +1190,9 @@ } /** + * visitWhileLoopTstNode + * + * @param ezcTemplateWhileLoopTstNode $type * @return ezcTemplateAstNode */ public function visitWhileLoopTstNode( ezcTemplateWhileLoopTstNode $type ) @@ -1159,6 +1222,9 @@ } /** + * visitIfConditionTstNode + * + * @param ezcTemplateIfConditionTstNode $type * @return ezcTemplateAstNode */ public function visitIfConditionTstNode( ezcTemplateIfConditionTstNode $type ) @@ -1171,41 +1237,13 @@ $astNode->conditions[$i++] = $child->accept( $this ); } - // $cb = $type->children[0]->accept( $this ); - // $astNode->conditions[0] = $cb; - - /* - - // First condition, the 'if'. - $if = new ezcTemplateConditionBodyAstNode(); - $if->condition = null; // $type->condition->accept( $this ); - $if->body = $this->addOutputNodeIfNeeded( $type->children[0]->accept( $this ) ); - $astNode->conditions[0] = $if; - */ - - // Second condition, the 'elseif'. - /* - if ( count( $type->elements ) == 3 ) - { - $elseif = new ezcTemplateConditionBodyAstNode(); - $elseif->body = $this->addOutputNodeIfNeeded( $type->elements[1]->accept( $this ) ); - $astNode->conditions[1] = $else; - - } - */ -/* - if ( isset( $type->elements[1] ) ) - { - $else = new ezcTemplateConditionBodyAstNode(); - $else->body = $this->addOutputNodeIfNeeded( $type->elements[1]->accept( $this ) ); - $astNode->conditions[2] = $else; - } - */ - return $astNode; } /** + * visitConditionBodyTstNode + * + * @param ezcTemplateConditionBodyTstNode $type * @return ezcTemplateAstNode */ public function visitConditionBodyTstNode( ezcTemplateConditionBodyTstNode $type ) @@ -1217,6 +1255,9 @@ } /** + * visitLoopTstNode + * + * @param ezcTemplateLoopTstNode $type * @return ezcTemplateAstNode */ public function visitLoopTstNode( ezcTemplateLoopTstNode $type ) @@ -1244,6 +1285,9 @@ } /** + * visitPropertyFetchOperatorTstNode + * + * @param ezcTemplatePropertyFetchOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitPropertyFetchOperatorTstNode( ezcTemplatePropertyFetchOperatorTstNode $type ) @@ -1253,6 +1297,9 @@ /** + * visitArrayFetchOperatorTstNode + * + * @param ezcTemplateArrayFetchOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitArrayFetchOperatorTstNode( ezcTemplateArrayFetchOperatorTstNode $type ) @@ -1275,6 +1322,9 @@ } /** + * visitArrayAppendOperatorTstNode + * + * @param ezcTemplateArrayAppendOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitArrayAppendOperatorTstNode( ezcTemplateArrayAppendOperatorTstNode $type ) @@ -1288,6 +1338,9 @@ } /** + * visitPlusOperatorTstNode + * + * @param ezcTemplatePlusOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitPlusOperatorTstNode( ezcTemplatePlusOperatorTstNode $type ) @@ -1296,6 +1349,9 @@ } /** + * visitMinusOperatorTstNode + * + * @param ezcTemplateMinusOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitMinusOperatorTstNode( ezcTemplateMinusOperatorTstNode $type ) @@ -1304,6 +1360,9 @@ } /** + * visitConcatOperatorTstNode + * + * @param ezcTemplateConcatOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitConcatOperatorTstNode( ezcTemplateConcatOperatorTstNode $type ) @@ -1312,6 +1371,9 @@ } /** + * visitMultiplicationOperatorTstNode + * + * @param ezcTemplateMultiplicationOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitMultiplicationOperatorTstNode( ezcTemplateMultiplicationOperatorTstNode $type ) @@ -1320,6 +1382,9 @@ } /** + * visitDivisionOperatorTstNode + * + * @param ezcTemplateDivisionOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitDivisionOperatorTstNode( ezcTemplateDivisionOperatorTstNode $type ) @@ -1328,6 +1393,9 @@ } /** + * visitModuloOperatorTstNode + * + * @param ezcTemplateModuloOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitModuloOperatorTstNode( ezcTemplateModuloOperatorTstNode $type ) @@ -1336,6 +1404,9 @@ } /** + * visitEqualOperatorTstNode + * + * @param ezcTemplateEqualOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitEqualOperatorTstNode( ezcTemplateEqualOperatorTstNode $type ) @@ -1344,6 +1415,9 @@ } /** + * visitNotEqualOperatorTstNode + * + * @param ezcTemplateNotEqualOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitNotEqualOperatorTstNode( ezcTemplateNotEqualOperatorTstNode $type ) @@ -1352,6 +1426,9 @@ } /** + * visitIdenticalOperatorTstNode + * + * @param ezcTemplateIdenticalOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitIdenticalOperatorTstNode( ezcTemplateIdenticalOperatorTstNode $type ) @@ -1360,6 +1437,9 @@ } /** + * visitNotIdenticalOperatorTstNode + * + * @param ezcTemplateNotIdenticalOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitNotIdenticalOperatorTstNode( ezcTemplateNotIdenticalOperatorTstNode $type ) @@ -1368,6 +1448,9 @@ } /** + * visitLessThanOperatorTstNode + * + * @param ezcTemplateLessThanOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitLessThanOperatorTstNode( ezcTemplateLessThanOperatorTstNode $type ) @@ -1376,6 +1459,9 @@ } /** + * visitGreaterThanOperatorTstNode + * + * @param ezcTemplateGreaterThanOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitGreaterThanOperatorTstNode( ezcTemplateGreaterThanOperatorTstNode $type ) @@ -1384,6 +1470,9 @@ } /** + * visitLessEqualOperatorTstNode + * + * @param ezcTemplateLessEqualOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitLessEqualOperatorTstNode( ezcTemplateLessEqualOperatorTstNode $type ) @@ -1392,6 +1481,9 @@ } /** + * visitGreaterEqualOperatorTstNode + * + * @param ezcTemplateGreaterEqualOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitGreaterEqualOperatorTstNode( ezcTemplateGreaterEqualOperatorTstNode $type ) @@ -1400,6 +1492,9 @@ } /** + * visitLogicalAndOperatorTstNode + * + * @param ezcTemplateLogicalAndOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitLogicalAndOperatorTstNode( ezcTemplateLogicalAndOperatorTstNode $type ) @@ -1408,6 +1503,9 @@ } /** + * visitLogicalOrOperatorTstNode + * + * @param ezcTemplateLogicalOrOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitLogicalOrOperatorTstNode( ezcTemplateLogicalOrOperatorTstNode $type ) @@ -1416,6 +1514,9 @@ } /** + * visitAssignmentOperatorTstNode + * + * @param ezcTemplateAssignmentOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitAssignmentOperatorTstNode( ezcTemplateAssignmentOperatorTstNode $type ) @@ -1454,6 +1555,9 @@ } /** + * visitPlusAssignmentOperatorTstNode + * + * @param ezcTemplatePlusAssignmentOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitPlusAssignmentOperatorTstNode( ezcTemplatePlusAssignmentOperatorTstNode $type ) @@ -1469,6 +1573,9 @@ } /** + * visitMinusAssignmentOperatorTstNode + * + * @param ezcTemplateMinusAssignmentOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitMinusAssignmentOperatorTstNode( ezcTemplateMinusAssignmentOperatorTstNode $type ) @@ -1484,6 +1591,9 @@ } /** + * visitMultiplicationAssignmentOperatorTstNode + * + * @param ezcTemplateMultiplicationAssignmentOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitMultiplicationAssignmentOperatorTstNode( ezcTemplateMultiplicationAssignmentOperatorTstNode $type ) @@ -1499,6 +1609,9 @@ } /** + * visitDivisionAssignmentOperatorTstNode + * + * @param ezcTemplateDivisionAssignmentOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitDivisionAssignmentOperatorTstNode( ezcTemplateDivisionAssignmentOperatorTstNode $type ) @@ -1514,6 +1627,9 @@ } /** + * visitConcatAssignmentOperatorTstNode + * + * @param ezcTemplateConcatAssignmentOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitConcatAssignmentOperatorTstNode( ezcTemplateConcatAssignmentOperatorTstNode $type ) @@ -1529,6 +1645,9 @@ } /** + * visitModuloAssignmentOperatorTstNode + * + * @param ezcTemplateModuloAssignmentOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitModuloAssignmentOperatorTstNode( ezcTemplateModuloAssignmentOperatorTstNode $type ) @@ -1544,6 +1663,9 @@ } /** + * visitPreIncrementOperatorTstNode + * + * @param ezcTemplatePreIncrementOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitPreIncrementOperatorTstNode( ezcTemplatePreIncrementOperatorTstNode $type ) @@ -1553,6 +1675,9 @@ } /** + * visitPreDecrementOperatorTstNode + * + * @param ezcTemplatePreDecrementOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitPreDecrementOperatorTstNode( ezcTemplatePreDecrementOperatorTstNode $type ) @@ -1562,6 +1687,9 @@ } /** + * visitPostIncrementOperatorTstNode + * + * @param ezcTemplatePostIncrementOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitPostIncrementOperatorTstNode( ezcTemplatePostIncrementOperatorTstNode $type ) @@ -1571,6 +1699,9 @@ } /** + * visitPostDecrementOperatorTstNode + * + * @param ezcTemplatePostDecrementOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitPostDecrementOperatorTstNode( ezcTemplatePostDecrementOperatorTstNode $type ) @@ -1580,6 +1711,9 @@ } /** + * visitNegateOperatorTstNode + * + * @param ezcTemplateNegateOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitNegateOperatorTstNode( ezcTemplateNegateOperatorTstNode $type ) @@ -1589,6 +1723,9 @@ } /** + * visitLogicalNegateOperatorTstNode + * + * @param ezcTemplateLogicalNegateOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitLogicalNegateOperatorTstNode( ezcTemplateLogicalNegateOperatorTstNode $type ) @@ -1597,6 +1734,9 @@ } /** + * visitBlockCommentTstNode + * + * @param ezcTemplateBlockCommentTstNode $type * @return ezcTemplateAstNode */ public function visitBlockCommentTstNode( ezcTemplateBlockCommentTstNode $type ) @@ -1605,6 +1745,9 @@ } /** + * visitEolCommentTstNode + * + * @param ezcTemplateEolCommentTstNode $type * @return ezcTemplateAstNode */ public function visitEolCommentTstNode( ezcTemplateEolCommentTstNode $type ) @@ -1613,6 +1756,9 @@ } /** + * visitBlockTstNode + * + * @param ezcTemplateBlockTstNode $type * @return ezcTemplateAstNode */ public function visitBlockTstNode( ezcTemplateBlockTstNode $type ) @@ -1622,6 +1768,9 @@ } /** + * visitDeclarationTstNode + * + * @param ezcTemplateDeclarationTstNode $type * @return ezcTemplateAstNode */ public function visitDeclarationTstNode( ezcTemplateDeclarationTstNode $type ) @@ -1673,6 +1822,9 @@ } /** + * visitSwitchTstNode + * + * @param ezcTemplateSwitchTstNode $type * @return ezcTemplateAstNode */ public function visitSwitchTstNode( ezcTemplateSwitchTstNode $type ) @@ -1700,6 +1852,9 @@ } /** + * visitCaseTstNode + * + * @param ezcTemplateCaseTstNode $type * @return ezcTemplateAstNode */ public function visitCaseTstNode( ezcTemplateCaseTstNode $type ) @@ -1731,6 +1886,9 @@ } /** + * visitIncludeTstNode + * + * @param ezcTemplateIncludeTstNode $type * @return ezcTemplateAstNode */ public function visitIncludeTstNode( ezcTemplateIncludeTstNode $type ) @@ -1813,6 +1971,9 @@ } /** + * visitReturnTstNode + * + * @param ezcTemplateReturnTstNode $type * @return ezcTemplateAstNode */ public function visitReturnTstNode( ezcTemplateReturnTstNode $type ) @@ -1848,6 +2009,9 @@ } /** + * visitArrayRangeOperatorTstNode + * + * @param ezcTemplateArrayRangeOperatorTstNode $type * @return ezcTemplateAstNode */ public function visitArrayRangeOperatorTstNode( ezcTemplateArrayRangeOperatorTstNode $type ) Modified: trunk/Template/src/parsers/tst_to_tst/implementations/tst_walker.php ============================================================================== --- trunk/Template/src/parsers/tst_to_tst/implementations/tst_walker.php [iso-8859-1] (original) +++ trunk/Template/src/parsers/tst_to_tst/implementations/tst_walker.php [iso-8859-1] Wed Jun 20 15:08:13 2007 @@ -17,26 +17,65 @@ */ class ezcTemplateTstWalker implements ezcTemplateTstNodeVisitor { + /** + * Keeps a trace of the nodes currently entered. + * + * @var array(ezcTemplateTstNode) + */ protected $nodePath = array(); + + /** + * Keeps count of the amount of subnodes. + * + * @var int + */ protected $statements = array(); + + /** + * Keeps track of the current offset. E.g. when an extra statement is + * inserted the offset should be increased. + * + * var array(int) + */ protected $offset = array(); + /** + * Constructs a ezcTemplateTstWalker + */ public function __construct() { } + /** + * visitBlockTstNode + * + * @param ezcTemplateBlockTstNode $node + * @return void + */ public function visitBlockTstNode( ezcTemplateBlockTstNode $node ) { // NOT USED. } + /** + * visitCustomBlockTstNode + * + * @param ezcTemplateCustomBlockTstNode $node + * @return void + */ public function visitCustomBlockTstNode( ezcTemplateCustomBlockTstNode $node ) { } + /** + * visitProgramTstNode + * + * @param ezcTemplateProgramTstNode $node + * @return void + */ public function visitProgramTstNode( ezcTemplateProgramTstNode $node ) { array_unshift( $this->nodePath, $node ); @@ -57,21 +96,45 @@ } + /** + * visitLiteralBlockTstNode + * + * @param ezcTemplateLiteralBlockTstNode $node + * @return void + */ public function visitLiteralBlockTstNode( ezcTemplateLiteralBlockTstNode $node ) { } + /** + * visitEmptyBlockTstNode + * + * @param ezcTemplateEmptyBlockTstNode $node + * @return void + */ public function visitEmptyBlockTstNode( ezcTemplateEmptyBlockTstNode $node ) { } + /** + * visitParenthesisTstNode + * + * @param ezcTemplateParenthesisTstNode $node + * @return void + */ public function visitParenthesisTstNode( ezcTemplateParenthesisTstNode $node ) { } + /** + * visitOutputBlockTstNode + * + * @param ezcTemplateOutputBlockTstNode $node + * @return void + */ public function visitOutputBlockTstNode( ezcTemplateOutputBlockTstNode $node ) { if ( $node->expressionRoot !== null) @@ -82,250 +145,556 @@ } + /** + * visitModifyingBlockTstNode + * + * @param ezcTemplateModifyingBlockTstNode $node + * @return void + */ public function visitModifyingBlockTstNode( ezcTemplateModifyingBlockTstNode $node ) { $this->acceptAndUpdate( $node->expressionRoot ); } + /** + * visitLiteralTstNode + * + * @param ezcTemplateLiteralTstNode $node + * @return void + */ public function visitLiteralTstNode( ezcTemplateLiteralTstNode $node ) { } + /** + * visitVariableTstNode + * + * @param ezcTemplateVariableTstNode $node + * @return void + */ public function visitVariableTstNode( ezcTemplateVariableTstNode $node ) { } + /** + * visitTextBlockTstNode + * + * @param ezcTemplateTextBlockTstNode $node + * @return void + */ public function visitTextBlockTstNode( ezcTemplateTextBlockTstNode $node ) { } + /** + * visitFunctionCallTstNode + * + * @param ezcTemplateFunctionCallTstNode $node + * @return void + */ public function visitFunctionCallTstNode( ezcTemplateFunctionCallTstNode $node ) { } + /** + * visitDocCommentTstNode + * + * @param ezcTemplateDocCommentTstNode $node + * @return void + */ public function visitDocCommentTstNode( ezcTemplateDocCommentTstNode $node ) { } + /** + * visitBlockCommentTstNode + * + * @param ezcTemplateBlockCommentTstNode $node + * @return void + */ public function visitBlockCommentTstNode( ezcTemplateBlockCommentTstNode $node ) { } + /** + * visitEolCommentTstNode + * + * @param ezcTemplateEolCommentTstNode $node + * @return void + */ public function visitEolCommentTstNode( ezcTemplateEolCommentTstNode $node ) { } + /** + * visitForeachLoopTstNode + * + * @param ezcTemplateForeachLoopTstNode $node + * @return void + */ public function visitForeachLoopTstNode( ezcTemplateForeachLoopTstNode $node ) { } + /** + * visitDelimiterTstNode + * + * @param ezcTemplateDelimiterTstNode $node + * @return void + */ public function visitDelimiterTstNode( ezcTemplateDelimiterTstNode $node ) { } + /** + * visitWhileLoopTstNode + * + * @param ezcTemplateWhileLoopTstNode $node + * @return void + */ public function visitWhileLoopTstNode( ezcTemplateWhileLoopTstNode $node ) { } + /** + * visitIfConditionTstNode + * + * @param ezcTemplateIfConditionTstNode $node + * @return void + */ public function visitIfConditionTstNode( ezcTemplateIfConditionTstNode $node ) { } + /** + * visitLoopTstNode + * + * @param ezcTemplateLoopTstNode $node + * @return void + */ public function visitLoopTstNode( ezcTemplateLoopTstNode $node ) { } + /** + * visitPropertyFetchOperatorTstNode + * + * @param ezcTemplatePropertyFetchOperatorTstNode $node + * @return void + */ public function visitPropertyFetchOperatorTstNode( ezcTemplatePropertyFetchOperatorTstNode $node ) { } + /** + * visitArrayFetchOperatorTstNode + * + * @param ezcTemplateArrayFetchOperatorTstNode $node + * @return void + */ public function visitArrayFetchOperatorTstNode( ezcTemplateArrayFetchOperatorTstNode $node ) { } + /** + * visitPlusOperatorTstNode + * + * @param ezcTemplatePlusOperatorTstNode $node + * @return void + */ public function visitPlusOperatorTstNode( ezcTemplatePlusOperatorTstNode $node ) { } + /** + * visitMinusOperatorTstNode + * + * @param ezcTemplateMinusOperatorTstNode $node + * @return void + */ public function visitMinusOperatorTstNode( ezcTemplateMinusOperatorTstNode $node ) { } + /** + * visitConcatOperatorTstNode + * + * @param ezcTemplateConcatOperatorTstNode $node + * @return void + */ public function visitConcatOperatorTstNode( ezcTemplateConcatOperatorTstNode $node ) { } + /** + * visitMultiplicationOperatorTstNode + * + * @param ezcTemplateMultiplicationOperatorTstNode $node + * @return void + */ public function visitMultiplicationOperatorTstNode( ezcTemplateMultiplicationOperatorTstNode $node ) { } + /** + * visitDivisionOperatorTstNode + * + * @param ezcTemplateDivisionOperatorTstNode $node + * @return void + */ public function visitDivisionOperatorTstNode( ezcTemplateDivisionOperatorTstNode $node ) { } + /** + * visitModuloOperatorTstNode + * + * @param ezcTemplateModuloOperatorTstNode $node + * @return void + */ public function visitModuloOperatorTstNode( ezcTemplateModuloOperatorTstNode $node ) { } + /** + * visitEqualOperatorTstNode + * + * @param ezcTemplateEqualOperatorTstNode $node + * @return void + */ public function visitEqualOperatorTstNode( ezcTemplateEqualOperatorTstNode $node ) { } + /** + * visitNotEqualOperatorTstNode + * + * @param ezcTemplateNotEqualOperatorTstNode $node + * @return void + */ public function visitNotEqualOperatorTstNode( ezcTemplateNotEqualOperatorTstNode $node ) { } + /** + * visitIdenticalOperatorTstNode + * + * @param ezcTemplateIdenticalOperatorTstNode $node + * @return void + */ public function visitIdenticalOperatorTstNode( ezcTemplateIdenticalOperatorTstNode $node ) { } + /** + * visitNotIdenticalOperatorTstNode + * + * @param ezcTemplateNotIdenticalOperatorTstNode $node + * @return void + */ public function visitNotIdenticalOperatorTstNode( ezcTemplateNotIdenticalOperatorTstNode $node ) { } + /** + * visitLessThanOperatorTstNode + * + * @param ezcTemplateLessThanOperatorTstNode $node + * @return void + */ public function visitLessThanOperatorTstNode( ezcTemplateLessThanOperatorTstNode $node ) { } + /** + * visitGreaterThanOperatorTstNode + * + * @param ezcTemplateGreaterThanOperatorTstNode $node + * @return void + */ public function visitGreaterThanOperatorTstNode( ezcTemplateGreaterThanOperatorTstNode $node ) { } + /** + * visitLessEqualOperatorTstNode + * + * @param ezcTemplateLessEqualOperatorTstNode $node + * @return void + */ public function visitLessEqualOperatorTstNode( ezcTemplateLessEqualOperatorTstNode $node ) { } + /** + * visitGreaterEqualOperatorTstNode + * + * @param ezcTemplateGreaterEqualOperatorTstNode $node + * @return void + */ public function visitGreaterEqualOperatorTstNode( ezcTemplateGreaterEqualOperatorTstNode $node ) { } + /** + * visitLogicalAndOperatorTstNode + * + * @param ezcTemplateLogicalAndOperatorTstNode $node + * @return void + */ public function visitLogicalAndOperatorTstNode( ezcTemplateLogicalAndOperatorTstNode $node ) { } + /** + * visitLogicalOrOperatorTstNode + * + * @param ezcTemplateLogicalOrOperatorTstNode $node + * @return void + */ public function visitLogicalOrOperatorTstNode( ezcTemplateLogicalOrOperatorTstNode $node ) { } + /** + * visitAssignmentOperatorTstNode + * + * @param ezcTemplateAssignmentOperatorTstNode $node + * @return void + */ public function visitAssignmentOperatorTstNode( ezcTemplateAssignmentOperatorTstNode $node ) { } + /** + * visitPlusAssignmentOperatorTstNode + * + * @param ezcTemplatePlusAssignmentOperatorTstNode $node + * @return void + */ public function visitPlusAssignmentOperatorTstNode( ezcTemplatePlusAssignmentOperatorTstNode $node ) { } + /** + * visitMinusAssignmentOperatorTstNode + * + * @param ezcTemplateMinusAssignmentOperatorTstNode $node + * @return void + */ public function visitMinusAssignmentOperatorTstNode( ezcTemplateMinusAssignmentOperatorTstNode $node ) { } + /** + * visitMultiplicationAssignmentOperatorTstNode + * + * @param ezcTemplateMultiplicationAssignmentOperatorTstNode $node + * @return void + */ public function visitMultiplicationAssignmentOperatorTstNode( ezcTemplateMultiplicationAssignmentOperatorTstNode $node ) { } + /** + * visitDivisionAssignmentOperatorTstNode + * + * @param ezcTemplateDivisionAssignmentOperatorTstNode $node + * @return void + */ public function visitDivisionAssignmentOperatorTstNode( ezcTemplateDivisionAssignmentOperatorTstNode $node ) { } + /** + * visitConcatAssignmentOperatorTstNode + * + * @param ezcTemplateConcatAssignmentOperatorTstNode $node + * @return void + */ public function visitConcatAssignmentOperatorTstNode( ezcTemplateConcatAssignmentOperatorTstNode $node ) { } + /** + * visitModuloAssignmentOperatorTstNode + * + * @param ezcTemplateModuloAssignmentOperatorTstNode $node + * @return void + */ public function visitModuloAssignmentOperatorTstNode( ezcTemplateModuloAssignmentOperatorTstNode $node ) { } + /** + * visitPreIncrementOperatorTstNode + * + * @param ezcTemplatePreIncrementOperatorTstNode $node + * @return void + */ public function visitPreIncrementOperatorTstNode( ezcTemplatePreIncrementOperatorTstNode $node ) { } + /** + * visitPreDecrementOperatorTstNode + * + * @param ezcTemplatePreDecrementOperatorTstNode $node + * @return void + */ public function visitPreDecrementOperatorTstNode( ezcTemplatePreDecrementOperatorTstNode $node ) { } + /** + * visitPostIncrementOperatorTstNode + * + * @param ezcTemplatePostIncrementOperatorTstNode $node + * @return void + */ public function visitPostIncrementOperatorTstNode( ezcTemplatePostIncrementOperatorTstNode $node ) { } + /** + * visitPostDecrementOperatorTstNode + * + * @param ezcTemplatePostDecrementOperatorTstNode $node + * @return void + */ public function visitPostDecrementOperatorTstNode( ezcTemplatePostDecrementOperatorTstNode $node ) { } + /** + * visitNegateOperatorTstNode + * + * @param ezcTemplateNegateOperatorTstNode $node + * @return void + */ public function visitNegateOperatorTstNode( ezcTemplateNegateOperatorTstNode $node ) { } + /** + * visitLogicalNegateOperatorTstNode + * + * @param ezcTemplateLogicalNegateOperatorTstNode $node + * @return void + */ public function visitLogicalNegateOperatorTstNode( ezcTemplateLogicalNegateOperatorTstNode $node ) { } + /** + * visitDynamicBlockTstNode + * + * @param ezcTemplateDynamicBlockTstNode $node + * @return void + */ public function visitDynamicBlockTstNode( ezcTemplateDynamicBlockTstNode $node ) { } - public function visitCacheTstNode( ezcTemplateCacheTstNode $node) - { - } - + /** + * visitCacheTstNode + * + * @param ezcTemplateCacheTstNode $node + * @return void + */ + public function visitCacheTstNode( ezcTemplateCacheTstNode $node ) + { + } + + /** + * visitDeclarationTstNode + * + * @param ezcTemplateDeclarationTstNode $node + * @return void + */ public function visitDeclarationTstNode( ezcTemplateDeclarationTstNode $node ) { } + /** + * visitCycleControlTstNode + * + * @param ezcTemplateCycleControlTstNode $node + * @return void + */ public function visitCycleControlTstNode( ezcTemplateCycleControlTstNode $node ) { } + /** + * visitIncludeTstNode + * + * @param ezcTemplateIncludeTstNode $node + * @return void + */ public function visitIncludeTstNode( ezcTemplateIncludeTstNode $node ) { } + /** + * visitReturnTstNode + * + * @param ezcTemplateReturnTstNode $node + * @return void + */ public function visitReturnTstNode( ezcTemplateReturnTstNode $node ) { } + /** + * visitSwitchTstNode + * + * @param ezcTemplateSwitchTstNode $node + * @return void + */ public function visitSwitchTstNode( ezcTemplateSwitchTstNode $node ) { foreach ( $node->elements as $element ) @@ -334,32 +703,81 @@ } } + /** + * visitCaseTstNode + * + * @param ezcTemplateCaseTstNode $node + * @return void + */ public function visitCaseTstNode( ezcTemplateCaseTstNode $node ) { } + /** + * visitLiteralArrayTstNode + * + * @param ezcTemplateLiteralArrayTstNode $node + * @return void + */ public function visitLiteralArrayTstNode( ezcTemplateLiteralArrayTstNode $node ) { } + /** + * visitArrayRangeOperatorTstNode + * + * @param ezcTemplateArrayRangeOperatorTstNode $node + * @return void + */ + /** + * visitArrayRangeOperatorTstNode + * + * @param ezcTemplateArrayRangeOperatorTstNode $node + * @return void + */ public function visitArrayRangeOperatorTstNode( ezcTemplateArrayRangeOperatorTstNode $node ) { } + /** + * visitArrayAppendOperatorTstNode + * + * @param ezcTemplateArrayAppendOperatorTstNode $node + * @return void + */ public function visitArrayAppendOperatorTstNode( ezcTemplateArrayAppendOperatorTstNode $node ) { } + /** + * visitConditionBodyTstNode + * + * @param ezcTemplateConditionBodyTstNode $node + * @return void + */ public function visitConditionBodyTstNode( ezcTemplateConditionBodyTstNode $node ) { } + /** + * visitCacheBlockTstNode + * + * @param ezcTemplateCacheBlockTstNode $node + * @return void + */ public function visitCacheBlockTstNode( ezcTemplateCacheBlockTstNode $node ) { } + /** + * Calls the accept method on the given tst node. The return value + * replaces the $node. + * + * @param ezcTemplateTstNode $node + * @return void + */ protected function acceptAndUpdate( ezcTemplateTstNode &$node ) { $ret = $node->accept( $this ); Modified: trunk/Template/src/syntax_trees/tst/interfaces/modifying_operator_tst.php ============================================================================== --- trunk/Template/src/syntax_trees/tst/interfaces/modifying_operator_tst.php [iso-8859-1] (original) +++ trunk/Template/src/syntax_trees/tst/interfaces/modifying_operator_tst.php [iso-8859-1] Wed Jun 20 15:08:13 2007 @@ -22,6 +22,14 @@ { /** * Initialize element with source and cursor positions. + * + * @param ezcTemplateSourceCode $source + * @param ezcTemplateCursor $start + * @param ezcTemplateCursor $end + * @param int $precedence + * @param int $order + * @param int $associativity + * @param string $symbol */ public function __construct( ezcTemplateSourceCode $source, /*ezcTemplateCursor*/ $start, /*ezcTemplateCursor*/ $end, $precedence, $order, $associativity, $symbol ) Modified: trunk/Template/src/syntax_trees/tst/interfaces/text_tst.php ============================================================================== --- trunk/Template/src/syntax_trees/tst/interfaces/text_tst.php [iso-8859-1] (original) +++ trunk/Template/src/syntax_trees/tst/interfaces/text_tst.php [iso-8859-1] Wed Jun 20 15:08:13 2007 @@ -56,6 +56,11 @@ protected $startColumn; /** + * Constructs a new ezcTemplateTextTstNode + * + * @param ezcTemplateSourceCode $source + * @param ezcTemplateCursor $start + * @param ezcTemplateCursor $end */ public function __construct( ezcTemplateSourceCode $source, /*ezcTemplateCursor*/ $start, /*ezcTemplateCursor*/ $end ) { @@ -66,6 +71,11 @@ $this->lines = array(); } + /** + * Returns the tree properties of this object. + * + * @return array(string=>mixed) + */ public function getTreeProperties() { return array( 'text' => $this->text ); @@ -74,7 +84,8 @@ /** * Returns true since text elements can always be children of blocks. * - * @return true + * @param ezcTemplateBlockTstNode $block + * @return bool */ public function canBeChildOf( ezcTemplateBlockTstNode $block ) { -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components