start of new file
[IRC.git] / Robust / src / Parse / java14.cup
index 6333defd77e80ee411561fcfedbdf521244c6aae..85d18b58f97a95cf983e81df9cfcd597e166073f 100644 (file)
@@ -120,12 +120,12 @@ non terminal ParseNode array_type;
 non terminal ParseNode name, simple_name, qualified_name;
 // 19.6) Packages
 non terminal ParseNode compilation_unit;
-//non terminal ParseNode package_declaration_opt, package_declaration;
-//non terminal ParseNode import_declarations_opt, import_declarations;
+non terminal ParseNode package_declaration_opt, package_declaration;
+non terminal ParseNode import_declarations_opt, import_declarations;
 non terminal ParseNode type_declarations_opt, type_declarations;
-//non terminal ParseNode import_declaration;
-//non terminal ParseNode single_type_import_declaration;
-//non terminal ParseNode type_import_on_demand_declaration;
+non terminal ParseNode import_declaration;
+non terminal ParseNode single_type_import_declaration;
+non terminal ParseNode type_import_on_demand_declaration;
 non terminal ParseNode type_declaration;
 // 19.7) Productions used only in the LALR(1) grammar
 non terminal ParseNode modifiers_opt, modifiers, modifier;
@@ -152,7 +152,7 @@ non terminal ParseNode method_body;
 // 19.8.5) Constructor Declarations
 non terminal ParseNode constructor_declaration, constructor_declarator;
 non terminal ParseNode constructor_body;
-//non terminal ParseNode explicit_constructor_invocation;
+non terminal ParseNode explicit_constructor_invocation;
 // 19.9.1) Interface Declarations
 //non terminal ParseNode interface_declaration;
 //non terminal ParseNode extends_interfaces_opt, extends_interfaces;
@@ -196,6 +196,7 @@ non terminal ParseNode return_statement;
 // 19.12) Expressions
 non terminal ParseNode primary, primary_no_new_array;
 non terminal ParseNode class_instance_creation_expression;
+non terminal ParseNode cons_argument_list_opt, cons_argument_list;
 non terminal ParseNode argument_list_opt, argument_list;
 //non terminal ParseNode array_creation_init;
 non terminal ParseNode array_creation_uninit;
@@ -220,6 +221,9 @@ non terminal ParseNode expression_opt, expression;
 //non terminal ParseNode constant_expression;
 //failure aware computation keywords
 terminal FLAG;
+terminal OPTIONAL;
+terminal ISAVAILABLE;
+terminal EXTERNAL;
 terminal TAG;
 terminal TASK;
 terminal TASKEXIT;
@@ -238,6 +242,23 @@ non terminal ParseNode flag_list;
 non terminal ParseNode flag_list_opt;
 non terminal ParseNode flag_change;
 
+non terminal ParseNode cons_checks_opt;
+non terminal ParseNode cons_checks;
+non terminal ParseNode cons_check;
+
+non terminal ParseNode tag_variable_declaration_statement;
+non terminal ParseNode tag_expression_list;
+non terminal ParseNode tag_expression;
+non terminal ParseNode tag_list;
+non terminal ParseNode tag_list_opt;
+non terminal ParseNode tag_change;
+
+//distributed transaction keywords
+terminal ATOMIC;
+terminal GLOBAL;
+non terminal ParseNode atomic_statement;
+
+
 start with goal;
 
 
@@ -274,9 +295,71 @@ task_parameter ::=
                pn.addChild(name);
                pn.addChild("flag").addChild(exp);
                RESULT=pn;
