diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java b/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java index b30832cb..b2f69b33 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java @@ -7,6 +7,7 @@ import java.util.Hashtable; import java.util.Iterator; import org.apache.bcel.generic.ClassGen; +import org.apache.bcel.generic.InstructionFactory; import org.apache.bcel.generic.InstructionList; import de.dhbwstuttgart.typeinference.Menge; @@ -173,12 +174,15 @@ public class Assign extends Expr @Override - public InstructionList genByteCode(ClassGen _cg) { - - - return null; + public InstructionList genByteCode(ClassGen cg) { // TODO Auto-generated method stub - + //Bytecode: bipush 20 + // istore_1 + InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool()); + InstructionList il = this.expr2.genByteCode(cg);//expr2 rechte expr + il.append(_factory.createConstant(expr2.toString())); + il.append(_factory.ISTORE_1); + return il; } }