Пример #1
0
        private static void IterateTree(ParseTreeNode root, int level, TreeIteratorContext ctx)
        {
            if (!ctx.Functor(ctx, root))
            {
                // no need to go deeper into the tree
                return;
            }

            foreach (var child in root.ChildNodes)
            {
                IterateTree(child, level + 1, ctx);
            }
        }
Пример #2
0
        private static void IterateTree(ParseTreeNode root, int level, TreeIteratorContext ctx)
        {
            if (!ctx.Functor(ctx, root))
            {
                // no need to go deeper into the tree
                return;
            }

            foreach (var child in root.ChildNodes)
            {
                IterateTree(child, level + 1, ctx);
            }
        }