prettyprinter

This commit is contained in:
trochas
2025-04-02 15:04:39 +02:00
parent 52a5c00f74
commit 4da495479f
7 changed files with 349 additions and 11 deletions

View File

@@ -29,9 +29,6 @@ public class Main {
VSLLexer lexer = new VSLLexer(input);
CommonTokenStream tokens = new CommonTokenStream(lexer);
for (Token token : tokens.getTokens()) {
System.out.println("Token: " + token.getText() + " Type: " + token.getType());
}
// Instantiate Parser
VSLParser parser = new VSLParser(tokens);
@@ -42,6 +39,8 @@ public class Main {
// Pretty-print the program (to debug parsing)
System.err.println("todo " + ast);
System.out.println("\n\n PRETTYPRINTER : \n--------------\n" + ast.prettyprinter() + "\n--------------\nFIN PRETTYPRINTER");
// Verify the program semantic
// Generate the intermediate representation