/** * Creates the TST tree structure from the source code. * * @return void */ public function parseIntoNodeTree() { if (!$this->source->hasCode()) { throw new ezcTemplateException(ezcTemplateSourceToTstErrorMessages::MSG_NO_SOURCE_CODE); } $sourceText = $this->source->code; $cursor = new ezcTemplateCursor($sourceText); $this->textElements = array(); $parser = new ezcTemplateProgramSourceToTstParser($this, null, null); $parser->setAllCursors($cursor); if (!$parser->parse()) { $currentParser = $parser->getFailingParser(); } // Trim starting/trailing whitespace if ($this->trimWhitespace) { $this->whitespaceRemoval->trimProgram($parser->program); } return $parser->program; }