+       :} 
+        | type:type variable_declarator_id:name LBRACE flag_expression:exp RBRACE LBRACE tag_expression_list:texp RBRACE {:
+               ParseNode pn=new ParseNode("task_parameter");
+               pn.addChild(type);
+               pn.addChild(name);
+               pn.addChild("flag").addChild(exp);
+               pn.addChild("tag").addChild(texp);
+               RESULT=pn;
+       :}
+        | type:type variable_declarator_id:name LBRACE RBRACE LBRACE tag_expression_list:texp RBRACE {:
+               ParseNode pn=new ParseNode("task_parameter");
+               pn.addChild(type);
+               pn.addChild(name);
+               pn.addChild("tag").addChild(texp);
+               RESULT=pn;
+       :}
+       | OPTIONAL task_parameter:fp {:
+               ParseNode pn=new ParseNode("task_parameter");
+               pn.addChild("optional").addChild(fp);
+               RESULT=pn;
+       :}              
+       
+       ;
+
+tag_expression_list ::= tag_expression:te {: 
+       ParseNode pn=new ParseNode("tag_expression_list");
+       pn.addChild(te);
+       RESULT=pn;
+       :}
+       | tag_expression_list:tel COMMA tag_expression:te {: 
+       tel.addChild(te);
+       RESULT=tel;
        :}
        ;
 
+tag_expression ::= IDENTIFIER:type IDENTIFIER:id {: 
+               ParseNode pn=new ParseNode("tag_expression");
+               pn.addChild("type").addChild(type);
+               pn.addChild("single").addChild(id);
+               RESULT=pn;
+       :}
+       ;
+
+tag_list_opt ::= LBRACE tag_list:fl RBRACE {:RESULT=fl;:}
+       | LBRACE RBRACE {: RESULT = new ParseNode("empty"); :}  
+       | {: RESULT = new ParseNode("empty"); :}
+       ;
+
+tag_list ::= tag_change:fc {: 
+               ParseNode pn=new ParseNode("tag_list");
+               pn.addChild(fc);
+               RESULT=pn;
+       :}
+       | tag_list:fl COMMA tag_change:fc {: 
+               fl.addChild(fc);
+               RESULT=fl;
+       :};
+
+tag_change ::= IDENTIFIER:id {: 
+               RESULT=new ParseNode("name").addChild(id).getRoot();
+       :}
+       | NOT IDENTIFIER:id {: 
+               RESULT=new ParseNode("not").addChild("name").addChild(id).getRoot();
+       :};
+
 flag_expression ::= 
        flag_andexpression:exp {: 
                RESULT=exp;
@@ -315,8 +398,29 @@ flag_notexpression ::=
        :}
        ;
 
