protected function create(\Jstewmc\Chunker\Chunker $chunker)
	{
		// create the document's stream
		$stream = new \Jstewmc\Stream\Stream($chunker);
		
		// lex the string into tokens
		$lexer = new Lexer();
		$tokens = $lexer->lex($stream);
		
		// if tokens exist
		if ( ! empty($tokens)) {
			// parse the tokens into the parse tree's root group
			$parser = new Parser();
			$group = $parser->parse($tokens);	
			// if a root exists
			if ($group !== null) {
				// render the parse tree's root into the document root
				$renderer = new Renderer();
				$this->root = $renderer->render($group);	
			} else {
				$this->root = null;
			}
		} else {
			$this->root = null;
		}
		
		return (bool) $this->root;
	}
protected function create(\Jstewmc\Chunker\Chunker $chunker)
	{
		// create the document's stream
		$stream = new \Jstewmc\Stream\Stream($chunker);
		
		// lex the string into tokens
		$lexer = new Lexer();
		$tokens = $lexer->lex($stream);
		
		// if tokens exist
		if ( ! empty($tokens)) {
			// parse the tokens into the parse tree's root group
			$parser = new Parser();
			$group = $parser->parse($tokens);	
			// if a root exists
			if ($group !== null) {
				// render the parse tree's root into the document root
				$renderer = new Renderer();
				$this->root = $renderer->render($group);	
			} else {
				$this->root = null;
			}
		} else {
			$this->root = null;
		}
		
		return (bool) $this->root;
	}
protected function create ( \ Jstewmc \ Chunker \ Chunker $ chunker ) { // create the document's stream $ stream = new \ Jstewmc \ Stream \ Stream ( $ chunker ) ; // lex the string into tokens $ lexer = new Lexer ( ) ; $ tokens = $ lexer -> lex ( $ stream ) ; // if tokens exist if ( ! empty ( $ tokens ) ) { // parse the tokens into the parse tree's root group $ parser = new Parser ( ) ; $ group = $ parser -> parse ( $ tokens ) ; // if a root exists if ( $ group !== null ) { // render the parse tree's root into the document root $ renderer = new Renderer ( ) ; $ this -> root = $ renderer -> render ( $ group ) ; } else { $ this -> root = null ; } } else { $ this -> root = null ; } return ( bool ) $ this -> root ; }
Creates the document

If the stream has no tokens, I'll clear the document's root.

@param  Jstewmc\Chunker\Chunker  $chunker  the document's file or text chunker
@return  bool
Creates the document