protected StatementListNode generateDestructorBody(Context context,StatementListNode statementList){
  Model model=(Model)value;
  Set<String> ids=new LinkedHashSet<String>();
  if (model.isDeclared())   ids.add(model.getId());
  collectDeclarations(model.getSubInitializerIterator(),ids);
  NodeFactory nodeFactory=context.getNodeFactory();
  StatementListNode result=statementList;
  StatementListNode functionStatementList=null;
  for (  String id : ids) {
    LiteralNullNode literalNull=nodeFactory.literalNull();
    IdentifierNode identifier=nodeFactory.identifier(id);
    Node expressionStatement=nodeFactory.assignmentExpression(identifier,ASSIGN_TOKEN,literalNull);
    functionStatementList=nodeFactory.statementList(functionStatementList,expressionStatement);
  }
  FunctionSignatureNode functionSignature=nodeFactory.functionSignature(null,null);
  functionSignature.void_anno=true;
  IdentifierNode functionIdentifier=nodeFactory.identifier(model.getDefinitionName() + "_r");
  FunctionCommonNode functionCommon=nodeFactory.functionCommon(context,functionIdentifier,functionSignature,functionStatementList);
  functionCommon.setUserDefinedBody(true);
  AttributeListNode attributeList=AbstractSyntaxTreeUtil.generatePrivateAttribute(nodeFactory);
  FunctionNameNode functionName=nodeFactory.functionName(Tokens.EMPTY_TOKEN,functionIdentifier);
  FunctionDefinitionNode functionDefinition=nodeFactory.functionDefinition(context,attributeList,functionName,functionCommon);
  result=nodeFactory.statementList(result,functionDefinition);
  return result;
}

protected StatementListNode generateDestructorBody ( Context context , StatementListNode statementList ) { Model model = ( Model ) value ; Set < String > ids = new LinkedHashSet < String > ( ) ; if ( model . isDeclared ( ) ) ids . add ( model . getId ( ) ) ; collectDeclarations ( model . getSubInitializerIterator ( ) , ids ) ; NodeFactory nodeFactory = context . getNodeFactory ( ) ; StatementListNode result = statementList ; StatementListNode functionStatementList = null ; for ( String id : ids ) { LiteralNullNode literalNull = nodeFactory . literalNull ( ) ; IdentifierNode identifier = nodeFactory . identifier ( id ) ; Node expressionStatement = nodeFactory . assignmentExpression ( identifier , ASSIGN_TOKEN , literalNull ) ; functionStatementList = nodeFactory . statementList ( functionStatementList , expressionStatement ) ; } FunctionSignatureNode functionSignature = nodeFactory . functionSignature ( null , null ) ; functionSignature . void_anno = true ; IdentifierNode functionIdentifier = nodeFactory . identifier ( model . getDefinitionName ( ) + "_r" ) ; FunctionCommonNode functionCommon = nodeFactory . functionCommon ( context , functionIdentifier , functionSignature , functionStatementList ) ; functionCommon . setUserDefinedBody ( true ) ; AttributeListNode attributeList = AbstractSyntaxTreeUtil . generatePrivateAttribute ( nodeFactory ) ; FunctionNameNode functionName = nodeFactory . functionName ( Tokens . EMPTY_TOKEN , functionIdentifier ) ; FunctionDefinitionNode functionDefinition = nodeFactory . functionDefinition ( context , attributeList , functionName , functionCommon ) ; result = nodeFactory . statementList ( result , functionDefinition ) ; return result ; }
generates the destructor / reset method as necessary as required by itransientdeferredinstance rvalues .
