- //we have a type
- ClassDescriptor cd;
- if (min.getBaseName().getSymbol().equals("System.out"))
- cd=getClass("System");
- else
- cd=getClass(min.getBaseName().getSymbol());
- if (cd==null)
- throw new Error("md = "+ md.toString()+ " "+min.getBaseName()+" undefined");
- typetolookin=new TypeDescriptor(cd);
+ if(state.MGC) {
+ if(!min.getBaseName().getSymbol().equals("System.out")) {
+ ExpressionNode nn = translateNameDescriptorintoExpression(min.getBaseName());
+ checkExpressionNode(md, nametable, nn, null);
+ typetolookin = nn.getType();
+ if(!((nn.kind()== Kind.NameNode) && (((NameNode)nn).getField() == null)
+ && (((NameNode)nn).getVar() == null) && (((NameNode)nn).getExpression() == null))) {
+ // this is not a pure class name, need to add to
+ min.setExpression(nn);
+ }
+ } else {
+ //we have a type
+ ClassDescriptor cd = null;
+ //if (min.getBaseName().getSymbol().equals("System.out"))
+ cd=getClass("System");
+ /*else {
+ cd=getClass(min.getBaseName().getSymbol());
+ }*/
+ if (cd==null)
+ throw new Error("md = "+ md.toString()+ " "+min.getBaseName()+" undefined");
+ typetolookin=new TypeDescriptor(cd);
+ }
+ } else {
+ // we have a type
+ ClassDescriptor cd = null;
+ if (min.getBaseName().getSymbol().equals("System.out"))
+ cd=getClass("System");
+ else {
+ cd=getClass(min.getBaseName().getSymbol());
+ }
+ if (cd==null)
+ throw new Error("md = "+ md.toString()+ " "+min.getBaseName()+" undefined");
+ typetolookin=new TypeDescriptor(cd);
+ }