docs: public BaseDescr declare( PackageDescrBuilder pkg ) throws RecognitionException {
          BaseDescr declaration = null;
          try {
              DeclareDescrBuilder declare = helper.start( pkg,
                                                          DeclareDescrBuilder.class,
                                                          null );
  
              // 'declare'
              match( input,
                     DRL5Lexer.ID,
                     DroolsSoftKeywords.DECLARE,
                     null,
                     DroolsEditorType.KEYWORD );
              if ( state.failed ) return null;
              
              if ( helper.validateIdentifierKey( DroolsSoftKeywords.ENTRY ) ) {
                  // entry point declaration
                  declaration = entryPointDeclaration( declare );
              } else if( helper.validateIdentifierKey( DroolsSoftKeywords.WINDOW ) ) {
                  // window declaration
                  declaration = windowDeclaration( declare );
              } else if ( helper.validateIdentifierKey( DroolsSoftKeywords.TRAIT ) ) {
                  // trait type declaration
                  // 'trait'
                  match( input,
                         DRL5Lexer.ID,
                         DroolsSoftKeywords.TRAIT,
                         null,
                         DroolsEditorType.KEYWORD );
                  if ( state.failed ) return null;
  
                  declaration = typeDeclaration( declare, true );
              } else if ( helper.validateIdentifierKey( DroolsSoftKeywords.ENUM ) ) {
                  match( input,
                          DRL5Lexer.ID,
                          DroolsSoftKeywords.ENUM,
                          null,
                          DroolsEditorType.KEYWORD );
                  if ( state.failed ) return null;
  
                  declaration = enumDeclaration( declare );
              } else {
                  // class type declaration
                  declaration = typeDeclaration( declare, false );
              }
  
          } catch ( RecognitionException re ) {
              reportError( re );
          }
          return declaration;
      }