forked from JavaTX/JavaCompilerCore
Null eingefuegt
This commit is contained in:
parent
7530e01ea9
commit
99c719251d
@ -4,8 +4,11 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
// ino.module.Expr.8630.import
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.myexception.CTypeReconstructionException;
|
||||
import de.dhbwstuttgart.myexception.SCStatementException;
|
||||
import de.dhbwstuttgart.syntaxtree.Class;
|
||||
@ -109,5 +112,7 @@ public abstract class Expr extends ExprStmt
|
||||
public ConstraintsSet TYPEStmt(TypeAssumptions assumptions){
|
||||
throw new NotImplementedException(); //wird die TYPEStmt-Methode innerhalb einer Expr aufgerufen, dann ist etwas schief gelaufen.
|
||||
}
|
||||
|
||||
public abstract InstructionList genByteCode(ClassGen _cg);
|
||||
}
|
||||
// ino.end
|
||||
|
@ -5,6 +5,8 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
import org.apache.bcel.generic.InstructionFactory;
|
||||
import org.apache.bcel.generic.InstructionList;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.logger.Logger;
|
||||
@ -91,10 +93,14 @@ public class Null extends Literal
|
||||
}
|
||||
|
||||
@Override
|
||||
public void genByteCode(ClassGen _cg) {
|
||||
// TODO Auto-generated method stub
|
||||
public InstructionList genByteCode(ClassGen cg) {
|
||||
InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool());
|
||||
InstructionList il = new InstructionList();
|
||||
|
||||
il.append(_factory.ACONST_NULL);
|
||||
|
||||
return il;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// ino.end
|
||||
|
@ -134,8 +134,10 @@ public class Return extends Statement
|
||||
|
||||
@Override
|
||||
public InstructionList genByteCode(ClassGen cg) {
|
||||
InstructionList il = retexpr.genByteCode(cg);
|
||||
|
||||
InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool());
|
||||
InstructionList il = new InstructionList();
|
||||
|
||||
il.append(_factory.createReturn(org.apache.bcel.generic.Type.VOID));
|
||||
//TO BE DONE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user