[12 - Tree Grammar] Add type check

This commit is contained in:
2020-06-13 19:16:35 +02:00
parent 04c18d4fdf
commit 54d6ea874e
10 changed files with 1726 additions and 173 deletions

View File

@@ -16,21 +16,15 @@ import static org.junit.Assert.assertEquals;
import java.io.ByteArrayInputStream;
import de.dhbw.compiler.antlrxcompiler.*;
import org.antlr.runtime.ANTLRInputStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.tree.CommonTreeNodeStream;
import de.dhbw.compiler.antlrxcompiler.XLexer;
import de.dhbw.compiler.antlrxcompiler.XOptimizer;
import de.dhbw.compiler.antlrxcompiler.XParser;
import de.dhbw.compiler.antlrxcompiler.XTree;
import de.dhbw.compiler.antlrxcompiler.XTreeAdaptor;
import de.dhbw.compiler.antlrxcompiler.XTypeCheck;
public abstract class OptimizerTest {
protected void testTypeCheckTree(String in, String expected) throws Exception {
XTreeAdaptor xTreeAdaptor = new XTreeAdaptor();
XTreeAdaptor xTreeAdaptor = new XTreeAdaptor();
ANTLRInputStream input = new ANTLRInputStream(new ByteArrayInputStream(in.getBytes()));
XLexer scanner = new XLexer(input);
CommonTokenStream tokens = new CommonTokenStream(scanner);