示例#1
0
 @Override
 public void setInitializer(IASTInitializer initializer) {
   assertNotFrozen();
   this.initializer = initializer;
   if (initializer != null) {
     initializer.setParent(this);
     initializer.setPropertyInParent(INITIALIZER);
   }
 }
示例#2
0
 protected void writeDefaultDeclarator(IASTDeclarator declarator) {
   IASTPointerOperator[] pointOps = declarator.getPointerOperators();
   writePointerOperators(declarator, pointOps);
   IASTName name = declarator.getName();
   name.accept(visitor);
   writeNestedDeclarator(declarator);
   IASTInitializer init = getInitializer(declarator);
   if (init != null) {
     init.accept(visitor);
   }
 }
示例#3
0
 private void writeFieldDeclarator(IASTFieldDeclarator fieldDecl) {
   IASTPointerOperator[] pointOps = fieldDecl.getPointerOperators();
   writePointerOperators(fieldDecl, pointOps);
   fieldDecl.getName().accept(visitor);
   scribe.printSpace();
   scribe.print(':');
   scribe.printSpace();
   fieldDecl.getBitFieldSize().accept(visitor);
   IASTInitializer initializer = getInitializer(fieldDecl);
   if (initializer != null) {
     initializer.accept(visitor);
   }
 }
示例#4
0
  private void writeArrayDeclarator(IASTArrayDeclarator arrDecl) {
    IASTPointerOperator[] pointOps = arrDecl.getPointerOperators();
    writePointerOperators(arrDecl, pointOps);
    IASTName name = arrDecl.getName();
    name.accept(visitor);

    writeNestedDeclarator(arrDecl);

    IASTArrayModifier[] arrMods = arrDecl.getArrayModifiers();
    writeArrayModifiers(arrDecl, arrMods);
    IASTInitializer initializer = getInitializer(arrDecl);
    if (initializer != null) {
      initializer.accept(visitor);
    }
  }
示例#5
0
 protected <T extends CPPASTDeclarator> T copy(T copy, CopyStyle style) {
   copy.setName(name == null ? null : name.copy(style));
   copy.setInitializer(initializer == null ? null : initializer.copy(style));
   copy.setNestedDeclarator(nested == null ? null : nested.copy(style));
   ((CPPASTDeclarator) copy).isPackExpansion = isPackExpansion;
   for (IASTPointerOperator pointer : getPointerOperators()) {
     copy.addPointerOperator(pointer.copy(style));
   }
   return super.copy(copy, style);
 }
示例#6
0
 protected boolean postAccept(ASTVisitor action) {
   return initializer == null || initializer.accept(action);
 }
示例#7
0
 private void writeInitializer(IASTStandardFunctionDeclarator funcDec) {
   IASTInitializer init = getInitializer(funcDec);
   if (init != null) {
     init.accept(visitor);
   }
 }