-task_exitstatement ::= TASKEXIT flag_effects_opt:opt SEMICOLON{: 
-               RESULT=(new ParseNode("taskexit")).addChild(opt).getRoot();
+task_exitstatement ::= TASKEXIT flag_effects_opt:opt cons_checks_opt:cco SEMICOLON {: 
+               RESULT=(new ParseNode("taskexit")).addChild(opt).getRoot().addChild(cco).getRoot();
+       :};
+
+cons_checks_opt ::= ASSERT LPAREN cons_checks:cc RPAREN {: RESULT=cc; :}
+       | {: RESULT = new ParseNode("empty"); :}
+       ;
+
+cons_checks ::= cons_check:cc {: 
+               ParseNode pn=new ParseNode("cons_checks");
+               pn.addChild(cc);
+               RESULT=pn;
+       :}
+       |       cons_checks:ccs COMMA cons_check:cc {: 
+               ccs.addChild(cc);
+               RESULT=ccs;
+       :};
+
+cons_check ::= IDENTIFIER:name LPAREN cons_argument_list_opt:args RPAREN {: 
+               ParseNode pn=new ParseNode("cons_check");
+               pn.addChild("name").addChild("identifier").addChild(name);
+               pn.addChild(args);
+               RESULT=pn;
        :};
 
 flag_effects_opt ::= LPAREN flag_effects:fe RPAREN {:RESULT=fe;:}
@@ -333,15 +437,24 @@ flag_effects ::= flag_effect:fe {:
                RESULT=fes;
        :};
 
-flag_effect ::= IDENTIFIER:id LBRACE flag_list:fl RBRACE {: 
+flag_effect ::= IDENTIFIER:id LBRACE flag_list:fl RBRACE tag_list_opt:tlo {: 
                ParseNode pn=new ParseNode("flag_effect");
                pn.addChild("name").addChild(id);
                pn.addChild(fl);
+               pn.addChild(tlo);
+               RESULT=pn;
+       :}
+       | IDENTIFIER:id LBRACE RBRACE LBRACE tag_list:tl RBRACE {: 
+               ParseNode pn=new ParseNode("flag_effect");
+               pn.addChild("name").addChild(id);
+               pn.addChild(tl);
                RESULT=pn;
        :};
 
 flag_list_opt ::= LBRACE flag_list:fl RBRACE {:RESULT=fl;:}
-       | {: RESULT = new ParseNode("empty"); :}
+       | LBRACE RBRACE {: RESULT = new ParseNode("empty"); :}  
+       | 
+       {: RESULT = new ParseNode("empty"); :}
        ;
 
 flag_list ::= flag_change:fc {: 
@@ -446,13 +559,13 @@ array_type ::=    primitive_type:prim dims:dims {:
                ParseNode pn=(new ParseNode("type")).addChild("array");
                pn.addChild("basetype").addChild(prim);
                pn.addChild("dims").setLiteral(dims);
-               RESULT=pn;
+               RESULT=pn.getRoot();
        :}
        |       name:name dims:dims {: 
                ParseNode pn=(new ParseNode("type")).addChild("array");
                pn.addChild("basetype").addChild("type").addChild("class").addChild(name);
                pn.addChild("dims").setLiteral(dims);
-               RESULT=pn;
+               RESULT=pn.getRoot();
        :}
        ;
 
@@ -474,26 +587,44 @@ qualified_name ::= name:name DOT IDENTIFIER:id {:
 
 // 19.6) Packages
 compilation_unit ::=
-//              package_declaration_opt
-//              import_declarations_opt
+                package_declaration_opt:pdo
+                import_declarations_opt:ido
                type_declarations_opt:tdo {: 
                ParseNode pn=new ParseNode("compilation_unit");
                pn.addChild(tdo);
+               pn.addChild("packages").addChild(pdo);
+               pn.addChild("imports").addChild(ido);
                RESULT=pn;
                :}
                ;
-//package_declaration_opt ::= package_declaration | ;
-//import_declarations_opt ::= import_declarations | ;
+package_declaration_opt ::= package_declaration:pdo {:
+               RESULT=pdo;
+       :} |
+       {: RESULT=new ParseNode("empty"); :}
+;
+
+import_declarations_opt ::= import_declarations:ido {: 
+               RESULT=ido;
+       :} | 
+       {: RESULT=new ParseNode("empty"); :}
+;
 type_declarations_opt   ::= type_declarations:tds {:
                RESULT=tds;
                :}   | 
        {: RESULT=new ParseNode("empty"); :}
        ;
 
-//import_declarations ::=
-//               import_declaration
-//       |       import_declarations import_declaration
-//       ;
+import_declarations ::=
+               import_declaration:id {: 
+               ParseNode pn=new ParseNode("import_decls_list");
+               pn.addChild(id);
+               RESULT=pn;
+       :}
+       |       import_declarations:ids import_declaration:id {: 
+               ids.addChild(id);
+               RESULT=ids;
+       :}
+       ;
 
 type_declarations ::= 
                type_declaration:td {:
@@ -507,19 +638,31 @@ type_declarations ::=
                :}
        ;
 
-//package_declaration ::=
-//               PACKAGE name SEMICOLON
-//       ;
-//import_declaration ::=
-//               single_type_import_declaration
-//       |       type_import_on_demand_declaration
-//       ;
-//single_type_import_declaration ::=
-//               IMPORT name SEMICOLON
-//       ;
-//type_import_on_demand_declaration ::=
-//               IMPORT name DOT MULT SEMICOLON
-//       ;
+package_declaration ::=
+               PACKAGE name:name SEMICOLON {: 
+       ParseNode pn=new ParseNode("package");
+       pn.addChild(name);
+       RESULT=pn;
+       :}
+       ;
+import_declaration ::=
+               single_type_import_declaration:sid {: RESULT=sid; :}
+       |       type_import_on_demand_declaration:iod {: RESULT=iod; :}
+       ;
+single_type_import_declaration ::=
+               IMPORT name:name SEMICOLON {: 
+       ParseNode pn=new ParseNode("import_single");
+       pn.addChild(name);
+       RESULT=pn;
+:}
+       ;
+type_import_on_demand_declaration ::=
+               IMPORT name:name DOT MULT SEMICOLON {:
+       ParseNode pn=new ParseNode("import_ondemand");
+       pn.addChild(name);
+       RESULT=pn;
+       :}       
+       ;
 
 type_declaration ::=
                class_declaration:cd 
@@ -558,8 +701,9 @@ modifier ::=
        STATIC {: RESULT=new ParseNode("static"); :} |
 //     ABSTRACT |
        FINAL {: RESULT=new ParseNode("final"); :}|
-       NATIVE {: RESULT=new ParseNode("native"); :}
-//     SYNCHRONIZED | 
+       NATIVE {: RESULT=new ParseNode("native"); :} |
+       SYNCHRONIZED {: RESULT=new ParseNode("synchronized"); :} |
+       ATOMIC {: RESULT=new ParseNode("atomic"); :}
 //     TRANSIENT | 
 //     VOLATILE |
 //     STRICTFP // note that semantic analysis must check that the
@@ -657,6 +801,12 @@ flag_declaration ::=
                ParseNode pn=new ParseNode("flag_declaration");
                pn.addChild("name").addChild(id);
                RESULT=pn;
+       :}      |
+               EXTERNAL FLAG IDENTIFIER:id SEMICOLON {: 
+               ParseNode pn=new ParseNode("flag_declaration");
+               pn.addChild("name").addChild(id);
+               pn.addChild("external");
+               RESULT=pn;
        :}
        ;
 
@@ -668,6 +818,14 @@ field_declaration ::=
                pn.addChild("type").addChild(type);
                pn.addChild("variables").addChild(var);
                RESULT=pn;
+       :} |
+               modifiers_opt:mo GLOBAL type:type variable_declarators:var SEMICOLON {: 
+               ParseNode pn=new ParseNode("field_declaration");
+               pn.addChild("modifier").addChild(mo);
+               pn.addChild("type").addChild(type);
+               pn.addChild("variables").addChild(var);
+               pn.addChild("global");
+               RESULT=pn;
        :}
        ;
 
@@ -766,6 +924,12 @@ formal_parameter ::=
                pn.addChild(name);
                RESULT=pn;
        :}
+       |
+               TAG variable_declarator_id:name {:
+               ParseNode pn=new ParseNode("tag_parameter");
+               pn.addChild(name);
+               RESULT=pn;
+       :}
 //     |       FINAL type variable_declarator_id
        ;
 //throws_opt ::=       
@@ -798,6 +962,16 @@ constructor_declaration ::=
                pn.addChild(cd);
                pn.addChild("body").addChild(body);
                RESULT=pn;
+       :} |
+               modifiers_opt:mo GLOBAL constructor_declarator:cd
+//throws_opt 
+                       constructor_body:body   {:
+               ParseNode pn=new ParseNode("constructor_declaration");
+               pn.addChild("global");
+               pn.addChild("modifiers").addChild(mo);
+               pn.addChild(cd);
+               pn.addChild("body").addChild(body);
+               RESULT=pn;
        :}
        ;
 constructor_declarator ::=
