All Downloads are FREE. Search and download functionalities are using the official Maven repository.

antlr.build.ANTLR Maven / Gradle / Ivy

There is a newer version: 3.3.8
Show newest version
package antlr.build;

import java.io.*;

/** Simple class that uses build.Tool to compile ANTLR's Java stuff */
public class ANTLR {
    public static String compiler = "javac";
    public static String jarName = "antlr.jar";
    public static String root = ".";

    public static String[] srcdir = {
        "antlr",
        "antlr/actions/cpp",
        "antlr/actions/java",
        "antlr/actions/csharp",
        "antlr/collections",
        "antlr/collections/impl",
        "antlr/debug",
        "antlr/ASdebug",
        "antlr/debug/misc",
        "antlr/preprocessor"
    };

    public ANTLR() {
        compiler = System.getProperty("antlr.build.compiler", compiler);
        root = System.getProperty("antlr.build.root", root);
    }

    public String getName() { return "ANTLR"; }

    /** Build ANTLR.  action on cmd-line matches method name */
    public void build(Tool tool) {
        if ( !rootIsValidANTLRDir(tool) ) {
            return;
        }
        // run ANTLR on its own .g files
        tool.antlr(root+"/antlr/antlr.g");
        tool.antlr(root+"/antlr/tokdef.g");
        tool.antlr(root+"/antlr/preprocessor/preproc.g");
        tool.antlr(root+"/antlr/actions/java/action.g");
        tool.antlr(root+"/antlr/actions/cpp/action.g");
        tool.antlr(root+"/antlr/actions/csharp/action.g");
        for (int i=0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy