Modified to allow byte[] casting
authorafedward <afedward>
Mon, 1 Jun 2009 23:59:37 +0000 (23:59 +0000)
committerafedward <afedward>
Mon, 1 Jun 2009 23:59:37 +0000 (23:59 +0000)
Robust/src/Parse/java14.cup

index bf5141bd5ebfc0d78ac458a94e61defac5d7fb00..edc61cb7192fc16ecf06b097be30d837a139421d 100644 (file)
@@ -1718,11 +1718,16 @@ unary_expression_not_plus_minus ::=
        |       cast_expression:exp {: RESULT=exp; :}
        ;
 cast_expression ::=
-               LPAREN primitive_type:type
-       //dims_opt 
+               LPAREN primitive_type:type dims_opt:dims
                RPAREN unary_expression:exp {: 
                ParseNode pn=new ParseNode("cast1");
+if (dims.intValue()==0)
                pn.addChild("type").addChild(type);
+else {
+               ParseNode arrayt=pn.addChild("type").addChild("array");
+               pn.addChild("basetype").addChild(type);
+               pn.addChild("dims").setLiteral(dims);
+}
                pn.addChild("exp").addChild(exp);
                RESULT=pn;
        :}