Search in sources :

Example 1 with BlockSetTransformer

use of org.antlr.v4.parse.BlockSetTransformer in project antlr4 by antlr.

the class GrammarTransformPipeline method reduceBlocksToSets.

public void reduceBlocksToSets(GrammarAST root) {
    CommonTreeNodeStream nodes = new CommonTreeNodeStream(new GrammarASTAdaptor(), root);
    GrammarASTAdaptor adaptor = new GrammarASTAdaptor();
    BlockSetTransformer transformer = new BlockSetTransformer(nodes, g);
    transformer.setTreeAdaptor(adaptor);
    transformer.downup(root);
}
Also used : BlockSetTransformer(org.antlr.v4.parse.BlockSetTransformer) GrammarASTAdaptor(org.antlr.v4.parse.GrammarASTAdaptor) CommonTreeNodeStream(org.antlr.runtime.tree.CommonTreeNodeStream)

Aggregations

CommonTreeNodeStream (org.antlr.runtime.tree.CommonTreeNodeStream)1 BlockSetTransformer (org.antlr.v4.parse.BlockSetTransformer)1 GrammarASTAdaptor (org.antlr.v4.parse.GrammarASTAdaptor)1