| <?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"> |
| |
| <description> |
| Flexible Query Parser |
| </description> |
| |
| <property name="javac.source" value="1.5" /> |
| <property name="javac.target" value="1.5" /> |
| |
| <import file="../contrib-build.xml"/> |
| |
| <!-- |
| 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" |
| /> |
| <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"/> |
| </target> |
| |
| </project> |