code: @SuppressWarnings("fallthrough")
      boolean isUnboundMemberRef() {
          int pos = 0, depth = 0;
          outer: for (Token t = S.token(pos) ; ; t = S.token(++pos)) {
              switch (t.kind) {
                  case IDENTIFIER: case UNDERSCORE: case QUES: case EXTENDS: case SUPER:
                  case DOT: case RBRACKET: case LBRACKET: case COMMA:
                  case BYTE: case SHORT: case INT: case LONG: case FLOAT:
                  case DOUBLE: case BOOLEAN: case CHAR:
                  case MONKEYS_AT:
                      break;
  
                  case LPAREN:
                      // skip annotation values
                      int nesting = 0;
                      for (; ; pos++) {
                          TokenKind tk2 = S.token(pos).kind;
                          switch (tk2) {
                              case EOF:
                                  return false;
                              case LPAREN:
                                  nesting++;
                                  break;
                              case RPAREN:
                                  nesting--;
                                  if (nesting == 0) {
                                      continue outer;
                                  }
                                  break;
                          }
                      }
  
                  case LT:
                      depth++; break;
                  case GTGTGT:
                      depth--;
                  case GTGT:
                      depth--;
                  case GT:
                      depth--;
                      if (depth == 0) {
                          TokenKind nextKind = S.token(pos + 1).kind;
                          return
                              nextKind == TokenKind.DOT ||
                              nextKind == TokenKind.LBRACKET ||
                              nextKind == TokenKind.COLCOL;
                      }
                      break;
                  default:
                      return false;
              }
          }
      }
docs: If we see an identifier followed by a '&lt;' it could be an unbound
  method reference or a binary expression. To disambiguate, look for a
  matching '&gt;' and see if the subsequent terminal is either '.' or '::'.