Syntaxbaum anpassen
This commit is contained in:
parent
a1227a8b1b
commit
b05b0ea5df
@ -4,5 +4,4 @@ package de.dhbwstuttgart.core;
|
||||
public interface IItemWithOffset
|
||||
{
|
||||
public int getOffset();
|
||||
public int getVariableLength();
|
||||
}
|
||||
|
@ -298,16 +298,16 @@ public class Class extends GTVDeclarationContext implements IItemWithOffset, Gen
|
||||
* Dem ResultSet entsprechend werden in diesem Java-Code die TypePlaceholder durch die in ResultSet stehenden Typen ersetzt.
|
||||
* @return Java-Sourcefile
|
||||
*/
|
||||
public String printJavaCode(TypeinferenceResultSet reconstructionResult){
|
||||
public JavaCodeResult printJavaCode(ResultSet reconstructionResult){
|
||||
JavaCodeResult ret = new JavaCodeResult("class ");
|
||||
|
||||
JavaCodeResult classBodyCode = new JavaCodeResult();
|
||||
if(this.modifiers!=null)classBodyCode.attach(this.modifiers.printJavaCode(reconstructionResult.getUnifiedConstraints())).attach(" ");
|
||||
if(this.modifiers!=null)classBodyCode.attach(this.modifiers.printJavaCode(reconstructionResult)).attach(" ");
|
||||
|
||||
classBodyCode.attach(this.name + " extends ").attach(this.superClass.printJavaCode(reconstructionResult.getUnifiedConstraints())).attach("\n");
|
||||
classBodyCode.attach(this.name + " extends ").attach(this.superClass.printJavaCode(reconstructionResult)).attach("\n");
|
||||
|
||||
JavaCodeResult bodyString = new JavaCodeResult("{\n");
|
||||
for(Field field : this.fielddecl)bodyString.attach( field.printJavaCode(reconstructionResult.getUnifiedConstraints()) ).attach( "\n" );
|
||||
for(Field field : this.fielddecl)bodyString.attach( field.printJavaCode(reconstructionResult) ).attach( "\n" );
|
||||
bodyString.attach("}\n");
|
||||
|
||||
classBodyCode.attach(bodyString);
|
||||
@ -321,7 +321,7 @@ public class Class extends GTVDeclarationContext implements IItemWithOffset, Gen
|
||||
Iterator<GenericTypeVar> it = this.genericClassParameters.iterator();
|
||||
while(it.hasNext()){
|
||||
GenericTypeVar tph = it.next();
|
||||
ret.attach(tph.printJavaCode(reconstructionResult.getUnifiedConstraints()));
|
||||
ret.attach(tph.printJavaCode(reconstructionResult));
|
||||
if(it.hasNext())ret.attach(", ");
|
||||
}
|
||||
ret.attach(">");
|
||||
@ -329,7 +329,7 @@ public class Class extends GTVDeclarationContext implements IItemWithOffset, Gen
|
||||
|
||||
String stringReturn = ret.attach(classBodyCode).toString();
|
||||
|
||||
return stringReturn;
|
||||
return new JavaCodeResult(stringReturn);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -72,7 +72,7 @@ public class FieldDeclaration extends Field{
|
||||
}
|
||||
|
||||
|
||||
public JavaCodeResult printJavaCode(ResultSet resultSet) {
|
||||
public JavaCodeResult printJavaCode(TypeinferenceResultSet resultSet) {
|
||||
JavaCodeResult ret = new JavaCodeResult();
|
||||
JavaCodeResult toAttach = this.getType().printJavaCode(resultSet).attach(" ").attach( this.getIdentifier());
|
||||
if(this.wert!=null)toAttach.attach(" = ").attach(this.getWert().printJavaCode(resultSet) );
|
||||
|
@ -71,15 +71,6 @@ public class ArgumentList extends SyntaxTreeNode
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int getVariableLength() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Menge<? extends SyntaxTreeNode> getChildren() {
|
||||
return expr;
|
||||
|
@ -118,12 +118,12 @@ public class Assign extends ExprStmt
|
||||
}
|
||||
// ino.end
|
||||
|
||||
|
||||
/*
|
||||
@Override
|
||||
public String getTypeInformation(){
|
||||
return "(" + expr1.getTypeInformation() + " = " + expr2.getTypeInformation() + ") : "+this.getType();
|
||||
}
|
||||
|
||||
*/
|
||||
@Override
|
||||
public JavaCodeResult printJavaCode(ResultSet resultSet){
|
||||
JavaCodeResult ret = new JavaCodeResult().attach(this.expr1.printJavaCode(resultSet) ).attach( " = " ).attach( this.expr2.printJavaCode(resultSet));
|
||||
|
@ -180,7 +180,7 @@ public class Binary extends BinaryExpr
|
||||
* @param expr2
|
||||
* @return
|
||||
*/
|
||||
if(this.getType()==null)this.set_Type(TypePlaceholder.fresh(this));
|
||||
//if(this.getType()==null)this.set_Type(TypePlaceholder.fresh(this));
|
||||
OderConstraint oderCons = new OderConstraint();
|
||||
HashMap<Type,Type> rMap = this.op.getReturnTypes(assumptions);
|
||||
for(Type rT : rMap.keySet()){
|
||||
|
@ -32,5 +32,5 @@ public abstract class Executeable extends SyntaxTreeNode implements Typeable
|
||||
|
||||
public abstract InstructionList genByteCode(ClassGenerator _cg, TypeinferenceResultSet rs);
|
||||
|
||||
public abstract String getTypeInformation();
|
||||
//public abstract String getTypeInformation();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user