/** Annotation = "@" Qualident [ "(" AnnotationFieldValues ")" ] * @param pos position of "@" token */ JCAnnotation annotation(int pos) { // accept(AT); // AT consumed by caller checkAnnotations(); JCTree ident = qualident(); List<JCExpression> fieldValues = annotationFieldValuesOpt(); JCAnnotation ann = F.at(pos).Annotation(ident, fieldValues); storeEnd(ann, S.prevEndPos()); return ann; }
/** Annotation = "@" Qualident [ "(" AnnotationFieldValues ")" ] * @param pos position of "@" token */ JCAnnotation annotation(int pos) { // accept(AT); // AT consumed by caller checkAnnotations(); JCTree ident = qualident(); List<JCExpression> fieldValues = annotationFieldValuesOpt(); JCAnnotation ann = F.at(pos).Annotation(ident, fieldValues); storeEnd(ann, S.prevEndPos()); return ann; }
/** VariableDeclaratorsRest = VariableDeclaratorRest { "," VariableDeclarator } * ConstantDeclaratorsRest = ConstantDeclaratorRest { "," ConstantDeclarator } * * @param reqInit Is an initializer always required? * @param dc The documentation comment for the variable declarations, or null. */ <T extends ListBuffer<? super JCVariableDecl>> T variableDeclaratorsRest(int pos, JCModifiers mods, JCExpression type, Name name, boolean reqInit, String dc, T vdefs) { vdefs.append(variableDeclaratorRest(pos, mods, type, name, reqInit, dc)); while (S.token() == COMMA) { // All but last of multiple declarators subsume a comma storeEnd((JCTree)vdefs.elems.last(), S.endPos()); S.nextToken(); vdefs.append(variableDeclarator(mods, type, reqInit, dc)); } return vdefs; }
/** VariableDeclaratorsRest = VariableDeclaratorRest { "," VariableDeclarator } * ConstantDeclaratorsRest = ConstantDeclaratorRest { "," ConstantDeclarator } * * @param reqInit Is an initializer always required? * @param dc The documentation comment for the variable declarations, or null. */ <T extends ListBuffer<? super JCVariableDecl>> T variableDeclaratorsRest(int pos, JCModifiers mods, JCExpression type, Name name, boolean reqInit, String dc, T vdefs) { vdefs.append(variableDeclaratorRest(pos, mods, type, name, reqInit, dc)); while (S.token() == COMMA) { // All but last of multiple declarators subsume a comma storeEnd((JCTree)vdefs.elems.last(), S.endPos()); S.nextToken(); vdefs.append(variableDeclarator(mods, type, reqInit, dc)); } return vdefs; }
storeEnd(t, S.endPos()); S.nextToken(); return t;
storeEnd(t, S.endPos()); S.nextToken(); return t;
storeEnd(mods, S.prevEndPos()); return mods;
storeEnd(mods, S.prevEndPos()); return mods;
attach(toplevel, dc); if (defs.elems.isEmpty()) storeEnd(toplevel, S.prevEndPos()); if (keepDocComments) toplevel.docComments = docComments; return toplevel;
attach(toplevel, dc); if (defs.elems.isEmpty()) storeEnd(toplevel, S.prevEndPos()); if (keepDocComments) toplevel.docComments = docComments; return toplevel;
JCNewClass create = F.at(createPos).NewClass(null, typeArgs, ident, args, body); if (createPos != Position.NOPOS) storeEnd(create, S.prevEndPos()); ident = F.at(Position.NOPOS).Ident(enumName); JCTree result = toP(F.at(pos).VarDef(mods, name, ident, create));
JCNewClass create = F.at(createPos).NewClass(null, typeArgs, ident, args, body); if (createPos != Position.NOPOS) storeEnd(create, S.prevEndPos()); ident = F.at(Position.NOPOS).Ident(enumName); JCTree result = toP(F.at(pos).VarDef(mods, name, ident, create));
variableDeclaratorsRest(pos, mods, type, name, isInterface, dc, new ListBuffer<JCTree>()).toList(); storeEnd(defs.last(), S.endPos()); accept(SEMI); return defs;
variableDeclaratorsRest(pos, mods, type, name, isInterface, dc, new ListBuffer<JCTree>()).toList(); storeEnd(defs.last(), S.endPos()); accept(SEMI); return defs;