added astprinter to parsertest

This commit is contained in:
luca9913 2023-06-03 18:59:11 +02:00
parent eb5cf1ab33
commit e3edd0410a

View File

@ -9,6 +9,7 @@ import java.util.stream.Collectors;
import de.dhbwstuttgart.core.JavaTXCompiler; import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.parser.JavaTXParser; import de.dhbwstuttgart.parser.JavaTXParser;
import de.dhbwstuttgart.syntaxtree.visual.ASTPrinter;
import org.junit.Test; import org.junit.Test;
@ -41,11 +42,13 @@ public class GeneralParserTest {
filenames.add("PackageNameTest.jav"); filenames.add("PackageNameTest.jav");
filenames.add("AntlrTest.jav"); filenames.add("AntlrTest.jav");
// filenames.add("Java17Rules.jav"); // filenames.add("Java17Rules.jav");
filenames.add("NestedPattern.jav"); // filenames.add("NestedPattern.jav");
try { try {
for (String filename : filenames) { for (String filename : filenames) {
System.out.println(filename); System.out.println(filename);
new JavaTXCompiler(new File(rootDirectory + filename)); File sf = new File(rootDirectory + filename);
JavaTXCompiler compiler = new JavaTXCompiler(sf);
System.out.println(ASTPrinter.print(compiler.sourceFiles.get(sf)));
} }
// new JavaTXCompiler(filenames.stream().map(s -> new File(rootDirectory + // new JavaTXCompiler(filenames.stream().map(s -> new File(rootDirectory +
// s)).collect(Collectors.toList())); // s)).collect(Collectors.toList()));