[09 - LL(I) AST] Re-init project as project with modules

This commit is contained in:
2020-05-25 11:55:53 +02:00
parent ffd623e674
commit 0598ac09a7
22 changed files with 3755 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
/* **********************************************
* Duale Hochschule Baden-Württemberg Karlsruhe
* Prof. Dr. Jörn Eisenbiegler
*
* Vorlesung Übersetzerbau
* Praxis LL(1)-Parser für X
* - Testfall-Utility für Scanner
*
* **********************************************
*/
package de.dhbw.compiler.xparser.test;
import static org.junit.Assert.assertEquals;
import java.io.StringReader;
import de.dhbw.compiler.xparser.JFlexXScanner;
import de.dhbw.compiler.xparser.TokenBuffer;
import de.dhbw.compiler.xparser.Tree;
import de.dhbw.compiler.xparser.XParser;
public abstract class ParseTreeTest {
protected void testParseTree(String in, String expected) throws Exception {
JFlexXScanner scanner = new JFlexXScanner(new StringReader(in));
TokenBuffer buffer = new TokenBuffer(scanner);
XParser parser = new XParser(buffer);
Tree out = parser.parseProgram();
if (out==null) {
assertEquals(expected, out);
} else {
assertEquals(expected, out.toString());
}
}
}