1 /**2 * 3 */4 package jfun.parsec;5 6 final class IsReturnParser<R> extends Parser<R> {7 private final ObjectPredicate<R> op;8 9 IsReturnParser(String n, ObjectPredicate<R> op) {10 super(n);11 this.op = op;12 }13 14 boolean apply(final ParseContext ctxt) {15 final Object r = ctxt.getReturn();16 return op.isObject((R) r);17 }18 }