public void Run(NodeLinkedList list) { ActionNode currentNode = list.First; variables = new Dictionary<string, Variable>(); NodeVisitor visitor = new NodeVisitor(this); while(currentNode != null) { currentNode.accept(visitor); currentNode = currentNode.Next; // Doe iets met de huidige node: // Command pattern // Bepaal de volgende node: // Visitor pattern } }
public override void accept(NodeVisitor visitor) { visitor.visit(this); }