Rewrote grammar, implemented two visitors

This commit is contained in:
Marvin Kaiser
2019-10-29 09:51:43 +01:00
parent ea248733d0
commit 64c41122d0
11 changed files with 539 additions and 103 deletions

View File

@@ -19,8 +19,9 @@ public class Klang {
KlangParser parser = new KlangParser(tokens);
ParseTree tree = parser.parse(); // begin parsing at init rule
Visitor visitor = new Visitor();
int result = visitor.visit(tree);
System.out.println(result);
StringBuilder sb = new StringBuilder();
JSVisitor visitor = new JSVisitor(sb);
visitor.visit(tree);
System.out.println(sb.toString());
}
}