Parses a plural rules description and returns a PluralRules.
@param description the rule description.
@throws ParseException if the description cannot be parsed.
The exception index is typically not set, it will be -1.
501257
public static PluralRules parseDescription(String description)
            throws ParseException {

        description = description.trim();
        return description.length() == 0 ? DEFAULT : new PluralRules(parseRuleChain(description));
    }
1141819
public final void entryRuleXListLiteral() throws RecognitionException {
        try {
            // InternalXbase.g:759:1: ( ruleXListLiteral EOF )
            // InternalXbase.g:760:1: ruleXListLiteral EOF
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXListLiteralRule()); 
            }
            pushFollow(FOLLOW_1);
            ruleXListLiteral();

            state._fsp--;
            if (state.failed) return ;
            if ( state.backtracking==0 ) {
               after(grammarAccess.getXListLiteralRule()); 
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
327209
public static StandardPlural selectPlural(
            Number number, NumberFormat fmt, PluralRules rules,
            StringBuffer formattedNumber, FieldPosition pos) {
        UFieldPosition fpos = new UFieldPosition(pos.getFieldAttribute(), pos.getField());
        fmt.format(number, formattedNumber, fpos);
        // TODO: Long, BigDecimal & BigInteger may not fit into doubleValue().
        FixedDecimal fd = new FixedDecimal(
                number.doubleValue(),
                fpos.getCountVisibleFractionDigits(), fpos.getFractionDigits());
        String pluralKeyword = rules.select(fd);
        pos.setBeginIndex(fpos.getBeginIndex());
        pos.setEndIndex(fpos.getEndIndex());
        return StandardPlural.orOtherFromString(pluralKeyword);
    }
151498
protected void uncountable(String word) {
        Rule r = new UncountableRule(lower(word));
        plural(r);
        singular(r);
    }
57246
public final void ruleDisjunction() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:633:2: ( ( ( rule__Disjunction__Group__0 ) ) )
            // InternalXtext.g:634:2: ( ( rule__Disjunction__Group__0 ) )
            {
            // InternalXtext.g:634:2: ( ( rule__Disjunction__Group__0 ) )
            // InternalXtext.g:635:3: ( rule__Disjunction__Group__0 )
            {
             before(grammarAccess.getDisjunctionAccess().getGroup()); 
            // InternalXtext.g:636:3: ( rule__Disjunction__Group__0 )
            // InternalXtext.g:636:4: rule__Disjunction__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__Disjunction__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getDisjunctionAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
282307
public final void ruleEnumLiteralDeclaration() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:1458:2: ( ( ( rule__EnumLiteralDeclaration__Group__0 ) ) )
            // InternalXtext.g:1459:2: ( ( rule__EnumLiteralDeclaration__Group__0 ) )
            {
            // InternalXtext.g:1459:2: ( ( rule__EnumLiteralDeclaration__Group__0 ) )
            // InternalXtext.g:1460:3: ( rule__EnumLiteralDeclaration__Group__0 )
            {
             before(grammarAccess.getEnumLiteralDeclarationAccess().getGroup()); 
            // InternalXtext.g:1461:3: ( rule__EnumLiteralDeclaration__Group__0 )
            // InternalXtext.g:1461:4: rule__EnumLiteralDeclaration__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__EnumLiteralDeclaration__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getEnumLiteralDeclarationAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
870998
public final void entryRuleAnnotation() throws RecognitionException {
        try {
            // InternalXtext.g:204:1: ( ruleAnnotation EOF )
            // InternalXtext.g:205:1: ruleAnnotation EOF
            {
             before(grammarAccess.getAnnotationRule()); 
            pushFollow(FollowSets000.FOLLOW_1);
            ruleAnnotation();

            state._fsp--;

             after(grammarAccess.getAnnotationRule()); 
            match(input,EOF,FollowSets000.FOLLOW_2); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
1187721
public static void addPlural(String match, String rule, boolean insensitive){
        plurals.add(0, new Replacer(match, rule, insensitive));
    }
121645
public final void ruleEOF() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:1358:2: ( ( ( rule__EOF__Group__0 ) ) )
            // InternalXtext.g:1359:2: ( ( rule__EOF__Group__0 ) )
            {
            // InternalXtext.g:1359:2: ( ( rule__EOF__Group__0 ) )
            // InternalXtext.g:1360:3: ( rule__EOF__Group__0 )
            {
             before(grammarAccess.getEOFAccess().getGroup()); 
            // InternalXtext.g:1361:3: ( rule__EOF__Group__0 )
            // InternalXtext.g:1361:4: rule__EOF__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__EOF__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getEOFAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
36615
public final void ruleXMultiplicativeExpression() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:471:2: ( ( ( rule__XMultiplicativeExpression__Group__0 ) ) )
            // InternalXbase.g:472:2: ( ( rule__XMultiplicativeExpression__Group__0 ) )
            {
            // InternalXbase.g:472:2: ( ( rule__XMultiplicativeExpression__Group__0 ) )
            // InternalXbase.g:473:3: ( rule__XMultiplicativeExpression__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXMultiplicativeExpressionAccess().getGroup()); 
            }
            // InternalXbase.g:474:3: ( rule__XMultiplicativeExpression__Group__0 )
            // InternalXbase.g:474:4: rule__XMultiplicativeExpression__Group__0
            {
            pushFollow(FOLLOW_2);
            rule__XMultiplicativeExpression__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getXMultiplicativeExpressionAccess().getGroup()); 
            }

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
958213
public final void entryRuleEOF() throws RecognitionException {
        try {
            // InternalXtext.g:1346:1: ( ruleEOF EOF )
            // InternalXtext.g:1347:1: ruleEOF EOF
            {
             before(grammarAccess.getEOFRule()); 
            pushFollow(FollowSets000.FOLLOW_1);
            ruleEOF();

            state._fsp--;

             after(grammarAccess.getEOFRule()); 
            match(input,EOF,FollowSets000.FOLLOW_2); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
1200198
private final char parseSet(String rule, ParsePosition pos) {
        UnicodeSet set = new UnicodeSet(rule, pos, parseData);
        if (variableNext >= variableLimit) {
            throw new RuntimeException("Private use variables exhausted");
        }
        set.compact();
        return generateStandInFor(set);
    }
672542
public final void ruleXNumberLiteral() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:1346:2: ( ( ( rule__XNumberLiteral__Group__0 ) ) )
            // InternalXbase.g:1347:2: ( ( rule__XNumberLiteral__Group__0 ) )
            {
            // InternalXbase.g:1347:2: ( ( rule__XNumberLiteral__Group__0 ) )
            // InternalXbase.g:1348:3: ( rule__XNumberLiteral__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXNumberLiteralAccess().getGroup()); 
            }
            // InternalXbase.g:1349:3: ( rule__XNumberLiteral__Group__0 )
            // InternalXbase.g:1349:4: rule__XNumberLiteral__Group__0
            {
            pushFollow(FOLLOW_2);
            rule__XNumberLiteral__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getXNumberLiteralAccess().getGroup()); 
            }

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
271284
public PluralRules load(
        Locale locale,
        NumberType numType
    ) {

        Map<String, PluralRules> map;
        PluralRules stdRules;

        switch (numType) {
            case CARDINALS:
                map = CARDINAL_MAP;
                stdRules = STD_CARDINALS;
                break;
            case ORDINALS:
                map = ORDINAL_MAP;
                stdRules = STD_ORDINALS;
                break;
            default:
                throw new UnsupportedOperationException(numType.name());
        }

        PluralRules rules = null;
        String region = FormatUtils.getRegion(locale);

        if (!region.isEmpty()) {
            StringBuilder kb = new StringBuilder();
            kb.append(locale.getLanguage());
            kb.append('_');
            kb.append(region);
            rules = map.get(kb.toString());
        }

        if (rules == null) {
            rules = map.get(locale.getLanguage());
        }

        if (rules == null) {
            return stdRules;
        }

        return rules;

    }
1220016
public final void entryRuleXForLoopExpression() throws RecognitionException {
        try {
            // InternalXbase.g:959:1: ( ruleXForLoopExpression EOF )
            // InternalXbase.g:960:1: ruleXForLoopExpression EOF
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXForLoopExpressionRule()); 
            }
            pushFollow(FOLLOW_1);
            ruleXForLoopExpression();

            state._fsp--;
            if (state.failed) return ;
            if ( state.backtracking==0 ) {
               after(grammarAccess.getXForLoopExpressionRule()); 
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
1003600
public final void entryRuleLiteralCondition() throws RecognitionException {
        try {
            // InternalXtext.g:596:1: ( ruleLiteralCondition EOF )
            // InternalXtext.g:597:1: ruleLiteralCondition EOF
            {
             before(grammarAccess.getLiteralConditionRule()); 
            pushFollow(FollowSets000.FOLLOW_1);
            ruleLiteralCondition();

            state._fsp--;

             after(grammarAccess.getLiteralConditionRule()); 
            match(input,EOF,FollowSets000.FOLLOW_2); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
1058440
public final void entryRuleEnumRule() throws RecognitionException {
        try {
            // InternalXtext.g:1396:1: ( ruleEnumRule EOF )
            // InternalXtext.g:1397:1: ruleEnumRule EOF
            {
             before(grammarAccess.getEnumRuleRule()); 
            pushFollow(FollowSets000.FOLLOW_1);
            ruleEnumRule();

            state._fsp--;

             after(grammarAccess.getEnumRuleRule()); 
            match(input,EOF,FollowSets000.FOLLOW_2); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }