From 807c1e56d4ddf91071562948235e37393c4b9bba Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 30 Aug 2006 00:18:53 +0000 Subject: [PATCH] check in changes to allow [this.length] into grammar --- Repair/RepairCompiler/MCC/CDL.cup | 1 + Repair/RepairCompiler/MCC/Lexer.lex | 1 + Repair/RepairCompiler/MCC/MDL.cup | 1 + Repair/RepairCompiler/MCC/SDL.cup | 1 + Repair/RepairCompiler/MCC/TDL.cup | 14 +++++++++++++- 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Repair/RepairCompiler/MCC/CDL.cup b/Repair/RepairCompiler/MCC/CDL.cup index 6de3880..0c67630 100755 --- a/Repair/RepairCompiler/MCC/CDL.cup +++ b/Repair/RepairCompiler/MCC/CDL.cup @@ -145,6 +145,7 @@ parser code {: terminal FORALL; terminal IN; terminal INTEST; + terminal THIS; terminal COMMA; terminal SIZEOF; diff --git a/Repair/RepairCompiler/MCC/Lexer.lex b/Repair/RepairCompiler/MCC/Lexer.lex index 0664e0b..d6a249b 100755 --- a/Repair/RepairCompiler/MCC/Lexer.lex +++ b/Repair/RepairCompiler/MCC/Lexer.lex @@ -74,6 +74,7 @@ CHAR=(\\\"|\\\'|\\\\|\\t|\\n|[\x20-\x21\x23-\x26\x28-\x5B\x5D-\x7E]) isvalid { return tok(Sym.ISVALID, yytext()); } for { return tok(Sym.FOR, yytext()); } to { return tok(Sym.TO, yytext()); } + this { return tok(Sym.THIS, yytext()); } structure { return tok(Sym.STRUCTURE, yytext()); } reserved { return tok(Sym.RESERVED, yytext()); } diff --git a/Repair/RepairCompiler/MCC/MDL.cup b/Repair/RepairCompiler/MCC/MDL.cup index 0ba43a7..7a775c7 100755 --- a/Repair/RepairCompiler/MCC/MDL.cup +++ b/Repair/RepairCompiler/MCC/MDL.cup @@ -152,6 +152,7 @@ parser code {: terminal FORALL; terminal IN; terminal INTEST; + terminal THIS; terminal COMMA; terminal SIZEOF; diff --git a/Repair/RepairCompiler/MCC/SDL.cup b/Repair/RepairCompiler/MCC/SDL.cup index 4547171..9201818 100755 --- a/Repair/RepairCompiler/MCC/SDL.cup +++ b/Repair/RepairCompiler/MCC/SDL.cup @@ -135,6 +135,7 @@ parser code {: terminal FORALL; terminal IN; terminal INTEST; + terminal THIS; terminal COMMA; terminal SIZEOF; diff --git a/Repair/RepairCompiler/MCC/TDL.cup b/Repair/RepairCompiler/MCC/TDL.cup index 6436236..b2e990e 100755 --- a/Repair/RepairCompiler/MCC/TDL.cup +++ b/Repair/RepairCompiler/MCC/TDL.cup @@ -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)); -- 2.34.1