AST Browser?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

AST Browser?

vonbecmann
Hi All,

 do you know where i can get an AST Browser?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: AST Browser?

Lukas Renggli
Hi Bernardo,

What do you understand as an "AST browser"? A special inspector for AST nodes?

Lukas

On 20 May 2011 18:35, Bernardo Ezequiel Contreras <[hidden email]> wrote:
> Hi All,
>
>  do you know where i can get an AST Browser?
>
> Thanks
>



--
Lukas Renggli
www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: AST Browser?

vonbecmann
i dont know how to answer.
so i would show an example
http://groovy.codehaus.org/Groovy+Console

http://groovy.codehaus.org/download/attachments/36800/astbrowser.png?version=1&modificationDate=1238156032299

The groovy console has an AST browser, and i was wondering where the AST Browser for Pharo is.
 I played with the RBParser to parse an expression and inspect the AST tree, but i could not find a nice browser( or inspector )

Thanks



On Fri, May 20, 2011 at 2:54 PM, Lukas Renggli <[hidden email]> wrote:
Hi Bernardo,

What do you understand as an "AST browser"? A special inspector for AST nodes?

Lukas

On 20 May 2011 18:35, Bernardo Ezequiel Contreras <[hidden email]> wrote:
> Hi All,
>
>  do you know where i can get an AST Browser?
>
> Thanks
>



--
Lukas Renggli
www.lukas-renggli.ch


Reply | Threaded
Open this post in threaded view
|

Re: AST Browser?

Stéphane Ducasse
How different is from getting the ast of a method and exploring it?
So may be you do not know how to get an abstract syntax tree of a method?

Stef

> i dont know how to answer.
> so i would show an example
> http://groovy.codehaus.org/Groovy+Console
>
> http://groovy.codehaus.org/download/attachments/36800/astbrowser.png?version=1&modificationDate=1238156032299
>
> The groovy console has an AST browser, and i was wondering where the AST Browser for Pharo is.
>  I played with the RBParser to parse an expression and inspect the AST tree, but i could not find a nice browser( or inspector )
>
> Thanks
>
>
>
> On Fri, May 20, 2011 at 2:54 PM, Lukas Renggli <[hidden email]> wrote:
> Hi Bernardo,
>
> What do you understand as an "AST browser"? A special inspector for AST nodes?
>
> Lukas
>
> On 20 May 2011 18:35, Bernardo Ezequiel Contreras <[hidden email]> wrote:
> > Hi All,
> >
> >  do you know where i can get an AST Browser?
> >
> > Thanks
> >
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
>


Reply | Threaded
Open this post in threaded view
|

Re: AST Browser?

Lukas Renggli
In reply to this post by vonbecmann
Indeed, then

    (RBParser parseExpression: '1 + 2') explore

is probably the closest you get.

Lukas

On 20 May 2011 21:37, Bernardo Ezequiel Contreras <[hidden email]> wrote:

> i dont know how to answer.
> so i would show an example
> http://groovy.codehaus.org/Groovy+Console
>
> http://groovy.codehaus.org/download/attachments/36800/astbrowser.png?version=1&modificationDate=1238156032299
>
> The groovy console has an AST browser, and i was wondering where the AST
> Browser for Pharo is.
>  I played with the RBParser to parse an expression and inspect the AST tree,
> but i could not find a nice browser( or inspector )
>
> Thanks
>
>
>
> On Fri, May 20, 2011 at 2:54 PM, Lukas Renggli <[hidden email]> wrote:
>>
>> Hi Bernardo,
>>
>> What do you understand as an "AST browser"? A special inspector for AST
>> nodes?
>>
>> Lukas
>>
>> On 20 May 2011 18:35, Bernardo Ezequiel Contreras <[hidden email]>
>> wrote:
>> > Hi All,
>> >
>> >  do you know where i can get an AST Browser?
>> >
>> > Thanks
>> >
>>
>>
>>
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>>
>
>



--
Lukas Renggli
www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: AST Browser?

vonbecmann
yes, you are right!!
stupid question.

Thanks!

On Fri, May 20, 2011 at 4:45 PM, Lukas Renggli <[hidden email]> wrote:
Indeed, then

   (RBParser parseExpression: '1 + 2') explore

is probably the closest you get.

Lukas

On 20 May 2011 21:37, Bernardo Ezequiel Contreras <[hidden email]> wrote:
> i dont know how to answer.
> so i would show an example
> http://groovy.codehaus.org/Groovy+Console
>
> http://groovy.codehaus.org/download/attachments/36800/astbrowser.png?version=1&modificationDate=1238156032299
>
> The groovy console has an AST browser, and i was wondering where the AST
> Browser for Pharo is.
>  I played with the RBParser to parse an expression and inspect the AST tree,
> but i could not find a nice browser( or inspector )
>
> Thanks
>
>
>
> On Fri, May 20, 2011 at 2:54 PM, Lukas Renggli <[hidden email]> wrote:
>>
>> Hi Bernardo,
>>
>> What do you understand as an "AST browser"? A special inspector for AST
>> nodes?
>>
>> Lukas
>>
>> On 20 May 2011 18:35, Bernardo Ezequiel Contreras <[hidden email]>
>> wrote:
>> > Hi All,
>> >
>> >  do you know where i can get an AST Browser?
>> >
>> > Thanks
>> >
>>
>>
>>
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>>
>
>



--
Lukas Renggli
www.lukas-renggli.ch


Reply | Threaded
Open this post in threaded view
|

Re: AST Browser?

Lukas Renggli
No, not a stupid question.

In the screenshot you showed there was also semantic information displayed. You can get that in Pharo too, but you need to tell the AST in which context to resolve it:

     (RBParser parseExpression: 'x + y')
          annotateInClass: Point;
          explore

Cheers,
Lukas

On 20 May 2011 22:33, Bernardo Ezequiel Contreras <[hidden email]> wrote:
yes, you are right!!
stupid question.

Thanks!


On Fri, May 20, 2011 at 4:45 PM, Lukas Renggli <[hidden email]> wrote:
Indeed, then

   (RBParser parseExpression: '1 + 2') explore

is probably the closest you get.

Lukas

On 20 May 2011 21:37, Bernardo Ezequiel Contreras <[hidden email]> wrote:
> i dont know how to answer.
> so i would show an example
> http://groovy.codehaus.org/Groovy+Console
>
> http://groovy.codehaus.org/download/attachments/36800/astbrowser.png?version=1&modificationDate=1238156032299
>
> The groovy console has an AST browser, and i was wondering where the AST
> Browser for Pharo is.
>  I played with the RBParser to parse an expression and inspect the AST tree,
> but i could not find a nice browser( or inspector )
>
> Thanks
>
>
>
> On Fri, May 20, 2011 at 2:54 PM, Lukas Renggli <[hidden email]> wrote:
>>
>> Hi Bernardo,
>>
>> What do you understand as an "AST browser"? A special inspector for AST
>> nodes?
>>
>> Lukas
>>
>> On 20 May 2011 18:35, Bernardo Ezequiel Contreras <[hidden email]>
>> wrote:
>> > Hi All,
>> >
>> >  do you know where i can get an AST Browser?
>> >
>> > Thanks
>> >
>>
>>
>>
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>>
>
>



--
Lukas Renggli
www.lukas-renggli.ch





--
Lukas Renggli
www.lukas-renggli.ch