/** Add decl to struct ctx for rule or alt if labeled */ 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 } }
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]); altToContext[altNum].addDecl(d);
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]); altToContext[altNum].addDecl(d);
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]); altToContext[altNum].addDecl(d);
/** Add decl to struct ctx for rule or alt if labeled */ 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 } }
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]); altToContext[altNum].addDecl(d);
/** Add decl to struct ctx for rule or alt if labeled */ 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 } }
if (!labeledAlternatives.isEmpty()) { for (Map.Entry<String, List<AltAST>> entry : labeledAlternatives.entrySet()) { AltLabelStructDecl labelDecl = new AltLabelStructDecl(factory, rule, entry.getKey()); altLabelCtxs.put(entry.getKey(), labelDecl); Set<Decl> decls = getDeclsForAllElements(entry.getValue()); for (Decl decl : decls) { labelDecl.addDecl(decl);
/** Add decl to struct ctx for rule or alt if labeled */ 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 } }
/** Add decl to struct ctx for rule or alt if labeled */ 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 } }