support a bit more java
[IRC.git] / Robust / src / IR / Tree / SemanticCheck.java
index 84e18d9b3da8cbe43bf81a974a382a923c0b8e3f..7680db3d7ab64a5757c69a0bb047260c53e472a3 100644 (file)
@@ -677,7 +677,10 @@ public class SemanticCheck {
            typetolookin=min.getExpression().getType();
        } else if (min.getBaseName()!=null) {
            String rootname=min.getBaseName().getRoot();
-           if (nametable.get(rootname)!=null) {
+           if (rootname.equals("super")) {
+               ClassDescriptor supercd=((MethodDescriptor)md).getClassDesc().getSuperDesc();
+               typetolookin=new TypeDescriptor(supercd);
+           } else if (nametable.get(rootname)!=null) {
                //we have an expression
                min.setExpression(translateNameDescriptorintoExpression(min.getBaseName()));
                checkExpressionNode(md, nametable, min.getExpression(), null);
@@ -689,6 +692,10 @@ public class SemanticCheck {
                    throw new Error(min.getBaseName()+" undefined");
                typetolookin=new TypeDescriptor(cd);
            }
+       } else if ((md instanceof MethodDescriptor)&&min.getMethodName().equals("super")) {
+           ClassDescriptor supercd=((MethodDescriptor)md).getClassDesc().getSuperDesc();
+           min.methodid=supercd.getSymbol();
+           typetolookin=new TypeDescriptor(supercd);
        } else if (md instanceof MethodDescriptor) {
            typetolookin=new TypeDescriptor(((MethodDescriptor)md).getClassDesc());
        } else {