forked from JavaTX/JavaCompilerCore
Weitere Überlegung im Bereich Constructor / Method
This commit is contained in:
parent
e9c6170d15
commit
c6502600cc
@ -53,9 +53,9 @@ public class Constructor extends Method {
|
||||
|
||||
@Override
|
||||
public void genByteCode(ClassGen cg) {
|
||||
//ConstantPoolGen _cp = cg.getConstantPool();
|
||||
ConstantPoolGen _cp = cg.getConstantPool();
|
||||
//InstructionFactory _factory = new InstructionFactory(cg, _cp);
|
||||
//InstructionList il = new InstructionList();
|
||||
InstructionList il = new InstructionList();
|
||||
Class parentClass = this.getParentClass();
|
||||
//TODO: Hier return type und Argument-Typen dynamisch generieren. return type mittels method.getReturnType() ermitteln
|
||||
|
||||
|
@ -727,13 +727,15 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
|
||||
Class parentClass = this.getParentClass();
|
||||
//TODO: Hier return type und Argument-Typen dynamisch generieren. return type mittels method.getReturnType() ermitteln
|
||||
|
||||
//Über Statements iterieren um den Block abzurufen
|
||||
//Muss dafür ein Statement Array erstellt werden, sodass ich über alle Statements in einem Block iterieren kann?
|
||||
for(Statement statements : block.get_Statement()){
|
||||
statements.genByteCode(cg);
|
||||
}
|
||||
|
||||
MethodGen method = new MethodGen(Constants.ACC_PUBLIC, org.apache.bcel.generic.Type.getReturnType(Constructor.createEmptyMethod(getTypeInformation(), parent).getType().get_Name()), org.apache.bcel.generic.Type.NO_ARGS , new String[] { }, "<init>", parentClass.name, il, _cp);
|
||||
//Über Constructor iterieren, um alle Methoden zu bekommen
|
||||
for(Method methode : ){
|
||||
|
||||
//Über Statements iterieren um den Block abzurufen
|
||||
for(Statement statements : block.get_Statement()){
|
||||
statements.genByteCode(cg);
|
||||
}
|
||||
}
|
||||
|
||||
//GenByteCode Constructor
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
package de.dhbwstuttgart.syntaxtree;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import org.apache.bcel.generic.ClassGen;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import de.dhbwstuttgart.core.IItemWithOffset;
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericTypeVar;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Type;
|
||||
@ -126,4 +127,6 @@ public abstract class SyntaxTreeNode implements IItemWithOffset{
|
||||
return this.getParent().getGTVDeclarationContext();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user