diff --git a/asterix-app/src/test/resources/runtimets/queries/distinct/query-issue443-2/query-issue443-2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/distinct/query-issue443-2/query-issue443-2.3.query.aql
index 6b09eec..eee12d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/distinct/query-issue443-2/query-issue443-2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/distinct/query-issue443-2/query-issue443-2.3.query.aql
@@ -1,11 +1,10 @@
 /*
  * Description  : This test case is to verify the fix for issue443
- 				: https://code.google.com/p/asterixdb/issues/detail?id=443
- * Expected Res : Fail
+ * https://code.google.com/p/asterixdb/issues/detail?id=443
+ * Expected Res : Success
  * Date         : 22th May 2013
  */
 
-
-for $a in [ {"f" : 19, "g": 1} , {"f" : 12, "g": 2} , {"f" : 10, "g": 1} , {"f" : 17, "g": 1}, {"f" : 12, "g": 4} ]
+for $a in [ {"f" : 19, "g": 1} , {"f" : 12, "g": 4} , {"f" : 10, "g": 1} , {"f" : 17, "g": 1}, {"f" : 12, "g": 4} ]
 distinct by $a.f
-return $a
\ No newline at end of file
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/nestrecords/nestrecord/nestrecord.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nestrecords/nestrecord/nestrecord.2.update.aql
index bca3929..ac1a9f1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/nestrecords/nestrecord/nestrecord.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/nestrecords/nestrecord/nestrecord.2.update.aql
@@ -7,7 +7,7 @@
 use dataverse testdv2;
 
 insert into dataset testds (
-{ "id": "001", "name": "Person One", "address": {"street": "3019 DBH",  "city": "Irvine", "zip": 92697} }
+{ "id": "001", "name": "Person One", "address": {"street": "3019 DBH",  "city": "Irvine", "zip": 92697}}
 );
 
 insert into dataset testds (
@@ -15,10 +15,10 @@
 );
 
 insert into dataset testds (
-{ "id": "003", "name": "Person Three", "address": {"street": "2019 DBH",  "city": "Irvine"} }
+{ "id": "003", "name": "Person Three", "address": {"street": "2019 DBH",  "city": "Irvine"}}
 );
 
 insert into dataset testds (
-{ "id": "004", "name": "Person Four", "home": {"street": "2019 DBH",  "city": {"name": "Irvine", "zip": 92697} } }
+{ "id": "004", "name": "Person Four", "home": {"street": "2019 DBH",  "city": {"name": "Irvine", "zip": 92697}}}
 );
 
diff --git a/asterix-aql/src/main/javacc/AQL.jj b/asterix-aql/src/main/javacc/AQL.jj
index fdbcc71..cb6336b 100644
--- a/asterix-aql/src/main/javacc/AQL.jj
+++ b/asterix-aql/src/main/javacc/AQL.jj
@@ -13,11 +13,12 @@
 import java.io.*;
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Stack;
-
 import java.util.Map;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
+
+import org.apache.xerces.util.IntStack;
+
 import edu.uci.ics.asterix.aql.literal.FloatLiteral;
 import edu.uci.ics.asterix.aql.literal.DoubleLiteral;
 import edu.uci.ics.asterix.aql.literal.FalseLiteral;
@@ -278,7 +279,7 @@
       ncNames = new ArrayList<Identifier>();
       ncNames.add(new Identifier(tmp));
     }
