Michael Bayer wrote:
> On Nov 8, 2007, at 11:32 AM, svilen wrote:
>
>   
>> mmmh. u can think of splitting the Visitor into 3: Guide (who
>> traverses _everything_ given), Visitor (who does things), and
>> intermediate Decisor, who decides where to go / what to do. But this
>> can get complicated (slow) although it would be quite clear who does
>> what.
>> Also, do have both onEntry and onExit for each node; i am sure some
>> operations will require both; first to gather info, second to make a
>> decision about what to do with it while still at that level.
>>
>> i've done quite a lot of tree/expression traversers, and while
>> readonly walking doesnot care much if on entry or on exit (except if
>> u want depth or breadth first), replacements-in-place and
>> copy+replace sometimes needed both entry and exit hooks, + they where
>> conditional like in leafs.
>>     
>
> i think you should come up with your own ACP and lets take a look at  
> it.    while i can get various ACP ideas to work further and further,  
> im still able to come up with plenty of cases where none of them work  
> and its because the structure of a clauseelement really isnt a tree.   
> the same node can be represented many times largely because columns  
> reference their parent table.
>   
u mean a graph? mmm no.
IMO an expression is a tree of nodes, each node points to some element 
of another  space (metadata things+bindparams+...), and many nodes can 
point to same element, and eventualy many elements can hold same value 
(but be different elements - e.g. literal(1) and another literal(1) - 
not sure about whether this is usable). So traversing the (original) 
tree is one thing; what to do with the elements pointed by the nodes is 
another decision; e.g.. whether to process multiple-referred elements 
multiple times or just one, etc.

i can try... but dont rely on me too much ;-)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to