code: private function parseDocument()
      {
          $start = $this->lexer->token;
          $this->expect(Token::SOF);
  
          $definitions = [];
          do {
              $definitions[] = $this->parseDefinition();
          } while (! $this->skip(Token::EOF));
  
          return new DocumentNode([
              'definitions' => new NodeList($definitions),
              'loc'         => $this->loc($start),
          ]);
      }
docs: Implements the parsing rules in the Document section.
  
  @return DocumentNode
  
  @throws SyntaxError