-  ( "," tmp = Identifier()
+  ( <COMMA> tmp = Identifier()
     {
       ncNames.add(new Identifier(tmp));
     }
@@ -385,7 +386,7 @@
     {
       cis.addFieldExpr(fieldExpr);
     }
-  ) ("," fieldExpr = Identifier()
+  ) (<COMMA> fieldExpr = Identifier()
     {
       cis.addFieldExpr(fieldExpr);
     }
@@ -464,11 +465,11 @@
   "function" nameComponents = FunctionOrTypeName()
   ifNotExists = IfNotExists()
   paramList = ParameterList()
-  "{"
+  <LEFTBRACE>
     {
       beginPos = token;
     } 
-  functionBodyExpr = Expression() "}"
+  functionBodyExpr = Expression() <RIGHTBRACE>
     {
       endPos = token;
       functionBody = extractFragment(beginPos.beginLine, beginPos.beginColumn, endPos.beginLine, endPos.beginColumn);
@@ -493,7 +494,7 @@
       paramList.add(var);
       getCurrentScope().addNewVarSymbolToScope(var);
     }
-  ("," <VARIABLE>
+  (<COMMA> <VARIABLE>
     {
       var = new VarIdentifier();
       var.setValue(token.image);
@@ -560,7 +561,7 @@
     {
       primaryKeyFields.add(tmp);
     }
-  ( "," tmp = Identifier()
+  ( <COMMA> tmp = Identifier()
     {
       primaryKeyFields.add(tmp);
     }
@@ -616,7 +617,7 @@
 {
 }
 {
-  ( "if" "exists"
+  ( <IF> "exists"
     {
       return true;
     }
@@ -650,7 +651,7 @@
       getCurrentScope().addNewVarSymbolToScope(var.getVar());
     }
   "from" <DATASET> nameComponents  = QualifiedName() 
-  ("where" condition = Expression())?
+  (<WHERE> condition = Expression())?
     {
       return new DeleteStatement(var, nameComponents.first, nameComponents.second, condition, getVarCounter());
     }
@@ -665,13 +666,13 @@
   List<UpdateClause> ucs = new ArrayList<UpdateClause>();
 }
 {
-  "update" vars = Variable() "in" target = Expression()
-  "where" condition = Expression() 
+  "update" vars = Variable() <IN> target = Expression()
+  <WHERE> condition = Expression() 
   <LEFTPAREN> (uc = UpdateClause()
     {
       ucs.add(uc);
     }
-  ("," uc = UpdateClause()
+  (<COMMA> uc = UpdateClause()
     {
       ucs.add(uc);
     }
@@ -693,13 +694,13 @@
   UpdateClause elsebranch = null;
 }
 {
-   "set" target = Expression() ":=" value = Expression() 
+   "set" target = Expression() <ASSIGN> value = Expression() 
    | is = InsertStatement()
    | ds = DeleteStatement()
    | us = UpdateStatement()
-   | "if" <LEFTPAREN> condition = Expression() <RIGHTPAREN>
-     "then" ifbranch = UpdateClause()
-     [LOOKAHEAD(1) "else" elsebranch = UpdateClause()] 
+   | <IF> <LEFTPAREN> condition = Expression() <RIGHTPAREN>
+     <THEN> ifbranch = UpdateClause()
+     [LOOKAHEAD(1) <ELSE> elsebranch = UpdateClause()] 
      {
        return new UpdateClause(target, value, is, ds, us, condition, ifbranch, elsebranch);
      }
@@ -726,7 +727,7 @@
   Pair<Identifier,Identifier> nameComponents = null;
 }
 {
-  "write" "output" "to" nodeName = Identifier() ":" fileName = StringLiteral()
+  "write" "output" "to" nodeName = Identifier() <COLON> fileName = StringLiteral()
     ( "using" writerClass = StringLiteral() )?
     {                  
       return new WriteStatement(new Identifier(nodeName), fileName, writerClass);         
@@ -815,7 +816,7 @@
     {
       configuration.put(keyValuePair.first, keyValuePair.second);
     }
-  ( "," keyValuePair = KeyValuePair()
+  ( <COMMA> keyValuePair = KeyValuePair()
     {
       configuration.put(keyValuePair.first, keyValuePair.second);
     }
@@ -831,7 +832,7 @@
   String value;
 }
 {
-  <LEFTPAREN> key = StringLiteral() "=" value = StringLiteral() <RIGHTPAREN>
+  <LEFTPAREN> key = StringLiteral() <EQ> value = StringLiteral() <RIGHTPAREN>
     {
       return new Pair<String, String>(key, value);
     }  
@@ -847,7 +848,7 @@
     {
       properties.put(property.first, property.second);
     }
-  ( "," property = Property() 
+  ( <COMMA> property = Property() 
     {
       properties.put(property.first, property.second);
     }
@@ -863,7 +864,7 @@
   String value;
 }
 {
-  key = Identifier() "=" ( value = StringLiteral() | <INTEGER_LITERAL>
+  key = Identifier() <EQ> ( value = StringLiteral() | <INTEGER_LITERAL>
     {
       try {
         value = "" + Long.valueOf(token.image);
@@ -901,7 +902,7 @@
 {
   ( "closed" { recordKind = RecordTypeDefinition.RecordKind.CLOSED; } 
     | "open" { recordKind = RecordTypeDefinition.RecordKind.OPEN; } )?
-   "{"
+   <LEFTBRACE>
     {
       String hint = getHint(token);
       if (hint != null) { 
@@ -922,9 +923,9 @@
     }
 		( 
 		  RecordField(recType)
-		  ( ","  RecordField(recType) )*
+		  ( <COMMA>  RecordField(recType) )*
 		)?
-   "}"
+   <RIGHTBRACE>
    {
       if (recordKind == null) {
         recordKind = RecordTypeDefinition.RecordKind.OPEN;
@@ -946,7 +947,7 @@
       String hint = getHint(token);
       IRecordFieldDataGen rfdg = hint != null ? parseFieldDataGen(hint) : null;
     }
-  ":" type =  TypeExpr() ("?" { nullable = true; } )?
+  <COLON> type =  TypeExpr() (<QUES> { nullable = true; } )?
     {
       recType.addField(fieldName, type, nullable, rfdg);
     }   
@@ -968,9 +969,9 @@
   TypeExpression type = null;
 }
 {
-  "["
+  <LEFTBRACKET>
     ( type =  TypeExpr() )
-  "]"
+  <RIGHTBRACKET>
   {
     return new OrderedListTypeDefinition(type);
   }
@@ -982,9 +983,9 @@
   TypeExpression type = null;
 }
 {
-  "{{"
+  <LEFTDBLBRACE>
     ( type =  TypeExpr() )
-  "}}"
+  <RIGHTDBLBRACE>
   {
     return new UnorderedListTypeDefinition(type);
   }
@@ -1036,7 +1037,7 @@
   String second = null;
 }
 {
-  first = Identifier() ("." second = Identifier())?
+  first = Identifier() (<DOT> second = Identifier())?
   {
     Identifier id1 = null;
     Identifier id2 = null;
@@ -1058,7 +1059,7 @@
   String third = null;
 }
 {
-  first = Identifier() "." second = Identifier() ("." third = Identifier())?
+  first = Identifier() <DOT> second = Identifier() (<DOT> third = Identifier())?
   {
     Identifier id1 = null;
     Identifier id2 = null;
@@ -1087,7 +1088,7 @@
 {
   "declare" "function" functionName = Identifier()
   paramList = ParameterList()
-  "{" funcBody = Expression() "}"
+  <LEFTBRACE> funcBody = Expression() <RIGHTBRACE>
     {
       signature = new FunctionSignature(defaultDataverse, functionName, paramList.size());
       getCurrentScope().addFunctionDescriptor(signature, false);
@@ -1147,7 +1148,7 @@
 	operand = AndExpr()
 	(
 	
-	  "or"
+	  <OR>
   	{
   	  if (op == null) {
   	    op = new OperatorExpr();
@@ -1178,7 +1179,7 @@
 	operand = RelExpr()
 	(
 	
-	  "and"
+	  <AND>
   	{
   	  if (op == null) {
   	    op = new OperatorExpr();
@@ -1221,7 +1222,7 @@
     } 
 
     (
-      LOOKAHEAD(2)( "<" | ">" | "<=" | ">=" | "=" | "!=" |"~=")
+      LOOKAHEAD(2)( <LT> | <GT> | <LE> | <GE> | <EQ> | <NE> |<SIMILAR>)
   	  {
   	    String mhint = getHint(token);
   	    if (mhint != null && mhint.equals(INDEXED_NESTED_LOOP_JOIN_HINT)) {
@@ -1265,7 +1266,7 @@
 {
 	operand = MultExpr()
 
-	( ("+" | "-")
+	( (<PLUS> | <MINUS>)
   	{
   	  if (op == null) {
   	    op = new OperatorExpr();
@@ -1294,7 +1295,7 @@
 {
 	operand = UnionExpr()
 
-	(( "*" | "/" | "%" | <CARET> | "idiv")
+	(( <MUL> | <DIV> | <MOD> | <CARET> | <IDIV>)
   	{
   	  if (op == null) {
   	    op = new OperatorExpr();
@@ -1322,7 +1323,7 @@
 }
 {
    operand1 = UnaryExpr() 
-   ("union" 
+   (<UNION> 
        (operand2 = UnaryExpr()) {
           if (union == null) {
              union = new UnionExpr();
@@ -1341,7 +1342,7 @@
 	Expression expr = null;
 }
 {
-	(( "+"|"-") 
+	( (<PLUS> | <MINUS>) 
 	{
 	  	uexpr = new UnaryExpr();
 		if("+".equals(token.image))
@@ -1394,7 +1395,7 @@
   String ident = null;
 }
 {
-  "." ident = Identifier()
+  <DOT> ident = Identifier()
     {
       return new Identifier(ident);
     }
@@ -1406,7 +1407,7 @@
 	int idx = -2;
 }
 {
-  "[" ( expr = Expression()
+  <LEFTBRACKET> ( expr = Expression()
 	{
 		if(expr.getKind() == Expression.Kind.LITERAL_EXPRESSION)
 		{
@@ -1422,7 +1423,7 @@
 
 	}
 
-  	| "?"
+  	| <QUES>
 	{
 		idx = IndexAccessor.ANY;
 	  // ANY
@@ -1430,7 +1431,7 @@
  	 
   	)
 
-   "]"
+   <RIGHTBRACKET>
 	{
 	  return idx;
 	}
@@ -1572,16 +1573,16 @@
 }
 {
 
-    "[" 
+    <LEFTBRACKET> 
 	    ( tmp = Expression()
 			{
 			  exprList.add(tmp);
 			}
 		
-		    ("," tmp = Expression() { exprList.add(tmp);  })*
+		    (<COMMA> tmp = Expression() { exprList.add(tmp);  })*
 	    )? 
     
-    "]"
+    <RIGHTBRACKET>
 
     {
       expr.setExprList(exprList);
@@ -1598,11 +1599,11 @@
 }
 {
 
-    "{{" ( tmp = Expression()
+    <LEFTDBLBRACE> ( tmp = Expression()
 	{
 	  exprList.add(tmp);
 	}
-    ("," tmp = Expression() { exprList.add(tmp);  })*)? "}}"
+    (<COMMA> tmp = Expression() { exprList.add(tmp);  })*)? <RIGHTDBLBRACE>
     {
       expr.setExprList(exprList);
       return expr;
@@ -1616,11 +1617,11 @@
   	List<FieldBinding> fbList = new ArrayList<FieldBinding>();
 }
 {
-    "{" (tmp = FieldBinding()
+    <LEFTBRACE> (tmp = FieldBinding()
     {
       fbList.add(tmp);
     }
-    ("," tmp = FieldBinding() { fbList.add(tmp);  })*)? "}"
+    (<COMMA> tmp = FieldBinding() { fbList.add(tmp);  })*)? <RIGHTBRACE>
     {
       expr.setFbList(fbList);
       return expr;
@@ -1633,7 +1634,7 @@
 	Expression left, right;
 }
 {
-    left = Expression() ":" right = Expression()
+    left = Expression() <COLON> right = Expression()
     {
       fb.setLeftExpr(left);
       fb.setRightExpr(right);
@@ -1667,7 +1668,7 @@
       argList.add(tmp);
       arity ++;
     }
-  ("," tmp = Expression()
+  (<COMMA> tmp = Expression()
     {
       argList.add(tmp);
       arity++;
@@ -1698,7 +1699,7 @@
     {
       funcName = token.image;
     }
-  ( ( arg1 = Identifier() ( "." arg2 = Identifier() )? ) 
+  ( ( arg1 = Identifier() ( <DOT> arg2 = Identifier() )? ) 
     {
       String name = arg2 == null ? arg1 : arg1 + "." + arg2;
       LiteralExpr ds = new LiteralExpr();
@@ -1737,7 +1738,7 @@
   IfExpr ifExpr = new IfExpr();
 }
 {
-    "if" <LEFTPAREN> condExpr = Expression() <RIGHTPAREN> "then" thenExpr = Expression() "else" elseExpr = Expression()
+    <IF> <LEFTPAREN> condExpr = Expression() <RIGHTPAREN> <THEN> thenExpr = Expression() <ELSE> elseExpr = Expression()
 
     {
       ifExpr.setCondExpr(condExpr);
@@ -1757,7 +1758,7 @@
 }
 {
      (tmp = ForClause()  {clauseList.add(tmp);} | tmp = LetClause() {clauseList.add(tmp);})
-      (tmp = Clause() {clauseList.add(tmp);})* "return" returnExpr = Expression()
+      (tmp = Clause() {clauseList.add(tmp);})* <RETURN> returnExpr = Expression()
 
      {
        flworg.setClauseList(clauseList);
@@ -1795,7 +1796,7 @@
 	extendCurrentScope();
 }
 {
-    "for" varExp = Variable() ("at" varPos = Variable())?  "in" ( inExp = Expression() )
+    <FOR> varExp = Variable() (<AT> varPos = Variable())?  <IN> ( inExp = Expression() )
     {
       fc.setVarExpr(varExp);
       getCurrentScope().addNewVarSymbolToScope(varExp.getVar());
@@ -1816,7 +1817,7 @@
 	extendCurrentScope();
 }
 {
-    "let" varExp = Variable() ":=" beExp = Expression()
+    <LET> varExp = Variable() <ASSIGN> beExp = Expression()
     {
       getCurrentScope().addNewVarSymbolToScope(varExp.getVar());
       lc.setVarExpr(varExp);
@@ -1831,7 +1832,7 @@
   Expression whereExpr;
 }
 {
-    "where" whereExpr = Expression()
+    <WHERE> whereExpr = Expression()
     {
       wc.setWhereExpr(whereExpr);
       return wc;
@@ -1848,7 +1849,7 @@
 }
 {
   (
-    "order" 
+    <ORDER> 
       {
          String hint = getHint(token);
          if (hint != null && hint.startsWith(INMEMORY_HINT)) {
@@ -1859,24 +1860,24 @@
            oc.setNumTuples(numTuples);   
          } 
       }     
-    "by" orderbyExpr = Expression()
+    <BY> orderbyExpr = Expression()
     {
       orderbyList.add(orderbyExpr);
       OrderbyClause.OrderModifier modif = OrderbyClause.OrderModifier.ASC;       
     }
-    ( ("asc" { modif = OrderbyClause.OrderModifier.ASC; })
-    | ("desc" { modif = OrderbyClause.OrderModifier.DESC; }))?
+    ( (<ASC> { modif = OrderbyClause.OrderModifier.ASC; })
+    | (<DESC> { modif = OrderbyClause.OrderModifier.DESC; }))?
     {
       modifierList.add(modif);
     }
     
-    ("," orderbyExpr = Expression()
+    (<COMMA> orderbyExpr = Expression()
     {
       orderbyList.add(orderbyExpr);
       modif = OrderbyClause.OrderModifier.ASC;
     }
-    ( ("asc" { modif = OrderbyClause.OrderModifier.ASC; })
-    | ("desc" { modif = OrderbyClause.OrderModifier.DESC; }))?
+    ( (<ASC> { modif = OrderbyClause.OrderModifier.ASC; })
+    | (<DESC> { modif = OrderbyClause.OrderModifier.DESC; }))?
     {
       modifierList.add(modif);
     }    
@@ -1906,39 +1907,39 @@
   	  Scope newScope = extendCurrentScopeNoPush(true); 
   	  // extendCurrentScope(true);
   	}
-    "group"
+    <GROUP>
       {
          String hint = getHint(token);
          if (hint != null && hint.equals(HASH_GROUP_BY_HINT)) {
            gbc.setHashGroupByHint(true);   
          } 
       } 
-    "by" (LOOKAHEAD(2)  var = Variable()
+    <BY> (LOOKAHEAD(2)  var = Variable()
     {
       newScope.addNewVarSymbolToScope(var.getVar());
-    } ":=")?
+    } <ASSIGN>)?
     expr = Expression() 
        {
          GbyVariableExpressionPair pair1 = new GbyVariableExpressionPair(var, expr);    
          vePairList.add(pair1);
        }
-    ("," ( LOOKAHEAD(2) var = Variable()
+    (<COMMA> ( LOOKAHEAD(2) var = Variable()
     {
       newScope.addNewVarSymbolToScope(var.getVar());
-    } ":=")?
+    } <ASSIGN>)?
     	expr = Expression()  
     	 {
            GbyVariableExpressionPair pair2 = new GbyVariableExpressionPair(var, expr);    
            vePairList.add(pair2);
          }
     	)*
-    ("decor" decorVar = Variable() ":=" decorExpr = Expression()
+    (<DECOR> decorVar = Variable() <ASSIGN> decorExpr = Expression()
        {    
          newScope.addNewVarSymbolToScope(decorVar.getVar()); 
          GbyVariableExpressionPair pair3 = new GbyVariableExpressionPair(decorVar, decorExpr);
          decorPairList.add(pair3);
        }
-      ("," "decor" decorVar = Variable() ":=" decorExpr = Expression()
+      (<COMMA> <DECOR> decorVar = Variable() <ASSIGN> decorExpr = Expression()
            { 
              newScope.addNewVarSymbolToScope(decorVar.getVar()); 
              GbyVariableExpressionPair pair4 = new GbyVariableExpressionPair(decorVar, decorExpr);
@@ -1946,14 +1947,14 @@
            }
        )*            
     )?	
-    "with" withVar = VariableRef()
+    <WITH> withVar = VariableRef()
     {
       if(withVar.getIsNewVar()==true)
       	throw new ParseException("can't find variable " + withVar.getVar());
       withVarList.add(withVar);
       newScope.addNewVarSymbolToScope(withVar.getVar());
     }
-    ("," withVar = VariableRef()
+    (<COMMA> withVar = VariableRef()
     {
       if(withVar.getIsNewVar()==true)
       	throw new ParseException("can't find variable " + withVar.getVar());
@@ -1977,8 +1978,8 @@
 	pushForbiddenScope(getCurrentScope());
 }
 {
-    "limit" expr = Expression()    { lc.setLimitExpr(expr);    }
-    ("offset" expr = Expression() { lc.setOffset(expr);    })?
+    <LIMIT> expr = Expression()    { lc.setLimitExpr(expr);    }
+    (<OFFSET> expr = Expression() { lc.setOffset(expr);    })?
 
   {
     popForbiddenScope();   
@@ -1992,11 +1993,11 @@
   Expression expr;
 }
 {
-  "distinct" "by" expr = Expression() 
+  <DISTINCT> <BY> expr = Expression() 
   {
     exprs.add(expr);
   }
-  ("," expr = Expression() 
+  (<COMMA> expr = Expression() 
   	{
   		exprs.add(expr); 
   	} 
@@ -2020,23 +2021,23 @@
     createNewScope();
   }
 	
-   (      ("some"  {  qc.setQuantifier(QuantifiedExpression.Quantifier.SOME);	})
-		| ("every" {  qc.setQuantifier(QuantifiedExpression.Quantifier.EVERY);	}))
-	var = Variable() "in" inExpr = Expression() 
+   (      (<SOME>  {  qc.setQuantifier(QuantifiedExpression.Quantifier.SOME);	})
+		| (<EVERY> {  qc.setQuantifier(QuantifiedExpression.Quantifier.EVERY);	}))
+	var = Variable() <IN> inExpr = Expression() 
 	{
 	  pair = new QuantifiedPair(var, inExpr);
       getCurrentScope().addNewVarSymbolToScope(var.getVar());
       quantifiedList.add(pair);
 	}
 	(
-	"," var = Variable() "in" inExpr = Expression() 
+	<COMMA> var = Variable() <IN> inExpr = Expression() 
 	{ 
       pair = new QuantifiedPair(var, inExpr);
       getCurrentScope().addNewVarSymbolToScope(var.getVar());
       quantifiedList.add(pair);	
 	}
 	)*
-	 "satisfies" satisfiesExpr = Expression()
+	 <SATISFIES> satisfiesExpr = Expression()
 	 {
 	   qc.setSatisfiesExpr(satisfiesExpr);
 	   qc.setQuantifiedList(quantifiedList);
@@ -2047,155 +2048,212 @@
 
 TOKEN_MGR_DECLS:
 {
-        public int commentDepth = 0;
+    public int commentDepth = 0;
+    public IntStack lexerStateStack = new IntStack();
+    
+    public void pushState() {
+      lexerStateStack.push( curLexState );
+    }
+    
+    public void popState() {
+      if (lexerStateStack.size() > 0) {
+         SwitchTo( lexerStateStack.pop() );
+      } else {
+         throw new RuntimeException();
+      }
+    }
+}
+
+<DEFAULT,IN_DBL_BRACE>
+TOKEN :
+{
+    <ASC : "asc">
+  | <AT : "at">
+  | <BY : "by">
+  | <DATASET : "dataset">
+  | <DECOR : "decor">
+  | <DESC : "desc">
+  | <DISTINCT : "distinct">
+  | <ELSE : "else">
+  | <EVERY : "every">
+  | <FOR : "for">
+  | <GROUP : "group">
+  | <IF : "if">
+  | <IN : "in">
+  | <LET : "let">
+  | <LIMIT : "limit">
+  | <OFFSET : "offset">
+  | <ORDER : "order">
+  | <RETURN : "return">
+  | <SATISFIES : "satisfies">
+  | <SOME : "some">
+  | <THEN : "then">
+  | <UNION : "union">
+  | <WHERE : "where">
+  | <WITH : "with">
+}
+
+<DEFAULT,IN_DBL_BRACE>
+TOKEN :
+{
+    <CARET : "^">
+  | <DIV : "/">
+  | <IDIV : "idiv">
+  | <MINUS : "-">
+  | <MOD : "%">
+  | <MUL : "*">
+  | <PLUS : "+">
+
+  | <LEFTPAREN : "(">
+  | <RIGHTPAREN : ")">
+  | <LEFTBRACKET : "[">
+  | <RIGHTBRACKET : "]">
+
+  | <COLON : ":">
+  | <COMMA : ",">
+  | <DOT : ".">
+  | <QUES : "?">
+
+  | <LT : "<">
+  | <GT : ">">
+  | <LE : "<=">
+  | <GE : ">=">
+  | <EQ : "=">
+  | <NE : "!=">
+  | <SIMILAR : "~=">
+  | <ASSIGN : ":=">
+
+  | <AND : "and">
+  | <OR : "or">
+}
+
+<DEFAULT,IN_DBL_BRACE>
+TOKEN :
+{
+    <LEFTBRACE : "{"> { pushState(); } : DEFAULT
 }
 
 <DEFAULT>
 TOKEN :
 {
-   <CARET : "^"  >
+    <RIGHTBRACE : "}"> { popState(); }
 }
 
-<DEFAULT>
+<DEFAULT,IN_DBL_BRACE>
 TOKEN :
 {
-   <DATASET : "dataset"  >
+    <LEFTDBLBRACE : "{{"> { pushState(); } : IN_DBL_BRACE
 }
 
-<DEFAULT>
+<IN_DBL_BRACE>
 TOKEN :
 {
-   <LEFTPAREN : "("  >
+    <RIGHTDBLBRACE : "}}"> { popState(); }
 }
 
-<DEFAULT>
+<DEFAULT,IN_DBL_BRACE>
 TOKEN :
 {
-   <RIGHTPAREN : ")"  >
+    <INTEGER_LITERAL : (<DIGIT>)+ >
 }
 
-
-<DEFAULT>
+<DEFAULT,IN_DBL_BRACE>
 TOKEN :
 {
-	<INTEGER_LITERAL : (<DIGIT>)+ >
+    <NULL : "null">
+  | <TRUE : "true">
+  | <FALSE : "false">
 }
 
-
-<DEFAULT>
+<DEFAULT,IN_DBL_BRACE>
 TOKEN :
 {
-	<NULL : "null">
+    <#DIGIT : ["0" - "9"]>
 }
 
-<DEFAULT>
-TOKEN :
-{
-	<TRUE : "true">
-}
-
-<DEFAULT>
-TOKEN :
-{
-	<FALSE : "false">
-}
-
-<DEFAULT>
-TOKEN :
-{
-	<#DIGIT : ["0" - "9"]>
-}
-
-
+<DEFAULT,IN_DBL_BRACE>
 TOKEN:
 {
-  < DOUBLE_LITERAL: <DIGITS>
+    < DOUBLE_LITERAL: <DIGITS>
         | <DIGITS> ( "." <DIGITS> )?
         | "." <DIGITS>
-  >
-  |
-  < FLOAT_LITERAL: <DIGITS> ( "f" | "F" )
+    >
+  | < FLOAT_LITERAL: <DIGITS> ( "f" | "F" )
         | <DIGITS> ( "." <DIGITS> ( "f" | "F" ) )?
         | "." <DIGITS> ( "f" | "F" )
-  >
-  |
-  <DIGITS : (<DIGIT>)+ >
+    >
+  | <DIGITS : (<DIGIT>)+ >
 }
 
-<DEFAULT>
+<DEFAULT,IN_DBL_BRACE>
 TOKEN :
 {
-	<#LETTER : ["A" - "Z", "a" - "z"]>
+    <#LETTER : ["A" - "Z", "a" - "z"]>
+  | <SPECIALCHARS : ["$", "_", "-"]>
 }
 
-<DEFAULT>
+<DEFAULT,IN_DBL_BRACE>
 TOKEN :
 {
-	<SPECIALCHARS : ["$", "_", "-"]  >
+    <STRING_LITERAL : ("\"" (<EscapeQuot> | ~["\""])* "\"") | ("\'"(<EscapeApos> | ~["\'"])* "\'")>
+  | < #EscapeQuot: "\\\"" >
+  | < #EscapeApos: "\\\'" >
 }
 
-<DEFAULT>
+<DEFAULT,IN_DBL_BRACE>
 TOKEN :
 {
-	<STRING_LITERAL : ("\"" (<EscapeQuot> | ~["\""])* "\"") | ("\'"(<EscapeApos> | ~["\'"])* "\'")>
-	|
-	< #EscapeQuot: "\\\"" >
-	|
-    < #EscapeApos: "\\\'" >
+    <IDENTIFIER : <LETTER> (<LETTER> | <DIGIT> | <SPECIALCHARS>)*>
 }
 
-<DEFAULT>
+<DEFAULT,IN_DBL_BRACE>
 TOKEN :
 {
-	<IDENTIFIER : <LETTER> (<LETTER> | <DIGIT> | <SPECIALCHARS>)*>
+    <VARIABLE : "$" <LETTER> (<LETTER> | <DIGIT> | "_")*>
 }
 
-
-<DEFAULT>
-TOKEN :
-{
-	<VARIABLE : "$" <LETTER> (<LETTER> | <DIGIT> | "_")*>
-}
-
+<DEFAULT,IN_DBL_BRACE>
 SKIP:
 {
     " "
-|   "\t"
-|   "\r"
-|   "\n"
+  | "\t"
+  | "\r"
+  | "\n"
 }
 
+<DEFAULT,IN_DBL_BRACE>
 SKIP:
 {
-	<"//" (~["\n"])* "\n">
+    <"//" (~["\n"])* "\n">
 }
 
+<DEFAULT,IN_DBL_BRACE>
 SKIP:
 {
-	<"//" (~["\n","\r"])* ("\n"|"\r"|"\r\n")?> 
+    <"//" (~["\n","\r"])* ("\n"|"\r"|"\r\n")?> 
 }
 
-
+<DEFAULT,IN_DBL_BRACE>
 SKIP:
 {
-        <"/*"> {commentDepth=1;}: INSIDE_COMMENT
+    <"/*"> { pushState(); } : INSIDE_COMMENT
 }
 
 <INSIDE_COMMENT>
 SPECIAL_TOKEN:
 {
-       <"+"(" ")*(~["*"])*>
+    <"+"(" ")*(~["*"])*>
 }
 
 <INSIDE_COMMENT>
 SKIP:
 {
-        <"/*"> {commentDepth++;}
+    <"/*"> { pushState(); }
 }
 
 <INSIDE_COMMENT>
 SKIP:
 {
-        <"*/"> {commentDepth--; if (commentDepth == 0) SwitchTo(DEFAULT);}
-|       <~[]>
+    <"*/"> { popState(); }
+  | <~[]>
 }
