}
private static void checkChoice(BnfChoice choice, ProblemsHolder problemsHolder) {
Set<BnfExpression> visited = new THashSet<BnfExpression>();
THashSet<BnfExpression> first = new THashSet<BnfExpression>();
BnfFirstNextAnalyzer analyzer = new BnfFirstNextAnalyzer();
List<BnfExpression> list = choice.getExpressionList();
for (int i = 0, listSize = list.size() - 1; i < listSize; i++) {
BnfExpression child = list.get(i);
Set<String> firstSet = analyzer.asStrings(analyzer.calcFirstInner(child, first, visited));
if (firstSet.contains(BnfFirstNextAnalyzer.MATCHES_NOTHING)) {
registerProblem(choice, child, "Branch is unable to match anything due to & or ! conditions", problemsHolder);
}
else if (firstSet.contains(BnfFirstNextAnalyzer.MATCHES_EOF)) {
registerProblem(choice, child, "Branch matches empty input making the rest branches unreachable", problemsHolder);