Examples of AltLabelStructDecl


Examples of org.antlr.v4.codegen.model.decl.AltLabelStructDecl

        }

        Set<Decl> decls = getDeclsForAllElements(alts);
        for (Pair<Integer, AltAST> pair : entry.getValue()) {
          Integer altNum = pair.a;
          altToContext[altNum] = new AltLabelStructDecl(factory, r, altNum, label);
          if (!altLabelCtxs.containsKey(label)) {
            altLabelCtxs.put(label, altToContext[altNum]);
          }

          // we know which ctx to put in, so do it directly
View Full Code Here

Examples of org.antlr.v4.codegen.model.decl.AltLabelStructDecl

  public void addContextDecl(String altLabel, Decl d) {
    CodeBlockForOuterMostAlt alt = d.getOuterMostAltCodeBlock();
    // if we found code blk and might be alt label, try to add to that label ctx
    if ( alt!=null && altLabelCtxs!=null ) {
//      System.out.println(d.name+" lives in alt "+alt.alt.altNum);
      AltLabelStructDecl altCtx = altLabelCtxs.get(altLabel);
      if ( altCtx!=null ) { // we have an alt ctx
//        System.out.println("ctx is "+ altCtx.name);
        altCtx.addDecl(d);
        return;
      }
    }
    ruleCtx.addDecl(d); // stick in overall rule's ctx
  }
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.