Visiting Nodes
Guido Chari
charig at gmail.com
Sat May 2 16:49:15 UTC 2015
2015-05-02 12:04 GMT-03:00 Stefan Marr <php at stefan-marr.de>:
> Hi Guido:
>
> > On 02 May 2015, at 15:31, Guido Chari <charig at gmail.com> wrote:
> >
> > @Stefan Thanks, sure it helps.
> > So summarizing, my use case would be that i need a
> > different visit method implementation for each kind of node.
>
> I don’t think you’ll actually need what you described. The visitor I
> mentioned calls SOMNode.replaceWithIndependentCopyForInlining(), which is a
> polymorphic method implemented by all relevant nodes.
>
> See:
>
>
> https://github.com/SOM-st/TruffleSOM/blob/master/src/som/interpreter/Inliner.java#L77
>
> https://github.com/SOM-st/TruffleSOM/blob/master/src/som/interpreter/nodes/SOMNode.java#L38
> and for instance:
> https://github.com/SOM-st/TruffleSOM/blob/master/src/som/interpreter/nodes/LocalVariableNode.java#L174
This works for me, thanks Stefan.
>
>
> Best regards
> Stefan
>
>
>
> --
> Stefan Marr
> INRIA Lille - Nord Europe
> http://stefan-marr.de/research/
>
>
>
>
More information about the graal-dev
mailing list