public boolean hasAltSpecificContexts() { return getAltLabels()!=null; }
public boolean hasAltSpecificContexts() { return getAltLabels()!=null; }
public boolean hasAltSpecificContexts() { return getAltLabels()!=null; }
public boolean hasAltSpecificContexts() { return getAltLabels()!=null; }
public boolean hasAltSpecificContexts() { return getAltLabels()!=null; }
public String[] getAltLabels(Rule r) { String[] altLabels = null; Map<String, List<Pair<Integer, AltAST>>> altLabelsMap = r.getAltLabels(); if ( altLabelsMap!=null ) { altLabels = new String[r.getOriginalNumberOfAlts() + 1]; for (String altLabel : altLabelsMap.keySet()) { List<Pair<Integer, AltAST>> pairs = altLabelsMap.get(altLabel); for (Pair<Integer, AltAST> pair : pairs) { altLabels[pair.a] = altLabel; } } } return altLabels; }
public VisitorFile(OutputModelFactory factory, String fileName) { super(factory, fileName); Grammar g = factory.getGrammar(); parserName = g.getRecognizerName(); grammarName = g.name; for (Rule r : g.rules.values()) { Map<String, List<Pair<Integer, AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> pair : labels.entrySet()) { visitorNames.add(pair.getKey()); visitorLabelRuleNames.put(pair.getKey(), r.name); } } else { // if labels, must label all. no need for generic rule visitor then visitorNames.add(r.name); } } ActionAST ast = g.namedActions.get("header"); if ( ast!=null ) header = new Action(factory, ast); genPackage = factory.getGrammar().tool.genPackage; } }
public Map<String, List<Pair<Integer, AltAST>>> getAltLabels() { Map<String, List<Pair<Integer, AltAST>>> labels = new HashMap<String, List<Pair<Integer, AltAST>>>(); Map<String, List<Pair<Integer, AltAST>>> normalAltLabels = super.getAltLabels(); if ( normalAltLabels!=null ) labels.putAll(normalAltLabels); if ( recPrimaryAlts!=null ) {
public Map<String, List<Pair<Integer, AltAST>>> getAltLabels() { Map<String, List<Pair<Integer, AltAST>>> labels = new HashMap<String, List<Pair<Integer, AltAST>>>(); Map<String, List<Pair<Integer, AltAST>>> normalAltLabels = super.getAltLabels(); if ( normalAltLabels!=null ) labels.putAll(normalAltLabels); if ( recPrimaryAlts!=null ) {
public ListenerFile(OutputModelFactory factory, String fileName) { super(factory, fileName); Grammar g = factory.getGrammar(); parserName = g.getRecognizerName(); grammarName = g.name; for (Rule r : g.rules.values()) { Map<String, List<Pair<Integer,AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> pair : labels.entrySet()) { listenerNames.add(pair.getKey()); listenerLabelRuleNames.put(pair.getKey(), r.name); } } else { // only add rule context if no labels listenerNames.add(r.name); } } ActionAST ast = g.namedActions.get("header"); if ( ast!=null ) header = new Action(factory, ast); genPackage = factory.getGrammar().tool.genPackage; } }
public ListenerFile(OutputModelFactory factory, String fileName) { super(factory, fileName); Grammar g = factory.getGrammar(); parserName = g.getRecognizerName(); grammarName = g.name; for (Rule r : g.rules.values()) { Map<String, List<Pair<Integer,AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> pair : labels.entrySet()) { listenerNames.add(pair.getKey()); listenerLabelRuleNames.put(pair.getKey(), r.name); } } else { // only add rule context if no labels listenerNames.add(r.name); } } ActionAST ast = g.namedActions.get("header"); if ( ast!=null ) header = new Action(factory, ast); genPackage = factory.getGrammar().tool.genPackage; } }
public VisitorFile(OutputModelFactory factory, String fileName) { super(factory, fileName); Grammar g = factory.getGrammar(); parserName = g.getRecognizerName(); grammarName = g.name; for (Rule r : g.rules.values()) { Map<String, List<Pair<Integer, AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> pair : labels.entrySet()) { visitorNames.add(pair.getKey()); visitorLabelRuleNames.put(pair.getKey(), r.name); } } else { // if labels, must label all. no need for generic rule visitor then visitorNames.add(r.name); } } ActionAST ast = g.namedActions.get("header"); if ( ast!=null ) header = new Action(factory, ast); genPackage = factory.getGrammar().tool.genPackage; } }
Map<String, List<Pair<Integer, AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> entry : labels.entrySet()) {
Map<String, List<Pair<Integer, AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> entry : labels.entrySet()) {
public VisitorFile(OutputModelFactory factory, String fileName) { super(factory, fileName); Grammar g = factory.getGrammar(); namedActions = buildNamedActions(g); parserName = g.getRecognizerName(); grammarName = g.name; for (Rule r : g.rules.values()) { Map<String, List<Pair<Integer, AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> pair : labels.entrySet()) { visitorNames.add(pair.getKey()); visitorLabelRuleNames.put(pair.getKey(), r.name); } } else { // if labels, must label all. no need for generic rule visitor then visitorNames.add(r.name); } } ActionAST ast = g.namedActions.get("header"); if ( ast!=null ) header = new Action(factory, ast); genPackage = g.tool.genPackage; accessLevel = g.getOptionString("accessLevel"); exportMacro = g.getOptionString("exportMacro"); } }
public VisitorFile(OutputModelFactory factory, String fileName) { super(factory, fileName); Grammar g = factory.getGrammar(); namedActions = buildNamedActions(g); parserName = g.getRecognizerName(); grammarName = g.name; for (Rule r : g.rules.values()) { Map<String, List<Pair<Integer, AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> pair : labels.entrySet()) { visitorNames.add(pair.getKey()); visitorLabelRuleNames.put(pair.getKey(), r.name); } } else { // if labels, must label all. no need for generic rule visitor then visitorNames.add(r.name); } } ActionAST ast = g.namedActions.get("header"); if ( ast!=null ) header = new Action(factory, ast); genPackage = g.tool.genPackage; accessLevel = g.getOptionString("accessLevel"); exportMacro = g.getOptionString("exportMacro"); } }
public ListenerFile(OutputModelFactory factory, String fileName) { super(factory, fileName); Grammar g = factory.getGrammar(); parserName = g.getRecognizerName(); grammarName = g.name; namedActions = buildNamedActions(factory.getGrammar()); for (Rule r : g.rules.values()) { Map<String, List<Pair<Integer,AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> pair : labels.entrySet()) { listenerNames.add(pair.getKey()); listenerLabelRuleNames.put(pair.getKey(), r.name); } } else { // only add rule context if no labels listenerNames.add(r.name); } } ActionAST ast = g.namedActions.get("header"); if ( ast!=null ) header = new Action(factory, ast); genPackage = g.tool.genPackage; accessLevel = g.getOptionString("accessLevel"); exportMacro = g.getOptionString("exportMacro"); } }
public ListenerFile(OutputModelFactory factory, String fileName) { super(factory, fileName); Grammar g = factory.getGrammar(); parserName = g.getRecognizerName(); grammarName = g.name; namedActions = buildNamedActions(factory.getGrammar()); for (Rule r : g.rules.values()) { Map<String, List<Pair<Integer,AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Pair<Integer, AltAST>>> pair : labels.entrySet()) { listenerNames.add(pair.getKey()); listenerLabelRuleNames.put(pair.getKey(), r.name); } } else { // only add rule context if no labels listenerNames.add(r.name); } } ActionAST ast = g.namedActions.get("header"); if ( ast!=null ) header = new Action(factory, ast); genPackage = g.tool.genPackage; accessLevel = g.getOptionString("accessLevel"); exportMacro = g.getOptionString("exportMacro"); } }
Map<String, List<Tuple2<Integer,AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Tuple2<Integer, AltAST>>> pair : labels.entrySet()) {
Map<String, List<Tuple2<Integer,AltAST>>> labels = r.getAltLabels(); if ( labels!=null ) { for (Map.Entry<String, List<Tuple2<Integer, AltAST>>> pair : labels.entrySet()) {