forked from JavaTX/JavaCompilerCore
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:
commit
22bc53cde9
24
src/build_compiler.sh
Executable file
24
src/build_compiler.sh
Executable 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:)."
|
@ -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)
|
||||||
@ -20,10 +20,11 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
public class PackageCrawler {
|
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())
|
||||||
|
@ -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");
|
||||||
|
@ -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]));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user