static L ai_buParser_parseWeightedProductions() { new L l; for (S s : mL(ai_language() + " bottom-up groupings")) { L meta = splitAtComma(trailingAngleBracketStuff(s)); s = dropTrailingAngleBracketStuff(s); L tok = javaTokWithAngleBracketsC(s); WeightedProduction p = null; double weight = 1.0; for (S met : meta) if (startsWithDigit(met)) weight = parseDouble(met); if (l(tok) == 5) p = WeightedProduction(tok.get(0), tok.get(2), tok.get(4), weight); else if (l(tok) == 3) p = WeightedProduction(tok.get(0), tok.get(2), weight); if (p != null) { for (S met : meta) if (eqOneOf(met, "L,", "R", "K")) p.simplificationHint = met; l.add(p); } } ret l; }