check in changes to allow [this.length] into grammar
authorbdemsky <bdemsky>
Wed, 30 Aug 2006 00:18:53 +0000 (00:18 +0000)
committerbdemsky <bdemsky>
Wed, 30 Aug 2006 00:18:53 +0000 (00:18 +0000)
Repair/RepairCompiler/MCC/CDL.cup
Repair/RepairCompiler/MCC/Lexer.lex
Repair/RepairCompiler/MCC/MDL.cup
Repair/RepairCompiler/MCC/SDL.cup
Repair/RepairCompiler/MCC/TDL.cup

index 6de3880a3f33ca5904d88a389df83e432477d0dd..0c67630528dff8624087fef98a57a832f43245eb 100755 (executable)
@@ -145,6 +145,7 @@ parser code {:
     terminal FORALL;
     terminal IN;
     terminal INTEST;
+    terminal THIS;
 
     terminal COMMA;
     terminal SIZEOF;
index 0664e0be013c324f7196b6bc574a3925ed23aab2..d6a249b1360db70d3baa6bc283142a1832e1f419 100755 (executable)
@@ -74,6 +74,7 @@ CHAR=(\\\"|\\\'|\\\\|\\t|\\n|[\x20-\x21\x23-\x26\x28-\x5B\x5D-\x7E])
 <YYINITIAL> isvalid                    { return tok(Sym.ISVALID, yytext()); }
 <YYINITIAL> for                                { return tok(Sym.FOR, yytext()); }
 <YYINITIAL> to                         { return tok(Sym.TO, yytext()); }
+<YYINITIAL> this                       { return tok(Sym.THIS, yytext()); }
 
 <YYINITIAL> structure                  { return tok(Sym.STRUCTURE, yytext()); }
 <YYINITIAL> reserved                   { return tok(Sym.RESERVED, yytext()); }
index 0ba43a71ad934cfe86fac970311e46cbc02a20f9..7a775c7426691169e56714098363907fafa68eeb 100755 (executable)
@@ -152,6 +152,7 @@ parser code {:
     terminal FORALL;
     terminal IN;
     terminal INTEST;
+    terminal THIS;
 
     terminal COMMA;
     terminal SIZEOF;
index 454717108727fa5f02a0b5660169ea27667fd081..920181896ac55657642d76ccef8c7c5ab8881f53 100755 (executable)
@@ -135,6 +135,7 @@ parser code {:
     terminal FORALL;
     terminal IN;
     terminal INTEST;
+    terminal THIS;
 
     terminal COMMA;
     terminal SIZEOF;
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));