Examples of insertOp()


Examples of org.antlr.v4.codegen.model.CodeBlockForAlt.insertOp()

      ST altActionST = codegenTemplates.getInstanceOf("recRuleReplaceContext");
      altActionST.add("ctxName", Utils.capitalize(altInfo.altLabel));
      Action altAction =
        new Action(delegate, function.altLabelCtxs.get(altInfo.altLabel), altActionST);
      CodeBlockForAlt alt = primaryAltsCode.get(i);
      alt.insertOp(0, altAction);
    }

    // Insert code to set ctx.stop after primary block and before op * loop
    ST setStopTokenAST = codegenTemplates.getInstanceOf("recRuleSetStopToken");
    Action setStopTokenAction = new Action(delegate, function.ruleCtx, setStopTokenAST);
View Full Code Here

Examples of org.antlr.v4.codegen.model.CodeBlockForAlt.insertOp()

        delegate.getGenerator().tool.errMgr.toolError(ErrorType.CODE_TEMPLATE_ARG_ISSUE, templateName, "isListLabel");
      }
      Action altAction =
        new Action(delegate, function.altLabelCtxs.get(altInfo.altLabel), altActionST);
      CodeBlockForAlt alt = opAltsCode.get(i);
      alt.insertOp(0, altAction);
    }
  }

  public void buildNormalRuleFunction(Rule r, RuleFunction function) {
    CodeGenerator gen = delegate.getGenerator();
View Full Code Here

Examples of org.antlr.v4.codegen.model.CodeBlockForOuterMostAlt.insertOp()

    }

    // Insert code to set ctx.stop after primary block and before op * loop
    ST setStopTokenAST = codegenTemplates.getInstanceOf("recRuleSetStopToken");
    Action setStopTokenAction = new Action(delegate, function.ruleCtx, setStopTokenAST);
    outerAlt.insertOp(1, setStopTokenAction);

    // Insert code to set _prevctx at start of * loop
    ST setPrevCtx = codegenTemplates.getInstanceOf("recRuleSetPrevCtx");
    Action setPrevCtxAction = new Action(delegate, function.ruleCtx, setPrevCtx);
    opAltStarBlock.addIterationOp(setPrevCtxAction);
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.