import java.io.FileInputStream;
import java.io.InputStream;

import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;

public class emlgrun {

	public static void main(String[] args) {
		try {
			if (args.length == 0)
				throw new emlgException();
			InputStream source = new FileInputStream(args[0]);
			checkAndExec(source);

		} catch (emlgException x) {
			System.out.println("Contextual analysis failed");
		} catch (Exception x) {
			x.printStackTrace(System.out);
		}

	}

	private static void checkAndExec(InputStream source) throws Exception {
		emlgLexer lexer = new emlgLexer(new ANTLRInputStream(source));
		CommonTokenStream tokens = new CommonTokenStream(lexer);
		ParseTree tree = syntacticAnalyse(tokens);
		//ExecVisitor exec = new ExecVisitor();
		compVisitor exec = new compVisitor();
		System.out.println("executing...");
		exec.visit(tree);
		System.out.println(exec.getClassByteArray());

	}

	private static ParseTree syntacticAnalyse(CommonTokenStream tokens) throws Exception {

		System.out.println();
		System.out.println("Syntactic analysis ...");
		emlgParser parser = new emlgParser(tokens);
		ParseTree tree = parser.program();
		int errors = parser.getNumberOfSyntaxErrors();
		System.out.println(errors + " syntactic errors");
		if (errors > 0)
			throw new emlgException();
		return tree;
	}

	@SuppressWarnings("serial")
	private static class emlgException extends Exception {
	}
}

@@ -802,10 +802,8 @@
 ;%0A%09%09
-//
 Exec
@@ -838,16 +838,18 @@
 or();%0A%09%09
+//
 compVisi
@@ -934,24 +934,26 @@
 it(tree);%0A%09%09
+//
 System.out.p

change back to interpite mode , compile is not going to be done in time