Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 841 Bytes

File metadata and controls

45 lines (34 loc) · 841 Bytes

Burito Java Compiler

Using JTB

Compiling the jj file:

java -jar jtb132.jar <jj_file>

Generating the visitors:

javacc jtb.out.jj

Invoking the visitors:

Make a Main.java file looking something like this:

import syntaxtree.*;
import visitor.*;
import my_visitors.*;

public class Main {
   public static void main(String [] args) {
      try {
         Node root = new BuritoJavaParser(System.in).Goal();
         System.out.println("Program parsed successfully");
         root.accept(new GJNoArguDepthFirst()); // Your assignment part is invoked here.
      }
      catch (ParseException e) {
         System.out.println(e.toString());
      }
   }
} 

Now compile it using javac and you can run the executable with your test files!!

javac Main.java
java Main < Factorial.java