Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class ExtDepthFirstVisitor<T, S> : DepthFirstAstVisitor<T, S>
- {
- protected abstract S PreVisit(AstNode node, T data);
- protected abstract S PostVisit(AstNode node, T data);
- protected override S VisitChildren(AstNode node, T data)
- {
- PreVisit(node, data);
- AstNode next;
- for (var child = node.FirstChild; child != null; child = next)
- {
- // Store next to allow the loop to continue
- // if the visitor removes/replaces child.
- next = child.NextSibling;
- child.AcceptVisitor(this, data);
- }
- PostVisit(node, data);
- return default(S);
- }
- }
Add Comment
Please, Sign In to add comment