add --shared
[pylucene.git] / lucene-java-3.4.0 / lucene / contrib / queryparser / README.javacc
1 NOTE: often, if you are making a small change to the .jj file, you can
2 simply run "ant javacc" and skip the steps below.  JavaCC will print
3 warnings like this:
4
5    Warning: ParseException.java: File is obsolete.  Please rename or delete this file so that a new one can be generated for you.
6
7 which you should ignore (ie, simply keep the ParseException.java class
8 that's already present).
9
10 If, instead, you'd like to fully rebuild the StandardQueryParser,
11 here's how:
12
13   * Delete these files:
14
15     StandardQueryParser.java
16     StandardQueryParserConstants.java
17     StandardQueryParserTokenManager.java
18     TokenMgrError.java
19     JavaCharStream.java
20     Token.java
21
22   * Run "ant javacc". That will generate the all the classes
23
24   * To avoid lots of warnings in the generated code:
25
26     add @SupressWarnings("all"), immediately preceding the class declaration to:
27
28        QueryParserTokenManager.java
29        TokenMgrError.java
30        JavaCharStream.java
31        Token.java
32        JavaCharStream.java
33
34   * Remove all imports from TokenMgrError.java
35
36   * Fix the ParseException class:
37
38     - Change it to extend from QueryNodeParseException:
39
40        "public class ParseException extends QueryNodeParseException".
41
42     - Recreate the all the constructors like this:
43
44       public ParseException(Token currentTokenVal,
45         int[][] expectedTokenSequencesVal, String[] tokenImageVal) {
46         super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, initialise(
47           currentTokenVal, expectedTokenSequencesVal, tokenImageVal)));
48         this.currentToken = currentTokenVal;
49         this.expectedTokenSequences = expectedTokenSequencesVal;
50         this.tokenImage = tokenImageVal;
51       }
52
53       public ParseException(Message message) {
54         super(message);
55       }
56
57       public ParseException() {
58         super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error"));
59       }
60
61
62     - Fix all imports