Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.googlecode.mjorm.mql.MqlParser Maven / Gradle / Ivy
// $ANTLR 3.4 /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g 2013-10-10 16:38:05
package com.googlecode.mjorm.mql;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import org.antlr.runtime.tree.*;
@SuppressWarnings({"all", "warnings", "unchecked"})
public class MqlParser extends Parser {
public static final String[] tokenNames = new String[] {
"", "", "", "", "ACTION", "ADD_TO_SET", "ADD_TO_SET_EACH", "ALL", "AND", "ARRAY", "ASC", "ATOMIC", "BACK_SLASH", "BITWISE", "COLON", "COMMA", "COMMAND", "COMMANDS", "COMPARE_CRITERION", "CRITERIA", "CRITERIA_GROUP", "CRITERIA_GROUP_LIST", "CRITERION", "DECIMAL", "DELETE", "DELETE_ACTION", "DESC", "DIGIT", "DOCUMENT_FUNCTION_CRITERION", "DOT", "DOUBLE_QUOTED_STRING", "EACH", "EQUALS", "ESCAPE", "EXPLAIN", "EXPLAIN_ACTION", "FAD_ACTION", "FALSE", "FAM_ACTION", "FIELD_FUNCTION_CRITERION", "FIELD_LIST", "FIND_AND_DELETE", "FIND_AND_MODIFY", "FORWARD_SLASH", "FROM", "FUNCTION_CALL", "GT", "GT_EQUALS", "HEX_DIGIT", "HEX_NUMBER", "HINT", "HINT_FIELD", "INC", "INTEGER", "LIMIT", "LT", "LT_EQUALS", "LT_GT", "L_BRACKET", "L_PAREN", "MATCHES", "MINUS", "MULTI", "NATURAL", "NEGATED_CRITERION", "NEW", "NOT", "NOT_EQUALS", "OLD", "OR", "PARAMETER", "POP", "PULL", "PULL_ALL", "PUSH", "PUSH_ALL", "QUESTION_MARK", "REGEX", "RENAME", "RETURN", "R_BRACKET", "R_PAREN", "SCHEMA_IDENTIFIER", "SELECT", "SELECT_ACTION", "SEMI_COLON", "SET", "SHIFT", "SIGNED_DECIMAL", "SIGNED_INTEGER", "SINGLE_QUOTED_STRING", "SKIP", "SORT", "SORT_FILED", "STAR", "TRUE", "UNSET", "UPDATE", "UPDATE_ACTION", "UPDATE_OPERATIONS", "UPSERT", "UPSERT_ACTION", "VARIABLE_LIST", "WHERE", "WHITESPACE"
};
public static final int EOF=-1;
public static final int ACTION=4;
public static final int ADD_TO_SET=5;
public static final int ADD_TO_SET_EACH=6;
public static final int ALL=7;
public static final int AND=8;
public static final int ARRAY=9;
public static final int ASC=10;
public static final int ATOMIC=11;
public static final int BACK_SLASH=12;
public static final int BITWISE=13;
public static final int COLON=14;
public static final int COMMA=15;
public static final int COMMAND=16;
public static final int COMMANDS=17;
public static final int COMPARE_CRITERION=18;
public static final int CRITERIA=19;
public static final int CRITERIA_GROUP=20;
public static final int CRITERIA_GROUP_LIST=21;
public static final int CRITERION=22;
public static final int DECIMAL=23;
public static final int DELETE=24;
public static final int DELETE_ACTION=25;
public static final int DESC=26;
public static final int DIGIT=27;
public static final int DOCUMENT_FUNCTION_CRITERION=28;
public static final int DOT=29;
public static final int DOUBLE_QUOTED_STRING=30;
public static final int EACH=31;
public static final int EQUALS=32;
public static final int ESCAPE=33;
public static final int EXPLAIN=34;
public static final int EXPLAIN_ACTION=35;
public static final int FAD_ACTION=36;
public static final int FALSE=37;
public static final int FAM_ACTION=38;
public static final int FIELD_FUNCTION_CRITERION=39;
public static final int FIELD_LIST=40;
public static final int FIND_AND_DELETE=41;
public static final int FIND_AND_MODIFY=42;
public static final int FORWARD_SLASH=43;
public static final int FROM=44;
public static final int FUNCTION_CALL=45;
public static final int GT=46;
public static final int GT_EQUALS=47;
public static final int HEX_DIGIT=48;
public static final int HEX_NUMBER=49;
public static final int HINT=50;
public static final int HINT_FIELD=51;
public static final int INC=52;
public static final int INTEGER=53;
public static final int LIMIT=54;
public static final int LT=55;
public static final int LT_EQUALS=56;
public static final int LT_GT=57;
public static final int L_BRACKET=58;
public static final int L_PAREN=59;
public static final int MATCHES=60;
public static final int MINUS=61;
public static final int MULTI=62;
public static final int NATURAL=63;
public static final int NEGATED_CRITERION=64;
public static final int NEW=65;
public static final int NOT=66;
public static final int NOT_EQUALS=67;
public static final int OLD=68;
public static final int OR=69;
public static final int PARAMETER=70;
public static final int POP=71;
public static final int PULL=72;
public static final int PULL_ALL=73;
public static final int PUSH=74;
public static final int PUSH_ALL=75;
public static final int QUESTION_MARK=76;
public static final int REGEX=77;
public static final int RENAME=78;
public static final int RETURN=79;
public static final int R_BRACKET=80;
public static final int R_PAREN=81;
public static final int SCHEMA_IDENTIFIER=82;
public static final int SELECT=83;
public static final int SELECT_ACTION=84;
public static final int SEMI_COLON=85;
public static final int SET=86;
public static final int SHIFT=87;
public static final int SIGNED_DECIMAL=88;
public static final int SIGNED_INTEGER=89;
public static final int SINGLE_QUOTED_STRING=90;
public static final int SKIP=91;
public static final int SORT=92;
public static final int SORT_FILED=93;
public static final int STAR=94;
public static final int TRUE=95;
public static final int UNSET=96;
public static final int UPDATE=97;
public static final int UPDATE_ACTION=98;
public static final int UPDATE_OPERATIONS=99;
public static final int UPSERT=100;
public static final int UPSERT_ACTION=101;
public static final int VARIABLE_LIST=102;
public static final int WHERE=103;
public static final int WHITESPACE=104;
// delegates
public Parser[] getDelegates() {
return new Parser[] {};
}
// delegators
public MqlParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public MqlParser(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;
}
public String[] getTokenNames() { return MqlParser.tokenNames; }
public String getGrammarFileName() { return "/Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g"; }
public static class start_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "start"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:118:1: start :c+= command (c+= command )* EOF -> ^( COMMANDS ( $c)+ ) ;
public final MqlParser.start_return start() throws RecognitionException {
MqlParser.start_return retval = new MqlParser.start_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token EOF1=null;
List list_c=null;
RuleReturnScope c = null;
CommonTree EOF1_tree=null;
RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
RewriteRuleSubtreeStream stream_command=new RewriteRuleSubtreeStream(adaptor,"rule command");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:119:2: (c+= command (c+= command )* EOF -> ^( COMMANDS ( $c)+ ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:119:4: c+= command (c+= command )* EOF
{
pushFollow(FOLLOW_command_in_start1156);
c=command();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_command.add(c.getTree());
if (list_c==null) list_c=new ArrayList();
list_c.add(c.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:119:15: (c+= command )*
loop1:
do {
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0==FROM) ) {
alt1=1;
}
switch (alt1) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:119:16: c+= command
{
pushFollow(FOLLOW_command_in_start1161);
c=command();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_command.add(c.getTree());
if (list_c==null) list_c=new ArrayList();
list_c.add(c.getTree());
}
break;
default :
break loop1;
}
} while (true);
EOF1=(Token)match(input,EOF,FOLLOW_EOF_in_start1165); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_EOF.add(EOF1);
// AST REWRITE
// elements: c
// token labels:
// rule labels: retval
// token list labels:
// rule list labels: c
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_c=new RewriteRuleSubtreeStream(adaptor,"token c",list_c);
root_0 = (CommonTree)adaptor.nil();
// 119:33: -> ^( COMMANDS ( $c)+ )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:119:36: ^( COMMANDS ( $c)+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(COMMANDS, "COMMANDS")
, root_1);
if ( !(stream_c.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_c.hasNext() ) {
adaptor.addChild(root_1, stream_c.nextTree());
}
stream_c.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "start"
public static class command_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "command"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:123:1: command : FROM collection_name ( WHERE criteria )? action ( SEMI_COLON )? -> ^( COMMAND collection_name ( criteria )? action ) ;
public final MqlParser.command_return command() throws RecognitionException {
MqlParser.command_return retval = new MqlParser.command_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token FROM2=null;
Token WHERE4=null;
Token SEMI_COLON7=null;
MqlParser.collection_name_return collection_name3 =null;
MqlParser.criteria_return criteria5 =null;
MqlParser.action_return action6 =null;
CommonTree FROM2_tree=null;
CommonTree WHERE4_tree=null;
CommonTree SEMI_COLON7_tree=null;
RewriteRuleTokenStream stream_WHERE=new RewriteRuleTokenStream(adaptor,"token WHERE");
RewriteRuleTokenStream stream_SEMI_COLON=new RewriteRuleTokenStream(adaptor,"token SEMI_COLON");
RewriteRuleTokenStream stream_FROM=new RewriteRuleTokenStream(adaptor,"token FROM");
RewriteRuleSubtreeStream stream_criteria=new RewriteRuleSubtreeStream(adaptor,"rule criteria");
RewriteRuleSubtreeStream stream_action=new RewriteRuleSubtreeStream(adaptor,"rule action");
RewriteRuleSubtreeStream stream_collection_name=new RewriteRuleSubtreeStream(adaptor,"rule collection_name");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:124:2: ( FROM collection_name ( WHERE criteria )? action ( SEMI_COLON )? -> ^( COMMAND collection_name ( criteria )? action ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:124:4: FROM collection_name ( WHERE criteria )? action ( SEMI_COLON )?
{
FROM2=(Token)match(input,FROM,FOLLOW_FROM_in_command1188); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_FROM.add(FROM2);
pushFollow(FOLLOW_collection_name_in_command1190);
collection_name3=collection_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_collection_name.add(collection_name3.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:124:25: ( WHERE criteria )?
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0==WHERE) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:124:26: WHERE criteria
{
WHERE4=(Token)match(input,WHERE,FOLLOW_WHERE_in_command1193); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_WHERE.add(WHERE4);
pushFollow(FOLLOW_criteria_in_command1195);
criteria5=criteria();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_criteria.add(criteria5.getTree());
}
break;
}
pushFollow(FOLLOW_action_in_command1199);
action6=action();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_action.add(action6.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:124:50: ( SEMI_COLON )?
int alt3=2;
int LA3_0 = input.LA(1);
if ( (LA3_0==SEMI_COLON) ) {
alt3=1;
}
switch (alt3) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:124:50: SEMI_COLON
{
SEMI_COLON7=(Token)match(input,SEMI_COLON,FOLLOW_SEMI_COLON_in_command1201); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_SEMI_COLON.add(SEMI_COLON7);
}
break;
}
// AST REWRITE
// elements: criteria, action, collection_name
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 124:62: -> ^( COMMAND collection_name ( criteria )? action )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:124:65: ^( COMMAND collection_name ( criteria )? action )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(COMMAND, "COMMAND")
, root_1);
adaptor.addChild(root_1, stream_collection_name.nextTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:124:91: ( criteria )?
if ( stream_criteria.hasNext() ) {
adaptor.addChild(root_1, stream_criteria.nextTree());
}
stream_criteria.reset();
adaptor.addChild(root_1, stream_action.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "command"
public static class criteria_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "criteria"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:129:1: criteria :c+= criterion ( ( COMMA )? c+= criterion )* -> ^( CRITERIA ( $c)+ ) ;
public final MqlParser.criteria_return criteria() throws RecognitionException {
MqlParser.criteria_return retval = new MqlParser.criteria_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token COMMA8=null;
List list_c=null;
RuleReturnScope c = null;
CommonTree COMMA8_tree=null;
RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
RewriteRuleSubtreeStream stream_criterion=new RewriteRuleSubtreeStream(adaptor,"rule criterion");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:130:2: (c+= criterion ( ( COMMA )? c+= criterion )* -> ^( CRITERIA ( $c)+ ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:130:4: c+= criterion ( ( COMMA )? c+= criterion )*
{
pushFollow(FOLLOW_criterion_in_criteria1231);
c=criterion();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_criterion.add(c.getTree());
if (list_c==null) list_c=new ArrayList();
list_c.add(c.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:130:17: ( ( COMMA )? c+= criterion )*
loop5:
do {
int alt5=2;
int LA5_0 = input.LA(1);
if ( ((LA5_0 >= ALL && LA5_0 <= AND)||LA5_0==COMMA||LA5_0==NOT||LA5_0==OR||LA5_0==SCHEMA_IDENTIFIER) ) {
alt5=1;
}
switch (alt5) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:130:18: ( COMMA )? c+= criterion
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:130:18: ( COMMA )?
int alt4=2;
int LA4_0 = input.LA(1);
if ( (LA4_0==COMMA) ) {
alt4=1;
}
switch (alt4) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:130:18: COMMA
{
COMMA8=(Token)match(input,COMMA,FOLLOW_COMMA_in_criteria1234); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA8);
}
break;
}
pushFollow(FOLLOW_criterion_in_criteria1239);
c=criterion();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_criterion.add(c.getTree());
if (list_c==null) list_c=new ArrayList();
list_c.add(c.getTree());
}
break;
default :
break loop5;
}
} while (true);
// AST REWRITE
// elements: c
// token labels:
// rule labels: retval
// token list labels:
// rule list labels: c
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_c=new RewriteRuleSubtreeStream(adaptor,"token c",list_c);
root_0 = (CommonTree)adaptor.nil();
// 130:40: -> ^( CRITERIA ( $c)+ )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:130:43: ^( CRITERIA ( $c)+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(CRITERIA, "CRITERIA")
, root_1);
if ( !(stream_c.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_c.hasNext() ) {
adaptor.addChild(root_1, stream_c.nextTree());
}
stream_c.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "criteria"
public static class criteria_group_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "criteria_group"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:133:1: criteria_group : L_PAREN criteria R_PAREN -> ^( CRITERIA_GROUP criteria ) ;
public final MqlParser.criteria_group_return criteria_group() throws RecognitionException {
MqlParser.criteria_group_return retval = new MqlParser.criteria_group_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token L_PAREN9=null;
Token R_PAREN11=null;
MqlParser.criteria_return criteria10 =null;
CommonTree L_PAREN9_tree=null;
CommonTree R_PAREN11_tree=null;
RewriteRuleTokenStream stream_R_PAREN=new RewriteRuleTokenStream(adaptor,"token R_PAREN");
RewriteRuleTokenStream stream_L_PAREN=new RewriteRuleTokenStream(adaptor,"token L_PAREN");
RewriteRuleSubtreeStream stream_criteria=new RewriteRuleSubtreeStream(adaptor,"rule criteria");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:134:2: ( L_PAREN criteria R_PAREN -> ^( CRITERIA_GROUP criteria ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:134:4: L_PAREN criteria R_PAREN
{
L_PAREN9=(Token)match(input,L_PAREN,FOLLOW_L_PAREN_in_criteria_group1262); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_L_PAREN.add(L_PAREN9);
pushFollow(FOLLOW_criteria_in_criteria_group1264);
criteria10=criteria();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_criteria.add(criteria10.getTree());
R_PAREN11=(Token)match(input,R_PAREN,FOLLOW_R_PAREN_in_criteria_group1266); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_R_PAREN.add(R_PAREN11);
// AST REWRITE
// elements: criteria
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 134:29: -> ^( CRITERIA_GROUP criteria )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:134:32: ^( CRITERIA_GROUP criteria )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(CRITERIA_GROUP, "CRITERIA_GROUP")
, root_1);
adaptor.addChild(root_1, stream_criteria.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "criteria_group"
public static class criteria_group_list_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "criteria_group_list"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:137:1: criteria_group_list :c+= criteria_group ( ( COMMA )? c+= criteria_group )* -> ^( CRITERIA_GROUP_LIST ( $c)+ ) ;
public final MqlParser.criteria_group_list_return criteria_group_list() throws RecognitionException {
MqlParser.criteria_group_list_return retval = new MqlParser.criteria_group_list_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token COMMA12=null;
List list_c=null;
RuleReturnScope c = null;
CommonTree COMMA12_tree=null;
RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
RewriteRuleSubtreeStream stream_criteria_group=new RewriteRuleSubtreeStream(adaptor,"rule criteria_group");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:138:2: (c+= criteria_group ( ( COMMA )? c+= criteria_group )* -> ^( CRITERIA_GROUP_LIST ( $c)+ ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:138:4: c+= criteria_group ( ( COMMA )? c+= criteria_group )*
{
pushFollow(FOLLOW_criteria_group_in_criteria_group_list1287);
c=criteria_group();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_criteria_group.add(c.getTree());
if (list_c==null) list_c=new ArrayList();
list_c.add(c.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:138:22: ( ( COMMA )? c+= criteria_group )*
loop7:
do {
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==COMMA||LA7_0==L_PAREN) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:138:23: ( COMMA )? c+= criteria_group
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:138:23: ( COMMA )?
int alt6=2;
int LA6_0 = input.LA(1);
if ( (LA6_0==COMMA) ) {
alt6=1;
}
switch (alt6) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:138:23: COMMA
{
COMMA12=(Token)match(input,COMMA,FOLLOW_COMMA_in_criteria_group_list1290); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA12);
}
break;
}
pushFollow(FOLLOW_criteria_group_in_criteria_group_list1295);
c=criteria_group();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_criteria_group.add(c.getTree());
if (list_c==null) list_c=new ArrayList();
list_c.add(c.getTree());
}
break;
default :
break loop7;
}
} while (true);
// AST REWRITE
// elements: c
// token labels:
// rule labels: retval
// token list labels:
// rule list labels: c
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_c=new RewriteRuleSubtreeStream(adaptor,"token c",list_c);
root_0 = (CommonTree)adaptor.nil();
// 138:50: -> ^( CRITERIA_GROUP_LIST ( $c)+ )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:138:53: ^( CRITERIA_GROUP_LIST ( $c)+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(CRITERIA_GROUP_LIST, "CRITERIA_GROUP_LIST")
, root_1);
if ( !(stream_c.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_c.hasNext() ) {
adaptor.addChild(root_1, stream_c.nextTree());
}
stream_c.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "criteria_group_list"
public static class criterion_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "criterion"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:141:1: criterion : ( function_criterion | negated_field_criterion | field_criterion ) ;
public final MqlParser.criterion_return criterion() throws RecognitionException {
MqlParser.criterion_return retval = new MqlParser.criterion_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.function_criterion_return function_criterion13 =null;
MqlParser.negated_field_criterion_return negated_field_criterion14 =null;
MqlParser.field_criterion_return field_criterion15 =null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:142:2: ( ( function_criterion | negated_field_criterion | field_criterion ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:142:4: ( function_criterion | negated_field_criterion | field_criterion )
{
root_0 = (CommonTree)adaptor.nil();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:142:4: ( function_criterion | negated_field_criterion | field_criterion )
int alt8=3;
switch ( input.LA(1) ) {
case SCHEMA_IDENTIFIER:
{
int LA8_1 = input.LA(2);
if ( (LA8_1==L_PAREN) ) {
alt8=1;
}
else if ( ((LA8_1 >= ALL && LA8_1 <= AND)||LA8_1==EQUALS||(LA8_1 >= GT && LA8_1 <= GT_EQUALS)||(LA8_1 >= LT && LA8_1 <= LT_GT)||LA8_1==MATCHES||LA8_1==NOT_EQUALS||LA8_1==OR||LA8_1==SCHEMA_IDENTIFIER) ) {
alt8=3;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 8, 1, input);
throw nvae;
}
}
break;
case NOT:
{
alt8=2;
}
break;
case ALL:
case AND:
case OR:
{
alt8=1;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 8, 0, input);
throw nvae;
}
switch (alt8) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:142:5: function_criterion
{
pushFollow(FOLLOW_function_criterion_in_criterion1319);
function_criterion13=function_criterion();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, function_criterion13.getTree());
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:142:26: negated_field_criterion
{
pushFollow(FOLLOW_negated_field_criterion_in_criterion1323);
negated_field_criterion14=negated_field_criterion();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, negated_field_criterion14.getTree());
}
break;
case 3 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:142:52: field_criterion
{
pushFollow(FOLLOW_field_criterion_in_criterion1327);
field_criterion15=field_criterion();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_criterion15.getTree());
}
break;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "criterion"
public static class field_criterion_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "field_criterion"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:145:1: field_criterion : ( field_function_criterion | compare_criterion ) ;
public final MqlParser.field_criterion_return field_criterion() throws RecognitionException {
MqlParser.field_criterion_return retval = new MqlParser.field_criterion_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.field_function_criterion_return field_function_criterion16 =null;
MqlParser.compare_criterion_return compare_criterion17 =null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:146:2: ( ( field_function_criterion | compare_criterion ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:146:4: ( field_function_criterion | compare_criterion )
{
root_0 = (CommonTree)adaptor.nil();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:146:4: ( field_function_criterion | compare_criterion )
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0==SCHEMA_IDENTIFIER) ) {
int LA9_1 = input.LA(2);
if ( ((LA9_1 >= ALL && LA9_1 <= AND)||LA9_1==OR||LA9_1==SCHEMA_IDENTIFIER) ) {
alt9=1;
}
else if ( (LA9_1==EQUALS||(LA9_1 >= GT && LA9_1 <= GT_EQUALS)||(LA9_1 >= LT && LA9_1 <= LT_GT)||LA9_1==MATCHES||LA9_1==NOT_EQUALS) ) {
alt9=2;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 9, 1, input);
throw nvae;
}
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 9, 0, input);
throw nvae;
}
switch (alt9) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:146:5: field_function_criterion
{
pushFollow(FOLLOW_field_function_criterion_in_field_criterion1341);
field_function_criterion16=field_function_criterion();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_function_criterion16.getTree());
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:146:32: compare_criterion
{
pushFollow(FOLLOW_compare_criterion_in_field_criterion1345);
compare_criterion17=compare_criterion();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, compare_criterion17.getTree());
}
break;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "field_criterion"
public static class negated_field_criterion_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "negated_field_criterion"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:149:1: negated_field_criterion : NOT field_criterion -> ^( NEGATED_CRITERION field_criterion ) ;
public final MqlParser.negated_field_criterion_return negated_field_criterion() throws RecognitionException {
MqlParser.negated_field_criterion_return retval = new MqlParser.negated_field_criterion_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token NOT18=null;
MqlParser.field_criterion_return field_criterion19 =null;
CommonTree NOT18_tree=null;
RewriteRuleTokenStream stream_NOT=new RewriteRuleTokenStream(adaptor,"token NOT");
RewriteRuleSubtreeStream stream_field_criterion=new RewriteRuleSubtreeStream(adaptor,"rule field_criterion");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:150:2: ( NOT field_criterion -> ^( NEGATED_CRITERION field_criterion ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:150:4: NOT field_criterion
{
NOT18=(Token)match(input,NOT,FOLLOW_NOT_in_negated_field_criterion1359); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_NOT.add(NOT18);
pushFollow(FOLLOW_field_criterion_in_negated_field_criterion1361);
field_criterion19=field_criterion();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_criterion.add(field_criterion19.getTree());
// AST REWRITE
// elements: field_criterion
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 150:24: -> ^( NEGATED_CRITERION field_criterion )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:150:27: ^( NEGATED_CRITERION field_criterion )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(NEGATED_CRITERION, "NEGATED_CRITERION")
, root_1);
adaptor.addChild(root_1, stream_field_criterion.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "negated_field_criterion"
public static class compare_criterion_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "compare_criterion"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:153:1: compare_criterion : field_name comparison_operator variable_literal -> ^( COMPARE_CRITERION field_name comparison_operator variable_literal ) ;
public final MqlParser.compare_criterion_return compare_criterion() throws RecognitionException {
MqlParser.compare_criterion_return retval = new MqlParser.compare_criterion_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.field_name_return field_name20 =null;
MqlParser.comparison_operator_return comparison_operator21 =null;
MqlParser.variable_literal_return variable_literal22 =null;
RewriteRuleSubtreeStream stream_field_name=new RewriteRuleSubtreeStream(adaptor,"rule field_name");
RewriteRuleSubtreeStream stream_variable_literal=new RewriteRuleSubtreeStream(adaptor,"rule variable_literal");
RewriteRuleSubtreeStream stream_comparison_operator=new RewriteRuleSubtreeStream(adaptor,"rule comparison_operator");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:154:2: ( field_name comparison_operator variable_literal -> ^( COMPARE_CRITERION field_name comparison_operator variable_literal ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:154:4: field_name comparison_operator variable_literal
{
pushFollow(FOLLOW_field_name_in_compare_criterion1381);
field_name20=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(field_name20.getTree());
pushFollow(FOLLOW_comparison_operator_in_compare_criterion1383);
comparison_operator21=comparison_operator();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_comparison_operator.add(comparison_operator21.getTree());
pushFollow(FOLLOW_variable_literal_in_compare_criterion1385);
variable_literal22=variable_literal();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_variable_literal.add(variable_literal22.getTree());
// AST REWRITE
// elements: comparison_operator, field_name, variable_literal
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 154:52: -> ^( COMPARE_CRITERION field_name comparison_operator variable_literal )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:154:55: ^( COMPARE_CRITERION field_name comparison_operator variable_literal )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(COMPARE_CRITERION, "COMPARE_CRITERION")
, root_1);
adaptor.addChild(root_1, stream_field_name.nextTree());
adaptor.addChild(root_1, stream_comparison_operator.nextTree());
adaptor.addChild(root_1, stream_variable_literal.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "compare_criterion"
public static class field_function_criterion_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "field_function_criterion"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:157:1: field_function_criterion : field_name function_call -> ^( FIELD_FUNCTION_CRITERION field_name ( function_call )? ) ;
public final MqlParser.field_function_criterion_return field_function_criterion() throws RecognitionException {
MqlParser.field_function_criterion_return retval = new MqlParser.field_function_criterion_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.field_name_return field_name23 =null;
MqlParser.function_call_return function_call24 =null;
RewriteRuleSubtreeStream stream_field_name=new RewriteRuleSubtreeStream(adaptor,"rule field_name");
RewriteRuleSubtreeStream stream_function_call=new RewriteRuleSubtreeStream(adaptor,"rule function_call");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:158:2: ( field_name function_call -> ^( FIELD_FUNCTION_CRITERION field_name ( function_call )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:158:4: field_name function_call
{
pushFollow(FOLLOW_field_name_in_field_function_criterion1409);
field_name23=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(field_name23.getTree());
pushFollow(FOLLOW_function_call_in_field_function_criterion1411);
function_call24=function_call();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_function_call.add(function_call24.getTree());
// AST REWRITE
// elements: field_name, function_call
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 158:29: -> ^( FIELD_FUNCTION_CRITERION field_name ( function_call )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:158:32: ^( FIELD_FUNCTION_CRITERION field_name ( function_call )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(FIELD_FUNCTION_CRITERION, "FIELD_FUNCTION_CRITERION")
, root_1);
adaptor.addChild(root_1, stream_field_name.nextTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:158:70: ( function_call )?
if ( stream_function_call.hasNext() ) {
adaptor.addChild(root_1, stream_function_call.nextTree());
}
stream_function_call.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "field_function_criterion"
public static class function_criterion_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "function_criterion"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:161:1: function_criterion : function_call -> ^( DOCUMENT_FUNCTION_CRITERION ( function_call )? ) ;
public final MqlParser.function_criterion_return function_criterion() throws RecognitionException {
MqlParser.function_criterion_return retval = new MqlParser.function_criterion_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.function_call_return function_call25 =null;
RewriteRuleSubtreeStream stream_function_call=new RewriteRuleSubtreeStream(adaptor,"rule function_call");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:162:2: ( function_call -> ^( DOCUMENT_FUNCTION_CRITERION ( function_call )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:162:4: function_call
{
pushFollow(FOLLOW_function_call_in_function_criterion1434);
function_call25=function_call();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_function_call.add(function_call25.getTree());
// AST REWRITE
// elements: function_call
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 162:18: -> ^( DOCUMENT_FUNCTION_CRITERION ( function_call )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:162:21: ^( DOCUMENT_FUNCTION_CRITERION ( function_call )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(DOCUMENT_FUNCTION_CRITERION, "DOCUMENT_FUNCTION_CRITERION")
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:162:51: ( function_call )?
if ( stream_function_call.hasNext() ) {
adaptor.addChild(root_1, stream_function_call.nextTree());
}
stream_function_call.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "function_criterion"
public static class hint_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "hint"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:166:1: hint : ( HINT NATURAL ( direction )? -> ^( HINT NATURAL ( direction )? ) | HINT string ( direction )? -> ^( HINT string ( direction )? ) | HINT f+= hint_field ( ( COMMA )? f+= hint_field )* -> ^( HINT ( $f)+ ) );
public final MqlParser.hint_return hint() throws RecognitionException {
MqlParser.hint_return retval = new MqlParser.hint_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token HINT26=null;
Token NATURAL27=null;
Token HINT29=null;
Token HINT32=null;
Token COMMA33=null;
List list_f=null;
MqlParser.direction_return direction28 =null;
MqlParser.string_return string30 =null;
MqlParser.direction_return direction31 =null;
RuleReturnScope f = null;
CommonTree HINT26_tree=null;
CommonTree NATURAL27_tree=null;
CommonTree HINT29_tree=null;
CommonTree HINT32_tree=null;
CommonTree COMMA33_tree=null;
RewriteRuleTokenStream stream_NATURAL=new RewriteRuleTokenStream(adaptor,"token NATURAL");
RewriteRuleTokenStream stream_HINT=new RewriteRuleTokenStream(adaptor,"token HINT");
RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
RewriteRuleSubtreeStream stream_hint_field=new RewriteRuleSubtreeStream(adaptor,"rule hint_field");
RewriteRuleSubtreeStream stream_direction=new RewriteRuleSubtreeStream(adaptor,"rule direction");
RewriteRuleSubtreeStream stream_string=new RewriteRuleSubtreeStream(adaptor,"rule string");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:167:2: ( HINT NATURAL ( direction )? -> ^( HINT NATURAL ( direction )? ) | HINT string ( direction )? -> ^( HINT string ( direction )? ) | HINT f+= hint_field ( ( COMMA )? f+= hint_field )* -> ^( HINT ( $f)+ ) )
int alt14=3;
int LA14_0 = input.LA(1);
if ( (LA14_0==HINT) ) {
switch ( input.LA(2) ) {
case NATURAL:
{
alt14=1;
}
break;
case DOUBLE_QUOTED_STRING:
case SINGLE_QUOTED_STRING:
{
alt14=2;
}
break;
case SCHEMA_IDENTIFIER:
{
alt14=3;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 14, 1, input);
throw nvae;
}
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 14, 0, input);
throw nvae;
}
switch (alt14) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:167:4: HINT NATURAL ( direction )?
{
HINT26=(Token)match(input,HINT,FOLLOW_HINT_in_hint1456); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_HINT.add(HINT26);
NATURAL27=(Token)match(input,NATURAL,FOLLOW_NATURAL_in_hint1458); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_NATURAL.add(NATURAL27);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:167:17: ( direction )?
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==ASC||LA10_0==DESC) ) {
alt10=1;
}
switch (alt10) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:167:17: direction
{
pushFollow(FOLLOW_direction_in_hint1460);
direction28=direction();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_direction.add(direction28.getTree());
}
break;
}
// AST REWRITE
// elements: NATURAL, HINT, direction
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 167:28: -> ^( HINT NATURAL ( direction )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:167:31: ^( HINT NATURAL ( direction )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
stream_HINT.nextNode()
, root_1);
adaptor.addChild(root_1,
stream_NATURAL.nextNode()
);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:167:46: ( direction )?
if ( stream_direction.hasNext() ) {
adaptor.addChild(root_1, stream_direction.nextTree());
}
stream_direction.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:168:4: HINT string ( direction )?
{
HINT29=(Token)match(input,HINT,FOLLOW_HINT_in_hint1477); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_HINT.add(HINT29);
pushFollow(FOLLOW_string_in_hint1479);
string30=string();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_string.add(string30.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:168:16: ( direction )?
int alt11=2;
int LA11_0 = input.LA(1);
if ( (LA11_0==ASC||LA11_0==DESC) ) {
alt11=1;
}
switch (alt11) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:168:16: direction
{
pushFollow(FOLLOW_direction_in_hint1481);
direction31=direction();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_direction.add(direction31.getTree());
}
break;
}
// AST REWRITE
// elements: direction, HINT, string
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 168:27: -> ^( HINT string ( direction )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:168:30: ^( HINT string ( direction )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
stream_HINT.nextNode()
, root_1);
adaptor.addChild(root_1, stream_string.nextTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:168:44: ( direction )?
if ( stream_direction.hasNext() ) {
adaptor.addChild(root_1, stream_direction.nextTree());
}
stream_direction.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 3 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:169:4: HINT f+= hint_field ( ( COMMA )? f+= hint_field )*
{
HINT32=(Token)match(input,HINT,FOLLOW_HINT_in_hint1498); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_HINT.add(HINT32);
pushFollow(FOLLOW_hint_field_in_hint1502);
f=hint_field();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_hint_field.add(f.getTree());
if (list_f==null) list_f=new ArrayList();
list_f.add(f.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:169:23: ( ( COMMA )? f+= hint_field )*
loop13:
do {
int alt13=2;
int LA13_0 = input.LA(1);
if ( (LA13_0==COMMA||LA13_0==SCHEMA_IDENTIFIER) ) {
alt13=1;
}
switch (alt13) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:169:24: ( COMMA )? f+= hint_field
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:169:24: ( COMMA )?
int alt12=2;
int LA12_0 = input.LA(1);
if ( (LA12_0==COMMA) ) {
alt12=1;
}
switch (alt12) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:169:24: COMMA
{
COMMA33=(Token)match(input,COMMA,FOLLOW_COMMA_in_hint1505); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA33);
}
break;
}
pushFollow(FOLLOW_hint_field_in_hint1510);
f=hint_field();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_hint_field.add(f.getTree());
if (list_f==null) list_f=new ArrayList();
list_f.add(f.getTree());
}
break;
default :
break loop13;
}
} while (true);
// AST REWRITE
// elements: HINT, f
// token labels:
// rule labels: retval
// token list labels:
// rule list labels: f
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_f=new RewriteRuleSubtreeStream(adaptor,"token f",list_f);
root_0 = (CommonTree)adaptor.nil();
// 169:47: -> ^( HINT ( $f)+ )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:169:50: ^( HINT ( $f)+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
stream_HINT.nextNode()
, root_1);
if ( !(stream_f.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_f.hasNext() ) {
adaptor.addChild(root_1, stream_f.nextTree());
}
stream_f.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "hint"
public static class hint_field_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "hint_field"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:172:1: hint_field : field_name direction -> ^( HINT_FIELD field_name ( direction )? ) ;
public final MqlParser.hint_field_return hint_field() throws RecognitionException {
MqlParser.hint_field_return retval = new MqlParser.hint_field_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.field_name_return field_name34 =null;
MqlParser.direction_return direction35 =null;
RewriteRuleSubtreeStream stream_field_name=new RewriteRuleSubtreeStream(adaptor,"rule field_name");
RewriteRuleSubtreeStream stream_direction=new RewriteRuleSubtreeStream(adaptor,"rule direction");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:173:2: ( field_name direction -> ^( HINT_FIELD field_name ( direction )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:173:4: field_name direction
{
pushFollow(FOLLOW_field_name_in_hint_field1534);
field_name34=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(field_name34.getTree());
pushFollow(FOLLOW_direction_in_hint_field1536);
direction35=direction();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_direction.add(direction35.getTree());
// AST REWRITE
// elements: direction, field_name
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 173:25: -> ^( HINT_FIELD field_name ( direction )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:173:28: ^( HINT_FIELD field_name ( direction )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(HINT_FIELD, "HINT_FIELD")
, root_1);
adaptor.addChild(root_1, stream_field_name.nextTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:173:52: ( direction )?
if ( stream_direction.hasNext() ) {
adaptor.addChild(root_1, stream_direction.nextTree());
}
stream_direction.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "hint_field"
public static class action_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "action"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:177:1: action : ( select_action | explain_action | delete_action | update_action | fam_action | fad_action ) -> ^( ACTION ( select_action )? ( explain_action )? ( delete_action )? ( update_action )? ( fam_action )? ( fad_action )? ) ;
public final MqlParser.action_return action() throws RecognitionException {
MqlParser.action_return retval = new MqlParser.action_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.select_action_return select_action36 =null;
MqlParser.explain_action_return explain_action37 =null;
MqlParser.delete_action_return delete_action38 =null;
MqlParser.update_action_return update_action39 =null;
MqlParser.fam_action_return fam_action40 =null;
MqlParser.fad_action_return fad_action41 =null;
RewriteRuleSubtreeStream stream_explain_action=new RewriteRuleSubtreeStream(adaptor,"rule explain_action");
RewriteRuleSubtreeStream stream_select_action=new RewriteRuleSubtreeStream(adaptor,"rule select_action");
RewriteRuleSubtreeStream stream_delete_action=new RewriteRuleSubtreeStream(adaptor,"rule delete_action");
RewriteRuleSubtreeStream stream_fad_action=new RewriteRuleSubtreeStream(adaptor,"rule fad_action");
RewriteRuleSubtreeStream stream_update_action=new RewriteRuleSubtreeStream(adaptor,"rule update_action");
RewriteRuleSubtreeStream stream_fam_action=new RewriteRuleSubtreeStream(adaptor,"rule fam_action");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:2: ( ( select_action | explain_action | delete_action | update_action | fam_action | fad_action ) -> ^( ACTION ( select_action )? ( explain_action )? ( delete_action )? ( update_action )? ( fam_action )? ( fad_action )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:4: ( select_action | explain_action | delete_action | update_action | fam_action | fad_action )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:4: ( select_action | explain_action | delete_action | update_action | fam_action | fad_action )
int alt15=6;
switch ( input.LA(1) ) {
case SELECT:
{
alt15=1;
}
break;
case EXPLAIN:
{
alt15=2;
}
break;
case ATOMIC:
{
int LA15_3 = input.LA(2);
if ( (LA15_3==DELETE) ) {
alt15=3;
}
else if ( (LA15_3==UPDATE||LA15_3==UPSERT) ) {
alt15=4;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 15, 3, input);
throw nvae;
}
}
break;
case DELETE:
{
alt15=3;
}
break;
case UPDATE:
{
alt15=4;
}
break;
case UPSERT:
{
int LA15_6 = input.LA(2);
if ( (LA15_6==ADD_TO_SET||LA15_6==BITWISE||LA15_6==INC||(LA15_6 >= POP && LA15_6 <= PULL)||LA15_6==PUSH||LA15_6==RENAME||(LA15_6 >= SET && LA15_6 <= SHIFT)||LA15_6==UNSET) ) {
alt15=4;
}
else if ( (LA15_6==FIND_AND_MODIFY) ) {
alt15=5;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 15, 6, input);
throw nvae;
}
}
break;
case FIND_AND_MODIFY:
{
alt15=5;
}
break;
case FIND_AND_DELETE:
{
alt15=6;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 15, 0, input);
throw nvae;
}
switch (alt15) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:5: select_action
{
pushFollow(FOLLOW_select_action_in_action1561);
select_action36=select_action();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_select_action.add(select_action36.getTree());
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:21: explain_action
{
pushFollow(FOLLOW_explain_action_in_action1565);
explain_action37=explain_action();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_explain_action.add(explain_action37.getTree());
}
break;
case 3 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:38: delete_action
{
pushFollow(FOLLOW_delete_action_in_action1569);
delete_action38=delete_action();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_delete_action.add(delete_action38.getTree());
}
break;
case 4 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:54: update_action
{
pushFollow(FOLLOW_update_action_in_action1573);
update_action39=update_action();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_update_action.add(update_action39.getTree());
}
break;
case 5 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:70: fam_action
{
pushFollow(FOLLOW_fam_action_in_action1577);
fam_action40=fam_action();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_fam_action.add(fam_action40.getTree());
}
break;
case 6 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:83: fad_action
{
pushFollow(FOLLOW_fad_action_in_action1581);
fad_action41=fad_action();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_fad_action.add(fad_action41.getTree());
}
break;
}
// AST REWRITE
// elements: update_action, select_action, delete_action, fad_action, fam_action, explain_action
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 178:95: -> ^( ACTION ( select_action )? ( explain_action )? ( delete_action )? ( update_action )? ( fam_action )? ( fad_action )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:98: ^( ACTION ( select_action )? ( explain_action )? ( delete_action )? ( update_action )? ( fam_action )? ( fad_action )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(ACTION, "ACTION")
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:107: ( select_action )?
if ( stream_select_action.hasNext() ) {
adaptor.addChild(root_1, stream_select_action.nextTree());
}
stream_select_action.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:122: ( explain_action )?
if ( stream_explain_action.hasNext() ) {
adaptor.addChild(root_1, stream_explain_action.nextTree());
}
stream_explain_action.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:138: ( delete_action )?
if ( stream_delete_action.hasNext() ) {
adaptor.addChild(root_1, stream_delete_action.nextTree());
}
stream_delete_action.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:153: ( update_action )?
if ( stream_update_action.hasNext() ) {
adaptor.addChild(root_1, stream_update_action.nextTree());
}
stream_update_action.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:168: ( fam_action )?
if ( stream_fam_action.hasNext() ) {
adaptor.addChild(root_1, stream_fam_action.nextTree());
}
stream_fam_action.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:178:180: ( fad_action )?
if ( stream_fad_action.hasNext() ) {
adaptor.addChild(root_1, stream_fad_action.nextTree());
}
stream_fad_action.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "action"
public static class explain_action_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "explain_action"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:182:1: explain_action : EXPLAIN ( hint )? -> ^( EXPLAIN_ACTION ( hint )? ) ;
public final MqlParser.explain_action_return explain_action() throws RecognitionException {
MqlParser.explain_action_return retval = new MqlParser.explain_action_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token EXPLAIN42=null;
MqlParser.hint_return hint43 =null;
CommonTree EXPLAIN42_tree=null;
RewriteRuleTokenStream stream_EXPLAIN=new RewriteRuleTokenStream(adaptor,"token EXPLAIN");
RewriteRuleSubtreeStream stream_hint=new RewriteRuleSubtreeStream(adaptor,"rule hint");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:183:2: ( EXPLAIN ( hint )? -> ^( EXPLAIN_ACTION ( hint )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:183:4: EXPLAIN ( hint )?
{
EXPLAIN42=(Token)match(input,EXPLAIN,FOLLOW_EXPLAIN_in_explain_action1618); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_EXPLAIN.add(EXPLAIN42);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:183:12: ( hint )?
int alt16=2;
int LA16_0 = input.LA(1);
if ( (LA16_0==HINT) ) {
alt16=1;
}
switch (alt16) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:183:12: hint
{
pushFollow(FOLLOW_hint_in_explain_action1620);
hint43=hint();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_hint.add(hint43.getTree());
}
break;
}
// AST REWRITE
// elements: hint
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 183:18: -> ^( EXPLAIN_ACTION ( hint )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:183:21: ^( EXPLAIN_ACTION ( hint )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(EXPLAIN_ACTION, "EXPLAIN_ACTION")
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:183:38: ( hint )?
if ( stream_hint.hasNext() ) {
adaptor.addChild(root_1, stream_hint.nextTree());
}
stream_hint.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "explain_action"
public static class select_action_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "select_action"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:187:1: select_action : SELECT select_fields ( hint )? ( sort_field_list )? ( pagination )? -> ^( SELECT_ACTION select_fields ( hint )? ( sort_field_list )? ( pagination )? ) ;
public final MqlParser.select_action_return select_action() throws RecognitionException {
MqlParser.select_action_return retval = new MqlParser.select_action_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token SELECT44=null;
MqlParser.select_fields_return select_fields45 =null;
MqlParser.hint_return hint46 =null;
MqlParser.sort_field_list_return sort_field_list47 =null;
MqlParser.pagination_return pagination48 =null;
CommonTree SELECT44_tree=null;
RewriteRuleTokenStream stream_SELECT=new RewriteRuleTokenStream(adaptor,"token SELECT");
RewriteRuleSubtreeStream stream_sort_field_list=new RewriteRuleSubtreeStream(adaptor,"rule sort_field_list");
RewriteRuleSubtreeStream stream_hint=new RewriteRuleSubtreeStream(adaptor,"rule hint");
RewriteRuleSubtreeStream stream_select_fields=new RewriteRuleSubtreeStream(adaptor,"rule select_fields");
RewriteRuleSubtreeStream stream_pagination=new RewriteRuleSubtreeStream(adaptor,"rule pagination");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:2: ( SELECT select_fields ( hint )? ( sort_field_list )? ( pagination )? -> ^( SELECT_ACTION select_fields ( hint )? ( sort_field_list )? ( pagination )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:4: SELECT select_fields ( hint )? ( sort_field_list )? ( pagination )?
{
SELECT44=(Token)match(input,SELECT,FOLLOW_SELECT_in_select_action1642); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_SELECT.add(SELECT44);
pushFollow(FOLLOW_select_fields_in_select_action1644);
select_fields45=select_fields();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_select_fields.add(select_fields45.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:25: ( hint )?
int alt17=2;
int LA17_0 = input.LA(1);
if ( (LA17_0==HINT) ) {
alt17=1;
}
switch (alt17) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:25: hint
{
pushFollow(FOLLOW_hint_in_select_action1646);
hint46=hint();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_hint.add(hint46.getTree());
}
break;
}
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:31: ( sort_field_list )?
int alt18=2;
int LA18_0 = input.LA(1);
if ( (LA18_0==SORT) ) {
alt18=1;
}
switch (alt18) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:31: sort_field_list
{
pushFollow(FOLLOW_sort_field_list_in_select_action1649);
sort_field_list47=sort_field_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_sort_field_list.add(sort_field_list47.getTree());
}
break;
}
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:48: ( pagination )?
int alt19=2;
int LA19_0 = input.LA(1);
if ( (LA19_0==LIMIT) ) {
alt19=1;
}
switch (alt19) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:48: pagination
{
pushFollow(FOLLOW_pagination_in_select_action1652);
pagination48=pagination();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_pagination.add(pagination48.getTree());
}
break;
}
// AST REWRITE
// elements: hint, pagination, sort_field_list, select_fields
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 188:60: -> ^( SELECT_ACTION select_fields ( hint )? ( sort_field_list )? ( pagination )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:63: ^( SELECT_ACTION select_fields ( hint )? ( sort_field_list )? ( pagination )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(SELECT_ACTION, "SELECT_ACTION")
, root_1);
adaptor.addChild(root_1, stream_select_fields.nextTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:93: ( hint )?
if ( stream_hint.hasNext() ) {
adaptor.addChild(root_1, stream_hint.nextTree());
}
stream_hint.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:99: ( sort_field_list )?
if ( stream_sort_field_list.hasNext() ) {
adaptor.addChild(root_1, stream_sort_field_list.nextTree());
}
stream_sort_field_list.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:188:116: ( pagination )?
if ( stream_pagination.hasNext() ) {
adaptor.addChild(root_1, stream_pagination.nextTree());
}
stream_pagination.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "select_action"
public static class select_fields_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "select_fields"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:191:1: select_fields : ( STAR -> ^( FIELD_LIST STAR ) |f+= field_name ( ( COMMA )? f+= field_name )* -> ^( FIELD_LIST ( $f)+ ) );
public final MqlParser.select_fields_return select_fields() throws RecognitionException {
MqlParser.select_fields_return retval = new MqlParser.select_fields_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token STAR49=null;
Token COMMA50=null;
List list_f=null;
RuleReturnScope f = null;
CommonTree STAR49_tree=null;
CommonTree COMMA50_tree=null;
RewriteRuleTokenStream stream_STAR=new RewriteRuleTokenStream(adaptor,"token STAR");
RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
RewriteRuleSubtreeStream stream_field_name=new RewriteRuleSubtreeStream(adaptor,"rule field_name");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:192:2: ( STAR -> ^( FIELD_LIST STAR ) |f+= field_name ( ( COMMA )? f+= field_name )* -> ^( FIELD_LIST ( $f)+ ) )
int alt22=2;
int LA22_0 = input.LA(1);
if ( (LA22_0==STAR) ) {
alt22=1;
}
else if ( (LA22_0==SCHEMA_IDENTIFIER) ) {
alt22=2;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 22, 0, input);
throw nvae;
}
switch (alt22) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:192:4: STAR
{
STAR49=(Token)match(input,STAR,FOLLOW_STAR_in_select_fields1682); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_STAR.add(STAR49);
// AST REWRITE
// elements: STAR
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 192:9: -> ^( FIELD_LIST STAR )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:192:12: ^( FIELD_LIST STAR )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(FIELD_LIST, "FIELD_LIST")
, root_1);
adaptor.addChild(root_1,
stream_STAR.nextNode()
);
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:193:4: f+= field_name ( ( COMMA )? f+= field_name )*
{
pushFollow(FOLLOW_field_name_in_select_fields1697);
f=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(f.getTree());
if (list_f==null) list_f=new ArrayList();
list_f.add(f.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:193:18: ( ( COMMA )? f+= field_name )*
loop21:
do {
int alt21=2;
int LA21_0 = input.LA(1);
if ( (LA21_0==COMMA||LA21_0==SCHEMA_IDENTIFIER) ) {
alt21=1;
}
switch (alt21) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:193:19: ( COMMA )? f+= field_name
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:193:19: ( COMMA )?
int alt20=2;
int LA20_0 = input.LA(1);
if ( (LA20_0==COMMA) ) {
alt20=1;
}
switch (alt20) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:193:19: COMMA
{
COMMA50=(Token)match(input,COMMA,FOLLOW_COMMA_in_select_fields1700); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA50);
}
break;
}
pushFollow(FOLLOW_field_name_in_select_fields1705);
f=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(f.getTree());
if (list_f==null) list_f=new ArrayList();
list_f.add(f.getTree());
}
break;
default :
break loop21;
}
} while (true);
// AST REWRITE
// elements: f
// token labels:
// rule labels: retval
// token list labels:
// rule list labels: f
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_f=new RewriteRuleSubtreeStream(adaptor,"token f",list_f);
root_0 = (CommonTree)adaptor.nil();
// 193:42: -> ^( FIELD_LIST ( $f)+ )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:193:45: ^( FIELD_LIST ( $f)+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(FIELD_LIST, "FIELD_LIST")
, root_1);
if ( !(stream_f.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_f.hasNext() ) {
adaptor.addChild(root_1, stream_f.nextTree());
}
stream_f.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "select_fields"
public static class pagination_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "pagination"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:196:1: pagination : LIMIT (si= integer |sp= parameter ) ( COMMA (ei= integer |ep= parameter ) )? -> ^( LIMIT ( $si)? ( $sp)? ( $ei)? ( $ep)? ) ;
public final MqlParser.pagination_return pagination() throws RecognitionException {
MqlParser.pagination_return retval = new MqlParser.pagination_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token LIMIT51=null;
Token COMMA52=null;
MqlParser.integer_return si =null;
MqlParser.parameter_return sp =null;
MqlParser.integer_return ei =null;
MqlParser.parameter_return ep =null;
CommonTree LIMIT51_tree=null;
CommonTree COMMA52_tree=null;
RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
RewriteRuleTokenStream stream_LIMIT=new RewriteRuleTokenStream(adaptor,"token LIMIT");
RewriteRuleSubtreeStream stream_parameter=new RewriteRuleSubtreeStream(adaptor,"rule parameter");
RewriteRuleSubtreeStream stream_integer=new RewriteRuleSubtreeStream(adaptor,"rule integer");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:3: ( LIMIT (si= integer |sp= parameter ) ( COMMA (ei= integer |ep= parameter ) )? -> ^( LIMIT ( $si)? ( $sp)? ( $ei)? ( $ep)? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:5: LIMIT (si= integer |sp= parameter ) ( COMMA (ei= integer |ep= parameter ) )?
{
LIMIT51=(Token)match(input,LIMIT,FOLLOW_LIMIT_in_pagination1729); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_LIMIT.add(LIMIT51);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:11: (si= integer |sp= parameter )
int alt23=2;
int LA23_0 = input.LA(1);
if ( (LA23_0==INTEGER||LA23_0==SIGNED_INTEGER) ) {
alt23=1;
}
else if ( (LA23_0==COLON||LA23_0==QUESTION_MARK) ) {
alt23=2;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 23, 0, input);
throw nvae;
}
switch (alt23) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:12: si= integer
{
pushFollow(FOLLOW_integer_in_pagination1734);
si=integer();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_integer.add(si.getTree());
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:25: sp= parameter
{
pushFollow(FOLLOW_parameter_in_pagination1740);
sp=parameter();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_parameter.add(sp.getTree());
}
break;
}
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:39: ( COMMA (ei= integer |ep= parameter ) )?
int alt25=2;
int LA25_0 = input.LA(1);
if ( (LA25_0==COMMA) ) {
alt25=1;
}
switch (alt25) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:40: COMMA (ei= integer |ep= parameter )
{
COMMA52=(Token)match(input,COMMA,FOLLOW_COMMA_in_pagination1744); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA52);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:46: (ei= integer |ep= parameter )
int alt24=2;
int LA24_0 = input.LA(1);
if ( (LA24_0==INTEGER||LA24_0==SIGNED_INTEGER) ) {
alt24=1;
}
else if ( (LA24_0==COLON||LA24_0==QUESTION_MARK) ) {
alt24=2;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 24, 0, input);
throw nvae;
}
switch (alt24) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:47: ei= integer
{
pushFollow(FOLLOW_integer_in_pagination1749);
ei=integer();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_integer.add(ei.getTree());
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:60: ep= parameter
{
pushFollow(FOLLOW_parameter_in_pagination1755);
ep=parameter();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_parameter.add(ep.getTree());
}
break;
}
}
break;
}
// AST REWRITE
// elements: ep, ei, LIMIT, si, sp
// token labels:
// rule labels: retval, sp, ei, ep, si
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_sp=new RewriteRuleSubtreeStream(adaptor,"rule sp",sp!=null?sp.tree:null);
RewriteRuleSubtreeStream stream_ei=new RewriteRuleSubtreeStream(adaptor,"rule ei",ei!=null?ei.tree:null);
RewriteRuleSubtreeStream stream_ep=new RewriteRuleSubtreeStream(adaptor,"rule ep",ep!=null?ep.tree:null);
RewriteRuleSubtreeStream stream_si=new RewriteRuleSubtreeStream(adaptor,"rule si",si!=null?si.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 197:76: -> ^( LIMIT ( $si)? ( $sp)? ( $ei)? ( $ep)? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:79: ^( LIMIT ( $si)? ( $sp)? ( $ei)? ( $ep)? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
stream_LIMIT.nextNode()
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:88: ( $si)?
if ( stream_si.hasNext() ) {
adaptor.addChild(root_1, stream_si.nextTree());
}
stream_si.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:93: ( $sp)?
if ( stream_sp.hasNext() ) {
adaptor.addChild(root_1, stream_sp.nextTree());
}
stream_sp.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:98: ( $ei)?
if ( stream_ei.hasNext() ) {
adaptor.addChild(root_1, stream_ei.nextTree());
}
stream_ei.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:197:103: ( $ep)?
if ( stream_ep.hasNext() ) {
adaptor.addChild(root_1, stream_ep.nextTree());
}
stream_ep.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "pagination"
public static class fam_action_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "fam_action"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:201:1: fam_action : ( UPSERT )? FIND_AND_MODIFY ( fam_return )? update_operation_list SELECT select_fields ( sort_field_list )? -> ^( FAM_ACTION ( UPSERT )? ( fam_return )? update_operation_list ( select_fields )? ( sort_field_list )? ) ;
public final MqlParser.fam_action_return fam_action() throws RecognitionException {
MqlParser.fam_action_return retval = new MqlParser.fam_action_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token UPSERT53=null;
Token FIND_AND_MODIFY54=null;
Token SELECT57=null;
MqlParser.fam_return_return fam_return55 =null;
MqlParser.update_operation_list_return update_operation_list56 =null;
MqlParser.select_fields_return select_fields58 =null;
MqlParser.sort_field_list_return sort_field_list59 =null;
CommonTree UPSERT53_tree=null;
CommonTree FIND_AND_MODIFY54_tree=null;
CommonTree SELECT57_tree=null;
RewriteRuleTokenStream stream_UPSERT=new RewriteRuleTokenStream(adaptor,"token UPSERT");
RewriteRuleTokenStream stream_FIND_AND_MODIFY=new RewriteRuleTokenStream(adaptor,"token FIND_AND_MODIFY");
RewriteRuleTokenStream stream_SELECT=new RewriteRuleTokenStream(adaptor,"token SELECT");
RewriteRuleSubtreeStream stream_fam_return=new RewriteRuleSubtreeStream(adaptor,"rule fam_return");
RewriteRuleSubtreeStream stream_sort_field_list=new RewriteRuleSubtreeStream(adaptor,"rule sort_field_list");
RewriteRuleSubtreeStream stream_update_operation_list=new RewriteRuleSubtreeStream(adaptor,"rule update_operation_list");
RewriteRuleSubtreeStream stream_select_fields=new RewriteRuleSubtreeStream(adaptor,"rule select_fields");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:2: ( ( UPSERT )? FIND_AND_MODIFY ( fam_return )? update_operation_list SELECT select_fields ( sort_field_list )? -> ^( FAM_ACTION ( UPSERT )? ( fam_return )? update_operation_list ( select_fields )? ( sort_field_list )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:4: ( UPSERT )? FIND_AND_MODIFY ( fam_return )? update_operation_list SELECT select_fields ( sort_field_list )?
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:4: ( UPSERT )?
int alt26=2;
int LA26_0 = input.LA(1);
if ( (LA26_0==UPSERT) ) {
alt26=1;
}
switch (alt26) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:4: UPSERT
{
UPSERT53=(Token)match(input,UPSERT,FOLLOW_UPSERT_in_fam_action1793); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_UPSERT.add(UPSERT53);
}
break;
}
FIND_AND_MODIFY54=(Token)match(input,FIND_AND_MODIFY,FOLLOW_FIND_AND_MODIFY_in_fam_action1796); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_FIND_AND_MODIFY.add(FIND_AND_MODIFY54);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:28: ( fam_return )?
int alt27=2;
int LA27_0 = input.LA(1);
if ( (LA27_0==RETURN) ) {
alt27=1;
}
switch (alt27) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:28: fam_return
{
pushFollow(FOLLOW_fam_return_in_fam_action1798);
fam_return55=fam_return();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_fam_return.add(fam_return55.getTree());
}
break;
}
pushFollow(FOLLOW_update_operation_list_in_fam_action1801);
update_operation_list56=update_operation_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_update_operation_list.add(update_operation_list56.getTree());
SELECT57=(Token)match(input,SELECT,FOLLOW_SELECT_in_fam_action1803); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_SELECT.add(SELECT57);
pushFollow(FOLLOW_select_fields_in_fam_action1805);
select_fields58=select_fields();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_select_fields.add(select_fields58.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:83: ( sort_field_list )?
int alt28=2;
int LA28_0 = input.LA(1);
if ( (LA28_0==SORT) ) {
alt28=1;
}
switch (alt28) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:83: sort_field_list
{
pushFollow(FOLLOW_sort_field_list_in_fam_action1807);
sort_field_list59=sort_field_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_sort_field_list.add(sort_field_list59.getTree());
}
break;
}
// AST REWRITE
// elements: update_operation_list, select_fields, fam_return, sort_field_list, UPSERT
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 202:100: -> ^( FAM_ACTION ( UPSERT )? ( fam_return )? update_operation_list ( select_fields )? ( sort_field_list )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:103: ^( FAM_ACTION ( UPSERT )? ( fam_return )? update_operation_list ( select_fields )? ( sort_field_list )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(FAM_ACTION, "FAM_ACTION")
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:116: ( UPSERT )?
if ( stream_UPSERT.hasNext() ) {
adaptor.addChild(root_1,
stream_UPSERT.nextNode()
);
}
stream_UPSERT.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:124: ( fam_return )?
if ( stream_fam_return.hasNext() ) {
adaptor.addChild(root_1, stream_fam_return.nextTree());
}
stream_fam_return.reset();
adaptor.addChild(root_1, stream_update_operation_list.nextTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:158: ( select_fields )?
if ( stream_select_fields.hasNext() ) {
adaptor.addChild(root_1, stream_select_fields.nextTree());
}
stream_select_fields.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:202:173: ( sort_field_list )?
if ( stream_sort_field_list.hasNext() ) {
adaptor.addChild(root_1, stream_sort_field_list.nextTree());
}
stream_sort_field_list.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "fam_action"
public static class fam_return_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "fam_return"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:205:1: fam_return : ( RETURN ^ ( NEW | OLD ) ) ;
public final MqlParser.fam_return_return fam_return() throws RecognitionException {
MqlParser.fam_return_return retval = new MqlParser.fam_return_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token RETURN60=null;
Token set61=null;
CommonTree RETURN60_tree=null;
CommonTree set61_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:206:2: ( ( RETURN ^ ( NEW | OLD ) ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:206:4: ( RETURN ^ ( NEW | OLD ) )
{
root_0 = (CommonTree)adaptor.nil();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:206:4: ( RETURN ^ ( NEW | OLD ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:206:5: RETURN ^ ( NEW | OLD )
{
RETURN60=(Token)match(input,RETURN,FOLLOW_RETURN_in_fam_return1840); if (state.failed) return retval;
if ( state.backtracking==0 ) {
RETURN60_tree =
(CommonTree)adaptor.create(RETURN60)
;
root_0 = (CommonTree)adaptor.becomeRoot(RETURN60_tree, root_0);
}
set61=(Token)input.LT(1);
if ( input.LA(1)==NEW||input.LA(1)==OLD ) {
input.consume();
if ( state.backtracking==0 ) adaptor.addChild(root_0,
(CommonTree)adaptor.create(set61)
);
state.errorRecovery=false;
state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "fam_return"
public static class fad_action_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "fad_action"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:210:1: fad_action : FIND_AND_DELETE ( SELECT select_fields )? ( sort_field_list )? -> ^( FAD_ACTION ( select_fields )? ( sort_field_list )? ) ;
public final MqlParser.fad_action_return fad_action() throws RecognitionException {
MqlParser.fad_action_return retval = new MqlParser.fad_action_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token FIND_AND_DELETE62=null;
Token SELECT63=null;
MqlParser.select_fields_return select_fields64 =null;
MqlParser.sort_field_list_return sort_field_list65 =null;
CommonTree FIND_AND_DELETE62_tree=null;
CommonTree SELECT63_tree=null;
RewriteRuleTokenStream stream_FIND_AND_DELETE=new RewriteRuleTokenStream(adaptor,"token FIND_AND_DELETE");
RewriteRuleTokenStream stream_SELECT=new RewriteRuleTokenStream(adaptor,"token SELECT");
RewriteRuleSubtreeStream stream_sort_field_list=new RewriteRuleSubtreeStream(adaptor,"rule sort_field_list");
RewriteRuleSubtreeStream stream_select_fields=new RewriteRuleSubtreeStream(adaptor,"rule select_fields");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:211:2: ( FIND_AND_DELETE ( SELECT select_fields )? ( sort_field_list )? -> ^( FAD_ACTION ( select_fields )? ( sort_field_list )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:211:4: FIND_AND_DELETE ( SELECT select_fields )? ( sort_field_list )?
{
FIND_AND_DELETE62=(Token)match(input,FIND_AND_DELETE,FOLLOW_FIND_AND_DELETE_in_fad_action1863); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_FIND_AND_DELETE.add(FIND_AND_DELETE62);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:211:20: ( SELECT select_fields )?
int alt29=2;
int LA29_0 = input.LA(1);
if ( (LA29_0==SELECT) ) {
alt29=1;
}
switch (alt29) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:211:21: SELECT select_fields
{
SELECT63=(Token)match(input,SELECT,FOLLOW_SELECT_in_fad_action1866); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_SELECT.add(SELECT63);
pushFollow(FOLLOW_select_fields_in_fad_action1868);
select_fields64=select_fields();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_select_fields.add(select_fields64.getTree());
}
break;
}
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:211:44: ( sort_field_list )?
int alt30=2;
int LA30_0 = input.LA(1);
if ( (LA30_0==SORT) ) {
alt30=1;
}
switch (alt30) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:211:44: sort_field_list
{
pushFollow(FOLLOW_sort_field_list_in_fad_action1872);
sort_field_list65=sort_field_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_sort_field_list.add(sort_field_list65.getTree());
}
break;
}
// AST REWRITE
// elements: select_fields, sort_field_list
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 211:61: -> ^( FAD_ACTION ( select_fields )? ( sort_field_list )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:211:64: ^( FAD_ACTION ( select_fields )? ( sort_field_list )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(FAD_ACTION, "FAD_ACTION")
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:211:77: ( select_fields )?
if ( stream_select_fields.hasNext() ) {
adaptor.addChild(root_1, stream_select_fields.nextTree());
}
stream_select_fields.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:211:92: ( sort_field_list )?
if ( stream_sort_field_list.hasNext() ) {
adaptor.addChild(root_1, stream_sort_field_list.nextTree());
}
stream_sort_field_list.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "fad_action"
public static class delete_action_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "delete_action"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:215:1: delete_action : ( ATOMIC )? DELETE -> ^( DELETE_ACTION ( ATOMIC )? ) ;
public final MqlParser.delete_action_return delete_action() throws RecognitionException {
MqlParser.delete_action_return retval = new MqlParser.delete_action_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token ATOMIC66=null;
Token DELETE67=null;
CommonTree ATOMIC66_tree=null;
CommonTree DELETE67_tree=null;
RewriteRuleTokenStream stream_DELETE=new RewriteRuleTokenStream(adaptor,"token DELETE");
RewriteRuleTokenStream stream_ATOMIC=new RewriteRuleTokenStream(adaptor,"token ATOMIC");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:216:2: ( ( ATOMIC )? DELETE -> ^( DELETE_ACTION ( ATOMIC )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:216:4: ( ATOMIC )? DELETE
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:216:4: ( ATOMIC )?
int alt31=2;
int LA31_0 = input.LA(1);
if ( (LA31_0==ATOMIC) ) {
alt31=1;
}
switch (alt31) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:216:4: ATOMIC
{
ATOMIC66=(Token)match(input,ATOMIC,FOLLOW_ATOMIC_in_delete_action1897); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ATOMIC.add(ATOMIC66);
}
break;
}
DELETE67=(Token)match(input,DELETE,FOLLOW_DELETE_in_delete_action1900); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_DELETE.add(DELETE67);
// AST REWRITE
// elements: ATOMIC
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 216:19: -> ^( DELETE_ACTION ( ATOMIC )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:216:22: ^( DELETE_ACTION ( ATOMIC )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(DELETE_ACTION, "DELETE_ACTION")
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:216:38: ( ATOMIC )?
if ( stream_ATOMIC.hasNext() ) {
adaptor.addChild(root_1,
stream_ATOMIC.nextNode()
);
}
stream_ATOMIC.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "delete_action"
public static class update_action_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "update_action"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:220:1: update_action : ( ( ATOMIC )? UPDATE ( MULTI )? update_operation_list -> ^( UPDATE_ACTION ( ATOMIC )? ( MULTI )? update_operation_list ) | ( ATOMIC )? UPSERT update_operation_list -> ^( UPSERT_ACTION ( ATOMIC )? update_operation_list ) );
public final MqlParser.update_action_return update_action() throws RecognitionException {
MqlParser.update_action_return retval = new MqlParser.update_action_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token ATOMIC68=null;
Token UPDATE69=null;
Token MULTI70=null;
Token ATOMIC72=null;
Token UPSERT73=null;
MqlParser.update_operation_list_return update_operation_list71 =null;
MqlParser.update_operation_list_return update_operation_list74 =null;
CommonTree ATOMIC68_tree=null;
CommonTree UPDATE69_tree=null;
CommonTree MULTI70_tree=null;
CommonTree ATOMIC72_tree=null;
CommonTree UPSERT73_tree=null;
RewriteRuleTokenStream stream_UPSERT=new RewriteRuleTokenStream(adaptor,"token UPSERT");
RewriteRuleTokenStream stream_UPDATE=new RewriteRuleTokenStream(adaptor,"token UPDATE");
RewriteRuleTokenStream stream_MULTI=new RewriteRuleTokenStream(adaptor,"token MULTI");
RewriteRuleTokenStream stream_ATOMIC=new RewriteRuleTokenStream(adaptor,"token ATOMIC");
RewriteRuleSubtreeStream stream_update_operation_list=new RewriteRuleSubtreeStream(adaptor,"rule update_operation_list");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:221:2: ( ( ATOMIC )? UPDATE ( MULTI )? update_operation_list -> ^( UPDATE_ACTION ( ATOMIC )? ( MULTI )? update_operation_list ) | ( ATOMIC )? UPSERT update_operation_list -> ^( UPSERT_ACTION ( ATOMIC )? update_operation_list ) )
int alt35=2;
switch ( input.LA(1) ) {
case ATOMIC:
{
int LA35_1 = input.LA(2);
if ( (LA35_1==UPDATE) ) {
alt35=1;
}
else if ( (LA35_1==UPSERT) ) {
alt35=2;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 35, 1, input);
throw nvae;
}
}
break;
case UPDATE:
{
alt35=1;
}
break;
case UPSERT:
{
alt35=2;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 35, 0, input);
throw nvae;
}
switch (alt35) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:221:4: ( ATOMIC )? UPDATE ( MULTI )? update_operation_list
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:221:4: ( ATOMIC )?
int alt32=2;
int LA32_0 = input.LA(1);
if ( (LA32_0==ATOMIC) ) {
alt32=1;
}
switch (alt32) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:221:4: ATOMIC
{
ATOMIC68=(Token)match(input,ATOMIC,FOLLOW_ATOMIC_in_update_action1921); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ATOMIC.add(ATOMIC68);
}
break;
}
UPDATE69=(Token)match(input,UPDATE,FOLLOW_UPDATE_in_update_action1924); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_UPDATE.add(UPDATE69);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:221:19: ( MULTI )?
int alt33=2;
int LA33_0 = input.LA(1);
if ( (LA33_0==MULTI) ) {
alt33=1;
}
switch (alt33) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:221:19: MULTI
{
MULTI70=(Token)match(input,MULTI,FOLLOW_MULTI_in_update_action1926); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_MULTI.add(MULTI70);
}
break;
}
pushFollow(FOLLOW_update_operation_list_in_update_action1929);
update_operation_list71=update_operation_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_update_operation_list.add(update_operation_list71.getTree());
// AST REWRITE
// elements: update_operation_list, MULTI, ATOMIC
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 221:48: -> ^( UPDATE_ACTION ( ATOMIC )? ( MULTI )? update_operation_list )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:221:51: ^( UPDATE_ACTION ( ATOMIC )? ( MULTI )? update_operation_list )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(UPDATE_ACTION, "UPDATE_ACTION")
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:221:67: ( ATOMIC )?
if ( stream_ATOMIC.hasNext() ) {
adaptor.addChild(root_1,
stream_ATOMIC.nextNode()
);
}
stream_ATOMIC.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:221:75: ( MULTI )?
if ( stream_MULTI.hasNext() ) {
adaptor.addChild(root_1,
stream_MULTI.nextNode()
);
}
stream_MULTI.reset();
adaptor.addChild(root_1, stream_update_operation_list.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:222:4: ( ATOMIC )? UPSERT update_operation_list
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:222:4: ( ATOMIC )?
int alt34=2;
int LA34_0 = input.LA(1);
if ( (LA34_0==ATOMIC) ) {
alt34=1;
}
switch (alt34) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:222:4: ATOMIC
{
ATOMIC72=(Token)match(input,ATOMIC,FOLLOW_ATOMIC_in_update_action1948); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ATOMIC.add(ATOMIC72);
}
break;
}
UPSERT73=(Token)match(input,UPSERT,FOLLOW_UPSERT_in_update_action1951); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_UPSERT.add(UPSERT73);
pushFollow(FOLLOW_update_operation_list_in_update_action1953);
update_operation_list74=update_operation_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_update_operation_list.add(update_operation_list74.getTree());
// AST REWRITE
// elements: update_operation_list, ATOMIC
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 222:41: -> ^( UPSERT_ACTION ( ATOMIC )? update_operation_list )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:222:44: ^( UPSERT_ACTION ( ATOMIC )? update_operation_list )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(UPSERT_ACTION, "UPSERT_ACTION")
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:222:60: ( ATOMIC )?
if ( stream_ATOMIC.hasNext() ) {
adaptor.addChild(root_1,
stream_ATOMIC.nextNode()
);
}
stream_ATOMIC.reset();
adaptor.addChild(root_1, stream_update_operation_list.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "update_action"
public static class update_operation_list_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "update_operation_list"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:225:1: update_operation_list :u+= update_operation ( ( COMMA )? u+= update_operation )* -> ^( UPDATE_OPERATIONS ( $u)+ ) ;
public final MqlParser.update_operation_list_return update_operation_list() throws RecognitionException {
MqlParser.update_operation_list_return retval = new MqlParser.update_operation_list_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token COMMA75=null;
List list_u=null;
RuleReturnScope u = null;
CommonTree COMMA75_tree=null;
RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
RewriteRuleSubtreeStream stream_update_operation=new RewriteRuleSubtreeStream(adaptor,"rule update_operation");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:226:2: (u+= update_operation ( ( COMMA )? u+= update_operation )* -> ^( UPDATE_OPERATIONS ( $u)+ ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:226:4: u+= update_operation ( ( COMMA )? u+= update_operation )*
{
pushFollow(FOLLOW_update_operation_in_update_operation_list1978);
u=update_operation();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_update_operation.add(u.getTree());
if (list_u==null) list_u=new ArrayList();
list_u.add(u.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:226:24: ( ( COMMA )? u+= update_operation )*
loop37:
do {
int alt37=2;
int LA37_0 = input.LA(1);
if ( (LA37_0==ADD_TO_SET||LA37_0==BITWISE||LA37_0==COMMA||LA37_0==INC||(LA37_0 >= POP && LA37_0 <= PULL)||LA37_0==PUSH||LA37_0==RENAME||(LA37_0 >= SET && LA37_0 <= SHIFT)||LA37_0==UNSET) ) {
alt37=1;
}
switch (alt37) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:226:25: ( COMMA )? u+= update_operation
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:226:25: ( COMMA )?
int alt36=2;
int LA36_0 = input.LA(1);
if ( (LA36_0==COMMA) ) {
alt36=1;
}
switch (alt36) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:226:25: COMMA
{
COMMA75=(Token)match(input,COMMA,FOLLOW_COMMA_in_update_operation_list1981); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA75);
}
break;
}
pushFollow(FOLLOW_update_operation_in_update_operation_list1986);
u=update_operation();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_update_operation.add(u.getTree());
if (list_u==null) list_u=new ArrayList();
list_u.add(u.getTree());
}
break;
default :
break loop37;
}
} while (true);
// AST REWRITE
// elements: u
// token labels:
// rule labels: retval
// token list labels:
// rule list labels: u
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_u=new RewriteRuleSubtreeStream(adaptor,"token u",list_u);
root_0 = (CommonTree)adaptor.nil();
// 226:54: -> ^( UPDATE_OPERATIONS ( $u)+ )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:226:57: ^( UPDATE_OPERATIONS ( $u)+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(UPDATE_OPERATIONS, "UPDATE_OPERATIONS")
, root_1);
if ( !(stream_u.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_u.hasNext() ) {
adaptor.addChild(root_1, stream_u.nextTree());
}
stream_u.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "update_operation_list"
public static class update_operation_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "update_operation"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:229:1: update_operation : ( operation_inc | operation_set | operation_unset | operation_push | operation_push_all | operation_add_to_set | operation_add_to_set_each | operation_pop | operation_shift | operation_pull | operation_pull_all | operation_rename | operation_bitwise ) ;
public final MqlParser.update_operation_return update_operation() throws RecognitionException {
MqlParser.update_operation_return retval = new MqlParser.update_operation_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.operation_inc_return operation_inc76 =null;
MqlParser.operation_set_return operation_set77 =null;
MqlParser.operation_unset_return operation_unset78 =null;
MqlParser.operation_push_return operation_push79 =null;
MqlParser.operation_push_all_return operation_push_all80 =null;
MqlParser.operation_add_to_set_return operation_add_to_set81 =null;
MqlParser.operation_add_to_set_each_return operation_add_to_set_each82 =null;
MqlParser.operation_pop_return operation_pop83 =null;
MqlParser.operation_shift_return operation_shift84 =null;
MqlParser.operation_pull_return operation_pull85 =null;
MqlParser.operation_pull_all_return operation_pull_all86 =null;
MqlParser.operation_rename_return operation_rename87 =null;
MqlParser.operation_bitwise_return operation_bitwise88 =null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:230:2: ( ( operation_inc | operation_set | operation_unset | operation_push | operation_push_all | operation_add_to_set | operation_add_to_set_each | operation_pop | operation_shift | operation_pull | operation_pull_all | operation_rename | operation_bitwise ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:230:4: ( operation_inc | operation_set | operation_unset | operation_push | operation_push_all | operation_add_to_set | operation_add_to_set_each | operation_pop | operation_shift | operation_pull | operation_pull_all | operation_rename | operation_bitwise )
{
root_0 = (CommonTree)adaptor.nil();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:230:4: ( operation_inc | operation_set | operation_unset | operation_push | operation_push_all | operation_add_to_set | operation_add_to_set_each | operation_pop | operation_shift | operation_pull | operation_pull_all | operation_rename | operation_bitwise )
int alt38=13;
switch ( input.LA(1) ) {
case INC:
{
alt38=1;
}
break;
case SET:
{
alt38=2;
}
break;
case UNSET:
{
alt38=3;
}
break;
case PUSH:
{
int LA38_4 = input.LA(2);
if ( (LA38_4==ALL) ) {
alt38=5;
}
else if ( (LA38_4==SCHEMA_IDENTIFIER) ) {
alt38=4;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 38, 4, input);
throw nvae;
}
}
break;
case ADD_TO_SET:
{
int LA38_5 = input.LA(2);
if ( (LA38_5==SCHEMA_IDENTIFIER) ) {
int LA38_13 = input.LA(3);
if ( ((LA38_13 >= ALL && LA38_13 <= AND)||LA38_13==COLON||LA38_13==DECIMAL||LA38_13==DOUBLE_QUOTED_STRING||LA38_13==FALSE||LA38_13==HEX_NUMBER||LA38_13==INTEGER||LA38_13==L_BRACKET||LA38_13==OR||(LA38_13 >= QUESTION_MARK && LA38_13 <= REGEX)||LA38_13==SCHEMA_IDENTIFIER||(LA38_13 >= SIGNED_DECIMAL && LA38_13 <= SINGLE_QUOTED_STRING)||LA38_13==TRUE) ) {
alt38=6;
}
else if ( (LA38_13==EACH) ) {
alt38=7;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 38, 13, input);
throw nvae;
}
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 38, 5, input);
throw nvae;
}
}
break;
case POP:
{
alt38=8;
}
break;
case SHIFT:
{
alt38=9;
}
break;
case PULL:
{
int LA38_8 = input.LA(2);
if ( (LA38_8==ALL) ) {
alt38=11;
}
else if ( (LA38_8==SCHEMA_IDENTIFIER) ) {
alt38=10;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 38, 8, input);
throw nvae;
}
}
break;
case RENAME:
{
alt38=12;
}
break;
case BITWISE:
{
alt38=13;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 38, 0, input);
throw nvae;
}
switch (alt38) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:231:3: operation_inc
{
pushFollow(FOLLOW_operation_inc_in_update_operation2013);
operation_inc76=operation_inc();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_inc76.getTree());
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:232:5: operation_set
{
pushFollow(FOLLOW_operation_set_in_update_operation2019);
operation_set77=operation_set();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_set77.getTree());
}
break;
case 3 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:233:5: operation_unset
{
pushFollow(FOLLOW_operation_unset_in_update_operation2026);
operation_unset78=operation_unset();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_unset78.getTree());
}
break;
case 4 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:234:5: operation_push
{
pushFollow(FOLLOW_operation_push_in_update_operation2033);
operation_push79=operation_push();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_push79.getTree());
}
break;
case 5 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:235:5: operation_push_all
{
pushFollow(FOLLOW_operation_push_all_in_update_operation2040);
operation_push_all80=operation_push_all();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_push_all80.getTree());
}
break;
case 6 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:236:5: operation_add_to_set
{
pushFollow(FOLLOW_operation_add_to_set_in_update_operation2047);
operation_add_to_set81=operation_add_to_set();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_add_to_set81.getTree());
}
break;
case 7 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:237:5: operation_add_to_set_each
{
pushFollow(FOLLOW_operation_add_to_set_each_in_update_operation2053);
operation_add_to_set_each82=operation_add_to_set_each();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_add_to_set_each82.getTree());
}
break;
case 8 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:238:5: operation_pop
{
pushFollow(FOLLOW_operation_pop_in_update_operation2059);
operation_pop83=operation_pop();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_pop83.getTree());
}
break;
case 9 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:239:5: operation_shift
{
pushFollow(FOLLOW_operation_shift_in_update_operation2065);
operation_shift84=operation_shift();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_shift84.getTree());
}
break;
case 10 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:240:5: operation_pull
{
pushFollow(FOLLOW_operation_pull_in_update_operation2071);
operation_pull85=operation_pull();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_pull85.getTree());
}
break;
case 11 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:241:5: operation_pull_all
{
pushFollow(FOLLOW_operation_pull_all_in_update_operation2077);
operation_pull_all86=operation_pull_all();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_pull_all86.getTree());
}
break;
case 12 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:242:5: operation_rename
{
pushFollow(FOLLOW_operation_rename_in_update_operation2083);
operation_rename87=operation_rename();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_rename87.getTree());
}
break;
case 13 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:243:5: operation_bitwise
{
pushFollow(FOLLOW_operation_bitwise_in_update_operation2089);
operation_bitwise88=operation_bitwise();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, operation_bitwise88.getTree());
}
break;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "update_operation"
public static class operation_inc_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_inc"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:247:1: operation_inc : INC ^ field_name number ;
public final MqlParser.operation_inc_return operation_inc() throws RecognitionException {
MqlParser.operation_inc_return retval = new MqlParser.operation_inc_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token INC89=null;
MqlParser.field_name_return field_name90 =null;
MqlParser.number_return number91 =null;
CommonTree INC89_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:248:2: ( INC ^ field_name number )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:248:4: INC ^ field_name number
{
root_0 = (CommonTree)adaptor.nil();
INC89=(Token)match(input,INC,FOLLOW_INC_in_operation_inc2103); if (state.failed) return retval;
if ( state.backtracking==0 ) {
INC89_tree =
(CommonTree)adaptor.create(INC89)
;
root_0 = (CommonTree)adaptor.becomeRoot(INC89_tree, root_0);
}
pushFollow(FOLLOW_field_name_in_operation_inc2106);
field_name90=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name90.getTree());
pushFollow(FOLLOW_number_in_operation_inc2108);
number91=number();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, number91.getTree());
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_inc"
public static class operation_set_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_set"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:251:1: operation_set : SET ^ field_name EQUALS ! variable_literal ;
public final MqlParser.operation_set_return operation_set() throws RecognitionException {
MqlParser.operation_set_return retval = new MqlParser.operation_set_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token SET92=null;
Token EQUALS94=null;
MqlParser.field_name_return field_name93 =null;
MqlParser.variable_literal_return variable_literal95 =null;
CommonTree SET92_tree=null;
CommonTree EQUALS94_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:252:2: ( SET ^ field_name EQUALS ! variable_literal )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:252:4: SET ^ field_name EQUALS ! variable_literal
{
root_0 = (CommonTree)adaptor.nil();
SET92=(Token)match(input,SET,FOLLOW_SET_in_operation_set2121); if (state.failed) return retval;
if ( state.backtracking==0 ) {
SET92_tree =
(CommonTree)adaptor.create(SET92)
;
root_0 = (CommonTree)adaptor.becomeRoot(SET92_tree, root_0);
}
pushFollow(FOLLOW_field_name_in_operation_set2124);
field_name93=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name93.getTree());
EQUALS94=(Token)match(input,EQUALS,FOLLOW_EQUALS_in_operation_set2126); if (state.failed) return retval;
pushFollow(FOLLOW_variable_literal_in_operation_set2129);
variable_literal95=variable_literal();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, variable_literal95.getTree());
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_set"
public static class operation_unset_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_unset"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:255:1: operation_unset : UNSET ^ field_name ;
public final MqlParser.operation_unset_return operation_unset() throws RecognitionException {
MqlParser.operation_unset_return retval = new MqlParser.operation_unset_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token UNSET96=null;
MqlParser.field_name_return field_name97 =null;
CommonTree UNSET96_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:256:2: ( UNSET ^ field_name )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:256:4: UNSET ^ field_name
{
root_0 = (CommonTree)adaptor.nil();
UNSET96=(Token)match(input,UNSET,FOLLOW_UNSET_in_operation_unset2141); if (state.failed) return retval;
if ( state.backtracking==0 ) {
UNSET96_tree =
(CommonTree)adaptor.create(UNSET96)
;
root_0 = (CommonTree)adaptor.becomeRoot(UNSET96_tree, root_0);
}
pushFollow(FOLLOW_field_name_in_operation_unset2144);
field_name97=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name97.getTree());
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_unset"
public static class operation_push_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_push"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:259:1: operation_push : PUSH ^ field_name variable_literal ;
public final MqlParser.operation_push_return operation_push() throws RecognitionException {
MqlParser.operation_push_return retval = new MqlParser.operation_push_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token PUSH98=null;
MqlParser.field_name_return field_name99 =null;
MqlParser.variable_literal_return variable_literal100 =null;
CommonTree PUSH98_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:260:2: ( PUSH ^ field_name variable_literal )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:260:4: PUSH ^ field_name variable_literal
{
root_0 = (CommonTree)adaptor.nil();
PUSH98=(Token)match(input,PUSH,FOLLOW_PUSH_in_operation_push2156); if (state.failed) return retval;
if ( state.backtracking==0 ) {
PUSH98_tree =
(CommonTree)adaptor.create(PUSH98)
;
root_0 = (CommonTree)adaptor.becomeRoot(PUSH98_tree, root_0);
}
pushFollow(FOLLOW_field_name_in_operation_push2159);
field_name99=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name99.getTree());
pushFollow(FOLLOW_variable_literal_in_operation_push2161);
variable_literal100=variable_literal();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, variable_literal100.getTree());
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_push"
public static class operation_push_all_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_push_all"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:263:1: operation_push_all : PUSH ALL field_name array -> ^( PUSH_ALL field_name array ) ;
public final MqlParser.operation_push_all_return operation_push_all() throws RecognitionException {
MqlParser.operation_push_all_return retval = new MqlParser.operation_push_all_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token PUSH101=null;
Token ALL102=null;
MqlParser.field_name_return field_name103 =null;
MqlParser.array_return array104 =null;
CommonTree PUSH101_tree=null;
CommonTree ALL102_tree=null;
RewriteRuleTokenStream stream_PUSH=new RewriteRuleTokenStream(adaptor,"token PUSH");
RewriteRuleTokenStream stream_ALL=new RewriteRuleTokenStream(adaptor,"token ALL");
RewriteRuleSubtreeStream stream_field_name=new RewriteRuleSubtreeStream(adaptor,"rule field_name");
RewriteRuleSubtreeStream stream_array=new RewriteRuleSubtreeStream(adaptor,"rule array");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:264:2: ( PUSH ALL field_name array -> ^( PUSH_ALL field_name array ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:264:4: PUSH ALL field_name array
{
PUSH101=(Token)match(input,PUSH,FOLLOW_PUSH_in_operation_push_all2175); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_PUSH.add(PUSH101);
ALL102=(Token)match(input,ALL,FOLLOW_ALL_in_operation_push_all2177); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ALL.add(ALL102);
pushFollow(FOLLOW_field_name_in_operation_push_all2179);
field_name103=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(field_name103.getTree());
pushFollow(FOLLOW_array_in_operation_push_all2181);
array104=array();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_array.add(array104.getTree());
// AST REWRITE
// elements: field_name, array
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 264:30: -> ^( PUSH_ALL field_name array )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:264:33: ^( PUSH_ALL field_name array )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(PUSH_ALL, "PUSH_ALL")
, root_1);
adaptor.addChild(root_1, stream_field_name.nextTree());
adaptor.addChild(root_1, stream_array.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_push_all"
public static class operation_add_to_set_each_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_add_to_set_each"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:267:1: operation_add_to_set_each : ADD_TO_SET field_name EACH array -> ^( ADD_TO_SET_EACH field_name array ) ;
public final MqlParser.operation_add_to_set_each_return operation_add_to_set_each() throws RecognitionException {
MqlParser.operation_add_to_set_each_return retval = new MqlParser.operation_add_to_set_each_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token ADD_TO_SET105=null;
Token EACH107=null;
MqlParser.field_name_return field_name106 =null;
MqlParser.array_return array108 =null;
CommonTree ADD_TO_SET105_tree=null;
CommonTree EACH107_tree=null;
RewriteRuleTokenStream stream_ADD_TO_SET=new RewriteRuleTokenStream(adaptor,"token ADD_TO_SET");
RewriteRuleTokenStream stream_EACH=new RewriteRuleTokenStream(adaptor,"token EACH");
RewriteRuleSubtreeStream stream_field_name=new RewriteRuleSubtreeStream(adaptor,"rule field_name");
RewriteRuleSubtreeStream stream_array=new RewriteRuleSubtreeStream(adaptor,"rule array");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:268:2: ( ADD_TO_SET field_name EACH array -> ^( ADD_TO_SET_EACH field_name array ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:268:4: ADD_TO_SET field_name EACH array
{
ADD_TO_SET105=(Token)match(input,ADD_TO_SET,FOLLOW_ADD_TO_SET_in_operation_add_to_set_each2205); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ADD_TO_SET.add(ADD_TO_SET105);
pushFollow(FOLLOW_field_name_in_operation_add_to_set_each2207);
field_name106=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(field_name106.getTree());
EACH107=(Token)match(input,EACH,FOLLOW_EACH_in_operation_add_to_set_each2209); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_EACH.add(EACH107);
pushFollow(FOLLOW_array_in_operation_add_to_set_each2211);
array108=array();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_array.add(array108.getTree());
// AST REWRITE
// elements: array, field_name
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 268:37: -> ^( ADD_TO_SET_EACH field_name array )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:268:40: ^( ADD_TO_SET_EACH field_name array )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(ADD_TO_SET_EACH, "ADD_TO_SET_EACH")
, root_1);
adaptor.addChild(root_1, stream_field_name.nextTree());
adaptor.addChild(root_1, stream_array.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_add_to_set_each"
public static class operation_add_to_set_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_add_to_set"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:271:1: operation_add_to_set : ADD_TO_SET ^ field_name variable_literal ;
public final MqlParser.operation_add_to_set_return operation_add_to_set() throws RecognitionException {
MqlParser.operation_add_to_set_return retval = new MqlParser.operation_add_to_set_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token ADD_TO_SET109=null;
MqlParser.field_name_return field_name110 =null;
MqlParser.variable_literal_return variable_literal111 =null;
CommonTree ADD_TO_SET109_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:272:2: ( ADD_TO_SET ^ field_name variable_literal )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:272:4: ADD_TO_SET ^ field_name variable_literal
{
root_0 = (CommonTree)adaptor.nil();
ADD_TO_SET109=(Token)match(input,ADD_TO_SET,FOLLOW_ADD_TO_SET_in_operation_add_to_set2232); if (state.failed) return retval;
if ( state.backtracking==0 ) {
ADD_TO_SET109_tree =
(CommonTree)adaptor.create(ADD_TO_SET109)
;
root_0 = (CommonTree)adaptor.becomeRoot(ADD_TO_SET109_tree, root_0);
}
pushFollow(FOLLOW_field_name_in_operation_add_to_set2235);
field_name110=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name110.getTree());
pushFollow(FOLLOW_variable_literal_in_operation_add_to_set2237);
variable_literal111=variable_literal();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, variable_literal111.getTree());
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_add_to_set"
public static class operation_pop_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_pop"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:275:1: operation_pop : POP ^ field_name ;
public final MqlParser.operation_pop_return operation_pop() throws RecognitionException {
MqlParser.operation_pop_return retval = new MqlParser.operation_pop_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token POP112=null;
MqlParser.field_name_return field_name113 =null;
CommonTree POP112_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:276:2: ( POP ^ field_name )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:276:4: POP ^ field_name
{
root_0 = (CommonTree)adaptor.nil();
POP112=(Token)match(input,POP,FOLLOW_POP_in_operation_pop2250); if (state.failed) return retval;
if ( state.backtracking==0 ) {
POP112_tree =
(CommonTree)adaptor.create(POP112)
;
root_0 = (CommonTree)adaptor.becomeRoot(POP112_tree, root_0);
}
pushFollow(FOLLOW_field_name_in_operation_pop2253);
field_name113=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name113.getTree());
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_pop"
public static class operation_shift_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_shift"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:279:1: operation_shift : SHIFT ^ field_name ;
public final MqlParser.operation_shift_return operation_shift() throws RecognitionException {
MqlParser.operation_shift_return retval = new MqlParser.operation_shift_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token SHIFT114=null;
MqlParser.field_name_return field_name115 =null;
CommonTree SHIFT114_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:280:2: ( SHIFT ^ field_name )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:280:4: SHIFT ^ field_name
{
root_0 = (CommonTree)adaptor.nil();
SHIFT114=(Token)match(input,SHIFT,FOLLOW_SHIFT_in_operation_shift2265); if (state.failed) return retval;
if ( state.backtracking==0 ) {
SHIFT114_tree =
(CommonTree)adaptor.create(SHIFT114)
;
root_0 = (CommonTree)adaptor.becomeRoot(SHIFT114_tree, root_0);
}
pushFollow(FOLLOW_field_name_in_operation_shift2268);
field_name115=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name115.getTree());
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_shift"
public static class operation_pull_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_pull"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:283:1: operation_pull : PULL ^ field_name variable_literal ;
public final MqlParser.operation_pull_return operation_pull() throws RecognitionException {
MqlParser.operation_pull_return retval = new MqlParser.operation_pull_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token PULL116=null;
MqlParser.field_name_return field_name117 =null;
MqlParser.variable_literal_return variable_literal118 =null;
CommonTree PULL116_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:284:2: ( PULL ^ field_name variable_literal )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:284:4: PULL ^ field_name variable_literal
{
root_0 = (CommonTree)adaptor.nil();
PULL116=(Token)match(input,PULL,FOLLOW_PULL_in_operation_pull2281); if (state.failed) return retval;
if ( state.backtracking==0 ) {
PULL116_tree =
(CommonTree)adaptor.create(PULL116)
;
root_0 = (CommonTree)adaptor.becomeRoot(PULL116_tree, root_0);
}
pushFollow(FOLLOW_field_name_in_operation_pull2284);
field_name117=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name117.getTree());
pushFollow(FOLLOW_variable_literal_in_operation_pull2286);
variable_literal118=variable_literal();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, variable_literal118.getTree());
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_pull"
public static class operation_pull_all_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_pull_all"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:287:1: operation_pull_all : PULL ALL field_name array -> ^( PULL_ALL field_name array ) ;
public final MqlParser.operation_pull_all_return operation_pull_all() throws RecognitionException {
MqlParser.operation_pull_all_return retval = new MqlParser.operation_pull_all_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token PULL119=null;
Token ALL120=null;
MqlParser.field_name_return field_name121 =null;
MqlParser.array_return array122 =null;
CommonTree PULL119_tree=null;
CommonTree ALL120_tree=null;
RewriteRuleTokenStream stream_PULL=new RewriteRuleTokenStream(adaptor,"token PULL");
RewriteRuleTokenStream stream_ALL=new RewriteRuleTokenStream(adaptor,"token ALL");
RewriteRuleSubtreeStream stream_field_name=new RewriteRuleSubtreeStream(adaptor,"rule field_name");
RewriteRuleSubtreeStream stream_array=new RewriteRuleSubtreeStream(adaptor,"rule array");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:288:2: ( PULL ALL field_name array -> ^( PULL_ALL field_name array ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:288:4: PULL ALL field_name array
{
PULL119=(Token)match(input,PULL,FOLLOW_PULL_in_operation_pull_all2297); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_PULL.add(PULL119);
ALL120=(Token)match(input,ALL,FOLLOW_ALL_in_operation_pull_all2299); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_ALL.add(ALL120);
pushFollow(FOLLOW_field_name_in_operation_pull_all2301);
field_name121=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(field_name121.getTree());
pushFollow(FOLLOW_array_in_operation_pull_all2303);
array122=array();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_array.add(array122.getTree());
// AST REWRITE
// elements: array, field_name
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 288:30: -> ^( PULL_ALL field_name array )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:288:33: ^( PULL_ALL field_name array )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(PULL_ALL, "PULL_ALL")
, root_1);
adaptor.addChild(root_1, stream_field_name.nextTree());
adaptor.addChild(root_1, stream_array.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_pull_all"
public static class operation_rename_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_rename"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:291:1: operation_rename : RENAME ^ field_name field_name ;
public final MqlParser.operation_rename_return operation_rename() throws RecognitionException {
MqlParser.operation_rename_return retval = new MqlParser.operation_rename_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token RENAME123=null;
MqlParser.field_name_return field_name124 =null;
MqlParser.field_name_return field_name125 =null;
CommonTree RENAME123_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:292:2: ( RENAME ^ field_name field_name )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:292:4: RENAME ^ field_name field_name
{
root_0 = (CommonTree)adaptor.nil();
RENAME123=(Token)match(input,RENAME,FOLLOW_RENAME_in_operation_rename2324); if (state.failed) return retval;
if ( state.backtracking==0 ) {
RENAME123_tree =
(CommonTree)adaptor.create(RENAME123)
;
root_0 = (CommonTree)adaptor.becomeRoot(RENAME123_tree, root_0);
}
pushFollow(FOLLOW_field_name_in_operation_rename2327);
field_name124=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name124.getTree());
pushFollow(FOLLOW_field_name_in_operation_rename2329);
field_name125=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name125.getTree());
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_rename"
public static class operation_bitwise_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "operation_bitwise"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:295:1: operation_bitwise : BITWISE ^ ( OR | AND ) field_name INTEGER ;
public final MqlParser.operation_bitwise_return operation_bitwise() throws RecognitionException {
MqlParser.operation_bitwise_return retval = new MqlParser.operation_bitwise_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token BITWISE126=null;
Token set127=null;
Token INTEGER129=null;
MqlParser.field_name_return field_name128 =null;
CommonTree BITWISE126_tree=null;
CommonTree set127_tree=null;
CommonTree INTEGER129_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:296:2: ( BITWISE ^ ( OR | AND ) field_name INTEGER )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:296:4: BITWISE ^ ( OR | AND ) field_name INTEGER
{
root_0 = (CommonTree)adaptor.nil();
BITWISE126=(Token)match(input,BITWISE,FOLLOW_BITWISE_in_operation_bitwise2340); if (state.failed) return retval;
if ( state.backtracking==0 ) {
BITWISE126_tree =
(CommonTree)adaptor.create(BITWISE126)
;
root_0 = (CommonTree)adaptor.becomeRoot(BITWISE126_tree, root_0);
}
set127=(Token)input.LT(1);
if ( input.LA(1)==AND||input.LA(1)==OR ) {
input.consume();
if ( state.backtracking==0 ) adaptor.addChild(root_0,
(CommonTree)adaptor.create(set127)
);
state.errorRecovery=false;
state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
pushFollow(FOLLOW_field_name_in_operation_bitwise2351);
field_name128=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, field_name128.getTree());
INTEGER129=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_operation_bitwise2353); if (state.failed) return retval;
if ( state.backtracking==0 ) {
INTEGER129_tree =
(CommonTree)adaptor.create(INTEGER129)
;
adaptor.addChild(root_0, INTEGER129_tree);
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "operation_bitwise"
public static class sort_field_list_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "sort_field_list"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:300:1: sort_field_list : SORT s+= sort_field ( ( COMMA )? s+= sort_field )* -> ^( SORT ( $s)+ ) ;
public final MqlParser.sort_field_list_return sort_field_list() throws RecognitionException {
MqlParser.sort_field_list_return retval = new MqlParser.sort_field_list_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token SORT130=null;
Token COMMA131=null;
List list_s=null;
RuleReturnScope s = null;
CommonTree SORT130_tree=null;
CommonTree COMMA131_tree=null;
RewriteRuleTokenStream stream_SORT=new RewriteRuleTokenStream(adaptor,"token SORT");
RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
RewriteRuleSubtreeStream stream_sort_field=new RewriteRuleSubtreeStream(adaptor,"rule sort_field");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:301:2: ( SORT s+= sort_field ( ( COMMA )? s+= sort_field )* -> ^( SORT ( $s)+ ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:301:4: SORT s+= sort_field ( ( COMMA )? s+= sort_field )*
{
SORT130=(Token)match(input,SORT,FOLLOW_SORT_in_sort_field_list2367); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_SORT.add(SORT130);
pushFollow(FOLLOW_sort_field_in_sort_field_list2371);
s=sort_field();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_sort_field.add(s.getTree());
if (list_s==null) list_s=new ArrayList();
list_s.add(s.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:301:23: ( ( COMMA )? s+= sort_field )*
loop40:
do {
int alt40=2;
int LA40_0 = input.LA(1);
if ( (LA40_0==COMMA||LA40_0==SCHEMA_IDENTIFIER) ) {
alt40=1;
}
switch (alt40) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:301:24: ( COMMA )? s+= sort_field
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:301:24: ( COMMA )?
int alt39=2;
int LA39_0 = input.LA(1);
if ( (LA39_0==COMMA) ) {
alt39=1;
}
switch (alt39) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:301:24: COMMA
{
COMMA131=(Token)match(input,COMMA,FOLLOW_COMMA_in_sort_field_list2374); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA131);
}
break;
}
pushFollow(FOLLOW_sort_field_in_sort_field_list2379);
s=sort_field();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_sort_field.add(s.getTree());
if (list_s==null) list_s=new ArrayList();
list_s.add(s.getTree());
}
break;
default :
break loop40;
}
} while (true);
// AST REWRITE
// elements: s, SORT
// token labels:
// rule labels: retval
// token list labels:
// rule list labels: s
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_s=new RewriteRuleSubtreeStream(adaptor,"token s",list_s);
root_0 = (CommonTree)adaptor.nil();
// 301:47: -> ^( SORT ( $s)+ )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:301:50: ^( SORT ( $s)+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
stream_SORT.nextNode()
, root_1);
if ( !(stream_s.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_s.hasNext() ) {
adaptor.addChild(root_1, stream_s.nextTree());
}
stream_s.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "sort_field_list"
public static class sort_field_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "sort_field"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:304:1: sort_field : field_name ( direction )? -> ^( SORT_FILED field_name ( direction )? ) ;
public final MqlParser.sort_field_return sort_field() throws RecognitionException {
MqlParser.sort_field_return retval = new MqlParser.sort_field_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.field_name_return field_name132 =null;
MqlParser.direction_return direction133 =null;
RewriteRuleSubtreeStream stream_field_name=new RewriteRuleSubtreeStream(adaptor,"rule field_name");
RewriteRuleSubtreeStream stream_direction=new RewriteRuleSubtreeStream(adaptor,"rule direction");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:305:2: ( field_name ( direction )? -> ^( SORT_FILED field_name ( direction )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:305:4: field_name ( direction )?
{
pushFollow(FOLLOW_field_name_in_sort_field2402);
field_name132=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(field_name132.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:305:15: ( direction )?
int alt41=2;
int LA41_0 = input.LA(1);
if ( (LA41_0==ASC||LA41_0==DESC) ) {
alt41=1;
}
switch (alt41) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:305:15: direction
{
pushFollow(FOLLOW_direction_in_sort_field2404);
direction133=direction();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_direction.add(direction133.getTree());
}
break;
}
// AST REWRITE
// elements: direction, field_name
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 305:26: -> ^( SORT_FILED field_name ( direction )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:305:29: ^( SORT_FILED field_name ( direction )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(SORT_FILED, "SORT_FILED")
, root_1);
adaptor.addChild(root_1, stream_field_name.nextTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:305:53: ( direction )?
if ( stream_direction.hasNext() ) {
adaptor.addChild(root_1, stream_direction.nextTree());
}
stream_direction.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "sort_field"
public static class collection_name_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "collection_name"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:310:1: collection_name : SCHEMA_IDENTIFIER ;
public final MqlParser.collection_name_return collection_name() throws RecognitionException {
MqlParser.collection_name_return retval = new MqlParser.collection_name_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token SCHEMA_IDENTIFIER134=null;
CommonTree SCHEMA_IDENTIFIER134_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:311:2: ( SCHEMA_IDENTIFIER )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:311:4: SCHEMA_IDENTIFIER
{
root_0 = (CommonTree)adaptor.nil();
SCHEMA_IDENTIFIER134=(Token)match(input,SCHEMA_IDENTIFIER,FOLLOW_SCHEMA_IDENTIFIER_in_collection_name2430); if (state.failed) return retval;
if ( state.backtracking==0 ) {
SCHEMA_IDENTIFIER134_tree =
(CommonTree)adaptor.create(SCHEMA_IDENTIFIER134)
;
adaptor.addChild(root_0, SCHEMA_IDENTIFIER134_tree);
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "collection_name"
public static class field_name_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "field_name"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:314:1: field_name : SCHEMA_IDENTIFIER ;
public final MqlParser.field_name_return field_name() throws RecognitionException {
MqlParser.field_name_return retval = new MqlParser.field_name_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token SCHEMA_IDENTIFIER135=null;
CommonTree SCHEMA_IDENTIFIER135_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:315:2: ( SCHEMA_IDENTIFIER )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:315:4: SCHEMA_IDENTIFIER
{
root_0 = (CommonTree)adaptor.nil();
SCHEMA_IDENTIFIER135=(Token)match(input,SCHEMA_IDENTIFIER,FOLLOW_SCHEMA_IDENTIFIER_in_field_name2443); if (state.failed) return retval;
if ( state.backtracking==0 ) {
SCHEMA_IDENTIFIER135_tree =
(CommonTree)adaptor.create(SCHEMA_IDENTIFIER135)
;
adaptor.addChild(root_0, SCHEMA_IDENTIFIER135_tree);
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "field_name"
public static class field_list_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "field_list"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:318:1: field_list : f= field_name ( ( COMMA )? f= field_name )* -> ^( FIELD_LIST ( $f)+ ) ;
public final MqlParser.field_list_return field_list() throws RecognitionException {
MqlParser.field_list_return retval = new MqlParser.field_list_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token COMMA136=null;
MqlParser.field_name_return f =null;
CommonTree COMMA136_tree=null;
RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
RewriteRuleSubtreeStream stream_field_name=new RewriteRuleSubtreeStream(adaptor,"rule field_name");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:319:2: (f= field_name ( ( COMMA )? f= field_name )* -> ^( FIELD_LIST ( $f)+ ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:319:4: f= field_name ( ( COMMA )? f= field_name )*
{
pushFollow(FOLLOW_field_name_in_field_list2456);
f=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(f.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:319:17: ( ( COMMA )? f= field_name )*
loop43:
do {
int alt43=2;
int LA43_0 = input.LA(1);
if ( (LA43_0==COMMA||LA43_0==SCHEMA_IDENTIFIER) ) {
alt43=1;
}
switch (alt43) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:319:18: ( COMMA )? f= field_name
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:319:18: ( COMMA )?
int alt42=2;
int LA42_0 = input.LA(1);
if ( (LA42_0==COMMA) ) {
alt42=1;
}
switch (alt42) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:319:18: COMMA
{
COMMA136=(Token)match(input,COMMA,FOLLOW_COMMA_in_field_list2459); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA136);
}
break;
}
pushFollow(FOLLOW_field_name_in_field_list2464);
f=field_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_field_name.add(f.getTree());
}
break;
default :
break loop43;
}
} while (true);
// AST REWRITE
// elements: f
// token labels:
// rule labels: f, retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_f=new RewriteRuleSubtreeStream(adaptor,"rule f",f!=null?f.tree:null);
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 319:40: -> ^( FIELD_LIST ( $f)+ )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:319:43: ^( FIELD_LIST ( $f)+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(FIELD_LIST, "FIELD_LIST")
, root_1);
if ( !(stream_f.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_f.hasNext() ) {
adaptor.addChild(root_1, stream_f.nextTree());
}
stream_f.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "field_list"
public static class function_name_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "function_name"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:322:1: function_name : ( SCHEMA_IDENTIFIER | ALL | OR | AND );
public final MqlParser.function_name_return function_name() throws RecognitionException {
MqlParser.function_name_return retval = new MqlParser.function_name_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token set137=null;
CommonTree set137_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:323:2: ( SCHEMA_IDENTIFIER | ALL | OR | AND )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:
{
root_0 = (CommonTree)adaptor.nil();
set137=(Token)input.LT(1);
if ( (input.LA(1) >= ALL && input.LA(1) <= AND)||input.LA(1)==OR||input.LA(1)==SCHEMA_IDENTIFIER ) {
input.consume();
if ( state.backtracking==0 ) adaptor.addChild(root_0,
(CommonTree)adaptor.create(set137)
);
state.errorRecovery=false;
state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "function_name"
public static class comparison_operator_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "comparison_operator"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:326:1: comparison_operator : ( MATCHES | EQUALS | NOT_EQUALS | LT_GT | GT | LT | GT_EQUALS | LT_EQUALS ) ;
public final MqlParser.comparison_operator_return comparison_operator() throws RecognitionException {
MqlParser.comparison_operator_return retval = new MqlParser.comparison_operator_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token set138=null;
CommonTree set138_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:327:2: ( ( MATCHES | EQUALS | NOT_EQUALS | LT_GT | GT | LT | GT_EQUALS | LT_EQUALS ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:
{
root_0 = (CommonTree)adaptor.nil();
set138=(Token)input.LT(1);
if ( input.LA(1)==EQUALS||(input.LA(1) >= GT && input.LA(1) <= GT_EQUALS)||(input.LA(1) >= LT && input.LA(1) <= LT_GT)||input.LA(1)==MATCHES||input.LA(1)==NOT_EQUALS ) {
input.consume();
if ( state.backtracking==0 ) adaptor.addChild(root_0,
(CommonTree)adaptor.create(set138)
);
state.errorRecovery=false;
state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "comparison_operator"
public static class variable_literal_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "variable_literal"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:330:1: variable_literal : ( parameter | regex | string | bool | number | array | variable_function_call ) ;
public final MqlParser.variable_literal_return variable_literal() throws RecognitionException {
MqlParser.variable_literal_return retval = new MqlParser.variable_literal_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.parameter_return parameter139 =null;
MqlParser.regex_return regex140 =null;
MqlParser.string_return string141 =null;
MqlParser.bool_return bool142 =null;
MqlParser.number_return number143 =null;
MqlParser.array_return array144 =null;
MqlParser.variable_function_call_return variable_function_call145 =null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:2: ( ( parameter | regex | string | bool | number | array | variable_function_call ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:4: ( parameter | regex | string | bool | number | array | variable_function_call )
{
root_0 = (CommonTree)adaptor.nil();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:4: ( parameter | regex | string | bool | number | array | variable_function_call )
int alt44=7;
switch ( input.LA(1) ) {
case COLON:
case QUESTION_MARK:
{
alt44=1;
}
break;
case REGEX:
{
alt44=2;
}
break;
case DOUBLE_QUOTED_STRING:
case SINGLE_QUOTED_STRING:
{
alt44=3;
}
break;
case FALSE:
case TRUE:
{
alt44=4;
}
break;
case DECIMAL:
case HEX_NUMBER:
case INTEGER:
case SIGNED_DECIMAL:
case SIGNED_INTEGER:
{
alt44=5;
}
break;
case L_BRACKET:
{
alt44=6;
}
break;
case ALL:
case AND:
case OR:
case SCHEMA_IDENTIFIER:
{
alt44=7;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 44, 0, input);
throw nvae;
}
switch (alt44) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:5: parameter
{
pushFollow(FOLLOW_parameter_in_variable_literal2552);
parameter139=parameter();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, parameter139.getTree());
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:17: regex
{
pushFollow(FOLLOW_regex_in_variable_literal2556);
regex140=regex();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, regex140.getTree());
}
break;
case 3 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:25: string
{
pushFollow(FOLLOW_string_in_variable_literal2560);
string141=string();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, string141.getTree());
}
break;
case 4 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:34: bool
{
pushFollow(FOLLOW_bool_in_variable_literal2564);
bool142=bool();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, bool142.getTree());
}
break;
case 5 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:41: number
{
pushFollow(FOLLOW_number_in_variable_literal2568);
number143=number();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, number143.getTree());
}
break;
case 6 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:50: array
{
pushFollow(FOLLOW_array_in_variable_literal2572);
array144=array();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, array144.getTree());
}
break;
case 7 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:331:58: variable_function_call
{
pushFollow(FOLLOW_variable_function_call_in_variable_literal2576);
variable_function_call145=variable_function_call();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, variable_function_call145.getTree());
}
break;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "variable_literal"
public static class variable_list_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "variable_list"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:334:1: variable_list :v+= variable_literal ( COMMA v+= variable_literal )* -> ^( VARIABLE_LIST ( $v)+ ) ;
public final MqlParser.variable_list_return variable_list() throws RecognitionException {
MqlParser.variable_list_return retval = new MqlParser.variable_list_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token COMMA146=null;
List list_v=null;
RuleReturnScope v = null;
CommonTree COMMA146_tree=null;
RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
RewriteRuleSubtreeStream stream_variable_literal=new RewriteRuleSubtreeStream(adaptor,"rule variable_literal");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:335:2: (v+= variable_literal ( COMMA v+= variable_literal )* -> ^( VARIABLE_LIST ( $v)+ ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:335:4: v+= variable_literal ( COMMA v+= variable_literal )*
{
pushFollow(FOLLOW_variable_literal_in_variable_list2590);
v=variable_literal();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_variable_literal.add(v.getTree());
if (list_v==null) list_v=new ArrayList();
list_v.add(v.getTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:335:24: ( COMMA v+= variable_literal )*
loop45:
do {
int alt45=2;
int LA45_0 = input.LA(1);
if ( (LA45_0==COMMA) ) {
alt45=1;
}
switch (alt45) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:335:25: COMMA v+= variable_literal
{
COMMA146=(Token)match(input,COMMA,FOLLOW_COMMA_in_variable_list2593); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COMMA.add(COMMA146);
pushFollow(FOLLOW_variable_literal_in_variable_list2597);
v=variable_literal();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_variable_literal.add(v.getTree());
if (list_v==null) list_v=new ArrayList();
list_v.add(v.getTree());
}
break;
default :
break loop45;
}
} while (true);
// AST REWRITE
// elements: v
// token labels:
// rule labels: retval
// token list labels:
// rule list labels: v
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_v=new RewriteRuleSubtreeStream(adaptor,"token v",list_v);
root_0 = (CommonTree)adaptor.nil();
// 335:53: -> ^( VARIABLE_LIST ( $v)+ )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:335:56: ^( VARIABLE_LIST ( $v)+ )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(VARIABLE_LIST, "VARIABLE_LIST")
, root_1);
if ( !(stream_v.hasNext()) ) {
throw new RewriteEarlyExitException();
}
while ( stream_v.hasNext() ) {
adaptor.addChild(root_1, stream_v.nextTree());
}
stream_v.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "variable_list"
public static class function_call_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "function_call"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:338:1: function_call : function_name L_PAREN ( criteria_group_list | criteria | variable_list )? R_PAREN -> ^( FUNCTION_CALL function_name ( criteria_group_list )? ( criteria )? ( variable_list )? ) ;
public final MqlParser.function_call_return function_call() throws RecognitionException {
MqlParser.function_call_return retval = new MqlParser.function_call_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token L_PAREN148=null;
Token R_PAREN152=null;
MqlParser.function_name_return function_name147 =null;
MqlParser.criteria_group_list_return criteria_group_list149 =null;
MqlParser.criteria_return criteria150 =null;
MqlParser.variable_list_return variable_list151 =null;
CommonTree L_PAREN148_tree=null;
CommonTree R_PAREN152_tree=null;
RewriteRuleTokenStream stream_R_PAREN=new RewriteRuleTokenStream(adaptor,"token R_PAREN");
RewriteRuleTokenStream stream_L_PAREN=new RewriteRuleTokenStream(adaptor,"token L_PAREN");
RewriteRuleSubtreeStream stream_variable_list=new RewriteRuleSubtreeStream(adaptor,"rule variable_list");
RewriteRuleSubtreeStream stream_criteria=new RewriteRuleSubtreeStream(adaptor,"rule criteria");
RewriteRuleSubtreeStream stream_criteria_group_list=new RewriteRuleSubtreeStream(adaptor,"rule criteria_group_list");
RewriteRuleSubtreeStream stream_function_name=new RewriteRuleSubtreeStream(adaptor,"rule function_name");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:2: ( function_name L_PAREN ( criteria_group_list | criteria | variable_list )? R_PAREN -> ^( FUNCTION_CALL function_name ( criteria_group_list )? ( criteria )? ( variable_list )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:4: function_name L_PAREN ( criteria_group_list | criteria | variable_list )? R_PAREN
{
pushFollow(FOLLOW_function_name_in_function_call2620);
function_name147=function_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_function_name.add(function_name147.getTree());
L_PAREN148=(Token)match(input,L_PAREN,FOLLOW_L_PAREN_in_function_call2622); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_L_PAREN.add(L_PAREN148);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:26: ( criteria_group_list | criteria | variable_list )?
int alt46=4;
switch ( input.LA(1) ) {
case L_PAREN:
{
alt46=1;
}
break;
case SCHEMA_IDENTIFIER:
{
int LA46_2 = input.LA(2);
if ( (synpred81_Mql()) ) {
alt46=2;
}
else if ( (synpred82_Mql()) ) {
alt46=3;
}
}
break;
case NOT:
{
alt46=2;
}
break;
case ALL:
case AND:
case OR:
{
int LA46_4 = input.LA(2);
if ( (synpred81_Mql()) ) {
alt46=2;
}
else if ( (synpred82_Mql()) ) {
alt46=3;
}
}
break;
case COLON:
case DECIMAL:
case DOUBLE_QUOTED_STRING:
case FALSE:
case HEX_NUMBER:
case INTEGER:
case L_BRACKET:
case QUESTION_MARK:
case REGEX:
case SIGNED_DECIMAL:
case SIGNED_INTEGER:
case SINGLE_QUOTED_STRING:
case TRUE:
{
alt46=3;
}
break;
}
switch (alt46) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:27: criteria_group_list
{
pushFollow(FOLLOW_criteria_group_list_in_function_call2625);
criteria_group_list149=criteria_group_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_criteria_group_list.add(criteria_group_list149.getTree());
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:48: criteria
{
pushFollow(FOLLOW_criteria_in_function_call2628);
criteria150=criteria();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_criteria.add(criteria150.getTree());
}
break;
case 3 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:59: variable_list
{
pushFollow(FOLLOW_variable_list_in_function_call2632);
variable_list151=variable_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_variable_list.add(variable_list151.getTree());
}
break;
}
R_PAREN152=(Token)match(input,R_PAREN,FOLLOW_R_PAREN_in_function_call2636); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_R_PAREN.add(R_PAREN152);
// AST REWRITE
// elements: criteria_group_list, criteria, variable_list, function_name
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 339:83: -> ^( FUNCTION_CALL function_name ( criteria_group_list )? ( criteria )? ( variable_list )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:86: ^( FUNCTION_CALL function_name ( criteria_group_list )? ( criteria )? ( variable_list )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(FUNCTION_CALL, "FUNCTION_CALL")
, root_1);
adaptor.addChild(root_1, stream_function_name.nextTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:116: ( criteria_group_list )?
if ( stream_criteria_group_list.hasNext() ) {
adaptor.addChild(root_1, stream_criteria_group_list.nextTree());
}
stream_criteria_group_list.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:137: ( criteria )?
if ( stream_criteria.hasNext() ) {
adaptor.addChild(root_1, stream_criteria.nextTree());
}
stream_criteria.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:147: ( variable_list )?
if ( stream_variable_list.hasNext() ) {
adaptor.addChild(root_1, stream_variable_list.nextTree());
}
stream_variable_list.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "function_call"
public static class variable_function_call_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "variable_function_call"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:342:1: variable_function_call : function_name L_PAREN ( variable_list )? R_PAREN -> ^( FUNCTION_CALL function_name ( variable_list )? ) ;
public final MqlParser.variable_function_call_return variable_function_call() throws RecognitionException {
MqlParser.variable_function_call_return retval = new MqlParser.variable_function_call_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token L_PAREN154=null;
Token R_PAREN156=null;
MqlParser.function_name_return function_name153 =null;
MqlParser.variable_list_return variable_list155 =null;
CommonTree L_PAREN154_tree=null;
CommonTree R_PAREN156_tree=null;
RewriteRuleTokenStream stream_R_PAREN=new RewriteRuleTokenStream(adaptor,"token R_PAREN");
RewriteRuleTokenStream stream_L_PAREN=new RewriteRuleTokenStream(adaptor,"token L_PAREN");
RewriteRuleSubtreeStream stream_variable_list=new RewriteRuleSubtreeStream(adaptor,"rule variable_list");
RewriteRuleSubtreeStream stream_function_name=new RewriteRuleSubtreeStream(adaptor,"rule function_name");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:343:3: ( function_name L_PAREN ( variable_list )? R_PAREN -> ^( FUNCTION_CALL function_name ( variable_list )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:343:5: function_name L_PAREN ( variable_list )? R_PAREN
{
pushFollow(FOLLOW_function_name_in_variable_function_call2665);
function_name153=function_name();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_function_name.add(function_name153.getTree());
L_PAREN154=(Token)match(input,L_PAREN,FOLLOW_L_PAREN_in_variable_function_call2667); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_L_PAREN.add(L_PAREN154);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:343:27: ( variable_list )?
int alt47=2;
int LA47_0 = input.LA(1);
if ( ((LA47_0 >= ALL && LA47_0 <= AND)||LA47_0==COLON||LA47_0==DECIMAL||LA47_0==DOUBLE_QUOTED_STRING||LA47_0==FALSE||LA47_0==HEX_NUMBER||LA47_0==INTEGER||LA47_0==L_BRACKET||LA47_0==OR||(LA47_0 >= QUESTION_MARK && LA47_0 <= REGEX)||LA47_0==SCHEMA_IDENTIFIER||(LA47_0 >= SIGNED_DECIMAL && LA47_0 <= SINGLE_QUOTED_STRING)||LA47_0==TRUE) ) {
alt47=1;
}
switch (alt47) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:343:27: variable_list
{
pushFollow(FOLLOW_variable_list_in_variable_function_call2669);
variable_list155=variable_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_variable_list.add(variable_list155.getTree());
}
break;
}
R_PAREN156=(Token)match(input,R_PAREN,FOLLOW_R_PAREN_in_variable_function_call2672); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_R_PAREN.add(R_PAREN156);
// AST REWRITE
// elements: variable_list, function_name
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 343:50: -> ^( FUNCTION_CALL function_name ( variable_list )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:343:53: ^( FUNCTION_CALL function_name ( variable_list )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(FUNCTION_CALL, "FUNCTION_CALL")
, root_1);
adaptor.addChild(root_1, stream_function_name.nextTree());
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:343:83: ( variable_list )?
if ( stream_variable_list.hasNext() ) {
adaptor.addChild(root_1, stream_variable_list.nextTree());
}
stream_variable_list.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "variable_function_call"
public static class integer_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "integer"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:346:1: integer : ( SIGNED_INTEGER | INTEGER ) ;
public final MqlParser.integer_return integer() throws RecognitionException {
MqlParser.integer_return retval = new MqlParser.integer_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token set157=null;
CommonTree set157_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:347:2: ( ( SIGNED_INTEGER | INTEGER ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:
{
root_0 = (CommonTree)adaptor.nil();
set157=(Token)input.LT(1);
if ( input.LA(1)==INTEGER||input.LA(1)==SIGNED_INTEGER ) {
input.consume();
if ( state.backtracking==0 ) adaptor.addChild(root_0,
(CommonTree)adaptor.create(set157)
);
state.errorRecovery=false;
state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "integer"
public static class decimal_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "decimal"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:350:1: decimal : ( SIGNED_DECIMAL | DECIMAL ) ;
public final MqlParser.decimal_return decimal() throws RecognitionException {
MqlParser.decimal_return retval = new MqlParser.decimal_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token set158=null;
CommonTree set158_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:351:2: ( ( SIGNED_DECIMAL | DECIMAL ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:
{
root_0 = (CommonTree)adaptor.nil();
set158=(Token)input.LT(1);
if ( input.LA(1)==DECIMAL||input.LA(1)==SIGNED_DECIMAL ) {
input.consume();
if ( state.backtracking==0 ) adaptor.addChild(root_0,
(CommonTree)adaptor.create(set158)
);
state.errorRecovery=false;
state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "decimal"
public static class number_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "number"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:354:1: number : ( HEX_NUMBER | integer | decimal ) ;
public final MqlParser.number_return number() throws RecognitionException {
MqlParser.number_return retval = new MqlParser.number_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token HEX_NUMBER159=null;
MqlParser.integer_return integer160 =null;
MqlParser.decimal_return decimal161 =null;
CommonTree HEX_NUMBER159_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:355:2: ( ( HEX_NUMBER | integer | decimal ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:355:4: ( HEX_NUMBER | integer | decimal )
{
root_0 = (CommonTree)adaptor.nil();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:355:4: ( HEX_NUMBER | integer | decimal )
int alt48=3;
switch ( input.LA(1) ) {
case HEX_NUMBER:
{
alt48=1;
}
break;
case INTEGER:
case SIGNED_INTEGER:
{
alt48=2;
}
break;
case DECIMAL:
case SIGNED_DECIMAL:
{
alt48=3;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 48, 0, input);
throw nvae;
}
switch (alt48) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:355:5: HEX_NUMBER
{
HEX_NUMBER159=(Token)match(input,HEX_NUMBER,FOLLOW_HEX_NUMBER_in_number2730); if (state.failed) return retval;
if ( state.backtracking==0 ) {
HEX_NUMBER159_tree =
(CommonTree)adaptor.create(HEX_NUMBER159)
;
adaptor.addChild(root_0, HEX_NUMBER159_tree);
}
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:355:18: integer
{
pushFollow(FOLLOW_integer_in_number2734);
integer160=integer();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, integer160.getTree());
}
break;
case 3 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:355:28: decimal
{
pushFollow(FOLLOW_decimal_in_number2738);
decimal161=decimal();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, decimal161.getTree());
}
break;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "number"
public static class direction_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "direction"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:358:1: direction : ( ASC | DESC ) ;
public final MqlParser.direction_return direction() throws RecognitionException {
MqlParser.direction_return retval = new MqlParser.direction_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token set162=null;
CommonTree set162_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:359:2: ( ( ASC | DESC ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:
{
root_0 = (CommonTree)adaptor.nil();
set162=(Token)input.LT(1);
if ( input.LA(1)==ASC||input.LA(1)==DESC ) {
input.consume();
if ( state.backtracking==0 ) adaptor.addChild(root_0,
(CommonTree)adaptor.create(set162)
);
state.errorRecovery=false;
state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "direction"
public static class array_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "array"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:362:1: array : L_BRACKET ( variable_list )? R_BRACKET -> ^( ARRAY variable_list ) ;
public final MqlParser.array_return array() throws RecognitionException {
MqlParser.array_return retval = new MqlParser.array_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token L_BRACKET163=null;
Token R_BRACKET165=null;
MqlParser.variable_list_return variable_list164 =null;
CommonTree L_BRACKET163_tree=null;
CommonTree R_BRACKET165_tree=null;
RewriteRuleTokenStream stream_L_BRACKET=new RewriteRuleTokenStream(adaptor,"token L_BRACKET");
RewriteRuleTokenStream stream_R_BRACKET=new RewriteRuleTokenStream(adaptor,"token R_BRACKET");
RewriteRuleSubtreeStream stream_variable_list=new RewriteRuleSubtreeStream(adaptor,"rule variable_list");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:363:2: ( L_BRACKET ( variable_list )? R_BRACKET -> ^( ARRAY variable_list ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:363:4: L_BRACKET ( variable_list )? R_BRACKET
{
L_BRACKET163=(Token)match(input,L_BRACKET,FOLLOW_L_BRACKET_in_array2768); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_L_BRACKET.add(L_BRACKET163);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:363:14: ( variable_list )?
int alt49=2;
int LA49_0 = input.LA(1);
if ( ((LA49_0 >= ALL && LA49_0 <= AND)||LA49_0==COLON||LA49_0==DECIMAL||LA49_0==DOUBLE_QUOTED_STRING||LA49_0==FALSE||LA49_0==HEX_NUMBER||LA49_0==INTEGER||LA49_0==L_BRACKET||LA49_0==OR||(LA49_0 >= QUESTION_MARK && LA49_0 <= REGEX)||LA49_0==SCHEMA_IDENTIFIER||(LA49_0 >= SIGNED_DECIMAL && LA49_0 <= SINGLE_QUOTED_STRING)||LA49_0==TRUE) ) {
alt49=1;
}
switch (alt49) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:363:14: variable_list
{
pushFollow(FOLLOW_variable_list_in_array2770);
variable_list164=variable_list();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_variable_list.add(variable_list164.getTree());
}
break;
}
R_BRACKET165=(Token)match(input,R_BRACKET,FOLLOW_R_BRACKET_in_array2773); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_R_BRACKET.add(R_BRACKET165);
// AST REWRITE
// elements: variable_list
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 363:39: -> ^( ARRAY variable_list )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:363:42: ^( ARRAY variable_list )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(ARRAY, "ARRAY")
, root_1);
adaptor.addChild(root_1, stream_variable_list.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "array"
public static class regex_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "regex"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:366:1: regex : REGEX ;
public final MqlParser.regex_return regex() throws RecognitionException {
MqlParser.regex_return retval = new MqlParser.regex_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token REGEX166=null;
CommonTree REGEX166_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:367:2: ( REGEX )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:367:4: REGEX
{
root_0 = (CommonTree)adaptor.nil();
REGEX166=(Token)match(input,REGEX,FOLLOW_REGEX_in_regex2792); if (state.failed) return retval;
if ( state.backtracking==0 ) {
REGEX166_tree =
(CommonTree)adaptor.create(REGEX166)
;
adaptor.addChild(root_0, REGEX166_tree);
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "regex"
public static class string_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "string"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:370:1: string : ( DOUBLE_QUOTED_STRING | SINGLE_QUOTED_STRING ) ;
public final MqlParser.string_return string() throws RecognitionException {
MqlParser.string_return retval = new MqlParser.string_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token set167=null;
CommonTree set167_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:371:2: ( ( DOUBLE_QUOTED_STRING | SINGLE_QUOTED_STRING ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:
{
root_0 = (CommonTree)adaptor.nil();
set167=(Token)input.LT(1);
if ( input.LA(1)==DOUBLE_QUOTED_STRING||input.LA(1)==SINGLE_QUOTED_STRING ) {
input.consume();
if ( state.backtracking==0 ) adaptor.addChild(root_0,
(CommonTree)adaptor.create(set167)
);
state.errorRecovery=false;
state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "string"
public static class bool_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "bool"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:374:1: bool : ( TRUE | FALSE ) ;
public final MqlParser.bool_return bool() throws RecognitionException {
MqlParser.bool_return retval = new MqlParser.bool_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token set168=null;
CommonTree set168_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:375:2: ( ( TRUE | FALSE ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:
{
root_0 = (CommonTree)adaptor.nil();
set168=(Token)input.LT(1);
if ( input.LA(1)==FALSE||input.LA(1)==TRUE ) {
input.consume();
if ( state.backtracking==0 ) adaptor.addChild(root_0,
(CommonTree)adaptor.create(set168)
);
state.errorRecovery=false;
state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "bool"
public static class parameter_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "parameter"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:378:1: parameter : ( named_parameter | indexed_parameter ) -> ^( PARAMETER ( named_parameter )? ( indexed_parameter )? ) ;
public final MqlParser.parameter_return parameter() throws RecognitionException {
MqlParser.parameter_return retval = new MqlParser.parameter_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
MqlParser.named_parameter_return named_parameter169 =null;
MqlParser.indexed_parameter_return indexed_parameter170 =null;
RewriteRuleSubtreeStream stream_indexed_parameter=new RewriteRuleSubtreeStream(adaptor,"rule indexed_parameter");
RewriteRuleSubtreeStream stream_named_parameter=new RewriteRuleSubtreeStream(adaptor,"rule named_parameter");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:379:2: ( ( named_parameter | indexed_parameter ) -> ^( PARAMETER ( named_parameter )? ( indexed_parameter )? ) )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:379:4: ( named_parameter | indexed_parameter )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:379:4: ( named_parameter | indexed_parameter )
int alt50=2;
int LA50_0 = input.LA(1);
if ( (LA50_0==COLON) ) {
alt50=1;
}
else if ( (LA50_0==QUESTION_MARK) ) {
alt50=2;
}
else {
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 50, 0, input);
throw nvae;
}
switch (alt50) {
case 1 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:379:5: named_parameter
{
pushFollow(FOLLOW_named_parameter_in_parameter2838);
named_parameter169=named_parameter();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_named_parameter.add(named_parameter169.getTree());
}
break;
case 2 :
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:379:23: indexed_parameter
{
pushFollow(FOLLOW_indexed_parameter_in_parameter2842);
indexed_parameter170=indexed_parameter();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_indexed_parameter.add(indexed_parameter170.getTree());
}
break;
}
// AST REWRITE
// elements: indexed_parameter, named_parameter
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 379:42: -> ^( PARAMETER ( named_parameter )? ( indexed_parameter )? )
{
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:379:45: ^( PARAMETER ( named_parameter )? ( indexed_parameter )? )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(
(CommonTree)adaptor.create(PARAMETER, "PARAMETER")
, root_1);
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:379:57: ( named_parameter )?
if ( stream_named_parameter.hasNext() ) {
adaptor.addChild(root_1, stream_named_parameter.nextTree());
}
stream_named_parameter.reset();
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:379:74: ( indexed_parameter )?
if ( stream_indexed_parameter.hasNext() ) {
adaptor.addChild(root_1, stream_indexed_parameter.nextTree());
}
stream_indexed_parameter.reset();
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "parameter"
public static class named_parameter_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "named_parameter"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:382:1: named_parameter : COLON SCHEMA_IDENTIFIER -> SCHEMA_IDENTIFIER ;
public final MqlParser.named_parameter_return named_parameter() throws RecognitionException {
MqlParser.named_parameter_return retval = new MqlParser.named_parameter_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token COLON171=null;
Token SCHEMA_IDENTIFIER172=null;
CommonTree COLON171_tree=null;
CommonTree SCHEMA_IDENTIFIER172_tree=null;
RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
RewriteRuleTokenStream stream_SCHEMA_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token SCHEMA_IDENTIFIER");
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:383:2: ( COLON SCHEMA_IDENTIFIER -> SCHEMA_IDENTIFIER )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:383:4: COLON SCHEMA_IDENTIFIER
{
COLON171=(Token)match(input,COLON,FOLLOW_COLON_in_named_parameter2866); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_COLON.add(COLON171);
SCHEMA_IDENTIFIER172=(Token)match(input,SCHEMA_IDENTIFIER,FOLLOW_SCHEMA_IDENTIFIER_in_named_parameter2868); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_SCHEMA_IDENTIFIER.add(SCHEMA_IDENTIFIER172);
// AST REWRITE
// elements: SCHEMA_IDENTIFIER
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 383:28: -> SCHEMA_IDENTIFIER
{
adaptor.addChild(root_0,
stream_SCHEMA_IDENTIFIER.nextNode()
);
}
retval.tree = root_0;
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "named_parameter"
public static class indexed_parameter_return extends ParserRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "indexed_parameter"
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:386:1: indexed_parameter : QUESTION_MARK ;
public final MqlParser.indexed_parameter_return indexed_parameter() throws RecognitionException {
MqlParser.indexed_parameter_return retval = new MqlParser.indexed_parameter_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token QUESTION_MARK173=null;
CommonTree QUESTION_MARK173_tree=null;
try {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:387:2: ( QUESTION_MARK )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:387:4: QUESTION_MARK
{
root_0 = (CommonTree)adaptor.nil();
QUESTION_MARK173=(Token)match(input,QUESTION_MARK,FOLLOW_QUESTION_MARK_in_indexed_parameter2883); if (state.failed) return retval;
if ( state.backtracking==0 ) {
QUESTION_MARK173_tree =
(CommonTree)adaptor.create(QUESTION_MARK173)
;
adaptor.addChild(root_0, QUESTION_MARK173_tree);
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "indexed_parameter"
// $ANTLR start synpred81_Mql
public final void synpred81_Mql_fragment() throws RecognitionException {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:48: ( criteria )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:48: criteria
{
pushFollow(FOLLOW_criteria_in_synpred81_Mql2628);
criteria();
state._fsp--;
if (state.failed) return ;
}
}
// $ANTLR end synpred81_Mql
// $ANTLR start synpred82_Mql
public final void synpred82_Mql_fragment() throws RecognitionException {
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:59: ( variable_list )
// /Users/jun/Documents/workspace/mongo-java-orm/src/main/antlr3/com/googlecode/mjorm/mql/Mql.g:339:59: variable_list
{
pushFollow(FOLLOW_variable_list_in_synpred82_Mql2632);
variable_list();
state._fsp--;
if (state.failed) return ;
}
}
// $ANTLR end synpred82_Mql
// Delegated rules
public final boolean synpred81_Mql() {
state.backtracking++;
int start = input.mark();
try {
synpred81_Mql_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred82_Mql() {
state.backtracking++;
int start = input.mark();
try {
synpred82_Mql_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public static final BitSet FOLLOW_command_in_start1156 = new BitSet(new long[]{0x0000100000000000L});
public static final BitSet FOLLOW_command_in_start1161 = new BitSet(new long[]{0x0000100000000000L});
public static final BitSet FOLLOW_EOF_in_start1165 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_FROM_in_command1188 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_collection_name_in_command1190 = new BitSet(new long[]{0x0000060401000800L,0x0000009200080000L});
public static final BitSet FOLLOW_WHERE_in_command1193 = new BitSet(new long[]{0x0000000000000180L,0x0000000000040024L});
public static final BitSet FOLLOW_criteria_in_command1195 = new BitSet(new long[]{0x0000060401000800L,0x0000001200080000L});
public static final BitSet FOLLOW_action_in_command1199 = new BitSet(new long[]{0x0000000000000002L,0x0000000000200000L});
public static final BitSet FOLLOW_SEMI_COLON_in_command1201 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_criterion_in_criteria1231 = new BitSet(new long[]{0x0000000000008182L,0x0000000000040024L});
public static final BitSet FOLLOW_COMMA_in_criteria1234 = new BitSet(new long[]{0x0000000000000180L,0x0000000000040024L});
public static final BitSet FOLLOW_criterion_in_criteria1239 = new BitSet(new long[]{0x0000000000008182L,0x0000000000040024L});
public static final BitSet FOLLOW_L_PAREN_in_criteria_group1262 = new BitSet(new long[]{0x0000000000000180L,0x0000000000040024L});
public static final BitSet FOLLOW_criteria_in_criteria_group1264 = new BitSet(new long[]{0x0000000000000000L,0x0000000000020000L});
public static final BitSet FOLLOW_R_PAREN_in_criteria_group1266 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_criteria_group_in_criteria_group_list1287 = new BitSet(new long[]{0x0800000000008002L});
public static final BitSet FOLLOW_COMMA_in_criteria_group_list1290 = new BitSet(new long[]{0x0800000000000000L});
public static final BitSet FOLLOW_criteria_group_in_criteria_group_list1295 = new BitSet(new long[]{0x0800000000008002L});
public static final BitSet FOLLOW_function_criterion_in_criterion1319 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_negated_field_criterion_in_criterion1323 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_field_criterion_in_criterion1327 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_field_function_criterion_in_field_criterion1341 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_compare_criterion_in_field_criterion1345 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_NOT_in_negated_field_criterion1359 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_criterion_in_negated_field_criterion1361 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_field_name_in_compare_criterion1381 = new BitSet(new long[]{0x1380C00100000000L,0x0000000000000008L});
public static final BitSet FOLLOW_comparison_operator_in_compare_criterion1383 = new BitSet(new long[]{0x0422002040804180L,0x0000000087043020L});
public static final BitSet FOLLOW_variable_literal_in_compare_criterion1385 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_field_name_in_field_function_criterion1409 = new BitSet(new long[]{0x0000000000000180L,0x0000000000040020L});
public static final BitSet FOLLOW_function_call_in_field_function_criterion1411 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_function_call_in_function_criterion1434 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_HINT_in_hint1456 = new BitSet(new long[]{0x8000000000000000L});
public static final BitSet FOLLOW_NATURAL_in_hint1458 = new BitSet(new long[]{0x0000000004000402L});
public static final BitSet FOLLOW_direction_in_hint1460 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_HINT_in_hint1477 = new BitSet(new long[]{0x0000000040000000L,0x0000000004000000L});
public static final BitSet FOLLOW_string_in_hint1479 = new BitSet(new long[]{0x0000000004000402L});
public static final BitSet FOLLOW_direction_in_hint1481 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_HINT_in_hint1498 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_hint_field_in_hint1502 = new BitSet(new long[]{0x0000000000008002L,0x0000000000040000L});
public static final BitSet FOLLOW_COMMA_in_hint1505 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_hint_field_in_hint1510 = new BitSet(new long[]{0x0000000000008002L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_hint_field1534 = new BitSet(new long[]{0x0000000004000400L});
public static final BitSet FOLLOW_direction_in_hint_field1536 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_select_action_in_action1561 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_explain_action_in_action1565 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_delete_action_in_action1569 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_update_action_in_action1573 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_fam_action_in_action1577 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_fad_action_in_action1581 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_EXPLAIN_in_explain_action1618 = new BitSet(new long[]{0x0004000000000002L});
public static final BitSet FOLLOW_hint_in_explain_action1620 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SELECT_in_select_action1642 = new BitSet(new long[]{0x0000000000000000L,0x0000000040040000L});
public static final BitSet FOLLOW_select_fields_in_select_action1644 = new BitSet(new long[]{0x0044000000000002L,0x0000000010000000L});
public static final BitSet FOLLOW_hint_in_select_action1646 = new BitSet(new long[]{0x0040000000000002L,0x0000000010000000L});
public static final BitSet FOLLOW_sort_field_list_in_select_action1649 = new BitSet(new long[]{0x0040000000000002L});
public static final BitSet FOLLOW_pagination_in_select_action1652 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_STAR_in_select_fields1682 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_field_name_in_select_fields1697 = new BitSet(new long[]{0x0000000000008002L,0x0000000000040000L});
public static final BitSet FOLLOW_COMMA_in_select_fields1700 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_select_fields1705 = new BitSet(new long[]{0x0000000000008002L,0x0000000000040000L});
public static final BitSet FOLLOW_LIMIT_in_pagination1729 = new BitSet(new long[]{0x0020000000004000L,0x0000000002001000L});
public static final BitSet FOLLOW_integer_in_pagination1734 = new BitSet(new long[]{0x0000000000008002L});
public static final BitSet FOLLOW_parameter_in_pagination1740 = new BitSet(new long[]{0x0000000000008002L});
public static final BitSet FOLLOW_COMMA_in_pagination1744 = new BitSet(new long[]{0x0020000000004000L,0x0000000002001000L});
public static final BitSet FOLLOW_integer_in_pagination1749 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_parameter_in_pagination1755 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_UPSERT_in_fam_action1793 = new BitSet(new long[]{0x0000040000000000L});
public static final BitSet FOLLOW_FIND_AND_MODIFY_in_fam_action1796 = new BitSet(new long[]{0x0010000000002020L,0x0000000100C0C580L});
public static final BitSet FOLLOW_fam_return_in_fam_action1798 = new BitSet(new long[]{0x0010000000002020L,0x0000000100C04580L});
public static final BitSet FOLLOW_update_operation_list_in_fam_action1801 = new BitSet(new long[]{0x0000000000000000L,0x0000000000080000L});
public static final BitSet FOLLOW_SELECT_in_fam_action1803 = new BitSet(new long[]{0x0000000000000000L,0x0000000040040000L});
public static final BitSet FOLLOW_select_fields_in_fam_action1805 = new BitSet(new long[]{0x0000000000000002L,0x0000000010000000L});
public static final BitSet FOLLOW_sort_field_list_in_fam_action1807 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RETURN_in_fam_return1840 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000012L});
public static final BitSet FOLLOW_set_in_fam_return1843 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_FIND_AND_DELETE_in_fad_action1863 = new BitSet(new long[]{0x0000000000000002L,0x0000000010080000L});
public static final BitSet FOLLOW_SELECT_in_fad_action1866 = new BitSet(new long[]{0x0000000000000000L,0x0000000040040000L});
public static final BitSet FOLLOW_select_fields_in_fad_action1868 = new BitSet(new long[]{0x0000000000000002L,0x0000000010000000L});
public static final BitSet FOLLOW_sort_field_list_in_fad_action1872 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ATOMIC_in_delete_action1897 = new BitSet(new long[]{0x0000000001000000L});
public static final BitSet FOLLOW_DELETE_in_delete_action1900 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ATOMIC_in_update_action1921 = new BitSet(new long[]{0x0000000000000000L,0x0000000200000000L});
public static final BitSet FOLLOW_UPDATE_in_update_action1924 = new BitSet(new long[]{0x4010000000002020L,0x0000000100C04580L});
public static final BitSet FOLLOW_MULTI_in_update_action1926 = new BitSet(new long[]{0x0010000000002020L,0x0000000100C04580L});
public static final BitSet FOLLOW_update_operation_list_in_update_action1929 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ATOMIC_in_update_action1948 = new BitSet(new long[]{0x0000000000000000L,0x0000001000000000L});
public static final BitSet FOLLOW_UPSERT_in_update_action1951 = new BitSet(new long[]{0x0010000000002020L,0x0000000100C04580L});
public static final BitSet FOLLOW_update_operation_list_in_update_action1953 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_update_operation_in_update_operation_list1978 = new BitSet(new long[]{0x001000000000A022L,0x0000000100C04580L});
public static final BitSet FOLLOW_COMMA_in_update_operation_list1981 = new BitSet(new long[]{0x0010000000002020L,0x0000000100C04580L});
public static final BitSet FOLLOW_update_operation_in_update_operation_list1986 = new BitSet(new long[]{0x001000000000A022L,0x0000000100C04580L});
public static final BitSet FOLLOW_operation_inc_in_update_operation2013 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_set_in_update_operation2019 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_unset_in_update_operation2026 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_push_in_update_operation2033 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_push_all_in_update_operation2040 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_add_to_set_in_update_operation2047 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_add_to_set_each_in_update_operation2053 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_pop_in_update_operation2059 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_shift_in_update_operation2065 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_pull_in_update_operation2071 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_pull_all_in_update_operation2077 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_rename_in_update_operation2083 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_operation_bitwise_in_update_operation2089 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_INC_in_operation_inc2103 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_inc2106 = new BitSet(new long[]{0x0022000000800000L,0x0000000003000000L});
public static final BitSet FOLLOW_number_in_operation_inc2108 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SET_in_operation_set2121 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_set2124 = new BitSet(new long[]{0x0000000100000000L});
public static final BitSet FOLLOW_EQUALS_in_operation_set2126 = new BitSet(new long[]{0x0422002040804180L,0x0000000087043020L});
public static final BitSet FOLLOW_variable_literal_in_operation_set2129 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_UNSET_in_operation_unset2141 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_unset2144 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_PUSH_in_operation_push2156 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_push2159 = new BitSet(new long[]{0x0422002040804180L,0x0000000087043020L});
public static final BitSet FOLLOW_variable_literal_in_operation_push2161 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_PUSH_in_operation_push_all2175 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_ALL_in_operation_push_all2177 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_push_all2179 = new BitSet(new long[]{0x0400000000000000L});
public static final BitSet FOLLOW_array_in_operation_push_all2181 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ADD_TO_SET_in_operation_add_to_set_each2205 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_add_to_set_each2207 = new BitSet(new long[]{0x0000000080000000L});
public static final BitSet FOLLOW_EACH_in_operation_add_to_set_each2209 = new BitSet(new long[]{0x0400000000000000L});
public static final BitSet FOLLOW_array_in_operation_add_to_set_each2211 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ADD_TO_SET_in_operation_add_to_set2232 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_add_to_set2235 = new BitSet(new long[]{0x0422002040804180L,0x0000000087043020L});
public static final BitSet FOLLOW_variable_literal_in_operation_add_to_set2237 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_POP_in_operation_pop2250 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_pop2253 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SHIFT_in_operation_shift2265 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_shift2268 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_PULL_in_operation_pull2281 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_pull2284 = new BitSet(new long[]{0x0422002040804180L,0x0000000087043020L});
public static final BitSet FOLLOW_variable_literal_in_operation_pull2286 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_PULL_in_operation_pull_all2297 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_ALL_in_operation_pull_all2299 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_pull_all2301 = new BitSet(new long[]{0x0400000000000000L});
public static final BitSet FOLLOW_array_in_operation_pull_all2303 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_RENAME_in_operation_rename2324 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_rename2327 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_rename2329 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_BITWISE_in_operation_bitwise2340 = new BitSet(new long[]{0x0000000000000100L,0x0000000000000020L});
public static final BitSet FOLLOW_set_in_operation_bitwise2343 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_operation_bitwise2351 = new BitSet(new long[]{0x0020000000000000L});
public static final BitSet FOLLOW_INTEGER_in_operation_bitwise2353 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SORT_in_sort_field_list2367 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_sort_field_in_sort_field_list2371 = new BitSet(new long[]{0x0000000000008002L,0x0000000000040000L});
public static final BitSet FOLLOW_COMMA_in_sort_field_list2374 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_sort_field_in_sort_field_list2379 = new BitSet(new long[]{0x0000000000008002L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_sort_field2402 = new BitSet(new long[]{0x0000000004000402L});
public static final BitSet FOLLOW_direction_in_sort_field2404 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SCHEMA_IDENTIFIER_in_collection_name2430 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SCHEMA_IDENTIFIER_in_field_name2443 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_field_name_in_field_list2456 = new BitSet(new long[]{0x0000000000008002L,0x0000000000040000L});
public static final BitSet FOLLOW_COMMA_in_field_list2459 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_field_name_in_field_list2464 = new BitSet(new long[]{0x0000000000008002L,0x0000000000040000L});
public static final BitSet FOLLOW_parameter_in_variable_literal2552 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_regex_in_variable_literal2556 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_string_in_variable_literal2560 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_bool_in_variable_literal2564 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_number_in_variable_literal2568 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_array_in_variable_literal2572 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_variable_function_call_in_variable_literal2576 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_variable_literal_in_variable_list2590 = new BitSet(new long[]{0x0000000000008002L});
public static final BitSet FOLLOW_COMMA_in_variable_list2593 = new BitSet(new long[]{0x0422002040804180L,0x0000000087043020L});
public static final BitSet FOLLOW_variable_literal_in_variable_list2597 = new BitSet(new long[]{0x0000000000008002L});
public static final BitSet FOLLOW_function_name_in_function_call2620 = new BitSet(new long[]{0x0800000000000000L});
public static final BitSet FOLLOW_L_PAREN_in_function_call2622 = new BitSet(new long[]{0x0C22002040804180L,0x0000000087063024L});
public static final BitSet FOLLOW_criteria_group_list_in_function_call2625 = new BitSet(new long[]{0x0000000000000000L,0x0000000000020000L});
public static final BitSet FOLLOW_criteria_in_function_call2628 = new BitSet(new long[]{0x0000000000000000L,0x0000000000020000L});
public static final BitSet FOLLOW_variable_list_in_function_call2632 = new BitSet(new long[]{0x0000000000000000L,0x0000000000020000L});
public static final BitSet FOLLOW_R_PAREN_in_function_call2636 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_function_name_in_variable_function_call2665 = new BitSet(new long[]{0x0800000000000000L});
public static final BitSet FOLLOW_L_PAREN_in_variable_function_call2667 = new BitSet(new long[]{0x0422002040804180L,0x0000000087063020L});
public static final BitSet FOLLOW_variable_list_in_variable_function_call2669 = new BitSet(new long[]{0x0000000000000000L,0x0000000000020000L});
public static final BitSet FOLLOW_R_PAREN_in_variable_function_call2672 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_HEX_NUMBER_in_number2730 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_integer_in_number2734 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_decimal_in_number2738 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_L_BRACKET_in_array2768 = new BitSet(new long[]{0x0422002040804180L,0x0000000087053020L});
public static final BitSet FOLLOW_variable_list_in_array2770 = new BitSet(new long[]{0x0000000000000000L,0x0000000000010000L});
public static final BitSet FOLLOW_R_BRACKET_in_array2773 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_REGEX_in_regex2792 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_named_parameter_in_parameter2838 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_indexed_parameter_in_parameter2842 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_COLON_in_named_parameter2866 = new BitSet(new long[]{0x0000000000000000L,0x0000000000040000L});
public static final BitSet FOLLOW_SCHEMA_IDENTIFIER_in_named_parameter2868 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_QUESTION_MARK_in_indexed_parameter2883 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_criteria_in_synpred81_Mql2628 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_variable_list_in_synpred82_Mql2632 = new BitSet(new long[]{0x0000000000000002L});
}