public final Parser<T> otherwise(Parser<? extends T> fallback) {
    return new Parser<T>() {
      @Override boolean apply(ParseContext ctxt) {
        final Object result = ctxt.result;
        final int at = ctxt.at;
        final int step = ctxt.step;
        final int errorIndex = ctxt.errorIndex();
        if (Parser.this.apply(ctxt)) return true;
        if (ctxt.errorIndex() != errorIndex) return false;
        ctxt.set(step, at, result);
        return fallback.apply(ctxt);
      }
      @Override public String toString() {
        return "otherwise";
      }
    };
  }
public final Parser < T > otherwise ( Parser < ? extends T > fallback ) { return new Parser < T > ( ) { @ Override boolean apply ( ParseContext ctxt ) { final Object result = ctxt . result ; final int at = ctxt . at ; final int step = ctxt . step ; final int errorIndex = ctxt . errorIndex ( ) ; if ( Parser . this . apply ( ctxt ) ) return true ; if ( ctxt . errorIndex ( ) != errorIndex ) return false ; ctxt . set ( step , at , result ) ; return fallback . apply ( ctxt ) ; } @ Override public String toString ( ) { return "otherwise" ; } } ; }
{@code a.otherwise(fallback)} runs {@code fallback} when {@code a} matches zero input. This is different
from {@code a.or(alternative)} where {@code alternative} is run whenever {@code a} fails to match.

<p>One should usually use {@link #or}.

@param fallback the parser to run if {@code this} matches no input.
@since 3.1