*** empty log message ***
[IRC.git] / Robust / src / Parse / java14.cup
index ec6c5b80a6facc1ef1ffb283e104a54098280418..f48834448050f62cbc5c9006566268122668415c 100644 (file)
@@ -103,6 +103,12 @@ terminal ASSERT; // assert_statement
 terminal ELLIPSIS;
 terminal ENUM;
 
+//failure aware computation keywords
+terminal FLAG;
+terminal TAG;
+terminal TASK;
+non terminal ParseNode flag_declaration;
+
 // 19.2) The Syntactic Grammar
 non terminal ParseNode goal;
 // 19.3) Lexical Structure
@@ -489,6 +495,11 @@ class_body_declaration ::=
 :}
        ;
 class_member_declaration ::=
+       //failure aware computation
+       flag_declaration:flag {: 
+       RESULT=(new ParseNode("flag")).addChild(flag).getRoot(); 
+       :}
+       |
        field_declaration:field {: 
        RESULT=(new ParseNode("field")).addChild(field).getRoot(); 
        :}
@@ -501,6 +512,15 @@ class_member_declaration ::=
        |       SEMICOLON       {: RESULT=new ParseNode("empty"); :}
        ;
 
+//Failure aware computation
+flag_declaration ::= 
+               FLAG IDENTIFIER:id SEMICOLON {: 
+               ParseNode pn=new ParseNode("flag_declaration");
+               pn.addChild("name").addChild(id);
+               RESULT=pn;
+       :}
+       ;
+
 // 19.8.2) Field Declarations
 field_declaration ::= 
                modifiers_opt:mo type:type variable_declarators:var SEMICOLON {: