public function __construct(\Closure $parser) { parent::__construct(); parent::addChild($this->head = new TableRows(TableRows::TYPE_HEAD)); parent::addChild($this->body = new TableRows(TableRows::TYPE_BODY)); $this->parser = $parser; }
/** * @param AbstractBlock $block * * @return AbstractBlock */ public function addBlock(AbstractBlock $block) { $this->getBlockCloser()->closeUnmatchedBlocks(); $block->setStartLine($this->lineNumber); while (!$this->tip->canContain($block)) { $this->tip->finalize($this); } $this->tip->addChild($block); $this->tip = $block; $this->container = $block; return $block; }