>From Günter Khyo:

Günter Khyo wrote
> Hello!
> 
> I want to replace particular nodes of an AST (such as Assignments or Self
> sends) with my own nodes.
> Is there an easy (high-level) way to do this without being familiar with
> the entire compiler infrastructure?
> 
> The problem I am having is that AST nodes maintain internal state such as
> parent links and, in the case of RBVariables, links to scopes and
> bindings. There might be many other dependencies I am missing and missing
> one of them can trigger exceptions with stack traces buried deep in the IR
> Code-Generator and visitor calls.
> 
> For example, if I want to replace an assignment such as 
> 
> Morph>>position: aPoint
> 
> "box := self fullBounds."
> 
> with something like
> 
> "self assignAndNotifiyDependents: self fullBounds to: 'box' "
> 
> Btw: I know there is a rewrite tool, but I want to do it programmatically.
> 
> Thanks!





-----
Cheers,
Sean
--
View this message in context: 
http://forum.world.st/Modifying-the-AST-of-a-method-tp4848709.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to