lucene/contrib/queryparser
Uwe Schindler 3f722b66a5 LUCENE-2211: Fix various missing clearAttributes() and improve BaseTokenStreamTestCase to check for this trap
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@899627 13f79535-47bb-0310-9956-ffa450edef68
2010-01-15 13:42:18 +00:00
..
src LUCENE-2211: Fix various missing clearAttributes() and improve BaseTokenStreamTestCase to check for this trap 2010-01-15 13:42:18 +00:00
README.javacc LUCENE-1782: rename original -> standard in the new QueryParser 2009-08-07 10:24:28 +00:00
build.xml Remove unneeded Java 1.5 properties from contrib build.xmls 2009-09-30 22:29:02 +00:00
pom.xml.template LUCENE-1567: New flexible QueryParser framework. 2009-08-03 03:38:44 +00:00

README.javacc

NOTE: often, if you are making a small change to the .jj file, you can
simply run "ant javacc" and skip the steps below.  JavaCC will print
warnings like this:

   Warning: ParseException.java: File is obsolete.  Please rename or delete this file so that a new one can be generated for you.

which you should ignore (ie, simply keep the ParseException.java class
that's already present).

If, instead, you'd like to fully rebuild the StandardQueryParser,
here's how:

  * Delete these files:

    StandardQueryParser.java
    StandardQueryParserConstants.java
    StandardQueryParserTokenManager.java
    TokenMgrError.java
    JavaCharStream.java
    Token.java

  * Run "ant javacc". That will generate the all the classes

  * To avoid lots of warnings in the generated code:

    add @SupressWarnings("all"), immediately preceding the class declaration to:

       QueryParserTokenManager.java
       TokenMgrError.java
       JavaCharStream.java
       Token.java
       JavaCharStream.java

  * Remove all imports from TokenMgrError.java

  * Fix the ParseException class:

    - Change it to extend from QueryNodeParseException:

       "public class ParseException extends QueryNodeParseException".

    - Recreate the all the constructors like this:

      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"));
      }


    - Fix all imports