genLocalVariableTable(ctx2);
    protected void gen(Context ctx, Tree tree) throws JCode.OffsetTooBigException {        startCodeForTree(ctx, tree);        Symbol sym = tree.symbol();        switch (tree) {        case PackageDef(_, Tree.Template impl):            gen(ctx, impl);            break;        case ClassDef(_, _, _, _, _, Tree.Template impl) : {            Tree.ClassDef classDef = (Tree.ClassDef)tree;            Context ctx1 = enterClass(ctx, sym);            addValueClassMembers(ctx1, classDef);            gen(ctx1, impl);            JMethod clinit = getClassConstructorMethod(ctx1);            if (clinit.getCode().getSize() == 0) {                Context ctx2 =                    ctx1.withMethod(clinit, Collections.EMPTY_MAP, false);                completeClassConstructor(ctx2, sym);                ctx2.code.emitRETURN();            }            leaveClass(ctx1, sym);        } break;        case Template(_, Tree[] body):            gen(ctx, body);            break;        case ValDef(_, Name name, _, Tree rhs): {            if (ctx.method == null)                break;          // ignore ValDefs in classes, handled elsewhere            JType valType = typeStoJ(sym.info());            JLocalVariable var =                ctx.method.addNewLocalVariable(valType, name.toString());            ctx.locals.put(sym, new Integer(var.getIndex()));            assert (rhs != Tree.Empty) : Debug.show(sym);            genLoad(ctx, rhs, valType);            ctx.code.emitSTORE(var);        } break;        case DefDef(_, _, _, _, _, Tree rhs): {            Tree.DefDef defDef = (Tree.DefDef)tree;            boolean retry = false;            do {                Context ctx1 = enterMethod(ctx, defDef, retry);                try {                    if (! Modifiers.Helper.isAbstract(sym.flags)) {                        JType retType = ctx1.method.getReturnType();                        genLoad(ctx1, rhs, retType);                        if (sym.name == Names.CLASS_CONSTRUCTOR)                            completeClassConstructor(ctx1, sym.owner());                        ctx1.code.emitRETURN(retType);                        ctx1.method.freeze();                    }                    leaveMethod(ctx1);                    break;                } catch (JCode.OffsetTooBigException e) {                    ctx1.clazz.removeMethod(ctx1.method);                    assert !retry;                    retry = true;                }            } while (retry);        } break;        case Return(Tree expr): {            JType retType = ctx.method.getReturnType();            genLoad(ctx, expr, retType);            ctx.code.emitRETURN(retType);        } break;        case Typed(Tree expr, _):            gen(ctx, expr);            break;        case Empty:        case AbsTypeDef(_, _, _, _):        case AliasTypeDef(_, _, _, _):        case TypeApply(_, _):        case FunType(_, _):        case CompoundType(_, _):        case AppliedType(_,_):            break;        default:            genLoad(ctx, tree, JType.VOID);        }        endCodeForTree(ctx, tree);    }