srecord noeq LASToByteCode(MethodMaker m) { replace Tb with GazelleV_LeftArrowScript. // Short for "Toolbox" delegate objValue to JVMStackCellType. delegate none to JVMStackCellType. JVMStackCellType compile(Tb.Evaluable code) { if (code cast Tb.Const) { O o = code.value; if (o == null) { m.add(new ACONST_NULL); ret objValue; } else if (o cast S) { m.stringConstant(o); ret objValue; } else if (o cast Int) { m.intConstant(o); } else fail("Can't compile const value: " + className(o)); } else if (code cast Tb.Script) { var stackTop = none; for (step : code.steps) { // pop result of last instruction if any if (stackTop != none) m.add(new POP); stackTop = compile(step); } ret stackTop; } fail("Can't compile yet: " + className(code)); } }