Ejemplo n.º 1
0
        public static void Visit(this Node node, IParseTreeVisitor visitor)
        {
            int i = 0;
            switch (node.Name) {
                case "sequence":
                    visitor.VisitSequence(node);
                    if (node[i].Name == "var_def") {
                        visitor.VisitSequence(node);
                        ++i;
                    }

                    for (int max = node.Count; i < max; ++i)
                        node[i].Visit(visitor);
                break;
                case "var_def":
                    visitor.VisitVariableDefinition(node);
                break;
            }
        }