private static String nameHint(Collection<LookaheadPredicate> predicates) { StringBuilder sb = new StringBuilder("lookahead"); for (LookaheadPredicate p : predicates) { sb.append('_'); if (p.isNegated()) { sb.append("not"); } sb.append(p.getInput().getTarget().getNameText()); } return sb.toString(); }
@Override public String asString() { StringBuilder sb = new StringBuilder(); for (LookaheadPredicate p : predicates) { if (sb.length() > 0) { sb.append(" & "); } if (p.isNegated()) { sb.append("!"); } sb.append(p.getInput().getTarget().getNameText()); } return sb.toString(); }