1158 t = toP(F.at(pos).Select(t, ident())); |
1158 t = toP(F.at(pos).Select(t, ident())); |
1159 break; |
1159 break; |
1160 case LT: |
1160 case LT: |
1161 if ((mode & TYPE) == 0 && isUnboundMemberRef()) { |
1161 if ((mode & TYPE) == 0 && isUnboundMemberRef()) { |
1162 //this is an unbound method reference whose qualifier |
1162 //this is an unbound method reference whose qualifier |
1163 //is a generic type i.e. A<S>#m |
1163 //is a generic type i.e. A<S>::m |
1164 int pos1 = token.pos; |
1164 int pos1 = token.pos; |
1165 accept(LT); |
1165 accept(LT); |
1166 ListBuffer<JCExpression> args = new ListBuffer<JCExpression>(); |
1166 ListBuffer<JCExpression> args = new ListBuffer<JCExpression>(); |
1167 args.append(typeArgument()); |
1167 args.append(typeArgument()); |
1168 while (token.kind == COMMA) { |
1168 while (token.kind == COMMA) { |
1176 nextToken(); |
1176 nextToken(); |
1177 mode = TYPE; |
1177 mode = TYPE; |
1178 t = toP(F.at(token.pos).Select(t, ident())); |
1178 t = toP(F.at(token.pos).Select(t, ident())); |
1179 t = typeArgumentsOpt(t); |
1179 t = typeArgumentsOpt(t); |
1180 } |
1180 } |
1181 if (token.kind != HASH) { |
1181 t = bracketsOpt(t); |
|
1182 if (token.kind != COLCOL) { |
1182 //method reference expected here |
1183 //method reference expected here |
1183 t = illegal(); |
1184 t = illegal(); |
1184 } |
1185 } |
1185 mode = EXPR; |
1186 mode = EXPR; |
1186 return term3Rest(t, typeArgs); |
1187 return term3Rest(t, typeArgs); |
1268 } else { |
1273 } else { |
1269 t = toP(F.at(pos1).Select(t, ident())); |
1274 t = toP(F.at(pos1).Select(t, ident())); |
1270 t = argumentsOpt(typeArgs, typeArgumentsOpt(t)); |
1275 t = argumentsOpt(typeArgs, typeArgumentsOpt(t)); |
1271 typeArgs = null; |
1276 typeArgs = null; |
1272 } |
1277 } |
1273 } else if ((mode & EXPR) != 0 && token.kind == HASH) { |
1278 } else if ((mode & EXPR) != 0 && token.kind == COLCOL) { |
1274 mode = EXPR; |
1279 mode = EXPR; |
1275 if (typeArgs != null) return illegal(); |
1280 if (typeArgs != null) return illegal(); |
1276 accept(HASH); |
1281 accept(COLCOL); |
1277 t = memberReferenceSuffix(pos1, t); |
1282 t = memberReferenceSuffix(pos1, t); |
1278 } else { |
1283 } else { |
1279 break; |
1284 break; |
1280 } |
1285 } |
1281 } |
1286 } |
1366 */ |
1373 */ |
1367 JCExpression superSuffix(List<JCExpression> typeArgs, JCExpression t) { |
1374 JCExpression superSuffix(List<JCExpression> typeArgs, JCExpression t) { |
1368 nextToken(); |
1375 nextToken(); |
1369 if (token.kind == LPAREN || typeArgs != null) { |
1376 if (token.kind == LPAREN || typeArgs != null) { |
1370 t = arguments(typeArgs, t); |
1377 t = arguments(typeArgs, t); |
1371 } else if (token.kind == HASH) { |
1378 } else if (token.kind == COLCOL) { |
1372 if (typeArgs != null) return illegal(); |
1379 if (typeArgs != null) return illegal(); |
1373 t = memberReferenceSuffix(t); |
1380 t = memberReferenceSuffix(t); |
1374 } else { |
1381 } else { |
1375 int pos = token.pos; |
1382 int pos = token.pos; |
1376 accept(DOT); |
1383 accept(DOT); |
1577 t = F.at(pos).Erroneous(List.<JCTree>of(toP(F.at(pos).Select(t, name)))); |
1584 t = F.at(pos).Erroneous(List.<JCTree>of(toP(F.at(pos).Select(t, name)))); |
1578 } else { |
1585 } else { |
1579 t = toP(F.at(pos).Select(t, names._class)); |
1586 t = toP(F.at(pos).Select(t, names._class)); |
1580 } |
1587 } |
1581 } else if ((mode & TYPE) != 0) { |
1588 } else if ((mode & TYPE) != 0) { |
1582 mode = TYPE; |
1589 if (token.kind != COLCOL) { |
1583 } else { |
1590 mode = TYPE; |
|
1591 } |
|
1592 } else if (token.kind != COLCOL) { |
1584 syntaxError(token.pos, "dot.class.expected"); |
1593 syntaxError(token.pos, "dot.class.expected"); |
1585 } |
1594 } |
1586 return t; |
1595 return t; |
1587 } |
1596 } |
1588 |
1597 |
1589 /** |
1598 /** |
1590 * MemberReferenceSuffix = "#" [TypeArguments] Ident |
1599 * MemberReferenceSuffix = "::" [TypeArguments] Ident |
1591 * | "#" [TypeArguments] "new" |
1600 * | "::" [TypeArguments] "new" |
1592 */ |
1601 */ |
1593 JCExpression memberReferenceSuffix(JCExpression t) { |
1602 JCExpression memberReferenceSuffix(JCExpression t) { |
1594 int pos1 = token.pos; |
1603 int pos1 = token.pos; |
1595 accept(HASH); |
1604 accept(COLCOL); |
1596 return memberReferenceSuffix(pos1, t); |
1605 return memberReferenceSuffix(pos1, t); |
1597 } |
1606 } |
1598 |
1607 |
1599 JCExpression memberReferenceSuffix(int pos1, JCExpression t) { |
1608 JCExpression memberReferenceSuffix(int pos1, JCExpression t) { |
1600 checkMethodReferences(); |
1609 checkMethodReferences(); |