public void Traverse(CParser.Node Node) { if (TraverseHook == null) { TraverseHook = delegate(Action _Action, CParser.Node _ParentNode, CParser.Node _Node) { _Action(); } } ; TraverseHook(() => { Scopable.RefScope(ref ParentNode, Node, () => { if (Node != null) { var NodeType = Node.GetType(); if (Map.ContainsKey(NodeType)) { Map[NodeType].Invoke(TargetObject, new object[] { Node }); } else { throw (new NotImplementedException(String.Format("Not implemented {0}", Node.GetType()))); } } }); }, ParentNode, Node); }
protected override void TraverseHook(Action Action, CParser.Node ParentNode, CParser.Node Node) { // TODO: Reenable and run tests. #if true RequireYieldResult = !(ParentNode is CParser.ExpressionStatement); #endif //Console.WriteLine("{0} -> {1} : {2}", ParentNode, Node, RequireYieldResult); Action(); }
protected virtual void TraverseHook(Action Action, CParser.Node ParentNode, CParser.Node Node) { Action(); }