@@ -809,8 +983,17 @@ constructor_declarator ::=
        :}
        ;
 constructor_body ::=
-//             LBRACE explicit_constructor_invocation:eci block_statements:bs RBRACE |
-//             LBRACE explicit_constructor_invocation RBRACE |
+               LBRACE explicit_constructor_invocation:eci block_statements:bs RBRACE {: 
+                       ParseNode pn=new ParseNode("constructor_body");
+                       pn.addChild(eci);
+                       pn.addChild(bs);
+                       RESULT=pn;
+       :} |
+               LBRACE explicit_constructor_invocation:eci RBRACE {: 
+                       ParseNode pn=new ParseNode("constructor_body");
+                       pn.addChild(eci);
+                       RESULT=pn;
+       :} |
                LBRACE block_statements:block RBRACE {: 
                ParseNode pn=new ParseNode("constructor_body");
                pn.addChild(block);
@@ -818,12 +1001,17 @@ constructor_body ::=
        :}
        |       LBRACE RBRACE {: RESULT=new ParseNode("empty"); :}
        ;
-//explicit_constructor_invocation ::=
+explicit_constructor_invocation ::=
 //             THIS LPAREN argument_list_opt RPAREN SEMICOLON
-//     |       SUPER LPAREN argument_list_opt RPAREN SEMICOLON
+//     |       
+SUPER LPAREN argument_list_opt:alo RPAREN SEMICOLON {: 
+       ParseNode pn=new ParseNode("superinvoke");
+       pn.addChild(alo);
+       RESULT=pn;
+:}
 //     |       primary DOT THIS LPAREN argument_list_opt RPAREN SEMICOLON
 //     |       primary DOT SUPER LPAREN argument_list_opt RPAREN SEMICOLON
