From 6738eecdf37ce8827512c7ac8d254341de7fbf9d Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Thu, 5 Oct 2017 19:21:30 +0200 Subject: [PATCH] Merge --- .gitignore | 3 ++- .../Maven__org_ow2_asm_asm_all_6_0_BETA.xml | 13 +++++++++++++ JavaTXcompiler.iml | 1 + pom.xml | 5 +++++ .../syntaxtree/statement/ArgumentList.java | 5 +++++ test/bytecode/JavaTXCompilerTest.java | 15 +++------------ 6 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 .idea/libraries/Maven__org_ow2_asm_asm_all_6_0_BETA.xml diff --git a/.gitignore b/.gitignore index c71c9ed2..77e5f2f1 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ bin # IDEs .classpath - +*.iml +.idea/ diff --git a/.idea/libraries/Maven__org_ow2_asm_asm_all_6_0_BETA.xml b/.idea/libraries/Maven__org_ow2_asm_asm_all_6_0_BETA.xml new file mode 100644 index 00000000..20d5330e --- /dev/null +++ b/.idea/libraries/Maven__org_ow2_asm_asm_all_6_0_BETA.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/JavaTXcompiler.iml b/JavaTXcompiler.iml index 20953853..f53d2064 100644 --- a/JavaTXcompiler.iml +++ b/JavaTXcompiler.iml @@ -21,5 +21,6 @@ + \ No newline at end of file diff --git a/pom.xml b/pom.xml index fed9a769..7bbd8abd 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,11 @@ org.reflections reflections 0.9.11 + + + org.ow2.asm + asm-all + [4.0.0,) diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java b/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java index 75c92370..c4b8367d 100644 --- a/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/ArgumentList.java @@ -2,6 +2,7 @@ package de.dhbwstuttgart.syntaxtree.statement; import de.dhbwstuttgart.syntaxtree.ASTVisitor; +import de.dhbwstuttgart.syntaxtree.StatementVisitor; import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import org.antlr.v4.runtime.Token; @@ -24,4 +25,8 @@ public class ArgumentList extends SyntaxTreeNode public void accept(ASTVisitor visitor) { visitor.visit(this); } + + public void accept(StatementVisitor visitor) { + visitor.visit(this); + } } diff --git a/test/bytecode/JavaTXCompilerTest.java b/test/bytecode/JavaTXCompilerTest.java index 16e96e5a..fbbea261 100644 --- a/test/bytecode/JavaTXCompilerTest.java +++ b/test/bytecode/JavaTXCompilerTest.java @@ -4,15 +4,6 @@ import de.dhbwstuttgart.bytecode.BytecodeGen; import de.dhbwstuttgart.core.JavaTXCompiler; import de.dhbwstuttgart.exceptions.DebugException; import de.dhbwstuttgart.syntaxtree.SourceFile; -import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; -import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import de.dhbwstuttgart.syntaxtree.visual.ASTPrinter; -import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter; -import de.dhbwstuttgart.syntaxtree.visual.OutputGenerator; -import de.dhbwstuttgart.typedeployment.TypeInsert; -import de.dhbwstuttgart.typedeployment.TypeInsertFactory; -import de.dhbwstuttgart.typedeployment.TypeInsertPoint; -import de.dhbwstuttgart.typeinference.ResultSet; import org.junit.Test; import java.io.File; @@ -30,7 +21,7 @@ import java.util.Set; import static org.junit.Assert.*; -public class JavaTXCompilerTest extends JavaTXCompiler { +public class JavaTXCompilerTest { private static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/"; private static final List filesToTest = new ArrayList<>(); @@ -38,10 +29,10 @@ public class JavaTXCompilerTest extends JavaTXCompiler { @Test public void test() throws IOException, java.lang.ClassNotFoundException { filesToTest.add(new File(rootDirectory+"EmptyClass.jav")); + JavaTXCompiler compiler = new JavaTXCompiler(filesToTest); for(File f : filesToTest){ - SourceFile sf = this.parse(f); String content = readFile(f.getPath(), StandardCharsets.UTF_8); - HashMap bytecode = this.getBytecode(sf); + HashMap bytecode = this.getBytecode(compiler.sourceFiles.get(f)); this.writeClassFile(bytecode, "EmptyClass"); }