docs: protected final PackageDescr compilationUnit(PackageDescrBuilder pkg) throws RecognitionException {
          try {
              // package declaration?
              if (input.LA(1) != DRL6Lexer.EOF && helper.validateIdentifierKey(DroolsSoftKeywords.PACKAGE)) {
                  String pkgName = packageStatement(pkg);
                  pkg.name(pkgName);
                  if (state.failed)
                      return pkg.getDescr();
  
                  // unit declaration?
                  // this is only allowed immediately after the package declaration
                  if (input.LA(1) != DRL6Lexer.EOF && helper.validateIdentifierKey(DroolsSoftKeywords.UNIT)) {
                      unitStatement(pkg);
                  }
              }
  
              // statements
              while (input.LA(1) != DRL6Lexer.EOF) {
                  int next = input.index();
                  if (helper.validateStatement(1)) {
                      statement(pkg);
                      if (state.failed)
                          return pkg.getDescr();
  
                      if (next == input.index()) {
                          // no token consumed, so, report problem:
                          resyncToNextStatement();
                      }
                  } else {
                      resyncToNextStatement();
                  }
  
                  if (input.LA(1) == DRL6Lexer.SEMICOLON) {
                      match(input,
                              DRL6Lexer.SEMICOLON,
                              null,
                              null,
                              DroolsEditorType.SYMBOL);
                      if (state.failed)
                          return pkg.getDescr();
                  }
              }
          } catch (RecognitionException e) {
              helper.reportError(e);
          } catch (Exception e) {
              helper.reportError(e);
          } finally {
              helper.setEnd(pkg);
          }
          return pkg.getDescr();
      }