-//     ;
+       ;
 
 // 19.9) Interfaces
 
@@ -902,7 +1090,10 @@ block_statements ::=
        :}
        ;
 block_statement ::=
-               local_variable_declaration_statement:lvds {: 
+       tag_variable_declaration_statement:tvds {:
+               RESULT=tvds;
+       :}              
+       |       local_variable_declaration_statement:lvds {: 
                RESULT=lvds;
        :}
        |       statement:statement {: 
@@ -911,6 +1102,14 @@ block_statement ::=
 //     |       class_declaration
 //     |       interface_declaration
        ;
+tag_variable_declaration_statement ::=
+               TAG IDENTIFIER:id EQ NEW TAG LPAREN IDENTIFIER:type RPAREN SEMICOLON {: 
+               ParseNode pn=new ParseNode("tag_declaration");
+               pn.addChild("single").addChild(id);
+               pn.addChild("type").addChild(type);
+               RESULT=pn;
+       :}
+       ;
 local_variable_declaration_statement ::=
                local_variable_declaration:lvd SEMICOLON {: 
                RESULT=lvd;
@@ -946,11 +1145,12 @@ statement_without_trailing_substatement ::=
        |       empty_statement:st {: RESULT=st; :}
        |       expression_statement:st {: RESULT=st; :}
 //     |       switch_statement
-       |       do_statement
+       |       do_statement:dos {:RESULT=dos; :}
        |       break_statement:st {: RESULT=st; :}
        |       continue_statement:st {: RESULT=st; :}
        |       return_statement:st {: RESULT=st; :}
        |       task_exitstatement:st {: RESULT=st; :}
+       |       atomic_statement:st {: RESULT=st; :}
 //     |       synchronized_statement
 //     |       throw_statement
 //     |       try_statement
@@ -1128,6 +1328,11 @@ return_statement ::=
 //synchronized_statement ::=
 //             SYNCHRONIZED LPAREN expression RPAREN block
 //     ;
+atomic_statement ::=
+               ATOMIC block:blk {: 
+       RESULT=(new ParseNode("atomic")).addChild(blk).getRoot();
+       :}
+       ;
 //try_statement ::=
 //             TRY block catches
 //     |       TRY block catches_opt finally
@@ -1166,6 +1371,11 @@ primary_no_new_array ::=
        |       field_access:exp {: RESULT=exp; :}
        |       method_invocation:exp {: RESULT=exp; :}
        |       array_access:exp {: RESULT=exp; :}
+       |       ISAVAILABLE LPAREN IDENTIFIER:id RPAREN {: 
+               ParseNode pn=new ParseNode("isavailable");
+               pn.addChild(id);
+               RESULT=pn;
+       :}
 //     |       primitive_type DOT CLASS
 //     |       VOID DOT CLASS
 //     |       array_type DOT CLASS
@@ -1179,7 +1389,32 @@ class_instance_creation_expression ::=
                pn.addChild(args);
                pn.addChild(feo);
                RESULT=pn;
+       :} 
+       //Global object
+       | GLOBAL NEW class_or_interface_type:type LPAREN argument_list_opt:args RPAREN flag_list_opt:feo {: 
+               ParseNode pn=new ParseNode("createobject");
+               pn.addChild(type);
+               pn.addChild(args);
+               pn.addChild(feo);
+               pn.addChild("global");
+               RESULT=pn;
        :}
+       | NEW class_or_interface_type:type LPAREN argument_list_opt:args RPAREN LBRACE RBRACE LBRACE tag_list:tl RBRACE {: 
+               ParseNode pn=new ParseNode("createobject");
+               pn.addChild(type);
+               pn.addChild(args);
+               pn.addChild(tl);
+               RESULT=pn;
+       :}
+       | NEW class_or_interface_type:type LPAREN argument_list_opt:args RPAREN LBRACE flag_list:fl RBRACE LBRACE tag_list:tl RBRACE {: 
+               ParseNode pn=new ParseNode("createobject");
+               pn.addChild(type);
+               pn.addChild(args);
+               pn.addChild(fl);
+               pn.addChild(tl);
+               RESULT=pn;
+       :}
+
 //     |       NEW class_or_interface_type LPAREN argument_list_opt RPAREN class_body
 //     |       primary DOT NEW IDENTIFIER
 //                     LPAREN argument_list_opt RPAREN {: 
@@ -1192,10 +1427,33 @@ class_instance_creation_expression ::=
 //     |       name DOT NEW IDENTIFIER
 //                     LPAREN argument_list_opt RPAREN class_body
        ;
+cons_argument_list_opt ::=
+       {: RESULT=new ParseNode("empty"); :}
+       |       cons_argument_list:args {: RESULT=args; :}
+       ;
+
+cons_argument_list ::=
+               IDENTIFIER:id COLON expression:exp {:
+               ParseNode pn=new ParseNode("cons_argument_list");
+               ParseNode pnarg=pn.addChild("binding");
+               pnarg.addChild("var").addChild(id);
+               pnarg.addChild("exp").addChild(exp);
+               RESULT=pn;
+       :}
+       |       argument_list:list COMMA IDENTIFIER:id COLON expression:exp {:
+               ParseNode pnarg=new ParseNode("binding");
+               pnarg.addChild("var").addChild(id);
+               pnarg.addChild("exp").addChild(exp);
+               list.addChild(pnarg);
+               RESULT=list;
+       :}
+       ;
+
 argument_list_opt ::=
        {: RESULT=new ParseNode("empty"); :}
        |       argument_list:args {: RESULT=args; :}
        ;
+
 argument_list ::=
                expression:exp {:
                ParseNode pn=new ParseNode("argument_list");
@@ -1222,6 +1480,22 @@ array_creation_uninit ::=
                pn.addChild("dims_opt").setLiteral(dims);
                RESULT=pn;
        :}
+       |       GLOBAL NEW primitive_type:type dim_exprs:dimexpr dims_opt:dims {: 
+               ParseNode pn=new ParseNode("createarray");
+               pn.addChild(type);
+               pn.addChild(dimexpr);
+               pn.addChild("dims_opt").setLiteral(dims);
+               pn.addChild("global");
+               RESULT=pn;
+               :}
+       |       GLOBAL NEW class_or_interface_type:type dim_exprs:dimexpr dims_opt:dims {: 
+               ParseNode pn=new ParseNode("createarray");
+               pn.addChild(type);
+               pn.addChild(dimexpr);
+               pn.addChild("dims_opt").setLiteral(dims);
+               pn.addChild("global");
+               RESULT=pn;
+       :}
        ;
 //array_creation_init ::=
 //             NEW primitive_type dims array_initializer
@@ -1238,11 +1512,11 @@ dim_exprs ::=   dim_expr:exp {:
        ;
 dim_expr ::=   LBRACK expression:exp RBRACK {: RESULT=exp; :}
        ;
-dims_opt ::= {: RESULT=null; :}
+dims_opt ::= {: RESULT=new Integer(0); :}
        |       dims:dims {: RESULT = dims; :}
        ;
 
-dims ::=       LBRACK RBRACK {: RESULT=new Integer(0); :}
+dims ::=       LBRACK RBRACK {: RESULT=new Integer(1); :}
        |       dims:dims LBRACK RBRACK {: RESULT=new Integer(dims.intValue()+1); :}
        ;
 
@@ -1270,7 +1544,15 @@ method_invocation ::=
                pn.addChild(args);
                RESULT=pn;
        :}
-//     |       SUPER DOT IDENTIFIER LPAREN argument_list_opt RPAREN
+       |       SUPER DOT IDENTIFIER:id LPAREN argument_list_opt:args RPAREN {: 
+               ParseNode name=new ParseNode("name");
+               name.addChild("base").addChild("name").addChild("identifier").addChild("super");
+               name.addChild("identifier").addChild(id);
+               ParseNode pn=new ParseNode("methodinvoke1");
+               pn.addChild(name);
+               pn.addChild(args);
+               RESULT=pn;
+       :}
 //     |       name DOT SUPER DOT IDENTIFIER LPAREN argument_list_opt RPAREN
        ;
 array_access ::=
@@ -1329,7 +1611,8 @@ predecrement_expression ::=
 unary_expression_not_plus_minus ::=
                postfix_expression:exp {: 
                RESULT=exp; :}
-//     |       COMP unary_expression
+       |       COMP unary_expression:exp
+               {: RESULT=(new ParseNode("comp")).addChild(exp).getRoot(); :}
        |       NOT unary_expression:exp 
                {: RESULT=(new ParseNode("not")).addChild(exp).getRoot(); :}
        |       cast_expression:exp {: RESULT=exp; :}
@@ -1405,7 +1688,12 @@ shift_expression ::=
                pn.addChild(exp2);
                RESULT=pn;
        :}
-//     |       shift_expression URSHIFT additive_expression
+       |       shift_expression:exp1 URSHIFT additive_expression:exp2 {:
+               ParseNode pn=new ParseNode("urightshift");
+               pn.addChild(exp1);      
+               pn.addChild(exp2);      
+               RESULT=pn;
+       :}
        ;
 relational_expression ::=
                shift_expression:exp {: 
@@ -1537,7 +1825,7 @@ assignment_operator ::=
        |       MINUSEQ {: RESULT=new ParseNode("minuseq"); :}
        |       LSHIFTEQ {: RESULT=new ParseNode("lshifteq"); :}
        |       RSHIFTEQ {: RESULT=new ParseNode("rshifteq"); :}
-//     |       URSHIFTEQ {: RESULT=new ParseNode("urshifteq"); :}
+       |       URSHIFTEQ {: RESULT=new ParseNode("urshifteq"); :}
        |       ANDEQ {: RESULT=new ParseNode("andeq"); :}
        |       XOREQ {: RESULT=new ParseNode("xoreq"); :}
        |       OREQ {: RESULT=new ParseNode("oreq"); :}