forked from JavaTX/JavaCompilerCore
Merge
This commit is contained in:
parent
a011061f22
commit
6738eecdf3
3
.gitignore
vendored
3
.gitignore
vendored
@ -13,4 +13,5 @@ bin
|
|||||||
|
|
||||||
# IDEs
|
# IDEs
|
||||||
.classpath
|
.classpath
|
||||||
|
*.iml
|
||||||
|
.idea/
|
||||||
|
13
.idea/libraries/Maven__org_ow2_asm_asm_all_6_0_BETA.xml
generated
Normal file
13
.idea/libraries/Maven__org_ow2_asm_asm_all_6_0_BETA.xml
generated
Normal 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>
|
@ -21,5 +21,6 @@
|
|||||||
<orderEntry type="library" name="Maven: com.google.guava:guava:19.0" level="project" />
|
<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.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.javassist:javassist:3.21.0-GA" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.ow2.asm:asm-all:6.0_BETA" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
5
pom.xml
5
pom.xml
@ -31,6 +31,11 @@
|
|||||||
<groupId>org.reflections</groupId>
|
<groupId>org.reflections</groupId>
|
||||||
<artifactId>reflections</artifactId>
|
<artifactId>reflections</artifactId>
|
||||||
<version>0.9.11</version>
|
<version>0.9.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.ow2.asm</groupId>
|
||||||
|
<artifactId>asm-all</artifactId>
|
||||||
|
<version>[4.0.0,)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package de.dhbwstuttgart.syntaxtree.statement;
|
|||||||
|
|
||||||
|
|
||||||
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
|
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
|
||||||
|
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
|
||||||
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode;
|
||||||
import org.antlr.v4.runtime.Token;
|
import org.antlr.v4.runtime.Token;
|
||||||
|
|
||||||
@ -24,4 +25,8 @@ public class ArgumentList extends SyntaxTreeNode
|
|||||||
public void accept(ASTVisitor visitor) {
|
public void accept(ASTVisitor visitor) {
|
||||||
visitor.visit(this);
|
visitor.visit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void accept(StatementVisitor visitor) {
|
||||||
|
visitor.visit(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,15 +4,6 @@ import de.dhbwstuttgart.bytecode.BytecodeGen;
|
|||||||
import de.dhbwstuttgart.core.JavaTXCompiler;
|
import de.dhbwstuttgart.core.JavaTXCompiler;
|
||||||
import de.dhbwstuttgart.exceptions.DebugException;
|
import de.dhbwstuttgart.exceptions.DebugException;
|
||||||
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
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 org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -30,7 +21,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
import static org.junit.Assert.*;
|
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 String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/";
|
||||||
private static final List<File> filesToTest = new ArrayList<>();
|
private static final List<File> filesToTest = new ArrayList<>();
|
||||||
@ -38,10 +29,10 @@ public class JavaTXCompilerTest extends JavaTXCompiler {
|
|||||||
@Test
|
@Test
|
||||||
public void test() throws IOException, java.lang.ClassNotFoundException {
|
public void test() throws IOException, java.lang.ClassNotFoundException {
|
||||||
filesToTest.add(new File(rootDirectory+"EmptyClass.jav"));
|
filesToTest.add(new File(rootDirectory+"EmptyClass.jav"));
|
||||||
|
JavaTXCompiler compiler = new JavaTXCompiler(filesToTest);
|
||||||
for(File f : filesToTest){
|
for(File f : filesToTest){
|
||||||
SourceFile sf = this.parse(f);
|
|
||||||
String content = readFile(f.getPath(), StandardCharsets.UTF_8);
|
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");
|
this.writeClassFile(bytecode, "EmptyClass");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user