cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1152233 [8/9] - in /cassandra/trunk: conf/ src/gen-java/ src/gen-java/org/ src/gen-java/org/apache/ src/gen-java/org/apache/cassandra/ src/gen-java/org/apache/cassandra/cli/ src/gen-java/org/apache/cassandra/cql/ src/java/org/apache/cassan...
Date Fri, 29 Jul 2011 14:21:09 GMT
Added: cassandra/trunk/src/gen-java/org/apache/cassandra/cql/CqlParser.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/gen-java/org/apache/cassandra/cql/CqlParser.java?rev=1152233&view=auto
==============================================================================
--- cassandra/trunk/src/gen-java/org/apache/cassandra/cql/CqlParser.java (added)
+++ cassandra/trunk/src/gen-java/org/apache/cassandra/cql/CqlParser.java Fri Jul 29 14:21:06 2011
@@ -0,0 +1,3913 @@
+// $ANTLR 3.2 Sep 23, 2009 12:02:23 /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g 2011-07-28 15:11:05
+
+    package org.apache.cassandra.cql;
+    import java.util.Map;
+    import java.util.HashMap;
+    import java.util.Collections;
+    import java.util.List;
+    import java.util.ArrayList;
+    import org.apache.cassandra.thrift.ConsistencyLevel;
+    import org.apache.cassandra.thrift.InvalidRequestException;
+
+    import static org.apache.cassandra.cql.AlterTableStatement.OperationType;
+
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class CqlParser extends Parser {
+    public static final String[] tokenNames = new String[] {
+        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "K_USE", "IDENT", "K_SELECT", "K_COUNT", "K_FROM", "STRING_LITERAL", "INTEGER", "K_USING", "K_CONSISTENCY", "K_LEVEL", "K_WHERE", "K_LIMIT", "K_FIRST", "K_REVERSED", "RANGEOP", "K_AND", "K_IN", "K_INSERT", "K_INTO", "K_VALUES", "K_TIMESTAMP", "K_TTL", "K_BEGIN", "K_BATCH", "K_APPLY", "K_UPDATE", "K_SET", "K_DELETE", "K_CREATE", "K_KEYSPACE", "K_WITH", "COMPIDENT", "K_COLUMNFAMILY", "K_PRIMARY", "K_KEY", "FLOAT", "K_INDEX", "K_ON", "K_DROP", "K_ALTER", "K_TYPE", "K_ADD", "UUID", "K_TRUNCATE", "S", "E", "L", "C", "T", "F", "R", "O", "M", "W", "H", "A", "N", "D", "K", "Y", "I", "U", "P", "G", "Q", "V", "B", "X", "J", "Z", "DIGIT", "LETTER", "HEX", "WS", "COMMENT", "MULTILINE_COMMENT", "'('", "')'", "','", "'\\*'", "';'", "'='", "'bytea'", "'ascii'", "'text'", "'varchar'", "'int'", "'varint'", "'bigint'", "'uuid'", "'counter'", "'boolean'", "'date'", "'float'", "'double'", "'+'", "'-'", "'<'", "'<='", "'>='", "'>'"
+    };
+    public static final int LETTER=75;
+    public static final int K_CREATE=32;
+    public static final int EOF=-1;
+    public static final int K_PRIMARY=37;
+    public static final int T__93=93;
+    public static final int T__94=94;
+    public static final int T__91=91;
+    public static final int K_USE=4;
+    public static final int T__92=92;
+    public static final int K_VALUES=23;
+    public static final int STRING_LITERAL=9;
+    public static final int T__90=90;
+    public static final int K_ON=41;
+    public static final int K_USING=11;
+    public static final int K_ADD=45;
+    public static final int K_KEY=38;
+    public static final int COMMENT=78;
+    public static final int K_TRUNCATE=47;
+    public static final int T__99=99;
+    public static final int T__98=98;
+    public static final int T__97=97;
+    public static final int T__96=96;
+    public static final int T__95=95;
+    public static final int D=61;
+    public static final int E=49;
+    public static final int F=53;
+    public static final int G=67;
+    public static final int K_COUNT=7;
+    public static final int T__80=80;
+    public static final int K_KEYSPACE=33;
+    public static final int K_TYPE=44;
+    public static final int T__81=81;
+    public static final int A=59;
+    public static final int B=70;
+    public static final int T__82=82;
+    public static final int T__83=83;
+    public static final int C=51;
+    public static final int L=50;
+    public static final int M=56;
+    public static final int N=60;
+    public static final int O=55;
+    public static final int H=58;
+    public static final int I=64;
+    public static final int J=72;
+    public static final int K_UPDATE=29;
+    public static final int K=62;
+    public static final int U=65;
+    public static final int T=52;
+    public static final int W=57;
+    public static final int V=69;
+    public static final int Q=68;
+    public static final int P=66;
+    public static final int S=48;
+    public static final int R=54;
+    public static final int T__85=85;
+    public static final int T__84=84;
+    public static final int T__87=87;
+    public static final int T__86=86;
+    public static final int K_TTL=25;
+    public static final int T__89=89;
+    public static final int Y=63;
+    public static final int X=71;
+    public static final int T__88=88;
+    public static final int Z=73;
+    public static final int K_INDEX=40;
+    public static final int K_REVERSED=17;
+    public static final int K_INSERT=21;
+    public static final int WS=77;
+    public static final int K_APPLY=28;
+    public static final int K_TIMESTAMP=24;
+    public static final int K_AND=19;
+    public static final int K_LEVEL=13;
+    public static final int K_BATCH=27;
+    public static final int UUID=46;
+    public static final int K_DELETE=31;
+    public static final int FLOAT=39;
+    public static final int K_SELECT=6;
+    public static final int K_LIMIT=15;
+    public static final int K_ALTER=43;
+    public static final int K_SET=30;
+    public static final int K_WHERE=14;
+    public static final int MULTILINE_COMMENT=79;
+    public static final int HEX=76;
+    public static final int K_INTO=22;
+    public static final int T__103=103;
+    public static final int T__104=104;
+    public static final int IDENT=5;
+    public static final int DIGIT=74;
+    public static final int K_FIRST=16;
+    public static final int K_BEGIN=26;
+    public static final int INTEGER=10;
+    public static final int RANGEOP=18;
+    public static final int K_CONSISTENCY=12;
+    public static final int K_WITH=34;
+    public static final int COMPIDENT=35;
+    public static final int T__102=102;
+    public static final int T__101=101;
+    public static final int T__100=100;
+    public static final int K_IN=20;
+    public static final int K_FROM=8;
+    public static final int K_COLUMNFAMILY=36;
+    public static final int K_DROP=42;
+
+    // delegates
+    // delegators
+
+
+        public CqlParser(TokenStream input) {
+            this(input, new RecognizerSharedState());
+        }
+        public CqlParser(TokenStream input, RecognizerSharedState state) {
+            super(input, state);
+             
+        }
+        
+
+    public String[] getTokenNames() { return CqlParser.tokenNames; }
+    public String getGrammarFileName() { return "/home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g"; }
+
+
+        private List<String> recognitionErrors = new ArrayList<String>();
+        
+        public void displayRecognitionError(String[] tokenNames, RecognitionException e)
+        {
+            String hdr = getErrorHeader(e);
+            String msg = getErrorMessage(e, tokenNames);
+            recognitionErrors.add(hdr + " " + msg);
+        }
+        
+        public List<String> getRecognitionErrors()
+        {
+            return recognitionErrors;
+        }
+        
+        public void throwLastRecognitionError() throws InvalidRequestException
+        {
+            if (recognitionErrors.size() > 0)
+                throw new InvalidRequestException(recognitionErrors.get((recognitionErrors.size()-1)));
+        }
+
+
+
+    // $ANTLR start "query"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:105:1: query returns [CQLStatement stmnt] : ( selectStatement | insertStatement endStmnt | updateStatement endStmnt | batchStatement | useStatement | truncateStatement | deleteStatement endStmnt | createKeyspaceStatement | createColumnFamilyStatement | createIndexStatement | dropIndexStatement | dropKeyspaceStatement | dropColumnFamilyStatement | alterTableStatement );
+    public final CQLStatement query() throws RecognitionException {
+        CQLStatement stmnt = null;
+
+        SelectStatement selectStatement1 = null;
+
+        UpdateStatement insertStatement2 = null;
+
+        UpdateStatement updateStatement3 = null;
+
+        BatchStatement batchStatement4 = null;
+
+        String useStatement5 = null;
+
+        String truncateStatement6 = null;
+
+        DeleteStatement deleteStatement7 = null;
+
+        CreateKeyspaceStatement createKeyspaceStatement8 = null;
+
+        CreateColumnFamilyStatement createColumnFamilyStatement9 = null;
+
+        CreateIndexStatement createIndexStatement10 = null;
+
+        DropIndexStatement dropIndexStatement11 = null;
+
+        String dropKeyspaceStatement12 = null;
+
+        String dropColumnFamilyStatement13 = null;
+
+        AlterTableStatement alterTableStatement14 = null;
+
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:106:5: ( selectStatement | insertStatement endStmnt | updateStatement endStmnt | batchStatement | useStatement | truncateStatement | deleteStatement endStmnt | createKeyspaceStatement | createColumnFamilyStatement | createIndexStatement | dropIndexStatement | dropKeyspaceStatement | dropColumnFamilyStatement | alterTableStatement )
+            int alt1=14;
+            alt1 = dfa1.predict(input);
+            switch (alt1) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:106:7: selectStatement
+                    {
+                    pushFollow(FOLLOW_selectStatement_in_query69);
+                    selectStatement1=selectStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.SELECT, selectStatement1); 
+
+                    }
+                    break;
+                case 2 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:107:7: insertStatement endStmnt
+                    {
+                    pushFollow(FOLLOW_insertStatement_in_query81);
+                    insertStatement2=insertStatement();
+
+                    state._fsp--;
+
+                    pushFollow(FOLLOW_endStmnt_in_query83);
+                    endStmnt();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.INSERT, insertStatement2); 
+
+                    }
+                    break;
+                case 3 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:108:7: updateStatement endStmnt
+                    {
+                    pushFollow(FOLLOW_updateStatement_in_query93);
+                    updateStatement3=updateStatement();
+
+                    state._fsp--;
+
+                    pushFollow(FOLLOW_endStmnt_in_query95);
+                    endStmnt();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.UPDATE, updateStatement3); 
+
+                    }
+                    break;
+                case 4 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:109:7: batchStatement
+                    {
+                    pushFollow(FOLLOW_batchStatement_in_query105);
+                    batchStatement4=batchStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.BATCH, batchStatement4); 
+
+                    }
+                    break;
+                case 5 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:110:7: useStatement
+                    {
+                    pushFollow(FOLLOW_useStatement_in_query115);
+                    useStatement5=useStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.USE, useStatement5); 
+
+                    }
+                    break;
+                case 6 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:111:7: truncateStatement
+                    {
+                    pushFollow(FOLLOW_truncateStatement_in_query130);
+                    truncateStatement6=truncateStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.TRUNCATE, truncateStatement6); 
+
+                    }
+                    break;
+                case 7 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:112:7: deleteStatement endStmnt
+                    {
+                    pushFollow(FOLLOW_deleteStatement_in_query140);
+                    deleteStatement7=deleteStatement();
+
+                    state._fsp--;
+
+                    pushFollow(FOLLOW_endStmnt_in_query142);
+                    endStmnt();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.DELETE, deleteStatement7); 
+
+                    }
+                    break;
+                case 8 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:113:7: createKeyspaceStatement
+                    {
+                    pushFollow(FOLLOW_createKeyspaceStatement_in_query152);
+                    createKeyspaceStatement8=createKeyspaceStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.CREATE_KEYSPACE, createKeyspaceStatement8); 
+
+                    }
+                    break;
+                case 9 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:114:7: createColumnFamilyStatement
+                    {
+                    pushFollow(FOLLOW_createColumnFamilyStatement_in_query162);
+                    createColumnFamilyStatement9=createColumnFamilyStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.CREATE_COLUMNFAMILY, createColumnFamilyStatement9); 
+
+                    }
+                    break;
+                case 10 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:115:7: createIndexStatement
+                    {
+                    pushFollow(FOLLOW_createIndexStatement_in_query172);
+                    createIndexStatement10=createIndexStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.CREATE_INDEX, createIndexStatement10); 
+
+                    }
+                    break;
+                case 11 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:116:7: dropIndexStatement
+                    {
+                    pushFollow(FOLLOW_dropIndexStatement_in_query182);
+                    dropIndexStatement11=dropIndexStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.DROP_INDEX, dropIndexStatement11); 
+
+                    }
+                    break;
+                case 12 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:117:7: dropKeyspaceStatement
+                    {
+                    pushFollow(FOLLOW_dropKeyspaceStatement_in_query194);
+                    dropKeyspaceStatement12=dropKeyspaceStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.DROP_KEYSPACE, dropKeyspaceStatement12); 
+
+                    }
+                    break;
+                case 13 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:118:7: dropColumnFamilyStatement
+                    {
+                    pushFollow(FOLLOW_dropColumnFamilyStatement_in_query204);
+                    dropColumnFamilyStatement13=dropColumnFamilyStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.DROP_COLUMNFAMILY, dropColumnFamilyStatement13); 
+
+                    }
+                    break;
+                case 14 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:119:7: alterTableStatement
+                    {
+                    pushFollow(FOLLOW_alterTableStatement_in_query214);
+                    alterTableStatement14=alterTableStatement();
+
+                    state._fsp--;
+
+                     stmnt = new CQLStatement(StatementType.ALTER_TABLE, alterTableStatement14); 
+
+                    }
+                    break;
+
+            }
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return stmnt;
+    }
+    // $ANTLR end "query"
+
+
+    // $ANTLR start "useStatement"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:123:1: useStatement returns [String keyspace] : K_USE IDENT endStmnt ;
+    public final String useStatement() throws RecognitionException {
+        String keyspace = null;
+
+        Token IDENT15=null;
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:124:5: ( K_USE IDENT endStmnt )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:124:7: K_USE IDENT endStmnt
+            {
+            match(input,K_USE,FOLLOW_K_USE_in_useStatement238); 
+            IDENT15=(Token)match(input,IDENT,FOLLOW_IDENT_in_useStatement240); 
+             keyspace = (IDENT15!=null?IDENT15.getText():null); 
+            pushFollow(FOLLOW_endStmnt_in_useStatement244);
+            endStmnt();
+
+            state._fsp--;
+
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return keyspace;
+    }
+    // $ANTLR end "useStatement"
+
+
+    // $ANTLR start "selectStatement"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:127:1: selectStatement returns [SelectStatement expr] : K_SELECT (s1= selectExpression | K_COUNT '(' s2= selectExpression ')' ) K_FROM columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) ( K_USING K_CONSISTENCY K_LEVEL )? ( K_WHERE whereClause )? ( K_LIMIT rows= INTEGER )? endStmnt ;
+    public final SelectStatement selectStatement() throws RecognitionException {
+        SelectStatement expr = null;
+
+        Token columnFamily=null;
+        Token rows=null;
+        Token K_LEVEL16=null;
+        SelectExpression s1 = null;
+
+        SelectExpression s2 = null;
+
+        WhereClause whereClause17 = null;
+
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:140:5: ( K_SELECT (s1= selectExpression | K_COUNT '(' s2= selectExpression ')' ) K_FROM columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) ( K_USING K_CONSISTENCY K_LEVEL )? ( K_WHERE whereClause )? ( K_LIMIT rows= INTEGER )? endStmnt )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:140:7: K_SELECT (s1= selectExpression | K_COUNT '(' s2= selectExpression ')' ) K_FROM columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) ( K_USING K_CONSISTENCY K_LEVEL )? ( K_WHERE whereClause )? ( K_LIMIT rows= INTEGER )? endStmnt
+            {
+             
+                      int numRecords = 10000;
+                      SelectExpression expression = null;
+                      boolean isCountOp = false;
+                      ConsistencyLevel cLevel = ConsistencyLevel.ONE;
+                  
+            match(input,K_SELECT,FOLLOW_K_SELECT_in_selectStatement275); 
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:147:11: (s1= selectExpression | K_COUNT '(' s2= selectExpression ')' )
+            int alt2=2;
+            int LA2_0 = input.LA(1);
+
+            if ( (LA2_0==IDENT||(LA2_0>=STRING_LITERAL && LA2_0<=INTEGER)||(LA2_0>=K_FIRST && LA2_0<=K_REVERSED)||(LA2_0>=K_KEY && LA2_0<=FLOAT)||LA2_0==UUID||LA2_0==83) ) {
+                alt2=1;
+            }
+            else if ( (LA2_0==K_COUNT) ) {
+                alt2=2;
+            }
+            else {
+                NoViableAltException nvae =
+                    new NoViableAltException("", 2, 0, input);
+
+                throw nvae;
+            }
+            switch (alt2) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:147:13: s1= selectExpression
+                    {
+                    pushFollow(FOLLOW_selectExpression_in_selectStatement291);
+                    s1=selectExpression();
+
+                    state._fsp--;
+
+                     expression = s1; 
+
+                    }
+                    break;
+                case 2 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:148:13: K_COUNT '(' s2= selectExpression ')'
+                    {
+                    match(input,K_COUNT,FOLLOW_K_COUNT_in_selectStatement323); 
+                    match(input,80,FOLLOW_80_in_selectStatement325); 
+                    pushFollow(FOLLOW_selectExpression_in_selectStatement329);
+                    s2=selectExpression();
+
+                    state._fsp--;
+
+                    match(input,81,FOLLOW_81_in_selectStatement331); 
+                     expression = s2; isCountOp = true; 
+
+                    }
+                    break;
+
+            }
+
+            match(input,K_FROM,FOLLOW_K_FROM_in_selectStatement357); 
+            columnFamily=(Token)input.LT(1);
+            if ( input.LA(1)==IDENT||(input.LA(1)>=STRING_LITERAL && input.LA(1)<=INTEGER) ) {
+                input.consume();
+                state.errorRecovery=false;
+            }
+            else {
+                MismatchedSetException mse = new MismatchedSetException(null,input);
+                throw mse;
+            }
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:151:11: ( K_USING K_CONSISTENCY K_LEVEL )?
+            int alt3=2;
+            int LA3_0 = input.LA(1);
+
+            if ( (LA3_0==K_USING) ) {
+                alt3=1;
+            }
+            switch (alt3) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:151:13: K_USING K_CONSISTENCY K_LEVEL
+                    {
+                    match(input,K_USING,FOLLOW_K_USING_in_selectStatement387); 
+                    match(input,K_CONSISTENCY,FOLLOW_K_CONSISTENCY_in_selectStatement389); 
+                    K_LEVEL16=(Token)match(input,K_LEVEL,FOLLOW_K_LEVEL_in_selectStatement391); 
+                     cLevel = ConsistencyLevel.valueOf((K_LEVEL16!=null?K_LEVEL16.getText():null)); 
+
+                    }
+                    break;
+
+            }
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:152:11: ( K_WHERE whereClause )?
+            int alt4=2;
+            int LA4_0 = input.LA(1);
+
+            if ( (LA4_0==K_WHERE) ) {
+                alt4=1;
+            }
+            switch (alt4) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:152:13: K_WHERE whereClause
+                    {
+                    match(input,K_WHERE,FOLLOW_K_WHERE_in_selectStatement410); 
+                    pushFollow(FOLLOW_whereClause_in_selectStatement412);
+                    whereClause17=whereClause();
+
+                    state._fsp--;
+
+
+                    }
+                    break;
+
+            }
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:153:11: ( K_LIMIT rows= INTEGER )?
+            int alt5=2;
+            int LA5_0 = input.LA(1);
+
+            if ( (LA5_0==K_LIMIT) ) {
+                alt5=1;
+            }
+            switch (alt5) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:153:13: K_LIMIT rows= INTEGER
+                    {
+                    match(input,K_LIMIT,FOLLOW_K_LIMIT_in_selectStatement429); 
+                    rows=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_selectStatement433); 
+                     numRecords = Integer.parseInt((rows!=null?rows.getText():null)); 
+
+                    }
+                    break;
+
+            }
+
+            pushFollow(FOLLOW_endStmnt_in_selectStatement450);
+            endStmnt();
+
+            state._fsp--;
+
+
+                      return new SelectStatement(expression,
+                                                 isCountOp,
+                                                 (columnFamily!=null?columnFamily.getText():null),
+                                                 cLevel,
+                                                 whereClause17,
+                                                 numRecords);
+                  
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return expr;
+    }
+    // $ANTLR end "selectStatement"
+
+
+    // $ANTLR start "selectExpression"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:167:1: selectExpression returns [SelectExpression expr] : ( K_FIRST cols= INTEGER )? ( K_REVERSED )? (first= term ( ',' next= term )* | start= term RANGEOP finish= term | '\\*' ) ;
+    public final SelectExpression selectExpression() throws RecognitionException {
+        SelectExpression expr = null;
+
+        Token cols=null;
+        Term first = null;
+
+        Term next = null;
+
+        Term start = null;
+
+        Term finish = null;
+
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:168:5: ( ( K_FIRST cols= INTEGER )? ( K_REVERSED )? (first= term ( ',' next= term )* | start= term RANGEOP finish= term | '\\*' ) )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:168:7: ( K_FIRST cols= INTEGER )? ( K_REVERSED )? (first= term ( ',' next= term )* | start= term RANGEOP finish= term | '\\*' )
+            {
+
+                      int count = 10000;
+                      boolean reversed = false;
+                  
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:172:7: ( K_FIRST cols= INTEGER )?
+            int alt6=2;
+            int LA6_0 = input.LA(1);
+
+            if ( (LA6_0==K_FIRST) ) {
+                alt6=1;
+            }
+            switch (alt6) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:172:9: K_FIRST cols= INTEGER
+                    {
+                    match(input,K_FIRST,FOLLOW_K_FIRST_in_selectExpression491); 
+                    cols=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_selectExpression495); 
+                     count = Integer.parseInt((cols!=null?cols.getText():null)); 
+
+                    }
+                    break;
+
+            }
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:173:7: ( K_REVERSED )?
+            int alt7=2;
+            int LA7_0 = input.LA(1);
+
+            if ( (LA7_0==K_REVERSED) ) {
+                alt7=1;
+            }
+            switch (alt7) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:173:9: K_REVERSED
+                    {
+                    match(input,K_REVERSED,FOLLOW_K_REVERSED_in_selectExpression510); 
+                     reversed = true; 
+
+                    }
+                    break;
+
+            }
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:174:7: (first= term ( ',' next= term )* | start= term RANGEOP finish= term | '\\*' )
+            int alt9=3;
+            alt9 = dfa9.predict(input);
+            switch (alt9) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:174:9: first= term ( ',' next= term )*
+                    {
+                    pushFollow(FOLLOW_term_in_selectExpression527);
+                    first=term();
+
+                    state._fsp--;
+
+                     expr = new SelectExpression(first, count, reversed); 
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:175:13: ( ',' next= term )*
+                    loop8:
+                    do {
+                        int alt8=2;
+                        int LA8_0 = input.LA(1);
+
+                        if ( (LA8_0==82) ) {
+                            alt8=1;
+                        }
+
+
+                        switch (alt8) {
+                    	case 1 :
+                    	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:175:14: ',' next= term
+                    	    {
+                    	    match(input,82,FOLLOW_82_in_selectExpression544); 
+                    	    pushFollow(FOLLOW_term_in_selectExpression548);
+                    	    next=term();
+
+                    	    state._fsp--;
+
+                    	     expr.and(next); 
+
+                    	    }
+                    	    break;
+
+                    	default :
+                    	    break loop8;
+                        }
+                    } while (true);
+
+
+                    }
+                    break;
+                case 2 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:176:9: start= term RANGEOP finish= term
+                    {
+                    pushFollow(FOLLOW_term_in_selectExpression564);
+                    start=term();
+
+                    state._fsp--;
+
+                    match(input,RANGEOP,FOLLOW_RANGEOP_in_selectExpression566); 
+                    pushFollow(FOLLOW_term_in_selectExpression570);
+                    finish=term();
+
+                    state._fsp--;
+
+                     expr = new SelectExpression(start, finish, count, reversed, false); 
+
+                    }
+                    break;
+                case 3 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:177:9: '\\*'
+                    {
+                    match(input,83,FOLLOW_83_in_selectExpression582); 
+                     expr = new SelectExpression(new Term(), new Term(), count, reversed, true); 
+
+                    }
+                    break;
+
+            }
+
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return expr;
+    }
+    // $ANTLR end "selectExpression"
+
+
+    // $ANTLR start "whereClause"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:182:1: whereClause returns [WhereClause clause] : (first= relation ( K_AND next= relation )* | key_alias= term K_IN '(' f1= term ( ',' fN= term )* ')' );
+    public final WhereClause whereClause() throws RecognitionException {
+        WhereClause clause = null;
+
+        Relation first = null;
+
+        Relation next = null;
+
+        Term key_alias = null;
+
+        Term f1 = null;
+
+        Term fN = null;
+
+
+
+                WhereClause inClause = new WhereClause();
+            
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:186:5: (first= relation ( K_AND next= relation )* | key_alias= term K_IN '(' f1= term ( ',' fN= term )* ')' )
+            int alt12=2;
+            switch ( input.LA(1) ) {
+            case K_KEY:
+                {
+                int LA12_1 = input.LA(2);
+
+                if ( (LA12_1==K_IN) ) {
+                    alt12=2;
+                }
+                else if ( (LA12_1==85||(LA12_1>=101 && LA12_1<=104)) ) {
+                    alt12=1;
+                }
+                else {
+                    NoViableAltException nvae =
+                        new NoViableAltException("", 12, 1, input);
+
+                    throw nvae;
+                }
+                }
+                break;
+            case STRING_LITERAL:
+                {
+                int LA12_2 = input.LA(2);
+
+                if ( (LA12_2==K_IN) ) {
+                    alt12=2;
+                }
+                else if ( (LA12_2==85||(LA12_2>=101 && LA12_2<=104)) ) {
+                    alt12=1;
+                }
+                else {
+                    NoViableAltException nvae =
+                        new NoViableAltException("", 12, 2, input);
+
+                    throw nvae;
+                }
+                }
+                break;
+            case INTEGER:
+                {
+                int LA12_3 = input.LA(2);
+
+                if ( (LA12_3==K_IN) ) {
+                    alt12=2;
+                }
+                else if ( (LA12_3==85||(LA12_3>=101 && LA12_3<=104)) ) {
+                    alt12=1;
+                }
+                else {
+                    NoViableAltException nvae =
+                        new NoViableAltException("", 12, 3, input);
+
+                    throw nvae;
+                }
+                }
+                break;
+            case UUID:
+                {
+                int LA12_4 = input.LA(2);
+
+                if ( (LA12_4==K_IN) ) {
+                    alt12=2;
+                }
+                else if ( (LA12_4==85||(LA12_4>=101 && LA12_4<=104)) ) {
+                    alt12=1;
+                }
+                else {
+                    NoViableAltException nvae =
+                        new NoViableAltException("", 12, 4, input);
+
+                    throw nvae;
+                }
+                }
+                break;
+            case IDENT:
+                {
+                int LA12_5 = input.LA(2);
+
+                if ( (LA12_5==K_IN) ) {
+                    alt12=2;
+                }
+                else if ( (LA12_5==85||(LA12_5>=101 && LA12_5<=104)) ) {
+                    alt12=1;
+                }
+                else {
+                    NoViableAltException nvae =
+                        new NoViableAltException("", 12, 5, input);
+
+                    throw nvae;
+                }
+                }
+                break;
+            case FLOAT:
+                {
+                int LA12_6 = input.LA(2);
+
+                if ( (LA12_6==85||(LA12_6>=101 && LA12_6<=104)) ) {
+                    alt12=1;
+                }
+                else if ( (LA12_6==K_IN) ) {
+                    alt12=2;
+                }
+                else {
+                    NoViableAltException nvae =
+                        new NoViableAltException("", 12, 6, input);
+
+                    throw nvae;
+                }
+                }
+                break;
+            default:
+                NoViableAltException nvae =
+                    new NoViableAltException("", 12, 0, input);
+
+                throw nvae;
+            }
+
+            switch (alt12) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:186:7: first= relation ( K_AND next= relation )*
+                    {
+                    pushFollow(FOLLOW_relation_in_whereClause625);
+                    first=relation();
+
+                    state._fsp--;
+
+                     clause = new WhereClause(first); 
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:187:11: ( K_AND next= relation )*
+                    loop10:
+                    do {
+                        int alt10=2;
+                        int LA10_0 = input.LA(1);
+
+                        if ( (LA10_0==K_AND) ) {
+                            alt10=1;
+                        }
+
+
+                        switch (alt10) {
+                    	case 1 :
+                    	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:187:12: K_AND next= relation
+                    	    {
+                    	    match(input,K_AND,FOLLOW_K_AND_in_whereClause641); 
+                    	    pushFollow(FOLLOW_relation_in_whereClause645);
+                    	    next=relation();
+
+                    	    state._fsp--;
+
+                    	     clause.and(next); 
+
+                    	    }
+                    	    break;
+
+                    	default :
+                    	    break loop10;
+                        }
+                    } while (true);
+
+
+                    }
+                    break;
+                case 2 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:188:9: key_alias= term K_IN '(' f1= term ( ',' fN= term )* ')'
+                    {
+                    pushFollow(FOLLOW_term_in_whereClause661);
+                    key_alias=term();
+
+                    state._fsp--;
+
+                     inClause.setKeyAlias(key_alias.getText()); 
+                    match(input,K_IN,FOLLOW_K_IN_in_whereClause676); 
+                    match(input,80,FOLLOW_80_in_whereClause678); 
+                    pushFollow(FOLLOW_term_in_whereClause682);
+                    f1=term();
+
+                    state._fsp--;
+
+                     inClause.andKeyEquals(f1); 
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:190:19: ( ',' fN= term )*
+                    loop11:
+                    do {
+                        int alt11=2;
+                        int LA11_0 = input.LA(1);
+
+                        if ( (LA11_0==82) ) {
+                            alt11=1;
+                        }
+
+
+                        switch (alt11) {
+                    	case 1 :
+                    	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:190:20: ',' fN= term
+                    	    {
+                    	    match(input,82,FOLLOW_82_in_whereClause705); 
+                    	    pushFollow(FOLLOW_term_in_whereClause709);
+                    	    fN=term();
+
+                    	    state._fsp--;
+
+                    	     inClause.andKeyEquals(fN); 
+
+                    	    }
+                    	    break;
+
+                    	default :
+                    	    break loop11;
+                        }
+                    } while (true);
+
+                    match(input,81,FOLLOW_81_in_whereClause716); 
+                     inClause.setMultiKey(true); clause = inClause; 
+
+                    }
+                    break;
+
+            }
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return clause;
+    }
+    // $ANTLR end "whereClause"
+
+
+    // $ANTLR start "insertStatement"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:194:1: insertStatement returns [UpdateStatement expr] : K_INSERT K_INTO columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) '(' key_alias= term ( ',' column_name= term )+ ')' K_VALUES '(' key= term ( ',' column_value= term )+ ')' ( usingClause[attrs] )? ;
+    public final UpdateStatement insertStatement() throws RecognitionException {
+        UpdateStatement expr = null;
+
+        Token columnFamily=null;
+        Term key_alias = null;
+
+        Term column_name = null;
+
+        Term key = null;
+
+        Term column_value = null;
+
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:208:5: ( K_INSERT K_INTO columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) '(' key_alias= term ( ',' column_name= term )+ ')' K_VALUES '(' key= term ( ',' column_value= term )+ ')' ( usingClause[attrs] )? )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:208:7: K_INSERT K_INTO columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) '(' key_alias= term ( ',' column_name= term )+ ')' K_VALUES '(' key= term ( ',' column_value= term )+ ')' ( usingClause[attrs] )?
+            {
+
+                      Attributes attrs = new Attributes();
+                      Map<Term, Term> columns = new HashMap<Term, Term>();
+
+                      List<Term> columnNames  = new ArrayList<Term>();
+                      List<Term> columnValues = new ArrayList<Term>();
+                  
+            match(input,K_INSERT,FOLLOW_K_INSERT_in_insertStatement757); 
+            match(input,K_INTO,FOLLOW_K_INTO_in_insertStatement759); 
+            columnFamily=(Token)input.LT(1);
+            if ( input.LA(1)==IDENT||(input.LA(1)>=STRING_LITERAL && input.LA(1)<=INTEGER) ) {
+                input.consume();
+                state.errorRecovery=false;
+            }
+            else {
+                MismatchedSetException mse = new MismatchedSetException(null,input);
+                throw mse;
+            }
+
+            match(input,80,FOLLOW_80_in_insertStatement787); 
+            pushFollow(FOLLOW_term_in_insertStatement791);
+            key_alias=term();
+
+            state._fsp--;
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:216:30: ( ',' column_name= term )+
+            int cnt13=0;
+            loop13:
+            do {
+                int alt13=2;
+                int LA13_0 = input.LA(1);
+
+                if ( (LA13_0==82) ) {
+                    alt13=1;
+                }
+
+
+                switch (alt13) {
+            	case 1 :
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:216:32: ',' column_name= term
+            	    {
+            	    match(input,82,FOLLOW_82_in_insertStatement795); 
+            	    pushFollow(FOLLOW_term_in_insertStatement799);
+            	    column_name=term();
+
+            	    state._fsp--;
+
+            	     columnNames.add(column_name); 
+
+            	    }
+            	    break;
+
+            	default :
+            	    if ( cnt13 >= 1 ) break loop13;
+                        EarlyExitException eee =
+                            new EarlyExitException(13, input);
+                        throw eee;
+                }
+                cnt13++;
+            } while (true);
+
+            match(input,81,FOLLOW_81_in_insertStatement807); 
+            match(input,K_VALUES,FOLLOW_K_VALUES_in_insertStatement817); 
+            match(input,80,FOLLOW_80_in_insertStatement829); 
+            pushFollow(FOLLOW_term_in_insertStatement833);
+            key=term();
+
+            state._fsp--;
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:218:24: ( ',' column_value= term )+
+            int cnt14=0;
+            loop14:
+            do {
+                int alt14=2;
+                int LA14_0 = input.LA(1);
+
+                if ( (LA14_0==82) ) {
+                    alt14=1;
+                }
+
+
+                switch (alt14) {
+            	case 1 :
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:218:26: ',' column_value= term
+            	    {
+            	    match(input,82,FOLLOW_82_in_insertStatement837); 
+            	    pushFollow(FOLLOW_term_in_insertStatement841);
+            	    column_value=term();
+
+            	    state._fsp--;
+
+            	     columnValues.add(column_value); 
+
+            	    }
+            	    break;
+
+            	default :
+            	    if ( cnt14 >= 1 ) break loop14;
+                        EarlyExitException eee =
+                            new EarlyExitException(14, input);
+                        throw eee;
+                }
+                cnt14++;
+            } while (true);
+
+            match(input,81,FOLLOW_81_in_insertStatement847); 
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:219:9: ( usingClause[attrs] )?
+            int alt15=2;
+            int LA15_0 = input.LA(1);
+
+            if ( (LA15_0==K_USING) ) {
+                alt15=1;
+            }
+            switch (alt15) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:219:11: usingClause[attrs]
+                    {
+                    pushFollow(FOLLOW_usingClause_in_insertStatement859);
+                    usingClause(attrs);
+
+                    state._fsp--;
+
+
+                    }
+                    break;
+
+            }
+
+
+                      return new UpdateStatement((columnFamily!=null?columnFamily.getText():null), key_alias.getText(), columnNames, columnValues, Collections.singletonList(key), attrs);
+                  
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return expr;
+    }
+    // $ANTLR end "insertStatement"
+
+
+    // $ANTLR start "usingClause"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:225:1: usingClause[Attributes attrs] : K_USING usingClauseObjective[attrs] ( ( K_AND )? usingClauseObjective[attrs] )* ;
+    public final void usingClause(Attributes attrs) throws RecognitionException {
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:226:5: ( K_USING usingClauseObjective[attrs] ( ( K_AND )? usingClauseObjective[attrs] )* )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:226:7: K_USING usingClauseObjective[attrs] ( ( K_AND )? usingClauseObjective[attrs] )*
+            {
+            match(input,K_USING,FOLLOW_K_USING_in_usingClause889); 
+            pushFollow(FOLLOW_usingClauseObjective_in_usingClause891);
+            usingClauseObjective(attrs);
+
+            state._fsp--;
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:226:43: ( ( K_AND )? usingClauseObjective[attrs] )*
+            loop17:
+            do {
+                int alt17=2;
+                int LA17_0 = input.LA(1);
+
+                if ( (LA17_0==K_CONSISTENCY||LA17_0==K_AND||(LA17_0>=K_TIMESTAMP && LA17_0<=K_TTL)) ) {
+                    alt17=1;
+                }
+
+
+                switch (alt17) {
+            	case 1 :
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:226:45: ( K_AND )? usingClauseObjective[attrs]
+            	    {
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:226:45: ( K_AND )?
+            	    int alt16=2;
+            	    int LA16_0 = input.LA(1);
+
+            	    if ( (LA16_0==K_AND) ) {
+            	        alt16=1;
+            	    }
+            	    switch (alt16) {
+            	        case 1 :
+            	            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:226:45: K_AND
+            	            {
+            	            match(input,K_AND,FOLLOW_K_AND_in_usingClause896); 
+
+            	            }
+            	            break;
+
+            	    }
+
+            	    pushFollow(FOLLOW_usingClauseObjective_in_usingClause899);
+            	    usingClauseObjective(attrs);
+
+            	    state._fsp--;
+
+
+            	    }
+            	    break;
+
+            	default :
+            	    break loop17;
+                }
+            } while (true);
+
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return ;
+    }
+    // $ANTLR end "usingClause"
+
+
+    // $ANTLR start "usingClauseDelete"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:229:1: usingClauseDelete[Attributes attrs] : K_USING usingClauseDeleteObjective[attrs] ( ( K_AND )? usingClauseDeleteObjective[attrs] )* ;
+    public final void usingClauseDelete(Attributes attrs) throws RecognitionException {
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:230:5: ( K_USING usingClauseDeleteObjective[attrs] ( ( K_AND )? usingClauseDeleteObjective[attrs] )* )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:230:7: K_USING usingClauseDeleteObjective[attrs] ( ( K_AND )? usingClauseDeleteObjective[attrs] )*
+            {
+            match(input,K_USING,FOLLOW_K_USING_in_usingClauseDelete921); 
+            pushFollow(FOLLOW_usingClauseDeleteObjective_in_usingClauseDelete923);
+            usingClauseDeleteObjective(attrs);
+
+            state._fsp--;
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:230:49: ( ( K_AND )? usingClauseDeleteObjective[attrs] )*
+            loop19:
+            do {
+                int alt19=2;
+                int LA19_0 = input.LA(1);
+
+                if ( (LA19_0==K_CONSISTENCY||LA19_0==K_AND||LA19_0==K_TIMESTAMP) ) {
+                    alt19=1;
+                }
+
+
+                switch (alt19) {
+            	case 1 :
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:230:51: ( K_AND )? usingClauseDeleteObjective[attrs]
+            	    {
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:230:51: ( K_AND )?
+            	    int alt18=2;
+            	    int LA18_0 = input.LA(1);
+
+            	    if ( (LA18_0==K_AND) ) {
+            	        alt18=1;
+            	    }
+            	    switch (alt18) {
+            	        case 1 :
+            	            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:230:51: K_AND
+            	            {
+            	            match(input,K_AND,FOLLOW_K_AND_in_usingClauseDelete928); 
+
+            	            }
+            	            break;
+
+            	    }
+
+            	    pushFollow(FOLLOW_usingClauseDeleteObjective_in_usingClauseDelete931);
+            	    usingClauseDeleteObjective(attrs);
+
+            	    state._fsp--;
+
+
+            	    }
+            	    break;
+
+            	default :
+            	    break loop19;
+                }
+            } while (true);
+
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return ;
+    }
+    // $ANTLR end "usingClauseDelete"
+
+
+    // $ANTLR start "usingClauseDeleteObjective"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:233:1: usingClauseDeleteObjective[Attributes attrs] : ( K_CONSISTENCY K_LEVEL | K_TIMESTAMP ts= INTEGER );
+    public final void usingClauseDeleteObjective(Attributes attrs) throws RecognitionException {
+        Token ts=null;
+        Token K_LEVEL18=null;
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:234:5: ( K_CONSISTENCY K_LEVEL | K_TIMESTAMP ts= INTEGER )
+            int alt20=2;
+            int LA20_0 = input.LA(1);
+
+            if ( (LA20_0==K_CONSISTENCY) ) {
+                alt20=1;
+            }
+            else if ( (LA20_0==K_TIMESTAMP) ) {
+                alt20=2;
+            }
+            else {
+                NoViableAltException nvae =
+                    new NoViableAltException("", 20, 0, input);
+
+                throw nvae;
+            }
+            switch (alt20) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:234:7: K_CONSISTENCY K_LEVEL
+                    {
+                    match(input,K_CONSISTENCY,FOLLOW_K_CONSISTENCY_in_usingClauseDeleteObjective953); 
+                    K_LEVEL18=(Token)match(input,K_LEVEL,FOLLOW_K_LEVEL_in_usingClauseDeleteObjective955); 
+                     attrs.setConsistencyLevel(ConsistencyLevel.valueOf((K_LEVEL18!=null?K_LEVEL18.getText():null))); 
+
+                    }
+                    break;
+                case 2 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:235:7: K_TIMESTAMP ts= INTEGER
+                    {
+                    match(input,K_TIMESTAMP,FOLLOW_K_TIMESTAMP_in_usingClauseDeleteObjective966); 
+                    ts=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_usingClauseDeleteObjective970); 
+                     attrs.setTimestamp(Long.valueOf((ts!=null?ts.getText():null))); 
+
+                    }
+                    break;
+
+            }
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return ;
+    }
+    // $ANTLR end "usingClauseDeleteObjective"
+
+
+    // $ANTLR start "usingClauseObjective"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:238:1: usingClauseObjective[Attributes attrs] : ( usingClauseDeleteObjective[attrs] | K_TTL t= INTEGER );
+    public final void usingClauseObjective(Attributes attrs) throws RecognitionException {
+        Token t=null;
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:239:5: ( usingClauseDeleteObjective[attrs] | K_TTL t= INTEGER )
+            int alt21=2;
+            int LA21_0 = input.LA(1);
+
+            if ( (LA21_0==K_CONSISTENCY||LA21_0==K_TIMESTAMP) ) {
+                alt21=1;
+            }
+            else if ( (LA21_0==K_TTL) ) {
+                alt21=2;
+            }
+            else {
+                NoViableAltException nvae =
+                    new NoViableAltException("", 21, 0, input);
+
+                throw nvae;
+            }
+            switch (alt21) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:239:7: usingClauseDeleteObjective[attrs]
+                    {
+                    pushFollow(FOLLOW_usingClauseDeleteObjective_in_usingClauseObjective990);
+                    usingClauseDeleteObjective(attrs);
+
+                    state._fsp--;
+
+
+                    }
+                    break;
+                case 2 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:240:7: K_TTL t= INTEGER
+                    {
+                    match(input,K_TTL,FOLLOW_K_TTL_in_usingClauseObjective999); 
+                    t=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_usingClauseObjective1003); 
+                     attrs.setTimeToLive(Integer.parseInt((t!=null?t.getText():null))); 
+
+                    }
+                    break;
+
+            }
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return ;
+    }
+    // $ANTLR end "usingClauseObjective"
+
+
+    // $ANTLR start "batchStatement"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:243:1: batchStatement returns [BatchStatement expr] : K_BEGIN K_BATCH ( usingClause[attrs] )? s1= batchStatementObjective ( ';' )? (sN= batchStatementObjective ( ';' )? )* K_APPLY K_BATCH endStmnt ;
+    public final BatchStatement batchStatement() throws RecognitionException {
+        BatchStatement expr = null;
+
+        AbstractModification s1 = null;
+
+        AbstractModification sN = null;
+
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:268:5: ( K_BEGIN K_BATCH ( usingClause[attrs] )? s1= batchStatementObjective ( ';' )? (sN= batchStatementObjective ( ';' )? )* K_APPLY K_BATCH endStmnt )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:268:7: K_BEGIN K_BATCH ( usingClause[attrs] )? s1= batchStatementObjective ( ';' )? (sN= batchStatementObjective ( ';' )? )* K_APPLY K_BATCH endStmnt
+            {
+
+                      Attributes attrs = new Attributes();
+                      attrs.setConsistencyLevel(ConsistencyLevel.ONE);
+
+                      List<AbstractModification> statements = new ArrayList<AbstractModification>();
+                  
+            match(input,K_BEGIN,FOLLOW_K_BEGIN_in_batchStatement1043); 
+            match(input,K_BATCH,FOLLOW_K_BATCH_in_batchStatement1045); 
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:274:23: ( usingClause[attrs] )?
+            int alt22=2;
+            int LA22_0 = input.LA(1);
+
+            if ( (LA22_0==K_USING) ) {
+                alt22=1;
+            }
+            switch (alt22) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:274:25: usingClause[attrs]
+                    {
+                    pushFollow(FOLLOW_usingClause_in_batchStatement1049);
+                    usingClause(attrs);
+
+                    state._fsp--;
+
+
+                    }
+                    break;
+
+            }
+
+            pushFollow(FOLLOW_batchStatementObjective_in_batchStatement1067);
+            s1=batchStatementObjective();
+
+            state._fsp--;
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:275:38: ( ';' )?
+            int alt23=2;
+            int LA23_0 = input.LA(1);
+
+            if ( (LA23_0==84) ) {
+                alt23=1;
+            }
+            switch (alt23) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:275:38: ';'
+                    {
+                    match(input,84,FOLLOW_84_in_batchStatement1069); 
+
+                    }
+                    break;
+
+            }
+
+             statements.add(s1); 
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:275:67: (sN= batchStatementObjective ( ';' )? )*
+            loop25:
+            do {
+                int alt25=2;
+                int LA25_0 = input.LA(1);
+
+                if ( (LA25_0==K_INSERT||LA25_0==K_UPDATE||LA25_0==K_DELETE) ) {
+                    alt25=1;
+                }
+
+
+                switch (alt25) {
+            	case 1 :
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:275:69: sN= batchStatementObjective ( ';' )?
+            	    {
+            	    pushFollow(FOLLOW_batchStatementObjective_in_batchStatement1078);
+            	    sN=batchStatementObjective();
+
+            	    state._fsp--;
+
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:275:96: ( ';' )?
+            	    int alt24=2;
+            	    int LA24_0 = input.LA(1);
+
+            	    if ( (LA24_0==84) ) {
+            	        alt24=1;
+            	    }
+            	    switch (alt24) {
+            	        case 1 :
+            	            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:275:96: ';'
+            	            {
+            	            match(input,84,FOLLOW_84_in_batchStatement1080); 
+
+            	            }
+            	            break;
+
+            	    }
+
+            	     statements.add(sN); 
+
+            	    }
+            	    break;
+
+            	default :
+            	    break loop25;
+                }
+            } while (true);
+
+            match(input,K_APPLY,FOLLOW_K_APPLY_in_batchStatement1094); 
+            match(input,K_BATCH,FOLLOW_K_BATCH_in_batchStatement1096); 
+            pushFollow(FOLLOW_endStmnt_in_batchStatement1098);
+            endStmnt();
+
+            state._fsp--;
+
+
+                      return new BatchStatement(statements, attrs);
+                  
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return expr;
+    }
+    // $ANTLR end "batchStatement"
+
+
+    // $ANTLR start "batchStatementObjective"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:282:1: batchStatementObjective returns [AbstractModification statement] : (i= insertStatement | u= updateStatement | d= deleteStatement );
+    public final AbstractModification batchStatementObjective() throws RecognitionException {
+        AbstractModification statement = null;
+
+        UpdateStatement i = null;
+
+        UpdateStatement u = null;
+
+        DeleteStatement d = null;
+
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:283:5: (i= insertStatement | u= updateStatement | d= deleteStatement )
+            int alt26=3;
+            switch ( input.LA(1) ) {
+            case K_INSERT:
+                {
+                alt26=1;
+                }
+                break;
+            case K_UPDATE:
+                {
+                alt26=2;
+                }
+                break;
+            case K_DELETE:
+                {
+                alt26=3;
+                }
+                break;
+            default:
+                NoViableAltException nvae =
+                    new NoViableAltException("", 26, 0, input);
+
+                throw nvae;
+            }
+
+            switch (alt26) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:283:7: i= insertStatement
+                    {
+                    pushFollow(FOLLOW_insertStatement_in_batchStatementObjective1129);
+                    i=insertStatement();
+
+                    state._fsp--;
+
+                     statement = i; 
+
+                    }
+                    break;
+                case 2 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:284:7: u= updateStatement
+                    {
+                    pushFollow(FOLLOW_updateStatement_in_batchStatementObjective1142);
+                    u=updateStatement();
+
+                    state._fsp--;
+
+                     statement = u; 
+
+                    }
+                    break;
+                case 3 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:285:7: d= deleteStatement
+                    {
+                    pushFollow(FOLLOW_deleteStatement_in_batchStatementObjective1155);
+                    d=deleteStatement();
+
+                    state._fsp--;
+
+                     statement = d; 
+
+                    }
+                    break;
+
+            }
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return statement;
+    }
+    // $ANTLR end "batchStatementObjective"
+
+
+    // $ANTLR start "updateStatement"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:288:1: updateStatement returns [UpdateStatement expr] : K_UPDATE columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) ( usingClause[attrs] )? K_SET termPairWithOperation[columns] ( ',' termPairWithOperation[columns] )* K_WHERE (key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' ) ) ;
+    public final UpdateStatement updateStatement() throws RecognitionException {
+        UpdateStatement expr = null;
+
+        Token columnFamily=null;
+        Term key_alias = null;
+
+        Term key = null;
+
+        List<Term> keys = null;
+
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:302:5: ( K_UPDATE columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) ( usingClause[attrs] )? K_SET termPairWithOperation[columns] ( ',' termPairWithOperation[columns] )* K_WHERE (key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' ) ) )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:302:7: K_UPDATE columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) ( usingClause[attrs] )? K_SET termPairWithOperation[columns] ( ',' termPairWithOperation[columns] )* K_WHERE (key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' ) )
+            {
+
+                      Attributes attrs = new Attributes();
+                      Map<Term, Operation> columns = new HashMap<Term, Operation>();
+                      List<Term> keyList = null;
+                  
+            match(input,K_UPDATE,FOLLOW_K_UPDATE_in_updateStatement1189); 
+            columnFamily=(Token)input.LT(1);
+            if ( input.LA(1)==IDENT||(input.LA(1)>=STRING_LITERAL && input.LA(1)<=INTEGER) ) {
+                input.consume();
+                state.errorRecovery=false;
+            }
+            else {
+                MismatchedSetException mse = new MismatchedSetException(null,input);
+                throw mse;
+            }
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:308:11: ( usingClause[attrs] )?
+            int alt27=2;
+            int LA27_0 = input.LA(1);
+
+            if ( (LA27_0==K_USING) ) {
+                alt27=1;
+            }
+            switch (alt27) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:308:13: usingClause[attrs]
+                    {
+                    pushFollow(FOLLOW_usingClause_in_updateStatement1219);
+                    usingClause(attrs);
+
+                    state._fsp--;
+
+
+                    }
+                    break;
+
+            }
+
+            match(input,K_SET,FOLLOW_K_SET_in_updateStatement1235); 
+            pushFollow(FOLLOW_termPairWithOperation_in_updateStatement1237);
+            termPairWithOperation(columns);
+
+            state._fsp--;
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:309:48: ( ',' termPairWithOperation[columns] )*
+            loop28:
+            do {
+                int alt28=2;
+                int LA28_0 = input.LA(1);
+
+                if ( (LA28_0==82) ) {
+                    alt28=1;
+                }
+
+
+                switch (alt28) {
+            	case 1 :
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:309:49: ',' termPairWithOperation[columns]
+            	    {
+            	    match(input,82,FOLLOW_82_in_updateStatement1241); 
+            	    pushFollow(FOLLOW_termPairWithOperation_in_updateStatement1243);
+            	    termPairWithOperation(columns);
+
+            	    state._fsp--;
+
+
+            	    }
+            	    break;
+
+            	default :
+            	    break loop28;
+                }
+            } while (true);
+
+            match(input,K_WHERE,FOLLOW_K_WHERE_in_updateStatement1258); 
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:310:19: (key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' ) )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:310:21: key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' )
+            {
+            pushFollow(FOLLOW_term_in_updateStatement1264);
+            key_alias=term();
+
+            state._fsp--;
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:310:36: ( '=' key= term | K_IN '(' keys= termList ')' )
+            int alt29=2;
+            int LA29_0 = input.LA(1);
+
+            if ( (LA29_0==85) ) {
+                alt29=1;
+            }
+            else if ( (LA29_0==K_IN) ) {
+                alt29=2;
+            }
+            else {
+                NoViableAltException nvae =
+                    new NoViableAltException("", 29, 0, input);
+
+                throw nvae;
+            }
+            switch (alt29) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:310:37: '=' key= term
+                    {
+                    match(input,85,FOLLOW_85_in_updateStatement1267); 
+                    pushFollow(FOLLOW_term_in_updateStatement1271);
+                    key=term();
+
+                    state._fsp--;
+
+                     keyList = Collections.singletonList(key); 
+
+                    }
+                    break;
+                case 2 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:312:37: K_IN '(' keys= termList ')'
+                    {
+                    match(input,K_IN,FOLLOW_K_IN_in_updateStatement1349); 
+                    match(input,80,FOLLOW_80_in_updateStatement1351); 
+                    pushFollow(FOLLOW_termList_in_updateStatement1355);
+                    keys=termList();
+
+                    state._fsp--;
+
+                     keyList = keys; 
+                    match(input,81,FOLLOW_81_in_updateStatement1359); 
+
+                    }
+                    break;
+
+            }
+
+
+            }
+
+
+                      return new UpdateStatement((columnFamily!=null?columnFamily.getText():null), key_alias.getText(), columns, keyList, attrs);
+                  
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return expr;
+    }
+    // $ANTLR end "updateStatement"
+
+
+    // $ANTLR start "deleteStatement"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:318:1: deleteStatement returns [DeleteStatement expr] : K_DELETE (cols= termList )? K_FROM columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) ( usingClauseDelete[attrs] )? K_WHERE (key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' ) )? ;
+    public final DeleteStatement deleteStatement() throws RecognitionException {
+        DeleteStatement expr = null;
+
+        Token columnFamily=null;
+        List<Term> cols = null;
+
+        Term key_alias = null;
+
+        Term key = null;
+
+        List<Term> keys = null;
+
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:329:5: ( K_DELETE (cols= termList )? K_FROM columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) ( usingClauseDelete[attrs] )? K_WHERE (key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' ) )? )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:329:7: K_DELETE (cols= termList )? K_FROM columnFamily= ( IDENT | STRING_LITERAL | INTEGER ) ( usingClauseDelete[attrs] )? K_WHERE (key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' ) )?
+            {
+
+                      Attributes attrs = new Attributes();
+                      List<Term> keyList = null;
+                      List<Term> columnsList = Collections.emptyList();
+                  
+            match(input,K_DELETE,FOLLOW_K_DELETE_in_deleteStatement1401); 
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:335:11: (cols= termList )?
+            int alt30=2;
+            int LA30_0 = input.LA(1);
+
+            if ( (LA30_0==IDENT||(LA30_0>=STRING_LITERAL && LA30_0<=INTEGER)||(LA30_0>=K_KEY && LA30_0<=FLOAT)||LA30_0==UUID) ) {
+                alt30=1;
+            }
+            switch (alt30) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:335:13: cols= termList
+                    {
+                    pushFollow(FOLLOW_termList_in_deleteStatement1417);
+                    cols=termList();
+
+                    state._fsp--;
+
+                     columnsList = cols; 
+
+                    }
+                    break;
+
+            }
+
+            match(input,K_FROM,FOLLOW_K_FROM_in_deleteStatement1433); 
+            columnFamily=(Token)input.LT(1);
+            if ( input.LA(1)==IDENT||(input.LA(1)>=STRING_LITERAL && input.LA(1)<=INTEGER) ) {
+                input.consume();
+                state.errorRecovery=false;
+            }
+            else {
+                MismatchedSetException mse = new MismatchedSetException(null,input);
+                throw mse;
+            }
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:337:11: ( usingClauseDelete[attrs] )?
+            int alt31=2;
+            int LA31_0 = input.LA(1);
+
+            if ( (LA31_0==K_USING) ) {
+                alt31=1;
+            }
+            switch (alt31) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:337:13: usingClauseDelete[attrs]
+                    {
+                    pushFollow(FOLLOW_usingClauseDelete_in_deleteStatement1463);
+                    usingClauseDelete(attrs);
+
+                    state._fsp--;
+
+
+                    }
+                    break;
+
+            }
+
+            match(input,K_WHERE,FOLLOW_K_WHERE_in_deleteStatement1479); 
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:338:19: (key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' ) )?
+            int alt33=2;
+            int LA33_0 = input.LA(1);
+
+            if ( (LA33_0==IDENT||(LA33_0>=STRING_LITERAL && LA33_0<=INTEGER)||(LA33_0>=K_KEY && LA33_0<=FLOAT)||LA33_0==UUID) ) {
+                alt33=1;
+            }
+            switch (alt33) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:338:21: key_alias= term ( '=' key= term | K_IN '(' keys= termList ')' )
+                    {
+                    pushFollow(FOLLOW_term_in_deleteStatement1485);
+                    key_alias=term();
+
+                    state._fsp--;
+
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:338:36: ( '=' key= term | K_IN '(' keys= termList ')' )
+                    int alt32=2;
+                    int LA32_0 = input.LA(1);
+
+                    if ( (LA32_0==85) ) {
+                        alt32=1;
+                    }
+                    else if ( (LA32_0==K_IN) ) {
+                        alt32=2;
+                    }
+                    else {
+                        NoViableAltException nvae =
+                            new NoViableAltException("", 32, 0, input);
+
+                        throw nvae;
+                    }
+                    switch (alt32) {
+                        case 1 :
+                            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:338:37: '=' key= term
+                            {
+                            match(input,85,FOLLOW_85_in_deleteStatement1488); 
+                            pushFollow(FOLLOW_term_in_deleteStatement1492);
+                            key=term();
+
+                            state._fsp--;
+
+                             keyList = Collections.singletonList(key); 
+
+                            }
+                            break;
+                        case 2 :
+                            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:339:38: K_IN '(' keys= termList ')'
+                            {
+                            match(input,K_IN,FOLLOW_K_IN_in_deleteStatement1543); 
+                            match(input,80,FOLLOW_80_in_deleteStatement1545); 
+                            pushFollow(FOLLOW_termList_in_deleteStatement1549);
+                            keys=termList();
+
+                            state._fsp--;
+
+                             keyList = keys; 
+                            match(input,81,FOLLOW_81_in_deleteStatement1553); 
+
+                            }
+                            break;
+
+                    }
+
+
+                    }
+                    break;
+
+            }
+
+
+                      return new DeleteStatement(columnsList, (columnFamily!=null?columnFamily.getText():null), key_alias.getText(), keyList, attrs);
+                  
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return expr;
+    }
+    // $ANTLR end "deleteStatement"
+
+
+    // $ANTLR start "createKeyspaceStatement"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:348:1: createKeyspaceStatement returns [CreateKeyspaceStatement expr] : K_CREATE K_KEYSPACE keyspace= ( IDENT | STRING_LITERAL | INTEGER ) K_WITH a1= ( COMPIDENT | IDENT ) '=' v1= ( STRING_LITERAL | INTEGER | IDENT ) ( K_AND aN= ( COMPIDENT | IDENT ) '=' vN= ( STRING_LITERAL | INTEGER | IDENT ) )* endStmnt ;
+    public final CreateKeyspaceStatement createKeyspaceStatement() throws RecognitionException {
+        CreateKeyspaceStatement expr = null;
+
+        Token keyspace=null;
+        Token a1=null;
+        Token v1=null;
+        Token aN=null;
+        Token vN=null;
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:350:5: ( K_CREATE K_KEYSPACE keyspace= ( IDENT | STRING_LITERAL | INTEGER ) K_WITH a1= ( COMPIDENT | IDENT ) '=' v1= ( STRING_LITERAL | INTEGER | IDENT ) ( K_AND aN= ( COMPIDENT | IDENT ) '=' vN= ( STRING_LITERAL | INTEGER | IDENT ) )* endStmnt )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:350:7: K_CREATE K_KEYSPACE keyspace= ( IDENT | STRING_LITERAL | INTEGER ) K_WITH a1= ( COMPIDENT | IDENT ) '=' v1= ( STRING_LITERAL | INTEGER | IDENT ) ( K_AND aN= ( COMPIDENT | IDENT ) '=' vN= ( STRING_LITERAL | INTEGER | IDENT ) )* endStmnt
+            {
+
+                      Map<String, String> attrs = new HashMap<String, String>();
+                  
+            match(input,K_CREATE,FOLLOW_K_CREATE_in_createKeyspaceStatement1616); 
+            match(input,K_KEYSPACE,FOLLOW_K_KEYSPACE_in_createKeyspaceStatement1618); 
+            keyspace=(Token)input.LT(1);
+            if ( input.LA(1)==IDENT||(input.LA(1)>=STRING_LITERAL && input.LA(1)<=INTEGER) ) {
+                input.consume();
+                state.errorRecovery=false;
+            }
+            else {
+                MismatchedSetException mse = new MismatchedSetException(null,input);
+                throw mse;
+            }
+
+            match(input,K_WITH,FOLLOW_K_WITH_in_createKeyspaceStatement1646); 
+            a1=(Token)input.LT(1);
+            if ( input.LA(1)==IDENT||input.LA(1)==COMPIDENT ) {
+                input.consume();
+                state.errorRecovery=false;
+            }
+            else {
+                MismatchedSetException mse = new MismatchedSetException(null,input);
+                throw mse;
+            }
+
+            match(input,85,FOLLOW_85_in_createKeyspaceStatement1661); 
+            v1=(Token)input.LT(1);
+            if ( input.LA(1)==IDENT||(input.LA(1)>=STRING_LITERAL && input.LA(1)<=INTEGER) ) {
+                input.consume();
+                state.errorRecovery=false;
+            }
+            else {
+                MismatchedSetException mse = new MismatchedSetException(null,input);
+                throw mse;
+            }
+
+             attrs.put((a1!=null?a1.getText():null), (v1!=null?v1.getText():null)); 
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:355:11: ( K_AND aN= ( COMPIDENT | IDENT ) '=' vN= ( STRING_LITERAL | INTEGER | IDENT ) )*
+            loop34:
+            do {
+                int alt34=2;
+                int LA34_0 = input.LA(1);
+
+                if ( (LA34_0==K_AND) ) {
+                    alt34=1;
+                }
+
+
+                switch (alt34) {
+            	case 1 :
+            	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:355:13: K_AND aN= ( COMPIDENT | IDENT ) '=' vN= ( STRING_LITERAL | INTEGER | IDENT )
+            	    {
+            	    match(input,K_AND,FOLLOW_K_AND_in_createKeyspaceStatement1693); 
+            	    aN=(Token)input.LT(1);
+            	    if ( input.LA(1)==IDENT||input.LA(1)==COMPIDENT ) {
+            	        input.consume();
+            	        state.errorRecovery=false;
+            	    }
+            	    else {
+            	        MismatchedSetException mse = new MismatchedSetException(null,input);
+            	        throw mse;
+            	    }
+
+            	    match(input,85,FOLLOW_85_in_createKeyspaceStatement1707); 
+            	    vN=(Token)input.LT(1);
+            	    if ( input.LA(1)==IDENT||(input.LA(1)>=STRING_LITERAL && input.LA(1)<=INTEGER) ) {
+            	        input.consume();
+            	        state.errorRecovery=false;
+            	    }
+            	    else {
+            	        MismatchedSetException mse = new MismatchedSetException(null,input);
+            	        throw mse;
+            	    }
+
+            	     attrs.put((aN!=null?aN.getText():null), (vN!=null?vN.getText():null)); 
+
+            	    }
+            	    break;
+
+            	default :
+            	    break loop34;
+                }
+            } while (true);
+
+            pushFollow(FOLLOW_endStmnt_in_createKeyspaceStatement1740);
+            endStmnt();
+
+            state._fsp--;
+
+
+                      return new CreateKeyspaceStatement((keyspace!=null?keyspace.getText():null), attrs);
+                  
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }
+        finally {
+        }
+        return expr;
+    }
+    // $ANTLR end "createKeyspaceStatement"
+
+
+    // $ANTLR start "createColumnFamilyStatement"
+    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:362:1: createColumnFamilyStatement returns [CreateColumnFamilyStatement expr] : K_CREATE K_COLUMNFAMILY name= ( IDENT | STRING_LITERAL | INTEGER ) ( '(' createCfamColumns[expr] ( ',' createCfamColumns[expr] )* ')' )? ( K_WITH prop1= IDENT '=' arg1= createCfamKeywordArgument ( K_AND propN= IDENT '=' argN= createCfamKeywordArgument )* )? endStmnt ;
+    public final CreateColumnFamilyStatement createColumnFamilyStatement() throws RecognitionException {
+        CreateColumnFamilyStatement expr = null;
+
+        Token name=null;
+        Token prop1=null;
+        Token propN=null;
+        String arg1 = null;
+
+        String argN = null;
+
+
+        try {
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:370:5: ( K_CREATE K_COLUMNFAMILY name= ( IDENT | STRING_LITERAL | INTEGER ) ( '(' createCfamColumns[expr] ( ',' createCfamColumns[expr] )* ')' )? ( K_WITH prop1= IDENT '=' arg1= createCfamKeywordArgument ( K_AND propN= IDENT '=' argN= createCfamKeywordArgument )* )? endStmnt )
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:370:7: K_CREATE K_COLUMNFAMILY name= ( IDENT | STRING_LITERAL | INTEGER ) ( '(' createCfamColumns[expr] ( ',' createCfamColumns[expr] )* ')' )? ( K_WITH prop1= IDENT '=' arg1= createCfamKeywordArgument ( K_AND propN= IDENT '=' argN= createCfamKeywordArgument )* )? endStmnt
+            {
+            match(input,K_CREATE,FOLLOW_K_CREATE_in_createColumnFamilyStatement1775); 
+            match(input,K_COLUMNFAMILY,FOLLOW_K_COLUMNFAMILY_in_createColumnFamilyStatement1777); 
+            name=(Token)input.LT(1);
+            if ( input.LA(1)==IDENT||(input.LA(1)>=STRING_LITERAL && input.LA(1)<=INTEGER) ) {
+                input.consume();
+                state.errorRecovery=false;
+            }
+            else {
+                MismatchedSetException mse = new MismatchedSetException(null,input);
+                throw mse;
+            }
+
+             expr = new CreateColumnFamilyStatement((name!=null?name.getText():null)); 
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:371:7: ( '(' createCfamColumns[expr] ( ',' createCfamColumns[expr] )* ')' )?
+            int alt36=2;
+            int LA36_0 = input.LA(1);
+
+            if ( (LA36_0==80) ) {
+                alt36=1;
+            }
+            switch (alt36) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:371:9: '(' createCfamColumns[expr] ( ',' createCfamColumns[expr] )* ')'
+                    {
+                    match(input,80,FOLLOW_80_in_createColumnFamilyStatement1805); 
+                    pushFollow(FOLLOW_createCfamColumns_in_createColumnFamilyStatement1807);
+                    createCfamColumns(expr);
+
+                    state._fsp--;
+
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:371:37: ( ',' createCfamColumns[expr] )*
+                    loop35:
+                    do {
+                        int alt35=2;
+                        int LA35_0 = input.LA(1);
+
+                        if ( (LA35_0==82) ) {
+                            alt35=1;
+                        }
+
+
+                        switch (alt35) {
+                    	case 1 :
+                    	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:371:39: ',' createCfamColumns[expr]
+                    	    {
+                    	    match(input,82,FOLLOW_82_in_createColumnFamilyStatement1812); 
+                    	    pushFollow(FOLLOW_createCfamColumns_in_createColumnFamilyStatement1814);
+                    	    createCfamColumns(expr);
+
+                    	    state._fsp--;
+
+
+                    	    }
+                    	    break;
+
+                    	default :
+                    	    break loop35;
+                        }
+                    } while (true);
+
+                    match(input,81,FOLLOW_81_in_createColumnFamilyStatement1820); 
+
+                    }
+                    break;
+
+            }
+
+            // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:372:7: ( K_WITH prop1= IDENT '=' arg1= createCfamKeywordArgument ( K_AND propN= IDENT '=' argN= createCfamKeywordArgument )* )?
+            int alt38=2;
+            int LA38_0 = input.LA(1);
+
+            if ( (LA38_0==K_WITH) ) {
+                alt38=1;
+            }
+            switch (alt38) {
+                case 1 :
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:372:9: K_WITH prop1= IDENT '=' arg1= createCfamKeywordArgument ( K_AND propN= IDENT '=' argN= createCfamKeywordArgument )*
+                    {
+                    match(input,K_WITH,FOLLOW_K_WITH_in_createColumnFamilyStatement1833); 
+                    prop1=(Token)match(input,IDENT,FOLLOW_IDENT_in_createColumnFamilyStatement1837); 
+                    match(input,85,FOLLOW_85_in_createColumnFamilyStatement1839); 
+                    pushFollow(FOLLOW_createCfamKeywordArgument_in_createColumnFamilyStatement1843);
+                    arg1=createCfamKeywordArgument();
+
+                    state._fsp--;
+
+                     expr.addProperty((prop1!=null?prop1.getText():null), arg1); 
+                    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:373:11: ( K_AND propN= IDENT '=' argN= createCfamKeywordArgument )*
+                    loop37:
+                    do {
+                        int alt37=2;
+                        int LA37_0 = input.LA(1);
+
+                        if ( (LA37_0==K_AND) ) {
+                            alt37=1;
+                        }
+
+
+                        switch (alt37) {
+                    	case 1 :
+                    	    // /home/drift/svn/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g:373:13: K_AND propN= IDENT '=' argN= createCfamKeywordArgument
+                    	    {
+                    	    match(input,K_AND,FOLLOW_K_AND_in_createColumnFamilyStatement1859); 
+                    	    propN=(Token)match(input,IDENT,FOLLOW_IDENT_in_createColumnFamilyStatement1863); 
+                    	    match(input,85,FOLLOW_85_in_createColumnFamilyStatement1865); 
+                    	    pushFollow(FOLLOW_createCfamKeywordArgument_in_createColumnFamilyStatement1869);
+                    	    argN=createCfamKeywordArgument();
+
+                    	    state._fsp--;
+
+                    	     expr.addProperty((propN!=null?propN.getText():null), argN); 
+
+                    	    }
+                    	    break;
+
+                    	default :
+                    	    break loop37;
+                        }
+                    } while (true);
+
+
+                    }
+                    break;
+
+            }
+
+            pushFollow(FOLLOW_endStmnt_in_createColumnFamilyStatement1891);
+            endStmnt();
+
+            state._fsp--;
+
+
+            }
+
+        }
+        catch (RecognitionException re) {
+            reportError(re);
+            recover(input,re);
+        }

[... 1626 lines stripped ...]


Mime
View raw message