public static <T> Parser<T> expect(final String name) {
    return new Parser<T>() {
      @Override boolean apply(ParseContext ctxt) {
        ctxt.expected(name);
        return false;
      }
      
      @Override public String toString() {
        return name;
      }
    };
  }
public static < T > Parser < T > expect ( final String name ) { return new Parser < T > ( ) { @ Override boolean apply ( ParseContext ctxt ) { ctxt . expected ( name ) ; return false ; } @ Override public String toString ( ) { return name ; } } ; }
A {@link Parser} that fails and reports that {@code name} is logically expected.