Exemplo n.º 1
0
        private SyntaxVisitorResult <IN, OUT> Visit(GroupSyntaxNode <IN> node, object context = null)
        {
            var group  = new Group <IN, OUT>();
            var values = new List <SyntaxVisitorResult <IN, OUT> >();

            foreach (var n in node.Children)
            {
                var v = Visit(n, context);

                if (v.IsValue)
                {
                    group.Add(n.Name, v.ValueResult);
                }
                if (v.IsToken)
                {
                    if (!v.Discarded)
                    {
                        group.Add(n.Name, v.TokenResult);
                    }
                }
            }


            var res = SyntaxVisitorResult <IN, OUT> .NewGroup(group);

            return(res);
        }
Exemplo n.º 2
0
        private SyntaxVisitorResult <IN, OUT> Visit(GroupSyntaxNode <IN> node)
        {
            Group <IN, OUT> group = new Group <IN, OUT>();
            List <SyntaxVisitorResult <IN, OUT> > values = new List <SyntaxVisitorResult <IN, OUT> >();

            foreach (ISyntaxNode <IN> n in node.Children)
            {
                SyntaxVisitorResult <IN, OUT> v = Visit(n);

                if (v.IsValue)
                {
                    group.Add(n.Name, v.ValueResult);
                }
                if (v.IsToken)
                {
                    if (!v.Discarded)
                    {
                        group.Add(n.Name, v.TokenResult);
                    }
                }
            }


            var res = SyntaxVisitorResult <IN, OUT> .NewGroup(group);

            return(res);
        }