Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into strucTypes_dev2

Versuche aktuelle Version zu bekommen in der Hoffnung dass ich evtl. ein Interface parsen kann.
This commit is contained in:
sebastian 2017-04-20 00:16:33 +02:00
commit 22bc53cde9
4 changed files with 32 additions and 5 deletions

24
src/build_compiler.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# A basic script to compile the necessary packages and their subpackages to work with the parser.
# Messages are logged to stderr.
>&2 echo "Building de.dhbwstuttgart.typecheck..."
javac -d ../bin ./de/dhbwstuttgart/typecheck/*.java
>&2 echo "Building de.dhbwstuttgart.syntaxtree..."
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/*.java
>&2 echo "Building de.dhbwstuttgart.syntaxtree.factory..."
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/factory/*.java
>&2 echo "Building de.dhbwstuttgart.syntaxtree.operator..."
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/operator/*.java
>&2 echo "Building de.dhbwstuttgart.syntaxtree.statement..."
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/statement/*.java
>&2 echo "Building de.dhbwstuttgart.syntaxtree.statement.literal..."
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/statement/literal/*.java
>&2 echo "Building de.dhbwstuttgart.syntaxtree.type..."
javac -d ../bin ./de/dhbwstuttgart/syntaxtree/type/*.java
>&2 echo "Building de.dhbwstuttgart.parser..."
javac -d ../bin ./de/dhbwstuttgart/parser/*.java
>&2 echo "Building de.dhbwstuttgart.parser.SyntaxTreeGenerator..."
javac -d ../bin ./de/dhbwstuttgart/parser/SyntaxTreeGenerator/*.java
>&2 echo "Building de.dhbwstuttgart.parser.antlr..."
javac -d ../bin ./de/dhbwstuttgart/parser/antlr/*.java
echo "Done. Now its your turn to debug:)."

View File

@ -12,7 +12,7 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Set; import java.util.Set;
import java.lang.InterruptedException;
/** /**
* Hilft beim Durchsuchen von Packages * Hilft beim Durchsuchen von Packages
* Benutzt die Reflections-Library (https://github.com/ronmamo/reflections) * Benutzt die Reflections-Library (https://github.com/ronmamo/reflections)
@ -22,8 +22,9 @@ public class PackageCrawler {
public static Set<Class<?>> getClassesInPackage(String packageName){ public static Set<Class<?>> getClassesInPackage(String packageName){
List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>(); List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
classLoadersList.add(ClasspathHelper.contextClassLoader()); classLoadersList.add(Thread.currentThread().getContextClassLoader());
classLoadersList.add(ClasspathHelper.staticClassLoader()); classLoadersList.add(ClasspathHelper.staticClassLoader());
classLoadersList.add(Thread.currentThread().getContextClassLoader().getParent());
Reflections reflections = new Reflections(new ConfigurationBuilder() Reflections reflections = new Reflections(new ConfigurationBuilder()
.setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner()) .setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())

View File

@ -30,7 +30,6 @@ public class GeneralParserTest{
filenames.add("ImportTest.jav"); filenames.add("ImportTest.jav");
filenames.add("CastTest.jav"); filenames.add("CastTest.jav");
filenames.add("StatementsTest.jav"); filenames.add("StatementsTest.jav");
filenames.add("Methods.jav");
filenames.add("ImportTestGeneric.jav"); filenames.add("ImportTestGeneric.jav");
filenames.add("CastTest.jav"); filenames.add("CastTest.jav");
//filenames.add("BoundedParameter.jav"); //filenames.add("BoundedParameter.jav");

View File

@ -1,8 +1,11 @@
package parser; package parser;
import de.dhbwstuttgart.parser.JavaTXParser;
import de.dhbwstuttgart.parser.RunParser; import de.dhbwstuttgart.parser.RunParser;
import org.junit.Test; import org.junit.Test;
import java.io.File;
import static org.junit.Assert.*; import static org.junit.Assert.*;
public class RunParserTest { public class RunParserTest {
@ -13,6 +16,6 @@ public class RunParserTest {
public void testMain() throws Exception { public void testMain() throws Exception {
String[] args = new String[1]; String[] args = new String[1];
args[0] = rootDirectory+"ImportTest2.jav"; args[0] = rootDirectory+"ImportTest2.jav";
RunParser.main(args); new JavaTXParser().parse(new File(args[0]));
} }
} }