public function handleElement(ezcTemplateTstNode $element) { if ($element instanceof ezcTemplateCaseTstNode) { if ($element->conditions === null) { if ($this->defaultCaseFound) { throw new ezcTemplateParserException($element->source, $element->startCursor, $element->startCursor, ezcTemplateSourceToTstErrorMessages::MSG_DEFAULT_DUPLICATE); } $this->defaultCaseFound = true; } elseif ($this->defaultCaseFound) { throw new ezcTemplateParserException($element->source, $element->startCursor, $element->startCursor, ezcTemplateSourceToTstErrorMessages::MSG_DEFAULT_LAST); } $this->children[] = $element; return true; // parent::handleElement( $element ); } elseif ($element instanceof ezcTemplateDocCommentTstNode) { parent::handleElement($element); } else { if ($element instanceof ezcTemplateTextBlockTstNode) { // Only spaces, newlines and tabs? if (preg_match("#^\\s*\$#", $element->text) != 0) { // It's okay, but ignore it. return; } else { $trimmedLength = strlen(ltrim($element->text)); $element->startCursor->advance(strlen($element->text) - $trimmedLength); } } throw new ezcTemplateParserException($element->source, $element->startCursor, $element->startCursor, ezcTemplateSourceToTstErrorMessages::MSG_EXPECT_CASE_STATEMENT); } }
/** * Constructs a new ezcTemplateCycleControlTstNode. * * @param ezcTemplateSource $source * @param ezcTemplateCursor $start * @param ezcTemplateCursor $end */ public function __construct(ezcTemplateSourceCode $source, $start, $end, $name = null) { parent::__construct($source, $start, $end); $this->name = $name; $this->variables = array(); $this->isNestingBlock = false; }
/** * Constructs a new ezcTemplateForeachLoopTstNode. * * @param ezcTemplateSource $source * @param ezcTemplateCursor $start * @param ezcTemplateCursor $end */ public function __construct(ezcTemplateSourceCode $source, $start, $end) { parent::__construct($source, $start, $end); $this->context = null; $this->name = 'tr_context'; $this->isNestingBlock = false; }
/** * Constructs a new ezcTemplateDeclarationTstNode. * * @param ezcTemplateSource $source * @param ezcTemplateCursor $start * @param ezcTemplateCursor $end */ public function __construct(ezcTemplateSourceCode $source, $start, $end) { parent::__construct($source, $start, $end); $this->type = "normal"; $this->variable = null; $this->expression = null; }
/** * * @param ezcTemplateSource $source * @param ezcTemplateCursor $start * @param ezcTemplateCursor $end */ public function __construct(ezcTemplateSourceCode $source, $start, $end) { parent::__construct($source, $start, $end); $this->file = null; $this->send = array(); $this->receive = array(); $this->isNestingBlock = false; }
/** * * @param ezcTemplateSource $source * @param ezcTemplateCursor $start * @param ezcTemplateCursor $end */ public function __construct(ezcTemplateSourceCode $source, $start, $end) { parent::__construct($source, $start, $end); $this->startBracket = '{'; $this->endBracket = '}'; $this->expressionRoot = null; $this->isNestingBlock = false; }
public function handleElement(ezcTemplateTstNode $element) { if ($this->canHandleElement($element)) { $this->children[] = $element; $element->parentBlock = $this; } else { parent::handleElement($element); } }
/** * Constructs a new ezcTemplateForeachLoopTstNode. * * @param ezcTemplateSource $source * @param ezcTemplateCursor $start * @param ezcTemplateCursor $end */ public function __construct(ezcTemplateSourceCode $source, $start, $end) { parent::__construct($source, $start, $end); $this->value = $this->keyVariableName = $this->itemVariableName = null; $this->name = 'foreach'; $this->increment = array(); $this->decrement = array(); $this->offset = $this->limit = null; }
public function handleElement(ezcTemplateTstNode $element) { parent::handleElement($element); }
/** * Constructs a new custom block * * @param ezcTemplateSourceCode $source * @param ezcTemplateCursor $start * @param ezcTemplateCursor $end */ public function __construct(ezcTemplateSourceCode $source, $start, $end) { parent::__construct($source, $start, $end); $this->customParameters = array(); }
/** */ public function __construct(ezcTemplateSourceCode $source, $start, $end) { parent::__construct($source, $start, $end); }
/** * * @param ezcTemplateSource $source * @param ezcTemplateCursor $start * @param ezcTemplateCursor $end */ public function __construct(ezcTemplateSourceCode $source, $start, $end) { parent::__construct($source, $start, $end); $this->name = 'dynamic'; }
/** * * @param ezcTemplateSource $source * @param ezcTemplateCursor $start * @param ezcTemplateCursor $end */ public function __construct(ezcTemplateSourceCode $source, $start, $end) { parent::__construct($source, $start, $end); $this->isNestingBlock = true; }
/** * Trims away EOL whitespace for block lines for the specified block element. * * The parser will call the ezcTemplateBlockTstNode::trimLine() method * of the specified block object with the whitespace removal object passed * as parameter. This allows the block element to choose how to apply the trimming * process since it may have more than one child list. * * Note: This does nothing if self::$trimWhitespace is set to false. * @param ezcTemplateBlockTstNode $block * Block element which has its child blocks trimmed of EOL whitespace. * @return void */ public function trimBlockLine(ezcTemplateBlockTstNode $block) { if (!$this->trimWhitespace) { return; } // Tell the block to trim its block line for any whitespace and EOL characters // by passign the object which has defined the rules for trimming whitespace $block->trimLine($this->whitespaceRemoval); }