forked from JavaTX/JavaCompilerCore
GenCode: Assign ist jetzt dynamisch für mehrere Variablen - Anpassung
für verschiedene Typen potentiell nötig
This commit is contained in:
parent
c00e61eae6
commit
d028f7f14a
@ -172,19 +172,16 @@ public class Assign extends Expr
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int counter = 0; //Zaehlvariable für ISTORE
|
public static int counter = 0; //Zaehlvariable für ISTORE
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InstructionList genByteCode(ClassGen cg) {
|
public InstructionList genByteCode(ClassGen cg) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
//Bytecode: bipush 20
|
InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool());
|
||||||
// istore_1
|
|
||||||
//InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool());
|
|
||||||
InstructionList il = expr2.genByteCode(cg);//expr2 rechte expr
|
InstructionList il = expr2.genByteCode(cg);//expr2 rechte expr
|
||||||
//il.append(_factory.ISTORE_1);
|
|
||||||
counter++;
|
counter++;
|
||||||
il.append(new ISTORE(counter)); //nimmt das auch die Variable und nicht den Zaehler?
|
il.append(new ISTORE(counter)); //macht ISTORE für meherere Variable nutzbar (nicht nur ISTORE_1, ISTORE_2, etc.)
|
||||||
|
//Anpassung für Variablen außerhalb von int = ISTORE nötig?
|
||||||
return il;
|
return il;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
class Assign{
|
class Assign{
|
||||||
|
|
||||||
|
void method() {a; a = 20;b; b=59;}
|
||||||
void method() {i; i = 20; j; j=50;k; k=50;l; l =70;}//m; m=120; n; n=60;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user