Search in sources :

Example 1 with BuildDependencyGenerator

use of org.antlr.v4.tool.BuildDependencyGenerator in project antlr4 by antlr.

the class Tool method processGrammarsOnCommandLine.

public void processGrammarsOnCommandLine() {
    List<GrammarRootAST> sortedGrammars = sortGrammarByTokenVocab(grammarFiles);
    for (GrammarRootAST t : sortedGrammars) {
        final Grammar g = createGrammar(t);
        g.fileName = t.fileName;
        if (gen_dependencies) {
            BuildDependencyGenerator dep = new BuildDependencyGenerator(this, g);
            /*
					List outputFiles = dep.getGeneratedFileList();
					List dependents = dep.getDependenciesFileList();
					System.out.println("output: "+outputFiles);
					System.out.println("dependents: "+dependents);
					 */
            System.out.println(dep.getDependencies().render());
        } else if (errMgr.getNumErrors() == 0) {
            process(g, true);
        }
    }
}
Also used : GrammarRootAST(org.antlr.v4.tool.ast.GrammarRootAST) BuildDependencyGenerator(org.antlr.v4.tool.BuildDependencyGenerator) Grammar(org.antlr.v4.tool.Grammar) LexerGrammar(org.antlr.v4.tool.LexerGrammar)

Aggregations

BuildDependencyGenerator (org.antlr.v4.tool.BuildDependencyGenerator)1 Grammar (org.antlr.v4.tool.Grammar)1 LexerGrammar (org.antlr.v4.tool.LexerGrammar)1 GrammarRootAST (org.antlr.v4.tool.ast.GrammarRootAST)1