AST-Nodes API

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

AST-Nodes API

stepharo
Hi


I would love to get a more regular API for the AST Nodes.

Point 1

For example

     I would love to have


             leftBar -> leftBarToken to make sure that we see
immediately the fact that we do not get a node.


for example

     RBValueNode subclass: #RBArrayNode
         instanceVariableNames: 'left right statements periods'
         classVariableNames: ''
         package: 'AST-Core-Nodes'

is not really good since I have to remember "oh yes left = {


Point 2

     Apparently it is implied that we always get nodes so

     now when I get a methodNode


     messageNode receiver

         -> node


     to get the text

     messageNode receiver

         I have no idea.

While working on pharodoc (it is just great) I faced the problem that I
really like to know what I'm manipulating and there is a
difference between an expression (text) and an expression node.
So what is the convention?

I would prefer to have xxxNode each time I want to get a node.