Search in sources :

Example 1 with GrammarEngineImpl

use of org.antlr.works.grammar.engine.GrammarEngineImpl in project antlrworks by antlr.

the class Console method processSyntaxDiagram.

private void processSyntaxDiagram(ProcessSyntaxDiagramDelegate delegate) throws Exception {
    GrammarEngine engine = new GrammarEngineImpl(new EngineDelegate());
    GrammarSyntaxEngine syntaxEngine = engine.getSyntaxEngine();
    syntaxEngine.setDelegate(new SyntaxDelegate());
    syntaxEngine.processSyntax();
    engine.parserCompleted();
    SDGenerator gen = new SDGenerator(engine);
    delegate.beginProcess();
    for (String name : engine.getRuleNames()) {
        delegate.processRule(name, gen);
    }
    delegate.endProcess();
}
Also used : SDGenerator(org.antlr.works.visualization.SDGenerator) GrammarSyntaxEngine(org.antlr.works.grammar.syntax.GrammarSyntaxEngine) GrammarEngine(org.antlr.works.grammar.engine.GrammarEngine) ATESyntaxEngineDelegate(org.antlr.works.ate.syntax.generic.ATESyntaxEngineDelegate) GrammarEngineDelegate(org.antlr.works.grammar.engine.GrammarEngineDelegate) GrammarEngineImpl(org.antlr.works.grammar.engine.GrammarEngineImpl)

Aggregations

ATESyntaxEngineDelegate (org.antlr.works.ate.syntax.generic.ATESyntaxEngineDelegate)1 GrammarEngine (org.antlr.works.grammar.engine.GrammarEngine)1 GrammarEngineDelegate (org.antlr.works.grammar.engine.GrammarEngineDelegate)1 GrammarEngineImpl (org.antlr.works.grammar.engine.GrammarEngineImpl)1 GrammarSyntaxEngine (org.antlr.works.grammar.syntax.GrammarSyntaxEngine)1 SDGenerator (org.antlr.works.visualization.SDGenerator)1