You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Luis Alves (JIRA)" <ji...@apache.org> on 2009/08/06 03:03:14 UTC

[jira] Issue Comment Edited: (LUCENE-1782) Rename OriginalQueryParserHelper

    [ https://issues.apache.org/jira/browse/LUCENE-1782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739851#action_12739851 ] 

Luis Alves edited comment on LUCENE-1782 at 8/5/09 6:02 PM:
------------------------------------------------------------

To build the OriginalQueryParser.

Delete 
-  OriginalQueryParser.java
-  OriginalQueryParserConstants.java
-  OriginalQueryParserTokenManager.java
- TokenMgrError.java 
- JavaCharStream.java
- Token.java

run JavaCC on QueryParser.jj. That will generate the all the classes

Also, to avoid lots of warnings in the generated code:
- add @SupressWarnings("all") to QueryParserTokenManager.java, tokenMgrError.java, 
	JavaCharStream.java, Token.java and JavaCharStream.java
	immediately preceding the class declaration. 

- remove all imports from TokenMgrError.java

- If you delete ParseException. You will need to edit the ParseException class to extend from QueryNodeParseException class
  "public class ParseException extends QueryNodeParseException".
  Recreate the all the constructors like this:
{code}
    public ParseException(Token currentTokenVal,
      int[][] expectedTokenSequencesVal, String[] tokenImageVal) {
    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, initialise(
        currentTokenVal, expectedTokenSequencesVal, tokenImageVal)));
    this.currentToken = currentTokenVal;
    this.expectedTokenSequences = expectedTokenSequencesVal;
    this.tokenImage = tokenImageVal;
  }

  public ParseException(Message message) {
    super(message);
  }

  public ParseException() {
    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error"));
  }
{code}

- fix all imports

This needs to be done after each time these files are generated by javacc.

      was (Author: lafa):
    To build the OriginalQueryParser.

Delete 
-  OriginalQueryParser.java
-  OriginalQueryParserConstants.java
-  OriginalQueryParserTokenManager.java
- TokenMgrError.java 
- JavaCharStream.java
- Token.java

run JavaCC on QueryParser.jj. That will generate:

Also, to avoid lots of warnings in the generated code:
- add @SupressWarnings("all") to QueryParserTokenManager.java, tokenMgrError.java, 
	JavaCharStream.java, Token.java and JavaCharStream.java
	immediately preceding the class declaration. 

- remove all imports from TokenMgrError.java

- If you delete ParseException. You will need to edit the ParseException class to extend from QueryNodeParseException class
  "public class ParseException extends QueryNodeParseException".
  Recreate the all the constructors like this:
{code}
    public ParseException(Token currentTokenVal,
      int[][] expectedTokenSequencesVal, String[] tokenImageVal) {
    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, initialise(
        currentTokenVal, expectedTokenSequencesVal, tokenImageVal)));
    this.currentToken = currentTokenVal;
    this.expectedTokenSequences = expectedTokenSequencesVal;
    this.tokenImage = tokenImageVal;
  }

  public ParseException(Message message) {
    super(message);
  }

  public ParseException() {
    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error"));
  }
{code}

- fix all imports

This needs to be done after each time these files are generated by javacc.
  
> Rename OriginalQueryParserHelper
> --------------------------------
>
>                 Key: LUCENE-1782
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1782
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: contrib/*
>    Affects Versions: 2.9
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1782.patch
>
>
> We should rename the new QueryParser so it's clearer that it's
> Lucene's default QueryParser, going forward, and not just a temporary
> "bridge" to a future new QueryParser.
> How about we rename oal.queryParser.original -->
> oal.queryParser.standard (can't use "default": it's a Java keyword)?
> Then, leave the OriginalQueryParserHelper under that package, but
> simply rename it to QueryParser?
> This way if we create other sub-packages in the future, eg
> ComplexPhraseQueryParser, they too can have a QueryParser class under
> them, to make it clear that's the "top" class you use to parse
> queries.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org