}
}
/** Parse a query. */
final public Query parse(Configuration conf) throws ParseException {
Query query = new Query(conf);
ArrayList terms;
Token token;
String field;
boolean stop;
boolean prohibited;
nonOpOrTerm();
label_1:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WORD:
case ACRONYM:
case SIGRAM:
case PLUS:
case MINUS:
case QUOTE:
;
break;
default:
jj_la1[0] = jj_gen;
break label_1;
}
stop=true; prohibited=false; field = Clause.DEFAULT_FIELD;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PLUS:
case MINUS:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PLUS:
jj_consume_token(PLUS);
stop=false;
break;
case MINUS:
jj_consume_token(MINUS);
stop=false;prohibited=true;
break;
default:
jj_la1[1] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[2] = jj_gen;
;
}
if (jj_2_1(2147483647)) {
token = jj_consume_token(WORD);
jj_consume_token(COLON);
field = token.image;
} else {
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case QUOTE:
terms = phrase(field);
stop=false;
break;
case WORD:
case ACRONYM:
case SIGRAM:
// quoted terms or
terms = compound(field);
break;
default:
jj_la1[3] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
nonOpOrTerm();
String[] array = (String[])terms.toArray(new String[terms.size()]);
if (stop
&& field == Clause.DEFAULT_FIELD
&& terms.size()==1
&& isStopWord(array[0])) {
// ignore stop words only when single, unadorned terms in default field
} else {
if (prohibited)
query.addProhibitedPhrase(array, field);
else
query.addRequiredPhrase(array, field);
}
}
{if (true) return query;}
throw new Error("Missing return statement in function");
}