Refactoring

This commit is contained in:
FelixKrespach 2017-09-25 08:17:36 +02:00
parent df1c19e60d
commit 03080c43cb
5 changed files with 19 additions and 9 deletions

View File

@ -338,7 +338,7 @@ public class StatementGenerator {
private Statement convert(Java8Parser.SwitchBlockContext stmt){ private Statement convert(Java8Parser.SwitchBlockContext stmt){
//TODO //TODO
throw new NotImplementedException(); throw new NotImplementedException();
} }
private Statement convert(Java8Parser.SwitchBlockStatementGroupContext stmt){ private Statement convert(Java8Parser.SwitchBlockStatementGroupContext stmt){

View File

@ -3,6 +3,7 @@ import java.util.Hashtable;
import java.util.Iterator; import java.util.Iterator;
import de.dhbwstuttgart.parser.antlr.Java8Parser; import de.dhbwstuttgart.parser.antlr.Java8Parser;
import org.antlr.v4.runtime.Token;
import org.apache.bcel.generic.ClassGen; import org.apache.bcel.generic.ClassGen;
import org.apache.bcel.generic.InstructionList; import org.apache.bcel.generic.InstructionList;

View File

@ -4,12 +4,15 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceBlockInformation;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet; import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation; import de.dhbwstuttgart.typeinference.assumptions.TypeInferenceInformation;
import de.dhbwstuttgart.exceptions.NotImplementedException; import de.dhbwstuttgart.exceptions.NotImplementedException;
import org.antlr.v4.runtime.Token;
public class PostIncExpr extends UnaryExpr public class PostIncExpr extends UnaryExpr
{ {
final Expression expr;
public PostIncExpr(Expression expr) { public PostIncExpr(Expression expr) {
super(null); super(null);
this.expr=expr;
} }
} }

View File

@ -1,10 +1,10 @@
public class TestClass class TestClass
{ {
void testMethod() void testMethod()
{ {
++i; //++i;
i++; //i++;
--i; //--i;
i--; //i--;
} }
} }

View File

@ -38,13 +38,19 @@ public class JavaTXCompilerTest extends JavaTXCompiler {
//filesToTest.add(new File(rootDirectory+"MethodsEasy.jav")); //filesToTest.add(new File(rootDirectory+"MethodsEasy.jav"));
//filesToTest.add(new File(rootDirectory+"Matrix.jav")); //filesToTest.add(new File(rootDirectory+"Matrix.jav"));
//filesToTest.add(new File(rootDirectory+"Import.jav")); //filesToTest.add(new File(rootDirectory+"Import.jav"));
//filesToTest.add(new File(rootDirectory+"BreakTest.jav"));
filesToTest.add(new File(rootDirectory+"BreakTest.jav"));
filesToTest.add(new File(rootDirectory+"WhileTest.jav"));
filesToTest.add(new File(rootDirectory+"IfTest.jav"));
filesToTest.add(new File(rootDirectory+"AssertTest.jav"));
//filesToTest.add(new File(rootDirectory+"PrePostOperationTest.jav"));
//filesToTest.add(new File(rootDirectory+"SwitchTest.jav"));
filesToTest.add(new File(rootDirectory+"WhileTest.jav")); filesToTest.add(new File(rootDirectory+"WhileTest.jav"));
//filesToTest.add(new File(rootDirectory+"IfTest.jav"));
for(File f : filesToTest){ for(File f : filesToTest){
SourceFile sf = this.parse(f); SourceFile sf = this.parse(f);
System.out.println("-------------------------------------|"+f.getName()+"|----------------------------------------------");
System.out.println(ASTPrinter.print(this.sourceFiles.get(sourceFiles.size()-1))); System.out.println(ASTPrinter.print(this.sourceFiles.get(sourceFiles.size()-1)));
System.out.println("-----------------------------------------------------------------------------------");
/* /*
for(ResultSet resultSet : this.typeInference()){ for(ResultSet resultSet : this.typeInference()){
Set<TypeInsert> result = TypeInsertFactory.createTypeInsertPoints(sf, resultSet); Set<TypeInsert> result = TypeInsertFactory.createTypeInsertPoints(sf, resultSet);