Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] setName frozen ast node exception

Hello all,

We are working on a simple Eclipse plugin to change function calls of one name to another.

We are first working on the trivial case of changing the function call to the same function call, but we are receiving an exception.  The exception is: "attempt to modify frozen ast node".

Below is our visitor code:
public int visit(IASTExpression _expression_) {
   if (_expression_.getRawSignature().equals("printf"))
   {
      ((IASTIdExpression) _expression_).setName(((IASTIdExpression) _expression_).getName());
   }
   return PROCESS_CONTINUE;
}

Through debugging, we have learned _expression_ is of type CASTIdExpression, so I believe it is valid to cast it as an IASTIdExpression and we are not doing any specific freezing of AST nodes, so I'm not sure why we're receiving this exception.

Any help is much appreciated.

Justin

Back to the top