Example #1
0
 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();
 }
Example #2
0
 @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();
 }