Parse the final keyword but don't enforce its meaning
authorjjenista <jjenista>
Wed, 11 Feb 2009 22:36:16 +0000 (22:36 +0000)
committerjjenista <jjenista>
Wed, 11 Feb 2009 22:36:16 +0000 (22:36 +0000)
Robust/src/Parse/java14.cup

index 99d03684717aaeb1b60e663e89e5e6b307a13251..a1d07a811ccac7a27951eaa23b50718047f2eef0 100644 (file)
@@ -939,7 +939,12 @@ formal_parameter ::=
                pn.addChild(name);
                RESULT=pn;
        :}
-//     |       FINAL type variable_declarator_id
+       |       FINAL type:type variable_declarator_id:name {:
+               ParseNode pn=new ParseNode("formal_parameter");
+               pn.addChild(type);
+               pn.addChild(name);
+               RESULT=pn;
+       :}
        ;
 //throws_opt ::=       
 //     |       throws
@@ -1130,8 +1135,13 @@ local_variable_declaration ::=
                pn.addChild(type);
                pn.addChild(var);
                RESULT=pn;
-:}
-//     |       FINAL type variable_declarators
+       :}
+       |       FINAL type:type variable_declarators:var {: 
+               ParseNode pn=new ParseNode("local_variable_declaration");
+               pn.addChild(type);
+               pn.addChild(var);
+               RESULT=pn;
+       :}
        ;
 statement ::=  statement_without_trailing_substatement:st {: 
                RESULT=st;