docs: public String type() throws RecognitionException {
          String type = "";
          try {
              int first = input.index(), last = first;
              match( input,
                     DRL5Lexer.ID,
                     null,
                     new int[]{DRL5Lexer.DOT, DRL5Lexer.LESS},
                     DroolsEditorType.IDENTIFIER );
              if ( state.failed ) return type;
  
              if ( input.LA( 1 ) == DRL5Lexer.LESS ) {
                  typeArguments();
                  if ( state.failed ) return type;
              }
  
              while ( input.LA( 1 ) == DRL5Lexer.DOT && input.LA( 2 ) == DRL5Lexer.ID ) {
                  match( input,
                         DRL5Lexer.DOT,
                         null,
                         new int[]{DRL5Lexer.ID},
                         DroolsEditorType.IDENTIFIER );
                  if ( state.failed ) return type;
                  match( input,
                         DRL5Lexer.ID,
                         null,
                         new int[]{DRL5Lexer.DOT},
                         DroolsEditorType.IDENTIFIER );
                  if ( state.failed ) return type;
  
                  if ( input.LA( 1 ) == DRL5Lexer.LESS ) {
                      typeArguments();
                      if ( state.failed ) return type;
                  }
              }
  
              while ( input.LA( 1 ) == DRL5Lexer.LEFT_SQUARE && input.LA( 2 ) == DRL5Lexer.RIGHT_SQUARE ) {
                  match( input,
                                 DRL5Lexer.LEFT_SQUARE,
                                 null,
                                 new int[]{DRL5Lexer.RIGHT_SQUARE},
                                 DroolsEditorType.IDENTIFIER );
                  if ( state.failed ) return type;
                  match( input,
                                 DRL5Lexer.RIGHT_SQUARE,
                                 null,
                                 null,
                                 DroolsEditorType.IDENTIFIER );
                  if ( state.failed ) return type;
              }
              last = input.LT( -1 ).getTokenIndex();
              type = input.toString( first,
                                     last );
              type = type.replace( " ",
                                   "" );
          } catch ( RecognitionException re ) {
              reportError( re );
          }
          return type;
      }