@Override public boolean replaceChild(Element child, Element by) { if (child == getDefaultValue()) { setDefaultValue((Expression) by); return true; } return super.replaceChild(child, by); }
public void visitDeclarator(Declarator declarator) { visitModifiableElement(declarator); visit(declarator.getDefaultValue()); }
|| !mutatedType.getModifiers().contains(ModifierType.Const) || mutatedType.getModifiers().contains(ModifierType.Extern) || decl.getDefaultValue() == null) { continue; convertConstant(name, prim, mutatedType, decl.getDefaultValue(), v, decl, out, signatures, out.getResolvedJavaIdentifier()); } catch (UnsupportedConversionException ex) { out.addDeclaration(skipDeclaration(decl, ex.getMessage()));
|| !mutatedType.getModifiers().contains(ModifierType.Const) || mutatedType.getModifiers().contains(ModifierType.Extern) || decl.getDefaultValue() == null) { continue; convertConstant(name, prim, mutatedType, decl.getDefaultValue(), v, decl, out, signatures, out.getResolvedJavaIdentifier()); } catch (UnsupportedConversionException ex) { out.addDeclaration(skipDeclaration(decl, ex.getMessage()));
if (decl.getDefaultValue() == null) { TypeRef actualType = mutatedType; boolean referenced = ref.varDeclTypeRefsTransformedToPointers.contains(v) && (mutatedType instanceof Pointer); if (conv.arrayLengths != null && (mutatedType instanceof TargettedTypeRef) && decl.getDefaultValue() == null) { v.setDeclarators(Arrays.asList((Declarator) new DirectDeclarator(decl.resolveName(), newAllocateArray(((TargettedTypeRef) mutatedType).getTarget(), conv.arrayLengths))));
if (decl.getDefaultValue() == null) { TypeRef actualType = mutatedType; boolean referenced = ref.varDeclTypeRefsTransformedToPointers.contains(v) && (mutatedType instanceof Pointer); if (conv.arrayLengths != null && (mutatedType instanceof TargettedTypeRef) && decl.getDefaultValue() == null) { v.setDeclarators(Arrays.asList((Declarator) new DirectDeclarator(decl.resolveName(), newAllocateArray(((TargettedTypeRef) mutatedType).getTarget(), conv.arrayLengths))));
TypeRef valueType = v.getValueType(); for (Declarator vs : v.getDeclarators()) { if (vs.getDefaultValue() != null) { continue;
public void visitDeclarator(Declarator e) { if (e.isParenthesized()) { append('('); } implode(e.getModifiers(), " ").space(!e.getModifiers().isEmpty()); if (e instanceof DirectDeclarator) { append(((DirectDeclarator) e).getName()); } else if (e instanceof PointerDeclarator) { PointerDeclarator d = (PointerDeclarator) e; append(d.getPointerStyle(), d.getTarget()); } else if (e instanceof FunctionDeclarator) { FunctionDeclarator d = (FunctionDeclarator) e; append(d.getTarget(), '(').implode(d.getArgs(), ", ").append(")"); } else if (e instanceof ArrayDeclarator) { ArrayDeclarator d = (ArrayDeclarator) e; append(d.getTarget(), '[').implode(d.getDimensions(), "][").append("]"); } if (e.isParenthesized()) { append(')'); } if (e.getBits() >= 0) { append(":", e.getBits()); } if (e.getDefaultValue() != null) { append(" = ", e.getDefaultValue()); } }
TypeRef valueType = v.getValueType(); for (Declarator vs : v.getDeclarators()) { if (vs.getDefaultValue() != null) { continue;
if (mutatedType instanceof TypeRef) { TypeRef tr = (TypeRef) mutatedType; decl = new VariablesDeclaration(tr, new DirectDeclarator(vs.resolveName(), vs.getBits(), vs.getDefaultValue())); decl.importDetails(v, false); decl.importDetails(vs, false);
if (mutatedType instanceof TypeRef) { TypeRef tr = (TypeRef) mutatedType; decl = new VariablesDeclaration(tr, new DirectDeclarator(vs.resolveName(), vs.getBits(), vs.getDefaultValue())); decl.importDetails(v, false); decl.importDetails(vs, false);