Initial commit

This commit is contained in:
Marvin Kaiser
2019-10-28 15:55:18 +01:00
commit 0a9d702198
66 changed files with 4606 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package de.hsrm.compiler.Klang;
// import ANTLR's runtime libraries
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.tree.*;
public class Klang {
public static void main(String[] args) throws Exception {
// create a CharStream that reads from standard input
ANTLRInputStream input = new ANTLRInputStream(System.in);
// create a lexer that feeds off of input CharStream
KlangLexer lexer = new KlangLexer(input);
// create a buffer of tokens pulled from the lexer
CommonTokenStream tokens = new CommonTokenStream(lexer);
// create a parser that feeds off the tokens buffer
KlangParser parser = new KlangParser(tokens);
ParseTree tree = parser.parse(); // begin parsing at init rule
System.out.println(tree.toStringTree(parser)); // print LISP-style tree
}
}