2009-08-02 23:38:44 -04:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<project name="queryparser" default="default">
|
|
|
|
|
2009-08-07 06:24:28 -04:00
|
|
|
<description>
|
|
|
|
Flexible Query Parser
|
|
|
|
</description>
|
2009-08-02 23:38:44 -04:00
|
|
|
|
2009-08-07 06:24:28 -04:00
|
|
|
<import file="../contrib-build.xml"/>
|
2009-08-02 23:38:44 -04:00
|
|
|
|
2009-08-07 06:24:28 -04:00
|
|
|
<!--
|
|
|
|
NOTE: see the README.javacc for details on how to fully regenerate the parser
|
|
|
|
-->
|
|
|
|
<target name="javacc" depends="init,javacc-check" if="javacc.present">
|
|
|
|
<invoke-javacc target="src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.jj"
|
|
|
|
outputDir="src/java/org/apache/lucene/queryParser/standard/parser"
|
|
|
|
/>
|
2009-08-21 19:19:26 -04:00
|
|
|
<replaceregexp file="src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java"
|
|
|
|
match="public class ParseException extends Exception"
|
|
|
|
replace="public class ParseException extends QueryNodeParseException"
|
|
|
|
flags="g"
|
|
|
|
byline="false"/>
|
|
|
|
<replaceregexp file="src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java"
|
|
|
|
match="package org.apache.lucene.queryParser.standard.parser;"
|
|
|
|
replace="package org.apache.lucene.queryParser.standard.parser;
|
|
|
|
|
|
|
|
import org.apache.lucene.messages.Message;
|
|
|
|
import org.apache.lucene.messages.MessageImpl;
|
|
|
|
import org.apache.lucene.queryParser.core.*;
|
|
|
|
import org.apache.lucene.queryParser.core.messages.*;"
|
|
|
|
flags="g"
|
|
|
|
byline="false"/>
|
|
|
|
<replaceregexp file="src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java"
|
|
|
|
match="^ public ParseException\(Token currentTokenVal.*$(\s\s[^}].*\n)* \}"
|
|
|
|
replace=" 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;
|
|
|
|
}"
|
|
|
|
flags="gm"
|
|
|
|
byline="false"/>
|
|
|
|
<replaceregexp file="src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java"
|
|
|
|
match="^ public ParseException\(String message.*$(\s\s[^}].*\n)* \}"
|
|
|
|
replace=" public ParseException(Message message) {
|
|
|
|
super(message);
|
|
|
|
}"
|
|
|
|
flags="gm"
|
|
|
|
byline="false"/>
|
|
|
|
<replaceregexp file="src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java"
|
|
|
|
match="^ public ParseException\(\).*$(\s\s[^}].*\n)* \}"
|
|
|
|
replace=" public ParseException() {
|
|
|
|
super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error"));
|
|
|
|
}"
|
|
|
|
flags="gm"
|
|
|
|
byline="false"/>
|
|
|
|
<replaceregexp file="src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java"
|
|
|
|
match="^ public String getMessage\(\).*$(\s\s\s\s[^}].*\n)* \}"
|
|
|
|
replace=" private static String initialise(Token currentToken,
|
|
|
|
int[][] expectedTokenSequences, String[] tokenImage) {
|
|
|
|
String eol = System.getProperty("line.separator", "\n");"
|
|
|
|
flags="gm"
|
|
|
|
byline="false"/>
|
|
|
|
<replaceregexp file="src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java"
|
|
|
|
match="\s*protected String add_escapes.*"
|
|
|
|
replace=" static private String add_escapes(String str) {"
|
|
|
|
flags="g"
|
|
|
|
byline="false"/>
|
2009-08-07 06:24:28 -04:00
|
|
|
</target>
|
|
|
|
|
2009-08-02 23:38:44 -04:00
|
|
|
</project>
|