public function parse(Parser $parser, Stream $stream) { if (!$parser->inMainScope()) { throw new ParseException("Extends tags must be placed in the main scope. Unexpected extends tag", $stream->current()->getLine()); } $parser->getCurrentClassNode()->setParentTemplate($parser->parseExpression($stream)); }