@Override public int getOriginalNumberOfAlts() { int n = 0; if ( recPrimaryAlts!=null ) n += recPrimaryAlts.size(); if ( recOpAlts!=null ) n += recOpAlts.size(); return n; }
@Override public int getOriginalNumberOfAlts() { int n = 0; if ( recPrimaryAlts!=null ) n += recPrimaryAlts.size(); if ( recOpAlts!=null ) n += recOpAlts.size(); return n; }
@Override public int getOriginalNumberOfAlts() { int n = 0; if ( recPrimaryAlts!=null ) n += recPrimaryAlts.size(); if ( recOpAlts!=null ) n += recOpAlts.size(); return n; }
@Override public int getOriginalNumberOfAlts() { int n = 0; if ( recPrimaryAlts!=null ) n += recPrimaryAlts.size(); if ( recOpAlts!=null ) n += recOpAlts.size(); return n; }
@Override public int getOriginalNumberOfAlts() { int n = 0; if ( recPrimaryAlts!=null ) n += recPrimaryAlts.size(); if ( recOpAlts!=null ) n += recOpAlts.size(); return n; }
@Override public List<AltAST> getUnlabeledAltASTs() { List<AltAST> alts = new ArrayList<AltAST>(); for (LeftRecursiveRuleAltInfo altInfo : recPrimaryAlts) { if (altInfo.altLabel == null) alts.add(altInfo.originalAltAST); } for (int i = 0; i < recOpAlts.size(); i++) { LeftRecursiveRuleAltInfo altInfo = recOpAlts.getElement(i); if ( altInfo.altLabel==null ) alts.add(altInfo.originalAltAST); } if ( alts.isEmpty() ) return null; return alts; }
@Override public List<AltAST> getUnlabeledAltASTs() { List<AltAST> alts = new ArrayList<AltAST>(); for (LeftRecursiveRuleAltInfo altInfo : recPrimaryAlts) { if (altInfo.altLabel == null) alts.add(altInfo.originalAltAST); } for (int i = 0; i < recOpAlts.size(); i++) { LeftRecursiveRuleAltInfo altInfo = recOpAlts.getElement(i); if ( altInfo.altLabel==null ) alts.add(altInfo.originalAltAST); } if ( alts.isEmpty() ) return null; return alts; }
@Override public List<AltAST> getUnlabeledAltASTs() { List<AltAST> alts = new ArrayList<AltAST>(); for (LeftRecursiveRuleAltInfo altInfo : recPrimaryAlts) { if (altInfo.altLabel == null) alts.add(altInfo.originalAltAST); } for (int i = 0; i < recOpAlts.size(); i++) { LeftRecursiveRuleAltInfo altInfo = recOpAlts.getElement(i); if ( altInfo.altLabel==null ) alts.add(altInfo.originalAltAST); } if ( alts.isEmpty() ) return null; return alts; }
@Override public List<AltAST> getUnlabeledAltASTs() { List<AltAST> alts = new ArrayList<AltAST>(); for (LeftRecursiveRuleAltInfo altInfo : recPrimaryAlts) { if (altInfo.altLabel == null) alts.add(altInfo.originalAltAST); } for (int i = 0; i < recOpAlts.size(); i++) { LeftRecursiveRuleAltInfo altInfo = recOpAlts.getElement(i); if ( altInfo.altLabel==null ) alts.add(altInfo.originalAltAST); } if ( alts.isEmpty() ) return null; return alts; }
@Override public List<AltAST> getUnlabeledAltASTs() { List<AltAST> alts = new ArrayList<AltAST>(); for (LeftRecursiveRuleAltInfo altInfo : recPrimaryAlts) { if (altInfo.altLabel == null) alts.add(altInfo.originalAltAST); } for (int i = 0; i < recOpAlts.size(); i++) { LeftRecursiveRuleAltInfo altInfo = recOpAlts.getElement(i); if ( altInfo.altLabel==null ) alts.add(altInfo.originalAltAST); } if ( alts.isEmpty() ) return null; return alts; }
/** * Gets an array of rule names for rules defined or imported by the * grammar. The array index is the rule index, and the value is the name of * the rule with the corresponding {@link Rule#index}. * * <p>If no rule is defined with an index for an element of the resulting * array, the value of that element is {@link #INVALID_RULE_NAME}.</p> * * @return The names of all rules defined in the grammar. */ public String[] getRuleNames() { String[] result = new String[rules.size()]; Arrays.fill(result, INVALID_RULE_NAME); for (Rule rule : rules.values()) { result[rule.index] = rule.name; } return result; }
/** * Gets an array of rule names for rules defined or imported by the * grammar. The array index is the rule index, and the value is the name of * the rule with the corresponding {@link Rule#index}. * * <p>If no rule is defined with an index for an element of the resulting * array, the value of that element is {@link #INVALID_RULE_NAME}.</p> * * @return The names of all rules defined in the grammar. */ public String[] getRuleNames() { String[] result = new String[rules.size()]; Arrays.fill(result, INVALID_RULE_NAME); for (Rule rule : rules.values()) { result[rule.index] = rule.name; } return result; }
/** * Gets an array of rule names for rules defined or imported by the * grammar. The array index is the rule index, and the value is the name of * the rule with the corresponding {@link Rule#index}. * * <p>If no rule is defined with an index for an element of the resulting * array, the value of that element is {@link #INVALID_RULE_NAME}.</p> * * @return The names of all rules defined in the grammar. */ public String[] getRuleNames() { String[] result = new String[rules.size()]; Arrays.fill(result, INVALID_RULE_NAME); for (Rule rule : rules.values()) { result[rule.index] = rule.name; } return result; }
/** * Gets an array of rule names for rules defined or imported by the * grammar. The array index is the rule index, and the value is the name of * the rule with the corresponding {@link Rule#index}. * * <p>If no rule is defined with an index for an element of the resulting * array, the value of that element is {@link #INVALID_RULE_NAME}.</p> * * @return The names of all rules defined in the grammar. */ public String[] getRuleNames() { String[] result = new String[rules.size()]; Arrays.fill(result, INVALID_RULE_NAME); for (Rule rule : rules.values()) { result[rule.index] = rule.name; } return result; }
/** * Gets an array of rule names for rules defined or imported by the * grammar. The array index is the rule index, and the value is the name of * the rule with the corresponding {@link Rule#index}. * * <p>If no rule is defined with an index for an element of the resulting * array, the value of that element is {@link #INVALID_RULE_NAME}.</p> * * @return The names of all rules defined in the grammar. */ public String[] getRuleNames() { String[] result = new String[rules.size()]; Arrays.fill(result, INVALID_RULE_NAME); for (Rule rule : rules.values()) { result[rule.index] = rule.name; } return result; }
/** Define all the rule begin/end ATNStates to solve forward reference * issues. */ void createRuleStartAndStopATNStates() { atn.ruleToStartState = new RuleStartState[g.rules.size()]; atn.ruleToStopState = new RuleStopState[g.rules.size()]; for (Rule r : g.rules.values()) { RuleStartState start = newState(RuleStartState.class, r.ast); RuleStopState stop = newState(RuleStopState.class, r.ast); start.stopState = stop; start.isPrecedenceRule = r instanceof LeftRecursiveRule; start.setRuleIndex(r.index); stop.setRuleIndex(r.index); atn.ruleToStartState[r.index] = start; atn.ruleToStopState[r.index] = stop; } }
/** Define all the rule begin/end ATNStates to solve forward reference * issues. */ void createRuleStartAndStopATNStates() { atn.ruleToStartState = new RuleStartState[g.rules.size()]; atn.ruleToStopState = new RuleStopState[g.rules.size()]; for (Rule r : g.rules.values()) { RuleStartState start = newState(RuleStartState.class, r.ast); RuleStopState stop = newState(RuleStopState.class, r.ast); start.stopState = stop; start.isLeftRecursiveRule = r instanceof LeftRecursiveRule; start.setRuleIndex(r.index); stop.setRuleIndex(r.index); atn.ruleToStartState[r.index] = start; atn.ruleToStopState[r.index] = stop; } }
/** Define all the rule begin/end ATNStates to solve forward reference * issues. */ void createRuleStartAndStopATNStates() { atn.ruleToStartState = new RuleStartState[g.rules.size()]; atn.ruleToStopState = new RuleStopState[g.rules.size()]; for (Rule r : g.rules.values()) { RuleStartState start = newState(RuleStartState.class, r.ast); RuleStopState stop = newState(RuleStopState.class, r.ast); start.stopState = stop; start.isLeftRecursiveRule = r instanceof LeftRecursiveRule; start.setRuleIndex(r.index); stop.setRuleIndex(r.index); atn.ruleToStartState[r.index] = start; atn.ruleToStopState[r.index] = stop; } }
/** Define all the rule begin/end ATNStates to solve forward reference * issues. */ void createRuleStartAndStopATNStates() { atn.ruleToStartState = new RuleStartState[g.rules.size()]; atn.ruleToStopState = new RuleStopState[g.rules.size()]; for (Rule r : g.rules.values()) { RuleStartState start = newState(RuleStartState.class, r.ast); RuleStopState stop = newState(RuleStopState.class, r.ast); start.stopState = stop; start.isPrecedenceRule = r instanceof LeftRecursiveRule; start.setRuleIndex(r.index); stop.setRuleIndex(r.index); atn.ruleToStartState[r.index] = start; atn.ruleToStopState[r.index] = stop; } }
/** Define all the rule begin/end ATNStates to solve forward reference * issues. */ void createRuleStartAndStopATNStates() { atn.ruleToStartState = new RuleStartState[g.rules.size()]; atn.ruleToStopState = new RuleStopState[g.rules.size()]; for (Rule r : g.rules.values()) { RuleStartState start = newState(RuleStartState.class, r.ast); RuleStopState stop = newState(RuleStopState.class, r.ast); start.stopState = stop; start.isLeftRecursiveRule = r instanceof LeftRecursiveRule; start.setRuleIndex(r.index); stop.setRuleIndex(r.index); atn.ruleToStartState[r.index] = start; atn.ruleToStopState[r.index] = stop; } }