code: private boolean ctxHasErrorNode(ParserRuleContext ctx) {
          for (int i = 0; i < ctx.children.size(); i++) {
              if (ctx.getChild(i) instanceof ErrorNode) {
                  return true;
              }
          }
          return false;
      }
docs: check if rule context contains error node
  
  @param ctx rule context
  @return contains context error node