public Class enc_d_VisitorImpl(String name, Variable[] state, Type evalType, TypeFunction vcons, Map<String, ?> map, Class[] dtypes) {
        final String cname = d.get(name) + VISITOR;
        Class c = new Class(pack,cname, cons(VISITOR));
        //Variable stateVar = new Variable(cons(state), STATE);
        //Variable stateVarInit = new Variable(cons(state), STATE);
        //stateVarInit.init = new ObjectCreation(cons(state));
        // field state
        //c.fields.add(stateVarInit);
        // constructor
        //Method cons = new Method(cname);
        //cons.params.add(stateVar);
        //cons.mBody.add(new Assignment("this."+stateVar.name, new VariableExpression(stateVar.name)));
        //c.methods.add(cons);
        // method getState
        //Method gets = new Method(stateVar.type, "get"+STATE);
        //gets.mBody.add(new Return(new VariableExpression(stateVar.name)));
        //c.methods.add(gets);
        for (Class ds : dtypes) {
//            Type nodetype = ds.superType[0];
            Type rtype = evalType;
            Method m = new Method(rtype, VISIT);
            Type type = cons(ds.name);
            type.params = new Type[ds.params.size()];
            int i = 0;
            for (String ts : ds.params) {
                type.params[i++] = cons(ts);
            }
            m.params.addAll(Arrays.asList(state));
            m.params.add(new Variable(type.toRawType(), VISITORPARAM));
            IExpression dtt = (IExpression) map.get(ds.name);
            if (dtt != null) {
                m.mBody.add(new Return(dtt));
            }
            c.methods.add(m);
        }
        return c;
    }