code: private static boolean hasErrors(Symbol symbol) {
      switch(symbol.kind) {
        case ALTERNATIVE:
          return hasErrors(symbol, ((Symbol.Alternative) symbol).symbols);
        case EXPLICIT_ACTION:
          return false;
        case IMPLICIT_ACTION:
          return symbol instanceof Symbol.ErrorAction;
        case REPEATER:
          Symbol.Repeater r = (Symbol.Repeater) symbol;
          return hasErrors(r.end) || hasErrors(symbol, r.production);
        case ROOT:
        case SEQUENCE:
          return hasErrors(symbol, symbol.production);
        case TERMINAL:
          return false;
        default:
          throw new RuntimeException("unknown symbol kind: " + symbol.kind);
      }
    }
docs: Returns true if the Parser contains any Error symbol, indicating that it may fail
  for some inputs.