Examples of GrammarTransformPipeline


Examples of org.antlr.v4.tool.GrammarTransformPipeline

    // update grammar AST and set rule's AST.
    RULES.setChild(prevRuleAST.getChildIndex(), t);
    r.ast = t;

    // Reduce sets in newly created rule tree
    GrammarTransformPipeline transform = new GrammarTransformPipeline(g, g.tool);
    transform.reduceBlocksToSets(r.ast);
    transform.expandParameterizedLoops(r.ast);

    // Rerun semantic checks on the new rule
    RuleCollector ruleCollector = new RuleCollector(g);
    ruleCollector.visit(t, "rule");
    BasicSemanticChecks basics = new BasicSemanticChecks(g, ruleCollector);
View Full Code Here

Examples of org.antlr.v4.tool.GrammarTransformPipeline

    process the lexer first, if present, and then the parser grammar
   */
  public void process(Grammar g, boolean gencode) {
    g.loadImportedGrammars();

    GrammarTransformPipeline transform = new GrammarTransformPipeline(g, this);
    transform.process();

    LexerGrammar lexerg;
    GrammarRootAST lexerAST;
    if ( g.ast!=null && g.ast.grammarType== ANTLRParser.COMBINED &&
       !g.ast.hasErrors )
    {
      lexerAST = transform.extractImplicitLexer(g); // alters g.ast
      if ( lexerAST!=null ) {
        if (grammarOptions != null) {
          lexerAST.cmdLineOptions = grammarOptions;
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.