This commit is contained in:
JanUlrich 2017-10-05 19:21:30 +02:00
parent a011061f22
commit 6738eecdf3
6 changed files with 29 additions and 13 deletions

3
.gitignore vendored
View File

@ -13,4 +13,5 @@ bin
# IDEs
.classpath
*.iml
.idea/

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.ow2.asm:asm-all:6.0_BETA">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-all/6.0_BETA/asm-all-6.0_BETA.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-all/6.0_BETA/asm-all-6.0_BETA-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-all/6.0_BETA/asm-all-6.0_BETA-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -21,5 +21,6 @@
<orderEntry type="library" name="Maven: com.google.guava:guava:19.0" level="project" />
<orderEntry type="library" name="Maven: org.reflections:reflections:0.9.11" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm-all:6.0_BETA" level="project" />
</component>
</module>

View File

@ -31,6 +31,11 @@
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.11</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-all</artifactId>
<version>[4.0.0,)</version>
</dependency>
</dependencies>

View File

@ -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);
}
}

View File

@ -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<File> 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<String,byte[]> bytecode = this.getBytecode(sf);
HashMap<String,byte[]> bytecode = this.getBytecode(compiler.sourceFiles.get(f));
this.writeClassFile(bytecode, "EmptyClass");
}