recentpopularlog in

ianweatherhogg : visitor   4

RiK0 Tech Temple: call/cc! I yield! Bah, lazy-seq.
import collections

Node = collections.namedtuple('Node', 'value left right')

def make_node(value, left=None, right=None):
    return Node(value, left, right)

def preorder(tree):
    stack = [tree]
    while stack:
        current = stack.pop()
        
clojure  scheme  python  callcc  3*  visitor  design  pattern  continuation  generator 
march 2011 by ianweatherhogg
Visitor pattern in Python « lamby
Nice article on ast implementation in python and java using the visitor pattern to walk the ast
java  python  visitor  design  abstract  syntax  pattern  tree 
november 2010 by ianweatherhogg

Copy this bookmark:





to read