check in changes to allow [this.length] into grammar
[repair.git] / Repair / RepairCompiler / MCC / TDL.cup
index 6436236423a89f9b77e46b6021cc4c1314fcdbc4..b2e990e9b724c2128e38cc624cf03c7d0ed96388 100755 (executable)
@@ -133,6 +133,7 @@ parser code {:
     terminal FORALL;
     terminal IN;
     terminal INTEST;
+    terminal THIS;
 
     terminal COMMA;
     terminal SIZEOF;
@@ -474,7 +475,18 @@ location ::=
      
 expr ::= 
 
-       simple_expr:se 
+       THIS DOT ID:field
+       {:
+       debugMessage(PRODSTRING);
+       ParseNode expr = new ParseNode("expr", parser.curLine(1));
+       ParseNode sexpr = new ParseNode("simple_expr", parser.curLine(1));
+       ParseNode loc = new ParseNode("location", parser.curLine(1));
+       loc.addChild("thisfield",parser.curLine(1)).addChild(field);
+       sexpr.addChild(loc);
+       expr.addChild(sexpr);
+       RESULT = expr;
+       :}
+       | simple_expr:se 
        {:
        debugMessage(PRODSTRING);
        ParseNode expr = new ParseNode("expr", parser.curLine(1));