com.google.appengine.api.search.query.QueryParser Maven / Gradle / Ivy
// $ANTLR 3.5.3 com/google/appengine/api/search/query/Query.g 2024-06-06 12:43:20
package com.google.appengine.api.search.query;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
import org.antlr.runtime.tree.*;
@SuppressWarnings("all")
public class QueryParser extends Parser {
public static final String[] tokenNames = new String[] {
"", "", "", "", "AND", "ARGS", "BACKSLASH", "COMMA",
"CONJUNCTION", "DIGIT", "DISJUNCTION", "EMPTY", "EQ", "ESC", "ESCAPED_CHAR",
"EXCLAMATION", "FIX", "FUNCTION", "FUZZY", "GE", "GLOBAL", "GT", "HAS",
"HEX_DIGIT", "LE", "LESSTHAN", "LITERAL", "LPAREN", "MID_CHAR", "MINUS",
"NE", "NEGATION", "NOT", "NUMBER_PREFIX", "OCTAL_ESC", "OR", "QUOTE",
"REWRITE", "RPAREN", "SEQUENCE", "START_CHAR", "STRING", "TEXT", "TEXT_ESC",
"UNICODE_ESC", "VALUE", "WS"
};
public static final int EOF=-1;
public static final int AND=4;
public static final int ARGS=5;
public static final int BACKSLASH=6;
public static final int COMMA=7;
public static final int CONJUNCTION=8;
public static final int DIGIT=9;
public static final int DISJUNCTION=10;
public static final int EMPTY=11;
public static final int EQ=12;
public static final int ESC=13;
public static final int ESCAPED_CHAR=14;
public static final int EXCLAMATION=15;
public static final int FIX=16;
public static final int FUNCTION=17;
public static final int FUZZY=18;
public static final int GE=19;
public static final int GLOBAL=20;
public static final int GT=21;
public static final int HAS=22;
public static final int HEX_DIGIT=23;
public static final int LE=24;
public static final int LESSTHAN=25;
public static final int LITERAL=26;
public static final int LPAREN=27;
public static final int MID_CHAR=28;
public static final int MINUS=29;
public static final int NE=30;
public static final int NEGATION=31;
public static final int NOT=32;
public static final int NUMBER_PREFIX=33;
public static final int OCTAL_ESC=34;
public static final int OR=35;
public static final int QUOTE=36;
public static final int REWRITE=37;
public static final int RPAREN=38;
public static final int SEQUENCE=39;
public static final int START_CHAR=40;
public static final int STRING=41;
public static final int TEXT=42;
public static final int TEXT_ESC=43;
public static final int UNICODE_ESC=44;
public static final int VALUE=45;
public static final int WS=46;
// delegates
public Parser[] getDelegates() {
return new Parser[] {};
}
// delegators
public QueryParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public QueryParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
protected TreeAdaptor adaptor = new CommonTreeAdaptor();
public void setTreeAdaptor(TreeAdaptor adaptor) {
this.adaptor = adaptor;
}
public TreeAdaptor getTreeAdaptor() {
return adaptor;
}
@Override public String[] getTokenNames() { return QueryParser.tokenNames; }
@Override public String getGrammarFileName() { return "com/google/appengine/api/search/query/Query.g"; }
@Override
public Object recoverFromMismatchedSet(IntStream input,
RecognitionException e, BitSet follow) throws RecognitionException {
throw e;
}
@Override
protected Object recoverFromMismatchedToken(
IntStream input, int ttype, BitSet follow) throws RecognitionException {
throw new MismatchedTokenException(ttype, input);
}
public static class query_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "query"
// com/google/appengine/api/search/query/Query.g:84:1: query : ( ( WS )* EOF -> ^( EMPTY ) | ( WS )* expression ( WS )* EOF -> expression );
public final QueryParser.query_return query() throws RecognitionException {
QueryParser.query_return retval = new QueryParser.query_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token WS1=null;
Token EOF2=null;
Token WS3=null;
Token WS5=null;
Token EOF6=null;
ParserRuleReturnScope expression4 =null;
CommonTree WS1_tree=null;
CommonTree EOF2_tree=null;
CommonTree WS3_tree=null;
CommonTree WS5_tree=null;
CommonTree EOF6_tree=null;
RewriteRuleTokenStream stream_WS=new RewriteRuleTokenStream(adaptor,"token WS");
RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
try {
// com/google/appengine/api/search/query/Query.g:85:5: ( ( WS )* EOF -> ^( EMPTY ) | ( WS )* expression ( WS )* EOF -> expression )
int alt4=2;
alt4 = dfa4.predict(input);
switch (alt4) {
case 1 :
// com/google/appengine/api/search/query/Query.g:85:7: ( WS )* EOF
{
// com/google/appengine/api/search/query/Query.g:85:7: ( WS )*
loop1:
while (true) {
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0==WS) ) {
alt1=1;
}
switch (alt1) {
case 1 :
// com/google/appengine/api/search/query/Query.g:85:7: WS
{
WS1=(Token)match(input,WS,FOLLOW_WS_in_query148);
stream_WS.add(WS1);
}
break;
default :
break loop1;
}
}
EOF2=(Token)match(input,EOF,FOLLOW_EOF_in_query151);
stream_EOF.add(EOF2);
// AST REWRITE
// elements:
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 85:30: -> ^( EMPTY )
{
// com/google/appengine/api/search/query/Query.g:85:33: ^( EMPTY )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EMPTY, "EMPTY"), root_1);
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:86:7: ( WS )* expression ( WS )* EOF
{
// com/google/appengine/api/search/query/Query.g:86:7: ( WS )*
loop2:
while (true) {
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0==WS) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// com/google/appengine/api/search/query/Query.g:86:7: WS
{
WS3=(Token)match(input,WS,FOLLOW_WS_in_query180);
stream_WS.add(WS3);
}
break;
default :
break loop2;
}
}
pushFollow(FOLLOW_expression_in_query183);
expression4=expression();
state._fsp--;
stream_expression.add(expression4.getTree());
// com/google/appengine/api/search/query/Query.g:86:22: ( WS )*
loop3:
while (true) {
int alt3=2;
int LA3_0 = input.LA(1);
if ( (LA3_0==WS) ) {
alt3=1;
}
switch (alt3) {
case 1 :
// com/google/appengine/api/search/query/Query.g:86:22: WS
{
WS5=(Token)match(input,WS,FOLLOW_WS_in_query185);
stream_WS.add(WS5);
}
break;
default :
break loop3;
}
}
EOF6=(Token)match(input,EOF,FOLLOW_EOF_in_query188);
stream_EOF.add(EOF6);
// AST REWRITE
// elements: expression
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 86:30: -> expression
{
adaptor.addChild(root_0, stream_expression.nextTree());
}
retval.tree = root_0;
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "query"
public static class expression_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "expression"
// com/google/appengine/api/search/query/Query.g:91:1: expression : sequence ( -> sequence | ( andOp sequence )+ -> ^( CONJUNCTION ( sequence )+ ) ) ;
public final QueryParser.expression_return expression() throws RecognitionException {
QueryParser.expression_return retval = new QueryParser.expression_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope sequence7 =null;
ParserRuleReturnScope andOp8 =null;
ParserRuleReturnScope sequence9 =null;
RewriteRuleSubtreeStream stream_sequence=new RewriteRuleSubtreeStream(adaptor,"rule sequence");
RewriteRuleSubtreeStream stream_andOp=new RewriteRuleSubtreeStream(adaptor,"rule andOp");
try {
// com/google/appengine/api/search/query/Query.g:92:5: ( sequence ( -> sequence | ( andOp sequence )+ -> ^( CONJUNCTION ( sequence )+ ) ) )
// com/google/appengine/api/search/query/Query.g:92:7: sequence ( -> sequence | ( andOp sequence )+ -> ^( CONJUNCTION ( sequence )+ ) )
{
pushFollow(FOLLOW_sequence_in_expression211);
sequence7=sequence();
state._fsp--;
stream_sequence.add(sequence7.getTree());
// com/google/appengine/api/search/query/Query.g:92:16: ( -> sequence | ( andOp sequence )+ -> ^( CONJUNCTION ( sequence )+ ) )
int alt6=2;
alt6 = dfa6.predict(input);
switch (alt6) {
case 1 :
// com/google/appengine/api/search/query/Query.g:93:29:
{
// AST REWRITE
// elements: sequence
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 93:29: -> sequence
{
adaptor.addChild(root_0, stream_sequence.nextTree());
}
retval.tree = root_0;
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:94:11: ( andOp sequence )+
{
// com/google/appengine/api/search/query/Query.g:94:11: ( andOp sequence )+
int cnt5=0;
loop5:
while (true) {
int alt5=2;
alt5 = dfa5.predict(input);
switch (alt5) {
case 1 :
// com/google/appengine/api/search/query/Query.g:94:12: andOp sequence
{
pushFollow(FOLLOW_andOp_in_expression248);
andOp8=andOp();
state._fsp--;
stream_andOp.add(andOp8.getTree());
pushFollow(FOLLOW_sequence_in_expression250);
sequence9=sequence();
state._fsp--;
stream_sequence.add(sequence9.getTree());
}
break;
default :
if ( cnt5 >= 1 ) break loop5;
EarlyExitException eee = new EarlyExitException(5, input);
throw eee;
}
cnt5++;
}
// AST REWRITE
// elements: sequence
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 94:29: -> ^( CONJUNCTION ( sequence )+ )
{
// com/google/appengine/api/search/query/Query.g:94:32: ^( CONJUNCTION ( sequence )+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CONJUNCTION, "CONJUNCTION"), root_1);
if ( !(stream_sequence.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_sequence.hasNext() ) {
adaptor.addChild(root_1, stream_sequence.nextTree());
}
stream_sequence.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
}
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "expression"
public static class sequence_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "sequence"
// com/google/appengine/api/search/query/Query.g:100:1: sequence : factor ( -> factor | ( ( WS )+ factor )+ -> ^( SEQUENCE ( factor )+ ) ) ;
public final QueryParser.sequence_return sequence() throws RecognitionException {
QueryParser.sequence_return retval = new QueryParser.sequence_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token WS11=null;
ParserRuleReturnScope factor10 =null;
ParserRuleReturnScope factor12 =null;
CommonTree WS11_tree=null;
RewriteRuleTokenStream stream_WS=new RewriteRuleTokenStream(adaptor,"token WS");
RewriteRuleSubtreeStream stream_factor=new RewriteRuleSubtreeStream(adaptor,"rule factor");
try {
// com/google/appengine/api/search/query/Query.g:101:5: ( factor ( -> factor | ( ( WS )+ factor )+ -> ^( SEQUENCE ( factor )+ ) ) )
// com/google/appengine/api/search/query/Query.g:101:7: factor ( -> factor | ( ( WS )+ factor )+ -> ^( SEQUENCE ( factor )+ ) )
{
pushFollow(FOLLOW_factor_in_sequence288);
factor10=factor();
state._fsp--;
stream_factor.add(factor10.getTree());
// com/google/appengine/api/search/query/Query.g:101:14: ( -> factor | ( ( WS )+ factor )+ -> ^( SEQUENCE ( factor )+ ) )
int alt9=2;
alt9 = dfa9.predict(input);
switch (alt9) {
case 1 :
// com/google/appengine/api/search/query/Query.g:102:28:
{
// AST REWRITE
// elements: factor
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 102:28: -> factor
{
adaptor.addChild(root_0, stream_factor.nextTree());
}
retval.tree = root_0;
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:103:11: ( ( WS )+ factor )+
{
// com/google/appengine/api/search/query/Query.g:103:11: ( ( WS )+ factor )+
int cnt8=0;
loop8:
while (true) {
int alt8=2;
alt8 = dfa8.predict(input);
switch (alt8) {
case 1 :
// com/google/appengine/api/search/query/Query.g:103:12: ( WS )+ factor
{
// com/google/appengine/api/search/query/Query.g:103:12: ( WS )+
int cnt7=0;
loop7:
while (true) {
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==WS) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// com/google/appengine/api/search/query/Query.g:103:12: WS
{
WS11=(Token)match(input,WS,FOLLOW_WS_in_sequence324);
stream_WS.add(WS11);
}
break;
default :
if ( cnt7 >= 1 ) break loop7;
EarlyExitException eee = new EarlyExitException(7, input);
throw eee;
}
cnt7++;
}
pushFollow(FOLLOW_factor_in_sequence327);
factor12=factor();
state._fsp--;
stream_factor.add(factor12.getTree());
}
break;
default :
if ( cnt8 >= 1 ) break loop8;
EarlyExitException eee = new EarlyExitException(8, input);
throw eee;
}
cnt8++;
}
// AST REWRITE
// elements: factor
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 103:28: -> ^( SEQUENCE ( factor )+ )
{
// com/google/appengine/api/search/query/Query.g:103:31: ^( SEQUENCE ( factor )+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(SEQUENCE, "SEQUENCE"), root_1);
if ( !(stream_factor.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_factor.hasNext() ) {
adaptor.addChild(root_1, stream_factor.nextTree());
}
stream_factor.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
}
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "sequence"
public static class factor_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "factor"
// com/google/appengine/api/search/query/Query.g:109:1: factor : term ( -> term | ( orOp term )+ -> ^( DISJUNCTION ( term )+ ) ) ;
public final QueryParser.factor_return factor() throws RecognitionException {
QueryParser.factor_return retval = new QueryParser.factor_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope term13 =null;
ParserRuleReturnScope orOp14 =null;
ParserRuleReturnScope term15 =null;
RewriteRuleSubtreeStream stream_orOp=new RewriteRuleSubtreeStream(adaptor,"rule orOp");
RewriteRuleSubtreeStream stream_term=new RewriteRuleSubtreeStream(adaptor,"rule term");
try {
// com/google/appengine/api/search/query/Query.g:110:5: ( term ( -> term | ( orOp term )+ -> ^( DISJUNCTION ( term )+ ) ) )
// com/google/appengine/api/search/query/Query.g:110:7: term ( -> term | ( orOp term )+ -> ^( DISJUNCTION ( term )+ ) )
{
pushFollow(FOLLOW_term_in_factor368);
term13=term();
state._fsp--;
stream_term.add(term13.getTree());
// com/google/appengine/api/search/query/Query.g:110:12: ( -> term | ( orOp term )+ -> ^( DISJUNCTION ( term )+ ) )
int alt11=2;
alt11 = dfa11.predict(input);
switch (alt11) {
case 1 :
// com/google/appengine/api/search/query/Query.g:111:24:
{
// AST REWRITE
// elements: term
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 111:24: -> term
{
adaptor.addChild(root_0, stream_term.nextTree());
}
retval.tree = root_0;
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:112:11: ( orOp term )+
{
// com/google/appengine/api/search/query/Query.g:112:11: ( orOp term )+
int cnt10=0;
loop10:
while (true) {
int alt10=2;
alt10 = dfa10.predict(input);
switch (alt10) {
case 1 :
// com/google/appengine/api/search/query/Query.g:112:12: orOp term
{
pushFollow(FOLLOW_orOp_in_factor400);
orOp14=orOp();
state._fsp--;
stream_orOp.add(orOp14.getTree());
pushFollow(FOLLOW_term_in_factor402);
term15=term();
state._fsp--;
stream_term.add(term15.getTree());
}
break;
default :
if ( cnt10 >= 1 ) break loop10;
EarlyExitException eee = new EarlyExitException(10, input);
throw eee;
}
cnt10++;
}
// AST REWRITE
// elements: term
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 112:24: -> ^( DISJUNCTION ( term )+ )
{
// com/google/appengine/api/search/query/Query.g:112:27: ^( DISJUNCTION ( term )+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(DISJUNCTION, "DISJUNCTION"), root_1);
if ( !(stream_term.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_term.hasNext() ) {
adaptor.addChild(root_1, stream_term.nextTree());
}
stream_term.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
}
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "factor"
public static class term_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "term"
// com/google/appengine/api/search/query/Query.g:116:1: term : ( primitive | notOp primitive -> ^( NEGATION primitive ) );
public final QueryParser.term_return term() throws RecognitionException {
QueryParser.term_return retval = new QueryParser.term_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope primitive16 =null;
ParserRuleReturnScope notOp17 =null;
ParserRuleReturnScope primitive18 =null;
RewriteRuleSubtreeStream stream_primitive=new RewriteRuleSubtreeStream(adaptor,"rule primitive");
RewriteRuleSubtreeStream stream_notOp=new RewriteRuleSubtreeStream(adaptor,"rule notOp");
try {
// com/google/appengine/api/search/query/Query.g:117:3: ( primitive | notOp primitive -> ^( NEGATION primitive ) )
int alt12=2;
int LA12_0 = input.LA(1);
if ( (LA12_0==FIX||LA12_0==LPAREN||(LA12_0 >= QUOTE && LA12_0 <= REWRITE)||LA12_0==TEXT) ) {
alt12=1;
}
else if ( (LA12_0==MINUS||LA12_0==NOT) ) {
alt12=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 12, 0, input);
throw nvae;
}
switch (alt12) {
case 1 :
// com/google/appengine/api/search/query/Query.g:117:5: primitive
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_primitive_in_term436);
primitive16=primitive();
state._fsp--;
adaptor.addChild(root_0, primitive16.getTree());
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:118:5: notOp primitive
{
pushFollow(FOLLOW_notOp_in_term442);
notOp17=notOp();
state._fsp--;
stream_notOp.add(notOp17.getTree());
pushFollow(FOLLOW_primitive_in_term444);
primitive18=primitive();
state._fsp--;
stream_primitive.add(primitive18.getTree());
// AST REWRITE
// elements: primitive
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 118:21: -> ^( NEGATION primitive )
{
// com/google/appengine/api/search/query/Query.g:118:24: ^( NEGATION primitive )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(NEGATION, "NEGATION"), root_1);
adaptor.addChild(root_1, stream_primitive.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "term"
public static class primitive_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "primitive"
// com/google/appengine/api/search/query/Query.g:126:1: primitive : ( restriction | composite );
public final QueryParser.primitive_return primitive() throws RecognitionException {
QueryParser.primitive_return retval = new QueryParser.primitive_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope restriction19 =null;
ParserRuleReturnScope composite20 =null;
try {
// com/google/appengine/api/search/query/Query.g:127:3: ( restriction | composite )
int alt13=2;
int LA13_0 = input.LA(1);
if ( (LA13_0==FIX||(LA13_0 >= QUOTE && LA13_0 <= REWRITE)||LA13_0==TEXT) ) {
alt13=1;
}
else if ( (LA13_0==LPAREN) ) {
alt13=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 13, 0, input);
throw nvae;
}
switch (alt13) {
case 1 :
// com/google/appengine/api/search/query/Query.g:127:5: restriction
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_restriction_in_primitive470);
restriction19=restriction();
state._fsp--;
adaptor.addChild(root_0, restriction19.getTree());
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:128:5: composite
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_composite_in_primitive476);
composite20=composite();
state._fsp--;
adaptor.addChild(root_0, composite20.getTree());
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "primitive"
public static class restriction_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "restriction"
// com/google/appengine/api/search/query/Query.g:135:1: restriction : comparable ( -> ^( HAS GLOBAL comparable ) | comparator arg -> ^( comparator comparable arg ) ) ;
public final QueryParser.restriction_return restriction() throws RecognitionException {
QueryParser.restriction_return retval = new QueryParser.restriction_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope comparable21 =null;
ParserRuleReturnScope comparator22 =null;
ParserRuleReturnScope arg23 =null;
RewriteRuleSubtreeStream stream_comparator=new RewriteRuleSubtreeStream(adaptor,"rule comparator");
RewriteRuleSubtreeStream stream_arg=new RewriteRuleSubtreeStream(adaptor,"rule arg");
RewriteRuleSubtreeStream stream_comparable=new RewriteRuleSubtreeStream(adaptor,"rule comparable");
try {
// com/google/appengine/api/search/query/Query.g:136:3: ( comparable ( -> ^( HAS GLOBAL comparable ) | comparator arg -> ^( comparator comparable arg ) ) )
// com/google/appengine/api/search/query/Query.g:136:5: comparable ( -> ^( HAS GLOBAL comparable ) | comparator arg -> ^( comparator comparable arg ) )
{
pushFollow(FOLLOW_comparable_in_restriction493);
comparable21=comparable();
state._fsp--;
stream_comparable.add(comparable21.getTree());
// com/google/appengine/api/search/query/Query.g:136:16: ( -> ^( HAS GLOBAL comparable ) | comparator arg -> ^( comparator comparable arg ) )
int alt14=2;
alt14 = dfa14.predict(input);
switch (alt14) {
case 1 :
// com/google/appengine/api/search/query/Query.g:137:24:
{
// AST REWRITE
// elements: comparable
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 137:24: -> ^( HAS GLOBAL comparable )
{
// com/google/appengine/api/search/query/Query.g:137:27: ^( HAS GLOBAL comparable )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(HAS, "HAS"), root_1);
adaptor.addChild(root_1, (CommonTree)adaptor.create(GLOBAL, "GLOBAL"));
adaptor.addChild(root_1, stream_comparable.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:138:9: comparator arg
{
pushFollow(FOLLOW_comparator_in_restriction528);
comparator22=comparator();
state._fsp--;
stream_comparator.add(comparator22.getTree());
pushFollow(FOLLOW_arg_in_restriction530);
arg23=arg();
state._fsp--;
stream_arg.add(arg23.getTree());
// AST REWRITE
// elements: comparator, comparable, arg
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 138:24: -> ^( comparator comparable arg )
{
// com/google/appengine/api/search/query/Query.g:138:27: ^( comparator comparable arg )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(stream_comparator.nextNode(), root_1);
adaptor.addChild(root_1, stream_comparable.nextTree());
adaptor.addChild(root_1, stream_arg.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
}
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "restriction"
public static class comparator_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "comparator"
// com/google/appengine/api/search/query/Query.g:143:1: comparator : ( WS )* (x= LE |x= LESSTHAN |x= GE |x= GT |x= NE |x= EQ |x= HAS ) ( WS )* -> $x;
public final QueryParser.comparator_return comparator() throws RecognitionException {
QueryParser.comparator_return retval = new QueryParser.comparator_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token x=null;
Token WS24=null;
Token WS25=null;
CommonTree x_tree=null;
CommonTree WS24_tree=null;
CommonTree WS25_tree=null;
RewriteRuleTokenStream stream_NE=new RewriteRuleTokenStream(adaptor,"token NE");
RewriteRuleTokenStream stream_LESSTHAN=new RewriteRuleTokenStream(adaptor,"token LESSTHAN");
RewriteRuleTokenStream stream_LE=new RewriteRuleTokenStream(adaptor,"token LE");
RewriteRuleTokenStream stream_HAS=new RewriteRuleTokenStream(adaptor,"token HAS");
RewriteRuleTokenStream stream_WS=new RewriteRuleTokenStream(adaptor,"token WS");
RewriteRuleTokenStream stream_EQ=new RewriteRuleTokenStream(adaptor,"token EQ");
RewriteRuleTokenStream stream_GT=new RewriteRuleTokenStream(adaptor,"token GT");
RewriteRuleTokenStream stream_GE=new RewriteRuleTokenStream(adaptor,"token GE");
try {
// com/google/appengine/api/search/query/Query.g:144:3: ( ( WS )* (x= LE |x= LESSTHAN |x= GE |x= GT |x= NE |x= EQ |x= HAS ) ( WS )* -> $x)
// com/google/appengine/api/search/query/Query.g:144:5: ( WS )* (x= LE |x= LESSTHAN |x= GE |x= GT |x= NE |x= EQ |x= HAS ) ( WS )*
{
// com/google/appengine/api/search/query/Query.g:144:5: ( WS )*
loop15:
while (true) {
int alt15=2;
int LA15_0 = input.LA(1);
if ( (LA15_0==WS) ) {
alt15=1;
}
switch (alt15) {
case 1 :
// com/google/appengine/api/search/query/Query.g:144:5: WS
{
WS24=(Token)match(input,WS,FOLLOW_WS_in_comparator560);
stream_WS.add(WS24);
}
break;
default :
break loop15;
}
}
// com/google/appengine/api/search/query/Query.g:144:9: (x= LE |x= LESSTHAN |x= GE |x= GT |x= NE |x= EQ |x= HAS )
int alt16=7;
switch ( input.LA(1) ) {
case LE:
{
alt16=1;
}
break;
case LESSTHAN:
{
alt16=2;
}
break;
case GE:
{
alt16=3;
}
break;
case GT:
{
alt16=4;
}
break;
case NE:
{
alt16=5;
}
break;
case EQ:
{
alt16=6;
}
break;
case HAS:
{
alt16=7;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 16, 0, input);
throw nvae;
}
switch (alt16) {
case 1 :
// com/google/appengine/api/search/query/Query.g:144:10: x= LE
{
x=(Token)match(input,LE,FOLLOW_LE_in_comparator566);
stream_LE.add(x);
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:144:17: x= LESSTHAN
{
x=(Token)match(input,LESSTHAN,FOLLOW_LESSTHAN_in_comparator572);
stream_LESSTHAN.add(x);
}
break;
case 3 :
// com/google/appengine/api/search/query/Query.g:144:30: x= GE
{
x=(Token)match(input,GE,FOLLOW_GE_in_comparator578);
stream_GE.add(x);
}
break;
case 4 :
// com/google/appengine/api/search/query/Query.g:144:37: x= GT
{
x=(Token)match(input,GT,FOLLOW_GT_in_comparator584);
stream_GT.add(x);
}
break;
case 5 :
// com/google/appengine/api/search/query/Query.g:144:44: x= NE
{
x=(Token)match(input,NE,FOLLOW_NE_in_comparator590);
stream_NE.add(x);
}
break;
case 6 :
// com/google/appengine/api/search/query/Query.g:144:51: x= EQ
{
x=(Token)match(input,EQ,FOLLOW_EQ_in_comparator596);
stream_EQ.add(x);
}
break;
case 7 :
// com/google/appengine/api/search/query/Query.g:144:58: x= HAS
{
x=(Token)match(input,HAS,FOLLOW_HAS_in_comparator602);
stream_HAS.add(x);
}
break;
}
// com/google/appengine/api/search/query/Query.g:144:65: ( WS )*
loop17:
while (true) {
int alt17=2;
int LA17_0 = input.LA(1);
if ( (LA17_0==WS) ) {
alt17=1;
}
switch (alt17) {
case 1 :
// com/google/appengine/api/search/query/Query.g:144:65: WS
{
WS25=(Token)match(input,WS,FOLLOW_WS_in_comparator605);
stream_WS.add(WS25);
}
break;
default :
break loop17;
}
}
// AST REWRITE
// elements: x
// token labels: x
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleTokenStream stream_x=new RewriteRuleTokenStream(adaptor,"token x",x);
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 144:69: -> $x
{
adaptor.addChild(root_0, stream_x.nextNode());
}
retval.tree = root_0;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "comparator"
public static class comparable_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "comparable"
// com/google/appengine/api/search/query/Query.g:150:1: comparable : ( member | function );
public final QueryParser.comparable_return comparable() throws RecognitionException {
QueryParser.comparable_return retval = new QueryParser.comparable_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope member26 =null;
ParserRuleReturnScope function27 =null;
try {
// com/google/appengine/api/search/query/Query.g:151:3: ( member | function )
int alt18=2;
int LA18_0 = input.LA(1);
if ( (LA18_0==FIX||(LA18_0 >= QUOTE && LA18_0 <= REWRITE)) ) {
alt18=1;
}
else if ( (LA18_0==TEXT) ) {
int LA18_2 = input.LA(2);
if ( (LA18_2==EOF||LA18_2==COMMA||LA18_2==EQ||LA18_2==GE||(LA18_2 >= GT && LA18_2 <= HAS)||(LA18_2 >= LE && LA18_2 <= LESSTHAN)||LA18_2==NE||LA18_2==RPAREN||LA18_2==WS) ) {
alt18=1;
}
else if ( (LA18_2==LPAREN) ) {
alt18=2;
}
else {
int nvaeMark = input.mark();
try {
input.consume();
NoViableAltException nvae =
new NoViableAltException("", 18, 2, input);
throw nvae;
} finally {
input.rewind(nvaeMark);
}
}
}
else {
NoViableAltException nvae =
new NoViableAltException("", 18, 0, input);
throw nvae;
}
switch (alt18) {
case 1 :
// com/google/appengine/api/search/query/Query.g:151:5: member
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_member_in_comparable627);
member26=member();
state._fsp--;
adaptor.addChild(root_0, member26.getTree());
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:152:5: function
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_function_in_comparable633);
function27=function();
state._fsp--;
adaptor.addChild(root_0, function27.getTree());
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "comparable"
public static class member_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "member"
// com/google/appengine/api/search/query/Query.g:155:1: member : item ;
public final QueryParser.member_return member() throws RecognitionException {
QueryParser.member_return retval = new QueryParser.member_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope item28 =null;
try {
// com/google/appengine/api/search/query/Query.g:156:5: ( item )
// com/google/appengine/api/search/query/Query.g:156:7: item
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_item_in_member648);
item28=item();
state._fsp--;
adaptor.addChild(root_0, item28.getTree());
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "member"
public static class function_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "function"
// com/google/appengine/api/search/query/Query.g:161:1: function : text LPAREN arglist RPAREN -> ^( FUNCTION text ^( ARGS arglist ) ) ;
public final QueryParser.function_return function() throws RecognitionException {
QueryParser.function_return retval = new QueryParser.function_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token LPAREN30=null;
Token RPAREN32=null;
ParserRuleReturnScope text29 =null;
ParserRuleReturnScope arglist31 =null;
CommonTree LPAREN30_tree=null;
CommonTree RPAREN32_tree=null;
RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
RewriteRuleSubtreeStream stream_arglist=new RewriteRuleSubtreeStream(adaptor,"rule arglist");
RewriteRuleSubtreeStream stream_text=new RewriteRuleSubtreeStream(adaptor,"rule text");
try {
// com/google/appengine/api/search/query/Query.g:162:3: ( text LPAREN arglist RPAREN -> ^( FUNCTION text ^( ARGS arglist ) ) )
// com/google/appengine/api/search/query/Query.g:162:5: text LPAREN arglist RPAREN
{
pushFollow(FOLLOW_text_in_function665);
text29=text();
state._fsp--;
stream_text.add(text29.getTree());
LPAREN30=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_function667);
stream_LPAREN.add(LPAREN30);
pushFollow(FOLLOW_arglist_in_function669);
arglist31=arglist();
state._fsp--;
stream_arglist.add(arglist31.getTree());
RPAREN32=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_function671);
stream_RPAREN.add(RPAREN32);
// AST REWRITE
// elements: text, arglist
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 162:32: -> ^( FUNCTION text ^( ARGS arglist ) )
{
// com/google/appengine/api/search/query/Query.g:162:35: ^( FUNCTION text ^( ARGS arglist ) )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(FUNCTION, "FUNCTION"), root_1);
adaptor.addChild(root_1, stream_text.nextTree());
// com/google/appengine/api/search/query/Query.g:162:51: ^( ARGS arglist )
{
CommonTree root_2 = (CommonTree)adaptor.nil();
root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ARGS, "ARGS"), root_2);
adaptor.addChild(root_2, stream_arglist.nextTree());
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "function"
public static class arglist_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "arglist"
// com/google/appengine/api/search/query/Query.g:167:1: arglist : (| arg ( sep arg )* -> ( arg )* );
public final QueryParser.arglist_return arglist() throws RecognitionException {
QueryParser.arglist_return retval = new QueryParser.arglist_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope arg33 =null;
ParserRuleReturnScope sep34 =null;
ParserRuleReturnScope arg35 =null;
RewriteRuleSubtreeStream stream_arg=new RewriteRuleSubtreeStream(adaptor,"rule arg");
RewriteRuleSubtreeStream stream_sep=new RewriteRuleSubtreeStream(adaptor,"rule sep");
try {
// com/google/appengine/api/search/query/Query.g:168:3: (| arg ( sep arg )* -> ( arg )* )
int alt20=2;
int LA20_0 = input.LA(1);
if ( (LA20_0==RPAREN) ) {
alt20=1;
}
else if ( (LA20_0==FIX||LA20_0==LPAREN||(LA20_0 >= QUOTE && LA20_0 <= REWRITE)||LA20_0==TEXT) ) {
alt20=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 20, 0, input);
throw nvae;
}
switch (alt20) {
case 1 :
// com/google/appengine/api/search/query/Query.g:169:3:
{
root_0 = (CommonTree)adaptor.nil();
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:169:5: arg ( sep arg )*
{
pushFollow(FOLLOW_arg_in_arglist706);
arg33=arg();
state._fsp--;
stream_arg.add(arg33.getTree());
// com/google/appengine/api/search/query/Query.g:169:9: ( sep arg )*
loop19:
while (true) {
int alt19=2;
int LA19_0 = input.LA(1);
if ( (LA19_0==COMMA||LA19_0==WS) ) {
alt19=1;
}
switch (alt19) {
case 1 :
// com/google/appengine/api/search/query/Query.g:169:10: sep arg
{
pushFollow(FOLLOW_sep_in_arglist709);
sep34=sep();
state._fsp--;
stream_sep.add(sep34.getTree());
pushFollow(FOLLOW_arg_in_arglist711);
arg35=arg();
state._fsp--;
stream_arg.add(arg35.getTree());
}
break;
default :
break loop19;
}
}
// AST REWRITE
// elements: arg
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 169:20: -> ( arg )*
{
// com/google/appengine/api/search/query/Query.g:169:23: ( arg )*
while ( stream_arg.hasNext() ) {
adaptor.addChild(root_0, stream_arg.nextTree());
}
stream_arg.reset();
}
retval.tree = root_0;
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "arglist"
public static class arg_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "arg"
// com/google/appengine/api/search/query/Query.g:173:1: arg : ( comparable | composite );
public final QueryParser.arg_return arg() throws RecognitionException {
QueryParser.arg_return retval = new QueryParser.arg_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope comparable36 =null;
ParserRuleReturnScope composite37 =null;
try {
// com/google/appengine/api/search/query/Query.g:174:3: ( comparable | composite )
int alt21=2;
int LA21_0 = input.LA(1);
if ( (LA21_0==FIX||(LA21_0 >= QUOTE && LA21_0 <= REWRITE)||LA21_0==TEXT) ) {
alt21=1;
}
else if ( (LA21_0==LPAREN) ) {
alt21=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 21, 0, input);
throw nvae;
}
switch (alt21) {
case 1 :
// com/google/appengine/api/search/query/Query.g:174:5: comparable
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_comparable_in_arg732);
comparable36=comparable();
state._fsp--;
adaptor.addChild(root_0, comparable36.getTree());
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:175:5: composite
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_composite_in_arg738);
composite37=composite();
state._fsp--;
adaptor.addChild(root_0, composite37.getTree());
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "arg"
public static class andOp_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "andOp"
// com/google/appengine/api/search/query/Query.g:179:1: andOp : ( WS )+ AND ( WS )+ ;
public final QueryParser.andOp_return andOp() throws RecognitionException {
QueryParser.andOp_return retval = new QueryParser.andOp_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token WS38=null;
Token AND39=null;
Token WS40=null;
CommonTree WS38_tree=null;
CommonTree AND39_tree=null;
CommonTree WS40_tree=null;
try {
// com/google/appengine/api/search/query/Query.g:180:3: ( ( WS )+ AND ( WS )+ )
// com/google/appengine/api/search/query/Query.g:180:5: ( WS )+ AND ( WS )+
{
root_0 = (CommonTree)adaptor.nil();
// com/google/appengine/api/search/query/Query.g:180:5: ( WS )+
int cnt22=0;
loop22:
while (true) {
int alt22=2;
int LA22_0 = input.LA(1);
if ( (LA22_0==WS) ) {
alt22=1;
}
switch (alt22) {
case 1 :
// com/google/appengine/api/search/query/Query.g:180:5: WS
{
WS38=(Token)match(input,WS,FOLLOW_WS_in_andOp752);
WS38_tree = (CommonTree)adaptor.create(WS38);
adaptor.addChild(root_0, WS38_tree);
}
break;
default :
if ( cnt22 >= 1 ) break loop22;
EarlyExitException eee = new EarlyExitException(22, input);
throw eee;
}
cnt22++;
}
AND39=(Token)match(input,AND,FOLLOW_AND_in_andOp755);
AND39_tree = (CommonTree)adaptor.create(AND39);
adaptor.addChild(root_0, AND39_tree);
// com/google/appengine/api/search/query/Query.g:180:13: ( WS )+
int cnt23=0;
loop23:
while (true) {
int alt23=2;
int LA23_0 = input.LA(1);
if ( (LA23_0==WS) ) {
alt23=1;
}
switch (alt23) {
case 1 :
// com/google/appengine/api/search/query/Query.g:180:13: WS
{
WS40=(Token)match(input,WS,FOLLOW_WS_in_andOp757);
WS40_tree = (CommonTree)adaptor.create(WS40);
adaptor.addChild(root_0, WS40_tree);
}
break;
default :
if ( cnt23 >= 1 ) break loop23;
EarlyExitException eee = new EarlyExitException(23, input);
throw eee;
}
cnt23++;
}
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "andOp"
public static class orOp_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "orOp"
// com/google/appengine/api/search/query/Query.g:184:1: orOp : ( WS )+ OR ( WS )+ ;
public final QueryParser.orOp_return orOp() throws RecognitionException {
QueryParser.orOp_return retval = new QueryParser.orOp_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token WS41=null;
Token OR42=null;
Token WS43=null;
CommonTree WS41_tree=null;
CommonTree OR42_tree=null;
CommonTree WS43_tree=null;
try {
// com/google/appengine/api/search/query/Query.g:185:3: ( ( WS )+ OR ( WS )+ )
// com/google/appengine/api/search/query/Query.g:185:5: ( WS )+ OR ( WS )+
{
root_0 = (CommonTree)adaptor.nil();
// com/google/appengine/api/search/query/Query.g:185:5: ( WS )+
int cnt24=0;
loop24:
while (true) {
int alt24=2;
int LA24_0 = input.LA(1);
if ( (LA24_0==WS) ) {
alt24=1;
}
switch (alt24) {
case 1 :
// com/google/appengine/api/search/query/Query.g:185:5: WS
{
WS41=(Token)match(input,WS,FOLLOW_WS_in_orOp772);
WS41_tree = (CommonTree)adaptor.create(WS41);
adaptor.addChild(root_0, WS41_tree);
}
break;
default :
if ( cnt24 >= 1 ) break loop24;
EarlyExitException eee = new EarlyExitException(24, input);
throw eee;
}
cnt24++;
}
OR42=(Token)match(input,OR,FOLLOW_OR_in_orOp775);
OR42_tree = (CommonTree)adaptor.create(OR42);
adaptor.addChild(root_0, OR42_tree);
// com/google/appengine/api/search/query/Query.g:185:12: ( WS )+
int cnt25=0;
loop25:
while (true) {
int alt25=2;
int LA25_0 = input.LA(1);
if ( (LA25_0==WS) ) {
alt25=1;
}
switch (alt25) {
case 1 :
// com/google/appengine/api/search/query/Query.g:185:12: WS
{
WS43=(Token)match(input,WS,FOLLOW_WS_in_orOp777);
WS43_tree = (CommonTree)adaptor.create(WS43);
adaptor.addChild(root_0, WS43_tree);
}
break;
default :
if ( cnt25 >= 1 ) break loop25;
EarlyExitException eee = new EarlyExitException(25, input);
throw eee;
}
cnt25++;
}
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "orOp"
public static class notOp_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "notOp"
// com/google/appengine/api/search/query/Query.g:189:1: notOp : ( '-' | NOT ( WS )+ );
public final QueryParser.notOp_return notOp() throws RecognitionException {
QueryParser.notOp_return retval = new QueryParser.notOp_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token char_literal44=null;
Token NOT45=null;
Token WS46=null;
CommonTree char_literal44_tree=null;
CommonTree NOT45_tree=null;
CommonTree WS46_tree=null;
try {
// com/google/appengine/api/search/query/Query.g:190:3: ( '-' | NOT ( WS )+ )
int alt27=2;
int LA27_0 = input.LA(1);
if ( (LA27_0==MINUS) ) {
alt27=1;
}
else if ( (LA27_0==NOT) ) {
alt27=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 27, 0, input);
throw nvae;
}
switch (alt27) {
case 1 :
// com/google/appengine/api/search/query/Query.g:190:5: '-'
{
root_0 = (CommonTree)adaptor.nil();
char_literal44=(Token)match(input,MINUS,FOLLOW_MINUS_in_notOp792);
char_literal44_tree = (CommonTree)adaptor.create(char_literal44);
adaptor.addChild(root_0, char_literal44_tree);
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:191:5: NOT ( WS )+
{
root_0 = (CommonTree)adaptor.nil();
NOT45=(Token)match(input,NOT,FOLLOW_NOT_in_notOp798);
NOT45_tree = (CommonTree)adaptor.create(NOT45);
adaptor.addChild(root_0, NOT45_tree);
// com/google/appengine/api/search/query/Query.g:191:9: ( WS )+
int cnt26=0;
loop26:
while (true) {
int alt26=2;
int LA26_0 = input.LA(1);
if ( (LA26_0==WS) ) {
alt26=1;
}
switch (alt26) {
case 1 :
// com/google/appengine/api/search/query/Query.g:191:9: WS
{
WS46=(Token)match(input,WS,FOLLOW_WS_in_notOp800);
WS46_tree = (CommonTree)adaptor.create(WS46);
adaptor.addChild(root_0, WS46_tree);
}
break;
default :
if ( cnt26 >= 1 ) break loop26;
EarlyExitException eee = new EarlyExitException(26, input);
throw eee;
}
cnt26++;
}
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "notOp"
public static class sep_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "sep"
// com/google/appengine/api/search/query/Query.g:195:1: sep : ( WS )* COMMA ( WS )* ;
public final QueryParser.sep_return sep() throws RecognitionException {
QueryParser.sep_return retval = new QueryParser.sep_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token WS47=null;
Token COMMA48=null;
Token WS49=null;
CommonTree WS47_tree=null;
CommonTree COMMA48_tree=null;
CommonTree WS49_tree=null;
try {
// com/google/appengine/api/search/query/Query.g:196:3: ( ( WS )* COMMA ( WS )* )
// com/google/appengine/api/search/query/Query.g:196:5: ( WS )* COMMA ( WS )*
{
root_0 = (CommonTree)adaptor.nil();
// com/google/appengine/api/search/query/Query.g:196:5: ( WS )*
loop28:
while (true) {
int alt28=2;
int LA28_0 = input.LA(1);
if ( (LA28_0==WS) ) {
alt28=1;
}
switch (alt28) {
case 1 :
// com/google/appengine/api/search/query/Query.g:196:5: WS
{
WS47=(Token)match(input,WS,FOLLOW_WS_in_sep815);
WS47_tree = (CommonTree)adaptor.create(WS47);
adaptor.addChild(root_0, WS47_tree);
}
break;
default :
break loop28;
}
}
COMMA48=(Token)match(input,COMMA,FOLLOW_COMMA_in_sep818);
COMMA48_tree = (CommonTree)adaptor.create(COMMA48);
adaptor.addChild(root_0, COMMA48_tree);
// com/google/appengine/api/search/query/Query.g:196:15: ( WS )*
loop29:
while (true) {
int alt29=2;
int LA29_0 = input.LA(1);
if ( (LA29_0==WS) ) {
alt29=1;
}
switch (alt29) {
case 1 :
// com/google/appengine/api/search/query/Query.g:196:15: WS
{
WS49=(Token)match(input,WS,FOLLOW_WS_in_sep820);
WS49_tree = (CommonTree)adaptor.create(WS49);
adaptor.addChild(root_0, WS49_tree);
}
break;
default :
break loop29;
}
}
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "sep"
public static class composite_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "composite"
// com/google/appengine/api/search/query/Query.g:201:1: composite : LPAREN ( WS )* expression ( WS )* RPAREN -> expression ;
public final QueryParser.composite_return composite() throws RecognitionException {
QueryParser.composite_return retval = new QueryParser.composite_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token LPAREN50=null;
Token WS51=null;
Token WS53=null;
Token RPAREN54=null;
ParserRuleReturnScope expression52 =null;
CommonTree LPAREN50_tree=null;
CommonTree WS51_tree=null;
CommonTree WS53_tree=null;
CommonTree RPAREN54_tree=null;
RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
RewriteRuleTokenStream stream_WS=new RewriteRuleTokenStream(adaptor,"token WS");
RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
try {
// com/google/appengine/api/search/query/Query.g:202:3: ( LPAREN ( WS )* expression ( WS )* RPAREN -> expression )
// com/google/appengine/api/search/query/Query.g:202:5: LPAREN ( WS )* expression ( WS )* RPAREN
{
LPAREN50=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_composite836);
stream_LPAREN.add(LPAREN50);
// com/google/appengine/api/search/query/Query.g:202:12: ( WS )*
loop30:
while (true) {
int alt30=2;
int LA30_0 = input.LA(1);
if ( (LA30_0==WS) ) {
alt30=1;
}
switch (alt30) {
case 1 :
// com/google/appengine/api/search/query/Query.g:202:12: WS
{
WS51=(Token)match(input,WS,FOLLOW_WS_in_composite838);
stream_WS.add(WS51);
}
break;
default :
break loop30;
}
}
pushFollow(FOLLOW_expression_in_composite841);
expression52=expression();
state._fsp--;
stream_expression.add(expression52.getTree());
// com/google/appengine/api/search/query/Query.g:202:27: ( WS )*
loop31:
while (true) {
int alt31=2;
int LA31_0 = input.LA(1);
if ( (LA31_0==WS) ) {
alt31=1;
}
switch (alt31) {
case 1 :
// com/google/appengine/api/search/query/Query.g:202:27: WS
{
WS53=(Token)match(input,WS,FOLLOW_WS_in_composite843);
stream_WS.add(WS53);
}
break;
default :
break loop31;
}
}
RPAREN54=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_composite846);
stream_RPAREN.add(RPAREN54);
// AST REWRITE
// elements: expression
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 202:38: -> expression
{
adaptor.addChild(root_0, stream_expression.nextTree());
}
retval.tree = root_0;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "composite"
public static class item_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "item"
// com/google/appengine/api/search/query/Query.g:208:1: item : ( FIX value -> ^( LITERAL value ) | REWRITE value -> ^( FUZZY value ) | value -> value );
public final QueryParser.item_return item() throws RecognitionException {
QueryParser.item_return retval = new QueryParser.item_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token FIX55=null;
Token REWRITE57=null;
ParserRuleReturnScope value56 =null;
ParserRuleReturnScope value58 =null;
ParserRuleReturnScope value59 =null;
CommonTree FIX55_tree=null;
CommonTree REWRITE57_tree=null;
RewriteRuleTokenStream stream_REWRITE=new RewriteRuleTokenStream(adaptor,"token REWRITE");
RewriteRuleTokenStream stream_FIX=new RewriteRuleTokenStream(adaptor,"token FIX");
RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value");
try {
// com/google/appengine/api/search/query/Query.g:209:3: ( FIX value -> ^( LITERAL value ) | REWRITE value -> ^( FUZZY value ) | value -> value )
int alt32=3;
switch ( input.LA(1) ) {
case FIX:
{
alt32=1;
}
break;
case REWRITE:
{
alt32=2;
}
break;
case QUOTE:
case TEXT:
{
alt32=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 32, 0, input);
throw nvae;
}
switch (alt32) {
case 1 :
// com/google/appengine/api/search/query/Query.g:209:5: FIX value
{
FIX55=(Token)match(input,FIX,FOLLOW_FIX_in_item866);
stream_FIX.add(FIX55);
pushFollow(FOLLOW_value_in_item868);
value56=value();
state._fsp--;
stream_value.add(value56.getTree());
// AST REWRITE
// elements: value
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 209:15: -> ^( LITERAL value )
{
// com/google/appengine/api/search/query/Query.g:209:18: ^( LITERAL value )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(LITERAL, "LITERAL"), root_1);
adaptor.addChild(root_1, stream_value.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:210:5: REWRITE value
{
REWRITE57=(Token)match(input,REWRITE,FOLLOW_REWRITE_in_item882);
stream_REWRITE.add(REWRITE57);
pushFollow(FOLLOW_value_in_item884);
value58=value();
state._fsp--;
stream_value.add(value58.getTree());
// AST REWRITE
// elements: value
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 210:19: -> ^( FUZZY value )
{
// com/google/appengine/api/search/query/Query.g:210:22: ^( FUZZY value )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(FUZZY, "FUZZY"), root_1);
adaptor.addChild(root_1, stream_value.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
case 3 :
// com/google/appengine/api/search/query/Query.g:211:5: value
{
pushFollow(FOLLOW_value_in_item898);
value59=value();
state._fsp--;
stream_value.add(value59.getTree());
// AST REWRITE
// elements: value
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 211:11: -> value
{
adaptor.addChild(root_0, stream_value.nextTree());
}
retval.tree = root_0;
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "item"
public static class value_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "value"
// com/google/appengine/api/search/query/Query.g:215:1: value : ( text -> ^( VALUE TEXT text ) | phrase -> ^( VALUE STRING phrase ) );
public final QueryParser.value_return value() throws RecognitionException {
QueryParser.value_return retval = new QueryParser.value_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope text60 =null;
ParserRuleReturnScope phrase61 =null;
RewriteRuleSubtreeStream stream_phrase=new RewriteRuleSubtreeStream(adaptor,"rule phrase");
RewriteRuleSubtreeStream stream_text=new RewriteRuleSubtreeStream(adaptor,"rule text");
try {
// com/google/appengine/api/search/query/Query.g:216:3: ( text -> ^( VALUE TEXT text ) | phrase -> ^( VALUE STRING phrase ) )
int alt33=2;
int LA33_0 = input.LA(1);
if ( (LA33_0==TEXT) ) {
alt33=1;
}
else if ( (LA33_0==QUOTE) ) {
alt33=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 33, 0, input);
throw nvae;
}
switch (alt33) {
case 1 :
// com/google/appengine/api/search/query/Query.g:216:5: text
{
pushFollow(FOLLOW_text_in_value916);
text60=text();
state._fsp--;
stream_text.add(text60.getTree());
// AST REWRITE
// elements: text
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 216:10: -> ^( VALUE TEXT text )
{
// com/google/appengine/api/search/query/Query.g:216:13: ^( VALUE TEXT text )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VALUE, "VALUE"), root_1);
adaptor.addChild(root_1, (CommonTree)adaptor.create(TEXT, "TEXT"));
adaptor.addChild(root_1, stream_text.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
case 2 :
// com/google/appengine/api/search/query/Query.g:217:5: phrase
{
pushFollow(FOLLOW_phrase_in_value932);
phrase61=phrase();
state._fsp--;
stream_phrase.add(phrase61.getTree());
// AST REWRITE
// elements: phrase
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
root_0 = (CommonTree)adaptor.nil();
// 217:12: -> ^( VALUE STRING phrase )
{
// com/google/appengine/api/search/query/Query.g:217:15: ^( VALUE STRING phrase )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VALUE, "VALUE"), root_1);
adaptor.addChild(root_1, (CommonTree)adaptor.create(STRING, "STRING"));
adaptor.addChild(root_1, stream_phrase.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "value"
public static class text_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "text"
// com/google/appengine/api/search/query/Query.g:221:1: text : TEXT ;
public final QueryParser.text_return text() throws RecognitionException {
QueryParser.text_return retval = new QueryParser.text_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token TEXT62=null;
CommonTree TEXT62_tree=null;
try {
// com/google/appengine/api/search/query/Query.g:222:3: ( TEXT )
// com/google/appengine/api/search/query/Query.g:222:5: TEXT
{
root_0 = (CommonTree)adaptor.nil();
TEXT62=(Token)match(input,TEXT,FOLLOW_TEXT_in_text956);
TEXT62_tree = (CommonTree)adaptor.create(TEXT62);
adaptor.addChild(root_0, TEXT62_tree);
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "text"
public static class phrase_return extends ParserRuleReturnScope {
CommonTree tree;
@Override
public CommonTree getTree() { return tree; }
};
// $ANTLR start "phrase"
// com/google/appengine/api/search/query/Query.g:226:1: phrase : QUOTE (~ QUOTE )* QUOTE ;
public final QueryParser.phrase_return phrase() throws RecognitionException {
QueryParser.phrase_return retval = new QueryParser.phrase_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token QUOTE63=null;
Token set64=null;
Token QUOTE65=null;
CommonTree QUOTE63_tree=null;
CommonTree set64_tree=null;
CommonTree QUOTE65_tree=null;
try {
// com/google/appengine/api/search/query/Query.g:227:3: ( QUOTE (~ QUOTE )* QUOTE )
// com/google/appengine/api/search/query/Query.g:227:5: QUOTE (~ QUOTE )* QUOTE
{
root_0 = (CommonTree)adaptor.nil();
QUOTE63=(Token)match(input,QUOTE,FOLLOW_QUOTE_in_phrase970);
QUOTE63_tree = (CommonTree)adaptor.create(QUOTE63);
adaptor.addChild(root_0, QUOTE63_tree);
// com/google/appengine/api/search/query/Query.g:227:11: (~ QUOTE )*
loop34:
while (true) {
int alt34=2;
int LA34_0 = input.LA(1);
if ( ((LA34_0 >= AND && LA34_0 <= OR)||(LA34_0 >= REWRITE && LA34_0 <= WS)) ) {
alt34=1;
}
switch (alt34) {
case 1 :
// com/google/appengine/api/search/query/Query.g:
{
set64=input.LT(1);
if ( (input.LA(1) >= AND && input.LA(1) <= OR)||(input.LA(1) >= REWRITE && input.LA(1) <= WS) ) {
input.consume();
adaptor.addChild(root_0, (CommonTree)adaptor.create(set64));
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
break;
default :
break loop34;
}
}
QUOTE65=(Token)match(input,QUOTE,FOLLOW_QUOTE_in_phrase976);
QUOTE65_tree = (CommonTree)adaptor.create(QUOTE65);
adaptor.addChild(root_0, QUOTE65_tree);
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException e) {
reportError(e);
throw e;
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "phrase"
// Delegated rules
protected DFA4 dfa4 = new DFA4(this);
protected DFA6 dfa6 = new DFA6(this);
protected DFA5 dfa5 = new DFA5(this);
protected DFA9 dfa9 = new DFA9(this);
protected DFA8 dfa8 = new DFA8(this);
protected DFA11 dfa11 = new DFA11(this);
protected DFA10 dfa10 = new DFA10(this);
protected DFA14 dfa14 = new DFA14(this);
static final String DFA4_eotS =
"\4\uffff";
static final String DFA4_eofS =
"\2\2\2\uffff";
static final String DFA4_minS =
"\2\20\2\uffff";
static final String DFA4_maxS =
"\2\56\2\uffff";
static final String DFA4_acceptS =
"\2\uffff\1\1\1\2";
static final String DFA4_specialS =
"\4\uffff}>";
static final String[] DFA4_transitionS = {
"\1\3\12\uffff\1\3\1\uffff\1\3\2\uffff\1\3\3\uffff\2\3\4\uffff\1\3\3\uffff"+
"\1\1",
"\1\3\12\uffff\1\3\1\uffff\1\3\2\uffff\1\3\3\uffff\2\3\4\uffff\1\3\3"+
"\uffff\1\1",
"",
""
};
static final short[] DFA4_eot = DFA.unpackEncodedString(DFA4_eotS);
static final short[] DFA4_eof = DFA.unpackEncodedString(DFA4_eofS);
static final char[] DFA4_min = DFA.unpackEncodedStringToUnsignedChars(DFA4_minS);
static final char[] DFA4_max = DFA.unpackEncodedStringToUnsignedChars(DFA4_maxS);
static final short[] DFA4_accept = DFA.unpackEncodedString(DFA4_acceptS);
static final short[] DFA4_special = DFA.unpackEncodedString(DFA4_specialS);
static final short[][] DFA4_transition;
static {
int numStates = DFA4_transitionS.length;
DFA4_transition = new short[numStates][];
for (int i=0; i ^( EMPTY ) | ( WS )* expression ( WS )* EOF -> expression );";
}
}
static final String DFA6_eotS =
"\4\uffff";
static final String DFA6_eofS =
"\2\2\2\uffff";
static final String DFA6_minS =
"\1\46\1\4\2\uffff";
static final String DFA6_maxS =
"\2\56\2\uffff";
static final String DFA6_acceptS =
"\2\uffff\1\1\1\2";
static final String DFA6_specialS =
"\4\uffff}>";
static final String[] DFA6_transitionS = {
"\1\2\7\uffff\1\1",
"\1\3\41\uffff\1\2\7\uffff\1\1",
"",
""
};
static final short[] DFA6_eot = DFA.unpackEncodedString(DFA6_eotS);
static final short[] DFA6_eof = DFA.unpackEncodedString(DFA6_eofS);
static final char[] DFA6_min = DFA.unpackEncodedStringToUnsignedChars(DFA6_minS);
static final char[] DFA6_max = DFA.unpackEncodedStringToUnsignedChars(DFA6_maxS);
static final short[] DFA6_accept = DFA.unpackEncodedString(DFA6_acceptS);
static final short[] DFA6_special = DFA.unpackEncodedString(DFA6_specialS);
static final short[][] DFA6_transition;
static {
int numStates = DFA6_transitionS.length;
DFA6_transition = new short[numStates][];
for (int i=0; i sequence | ( andOp sequence )+ -> ^( CONJUNCTION ( sequence )+ ) )";
}
}
static final String DFA5_eotS =
"\4\uffff";
static final String DFA5_eofS =
"\2\2\2\uffff";
static final String DFA5_minS =
"\1\46\1\4\2\uffff";
static final String DFA5_maxS =
"\2\56\2\uffff";
static final String DFA5_acceptS =
"\2\uffff\1\2\1\1";
static final String DFA5_specialS =
"\4\uffff}>";
static final String[] DFA5_transitionS = {
"\1\2\7\uffff\1\1",
"\1\3\41\uffff\1\2\7\uffff\1\1",
"",
""
};
static final short[] DFA5_eot = DFA.unpackEncodedString(DFA5_eotS);
static final short[] DFA5_eof = DFA.unpackEncodedString(DFA5_eofS);
static final char[] DFA5_min = DFA.unpackEncodedStringToUnsignedChars(DFA5_minS);
static final char[] DFA5_max = DFA.unpackEncodedStringToUnsignedChars(DFA5_maxS);
static final short[] DFA5_accept = DFA.unpackEncodedString(DFA5_acceptS);
static final short[] DFA5_special = DFA.unpackEncodedString(DFA5_specialS);
static final short[][] DFA5_transition;
static {
int numStates = DFA5_transitionS.length;
DFA5_transition = new short[numStates][];
for (int i=0; i factor | ( ( WS )+ factor )+ -> ^( SEQUENCE ( factor )+ ) )";
}
}
static final String DFA8_eotS =
"\4\uffff";
static final String DFA8_eofS =
"\2\2\2\uffff";
static final String DFA8_minS =
"\1\46\1\4\2\uffff";
static final String DFA8_maxS =
"\2\56\2\uffff";
static final String DFA8_acceptS =
"\2\uffff\1\2\1\1";
static final String DFA8_specialS =
"\4\uffff}>";
static final String[] DFA8_transitionS = {
"\1\2\7\uffff\1\1",
"\1\2\13\uffff\1\3\12\uffff\1\3\1\uffff\1\3\2\uffff\1\3\3\uffff\2\3\1"+
"\2\3\uffff\1\3\3\uffff\1\1",
"",
""
};
static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS);
static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS);
static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS);
static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS);
static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS);
static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS);
static final short[][] DFA8_transition;
static {
int numStates = DFA8_transitionS.length;
DFA8_transition = new short[numStates][];
for (int i=0; i term | ( orOp term )+ -> ^( DISJUNCTION ( term )+ ) )";
}
}
static final String DFA10_eotS =
"\4\uffff";
static final String DFA10_eofS =
"\2\2\2\uffff";
static final String DFA10_minS =
"\1\46\1\4\2\uffff";
static final String DFA10_maxS =
"\2\56\2\uffff";
static final String DFA10_acceptS =
"\2\uffff\1\2\1\1";
static final String DFA10_specialS =
"\4\uffff}>";
static final String[] DFA10_transitionS = {
"\1\2\7\uffff\1\1",
"\1\2\13\uffff\1\2\12\uffff\1\2\1\uffff\1\2\2\uffff\1\2\2\uffff\1\3\3"+
"\2\3\uffff\1\2\3\uffff\1\1",
"",
""
};
static final short[] DFA10_eot = DFA.unpackEncodedString(DFA10_eotS);
static final short[] DFA10_eof = DFA.unpackEncodedString(DFA10_eofS);
static final char[] DFA10_min = DFA.unpackEncodedStringToUnsignedChars(DFA10_minS);
static final char[] DFA10_max = DFA.unpackEncodedStringToUnsignedChars(DFA10_maxS);
static final short[] DFA10_accept = DFA.unpackEncodedString(DFA10_acceptS);
static final short[] DFA10_special = DFA.unpackEncodedString(DFA10_specialS);
static final short[][] DFA10_transition;
static {
int numStates = DFA10_transitionS.length;
DFA10_transition = new short[numStates][];
for (int i=0; i ^( HAS GLOBAL comparable ) | comparator arg -> ^( comparator comparable arg ) )";
}
}
public static final BitSet FOLLOW_WS_in_query148 = new BitSet(new long[]{0x0000400000000000L});
public static final BitSet FOLLOW_EOF_in_query151 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_WS_in_query180 = new BitSet(new long[]{0x0000443128010000L});
public static final BitSet FOLLOW_expression_in_query183 = new BitSet(new long[]{0x0000400000000000L});
public static final BitSet FOLLOW_WS_in_query185 = new BitSet(new long[]{0x0000400000000000L});
public static final BitSet FOLLOW_EOF_in_query188 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_sequence_in_expression211 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_andOp_in_expression248 = new BitSet(new long[]{0x0000043128010000L});
public static final BitSet FOLLOW_sequence_in_expression250 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_factor_in_sequence288 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_WS_in_sequence324 = new BitSet(new long[]{0x0000443128010000L});
public static final BitSet FOLLOW_factor_in_sequence327 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_term_in_factor368 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_orOp_in_factor400 = new BitSet(new long[]{0x0000043128010000L});
public static final BitSet FOLLOW_term_in_factor402 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_primitive_in_term436 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_notOp_in_term442 = new BitSet(new long[]{0x0000043008010000L});
public static final BitSet FOLLOW_primitive_in_term444 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_restriction_in_primitive470 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_composite_in_primitive476 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_comparable_in_restriction493 = new BitSet(new long[]{0x0000400043681002L});
public static final BitSet FOLLOW_comparator_in_restriction528 = new BitSet(new long[]{0x0000043008010000L});
public static final BitSet FOLLOW_arg_in_restriction530 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_WS_in_comparator560 = new BitSet(new long[]{0x0000400043681000L});
public static final BitSet FOLLOW_LE_in_comparator566 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_LESSTHAN_in_comparator572 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_GE_in_comparator578 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_GT_in_comparator584 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_NE_in_comparator590 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_EQ_in_comparator596 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_HAS_in_comparator602 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_WS_in_comparator605 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_member_in_comparable627 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_function_in_comparable633 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_item_in_member648 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_text_in_function665 = new BitSet(new long[]{0x0000000008000000L});
public static final BitSet FOLLOW_LPAREN_in_function667 = new BitSet(new long[]{0x0000047008010000L});
public static final BitSet FOLLOW_arglist_in_function669 = new BitSet(new long[]{0x0000004000000000L});
public static final BitSet FOLLOW_RPAREN_in_function671 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_arg_in_arglist706 = new BitSet(new long[]{0x0000400000000082L});
public static final BitSet FOLLOW_sep_in_arglist709 = new BitSet(new long[]{0x0000043008010000L});
public static final BitSet FOLLOW_arg_in_arglist711 = new BitSet(new long[]{0x0000400000000082L});
public static final BitSet FOLLOW_comparable_in_arg732 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_composite_in_arg738 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_WS_in_andOp752 = new BitSet(new long[]{0x0000400000000010L});
public static final BitSet FOLLOW_AND_in_andOp755 = new BitSet(new long[]{0x0000400000000000L});
public static final BitSet FOLLOW_WS_in_andOp757 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_WS_in_orOp772 = new BitSet(new long[]{0x0000400800000000L});
public static final BitSet FOLLOW_OR_in_orOp775 = new BitSet(new long[]{0x0000400000000000L});
public static final BitSet FOLLOW_WS_in_orOp777 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_MINUS_in_notOp792 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_NOT_in_notOp798 = new BitSet(new long[]{0x0000400000000000L});
public static final BitSet FOLLOW_WS_in_notOp800 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_WS_in_sep815 = new BitSet(new long[]{0x0000400000000080L});
public static final BitSet FOLLOW_COMMA_in_sep818 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_WS_in_sep820 = new BitSet(new long[]{0x0000400000000002L});
public static final BitSet FOLLOW_LPAREN_in_composite836 = new BitSet(new long[]{0x0000443128010000L});
public static final BitSet FOLLOW_WS_in_composite838 = new BitSet(new long[]{0x0000443128010000L});
public static final BitSet FOLLOW_expression_in_composite841 = new BitSet(new long[]{0x0000404000000000L});
public static final BitSet FOLLOW_WS_in_composite843 = new BitSet(new long[]{0x0000404000000000L});
public static final BitSet FOLLOW_RPAREN_in_composite846 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_FIX_in_item866 = new BitSet(new long[]{0x0000041000000000L});
public static final BitSet FOLLOW_value_in_item868 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_REWRITE_in_item882 = new BitSet(new long[]{0x0000041000000000L});
public static final BitSet FOLLOW_value_in_item884 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_value_in_item898 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_text_in_value916 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_phrase_in_value932 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TEXT_in_text956 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_QUOTE_in_phrase970 = new BitSet(new long[]{0x00007FFFFFFFFFF0L});
public static final BitSet FOLLOW_QUOTE_in_phrase976 = new BitSet(new long[]{0x0000000000000002L});
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy