[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

replaceBy method




Hi,

I am trying to simplify an AST by removing redundant links. So, for example, i have the following tree:

...
AUnrestrictedStatement
   - AEmptyStatementUnrestricted
      - AEmpty  
         ...

I would like to  replace AUnrestrictedStatement with AEmptyStatement.
I think i should be using the replaceBy method, so I have some code like so:

   public void outAUnrestrictedStatement(AUnrestrictedStatement node)
   {
           node.replaceBy(new AEmpty(new TSemicolon()));
   }

but all i get is 'null' as the output...

the single get method for AUnrestrictedStatement is getStatementUnrestricted(), for AEmptyStatementUnrestricted it's getEmpty(), and for AEmpty it's getSemicolon().

thanks for any help at all,

rus

Important: This e-mail is intended for the use of the addressee and may contain information that is confidential, commercially valuable or subject to legal or parliamentary privilege. If you are not the intended recipient you are notified that any review, re-transmission, disclosure, use or dissemination of this communication is strictly prohibited by several Commonwealth Acts of Parliament. If you have received this communication in error please notify the sender immediately and delete all copies of this transmission together with any attachments.