diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java b/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java index 090e954f..5d6a4658 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/IfStmt.java @@ -1,22 +1,27 @@ package de.dhbwstuttgart.syntaxtree.statement; import de.dhbwstuttgart.syntaxtree.StatementVisitor; +import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation; import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation; +import org.antlr.v4.runtime.Token; public class IfStmt extends Statement { - public IfStmt(int offset, int variableLength) + public final Expression expr; + public final Block then_block; + public final Block else_block; + + public IfStmt(RefTypeOrTPHOrWildcardOrGeneric type, + Expression expr, Block thenBlock, Block elseBlock, Token offset) { - super(null,null); + super(type,offset); + this.expr = expr; + this.then_block = thenBlock; + this.else_block = elseBlock; } - - public boolean hamaDebug = true; //hama: Debug Ausgaben von mir ein- bzw. ausschalten - public Expression expr; - public Block then_block; - public Block else_block; @Override public void accept(StatementVisitor visitor) { diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java index 9b149620..4a693141 100644 --- a/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java +++ b/src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java @@ -226,7 +226,8 @@ public class TYPEStmt implements StatementVisitor{ @Override public void visit(Literal literal) { - throw new NotImplementedException(); + //Hier gibt es nichts zu tun + //throw new NotImplementedException(); } @Override diff --git a/test/typeinference/JavaTXCompilerTest.java b/test/typeinference/JavaTXCompilerTest.java index ec070d3d..cd8a2d24 100644 --- a/test/typeinference/JavaTXCompilerTest.java +++ b/test/typeinference/JavaTXCompilerTest.java @@ -26,8 +26,8 @@ public class JavaTXCompilerTest extends JavaTXCompiler { @Test public void test() throws IOException, java.lang.ClassNotFoundException { //filesToTest.add(new File(rootDirectory+"Faculty.jav")); - filesToTest.add(new File(rootDirectory+"mathStruc.jav")); - //filesToTest.add(new File(rootDirectory+"test.jav")); + //filesToTest.add(new File(rootDirectory+"mathStruc.jav")); + filesToTest.add(new File(rootDirectory+"test.jav")); //filesToTest.add(new File(rootDirectory+"Lambda.jav")); //filesToTest.add(new File(rootDirectory+"Lambda2.jav")); //filesToTest.add(new File(rootDirectory+"Lambda3.jav"));