From: Sven R. <rei...@ma...> - 2002-11-26 16:53:00
|
On Sun, 24 Nov 2002, Baptiste Lepilleur wrote: > I think you are underestimating the complexity of matching scope to a part > of the tree. For example, the AST structure of a for statement is: > > for ( int x= 1; x < 3; ++x ) > doStuff( x ); > > [for-statement] > iteration-property => [declaration-or-expression] = ( int x= > 1; x < 3; ++x ) > iteration-statement-property => [statement] = > doStuff( x ); > > As you can see, the iterated statement is not a child of the for iteration > declaration node. Also, there is no guaranty concerning the order properties > are visited (at the current time they are stored in a vector, which means > you get them in the order they were added, but it is an implementation > detail that we should not depend uppon). I see. I had the idea that you could easily access the initializer statement of a for statement. Still, I'll try out my idea. > On the wiki, you stated that: > > BTW, some of the visitor code should be moved to ASTNode; I'll look into > that. > > What are you refering to ? I removed that comment. Currently I'm trying to remove some of the code duplication in the visitor classes. Sven. |