/** AnnotationsOpt = { '@' Annotation } */ List<JCAnnotation> annotationsOpt() { if (S.token() != MONKEYS_AT) return List.nil(); // optimization ListBuffer<JCAnnotation> buf = new ListBuffer<JCAnnotation>(); while (S.token() == MONKEYS_AT) { int pos = S.pos(); S.nextToken(); buf.append(annotation(pos)); } return buf.toList(); }
JCExpression annotationValue() { int pos; switch (S.token()) { case MONKEYS_AT: pos = S.pos(); S.nextToken(); return annotation(pos); case LBRACE: pos = S.pos(); accept(LBRACE); ListBuffer<JCExpression> buf = new ListBuffer<JCExpression>(); if (S.token() != RBRACE) { buf.append(annotationValue()); while (S.token() == COMMA) { S.nextToken(); if (S.token() == RBRACE) break; buf.append(annotationValue()); } } accept(RBRACE); return toP(F.at(pos).NewArray(null, List.<JCExpression>nil(), buf.toList())); default: mode = EXPR; return term1(); } }
JCExpression annotationValue() { int pos; switch (S.token()) { case MONKEYS_AT: pos = S.pos(); S.nextToken(); return annotation(pos); case LBRACE: pos = S.pos(); accept(LBRACE); ListBuffer<JCExpression> buf = new ListBuffer<JCExpression>(); if (S.token() != RBRACE) { buf.append(annotationValue()); while (S.token() == COMMA) { S.nextToken(); if (S.token() == RPAREN) break; buf.append(annotationValue()); } } accept(RBRACE); return toP(F.at(pos).NewArray(null, List.<JCExpression>nil(), buf.toList())); default: mode = EXPR; return term1(); } }
/** AnnotationsOpt = { '@' Annotation } */ List<JCAnnotation> annotationsOpt() { if (S.token() != MONKEYS_AT) return List.nil(); // optimization ListBuffer<JCAnnotation> buf = new ListBuffer<JCAnnotation>(); while (S.token() == MONKEYS_AT) { int pos = S.pos(); S.nextToken(); buf.append(annotation(pos)); } return buf.toList(); }
checkAnnotations(); if (S.token() != INTERFACE) { JCAnnotation ann = annotation(lastPos);
checkAnnotations(); if (S.token() != INTERFACE) { JCAnnotation ann = annotation(lastPos);