public void generate_s(String path, String pack) throws IOException {
        for (DeepTreeTransformer S : SC.treeTransformerMap.values()) {
            Generator g = new Generator(t, d, e, dchi, pack);
            // convert map to use d(z)
            HashMap<String, IExpression> map;
            map=S.transExprMap;
            HashMap map2 = new HashMap();
            for (String key : map.keySet()) {
                map2.put(d.get(key), map.get(key));
            }
            if (ds == null) {
                List<TypingRule> rs = toTypingRules(G);
                ds = new Class[rs.size()];
                int i = 0;
                for (TypingRule r : rs) {
                    ds[i++] = g.en_d_L(r, S.state,S.rType, S.valueTypeFuncRaw);
                }
            }
            g.enc_d_VisitorImpl(S.name, S.state,S.rType,S.valueTypeFuncRaw, map2, ds).writeToFile(path);
        }
    }