protected Printer modifiersStringPrefix(ModifiableElement e) { return modifiersStringPrefix(e, true); }
public void visitPrimitive(Primitive e) { modifiersStringPrefix(e, e.getName() != null); append(e.getName()); }
public void visitArray(ArrayRef e) { modifiersStringPrefix(e); append(e.getTarget()); bracketsToString(e); }
public void visitSimpleTypeRef(SimpleTypeRef e) { formatComments(e, true, false, false).modifiersStringPrefix(e).append(e.getName()); }
public void visitTypeDef(TypeDef e) { formatComments(e, false, true, true); modifiersStringPrefix(e); append("typedef "); valueTypeAndStorageSuffix(e); append(";"); if (e.getCommentAfter() != null) { append(" ", e.getCommentAfter().trim()); } }
public void visitPointer(Pointer e) { modifiersStringPrefix(e); append(e.getTarget()); if (!(e.getTarget() instanceof FunctionSignature)) { append(e.getPointerStyle()); } }
public void visitFunctionPointerDeclaration(FunctionPointerDeclaration e) { modifiersStringPrefix(e); append(e.getValueType()); if (e.getDefaultValue() != null) { append(" = ", e.getDefaultValue()); } append(";"); }
public void visitVariablesDeclaration(VariablesDeclaration e) { formatComments(e, false, true, true); if (!e.getAnnotations().isEmpty()) { implode(e.getAnnotations(), "\n" + indent).append("\n", indent); } modifiersStringPrefix(e); valueTypeAndStorageSuffix(e); if (!(e.getParentElement() instanceof Catch)) { append(";"); } if (e.getCommentAfter() != null) { space().append(e.getCommentAfter()); } }
switch (e.getType()) { case CPPClass: modifiersStringPrefix(e); append("class ", e.getTag()); if (!e.getParents().isEmpty()) { modifiersStringPrefix(e); append("union ", e.getTag() == null ? null : " ", e.getTag()); break; case JavaClass: case JavaInterface: modifiersStringPrefix(e); append(e.getType() == Struct.Type.JavaClass ? "class " : "interface ", e.getTag()); if (!e.getParents().isEmpty()) { modifiersStringPrefix(e); append(e.isForwardDeclaration() ? "@class " : "@interface ", e.getTag()); if (e.getCategoryName() != null) { modifiersStringPrefix(e); append("@protocol ", e.getTag()); break; default: append("struct "); modifiersStringPrefix(e); append(e.getTag()); if (!e.getParents().isEmpty()) {
modifiersStringPrefix(e); if (!e.getAnnotations().isEmpty()) { implode(e.getAnnotations(), "\n" + indent).append("\n", indent);
public void visitFunctionSignature(FunctionSignature e) { if (e.getFunction() == null) { return; } assert e.getFunction().getBody() == null; modifiersStringPrefix(e); append(e.getFunction().getValueType()).space(e.getFunction().getValueType() != null); if (e.getParentElement() instanceof TypeRef.Pointer) { append("("); modifiersStringPrefix(e.getFunction()); switch (e.getType()) { case CFunction: append("*"); break; case ObjCBlock: append("^"); break; } append(e.getFunction().getName()); append(")"); } else { append(e.getFunction().getName()); } append("("); implode(e.getFunction().getArgs(), ", "); append(")"); append(e.getModifiers().isEmpty() ? "" : " "); implode(e.getModifiers(), " "); }