public virtual void Visit(AccessCallChainNode node)
        {
            var chainPretend = Nodes.Pop();

            Nodes.Push(chainPretend is AccessColumnNode
                ? chainPretend
                : new AccessCallChainNode(node.ColumnName, node.ReturnType, node.Props, node.Alias));
        }
        public virtual void Visit(AccessCallChainNode node)
        {
            var chainPretend = Nodes.Pop();

            if (chainPretend is AccessColumnNode)
            {
                Nodes.Push(chainPretend);
            }
            else
            {
                var dotNode = chainPretend;

                DotNode theMostInnerDotNode = null;
                while (dotNode != null && dotNode is DotNode dot)
                {
                    theMostInnerDotNode = dot;
                    dotNode             = dot.Root;
                }

                dotNode = theMostInnerDotNode;
                var props = new List <(PropertyInfo, object)>();

                while (dotNode != null && dotNode is DotNode dot)
                {
                    switch (dot.Expression)
                    {
                    case PropertyValueNode prop:
                        props.Add((prop.PropertyInfo, null));
                        break;

                    case AccessObjectKeyNode objKey:
                        props.Add((objKey.PropertyInfo, objKey.Token.Key));
                        break;

                    case AccessObjectArrayNode objArr:
                        props.Add((objArr.PropertyInfo, objArr.Token.Index));
                        break;
                    }

                    dotNode = dot.Expression;
                }

                Nodes.Push(new AccessCallChainNode(node.ColumnName, node.ReturnType, node.Props, node.Alias));
            }
        }
 public void Visit(AccessCallChainNode node)
 {
     node.Accept(_visitor);
 }
Example #4
0
 public virtual void Visit(AccessCallChainNode node)
 {
     node.Accept(Visitor);
 }
Example #5
0
 public override void Visit(AccessCallChainNode node)
 {
     Nodes.Push(new AccessColumnNode(node.ToString(), string.Empty, node.ReturnType, TextSpan.Empty));
 }
Example #6
0
 public virtual void Visit(AccessCallChainNode node)
 {
 }
Example #7
0
 public virtual void Visit(AccessCallChainNode node)
 {
     Nodes.Push(new AccessCallChainNode(node.ColumnName, node.ReturnType, node.Props, node.Alias));
 }