Exemplo n.º 1
0
        public override Node ExitInExpression(Production node)
        {
            var  childValues = this.GetChildValues(node);
            var  flag        = childValues.Count == 1;
            Node exitInExpression;

            if (flag)
            {
                this.AddFirstChildValue(node);
                exitInExpression = node;
            }
            else
            {
                var operand = (ExpressionElement)childValues[0];
                childValues.RemoveAt(0);
                var       second = RuntimeHelpers.GetObjectValue(childValues[0]);
                var       flag2  = second is IList;
                InElement op;
                if (flag2)
                {
                    op = new InElement(operand, (IList)second);
                }
                else
                {
                    var il = new InvocationListElement(childValues, this.myServices);
                    op = new InElement(operand, il);
                }
                node.AddValue(op);
                exitInExpression = node;
            }
            return(exitInExpression);
        }
Exemplo n.º 2
0
        public override Node ExitMemberExpression(Production node)
        {
            var childValues = this.GetChildValues(node);
            var first       = RuntimeHelpers.GetObjectValue(childValues[0]);
            var flag        = childValues.Count == 1 && !(first is MemberElement);

            if (flag)
            {
                node.AddValue(RuntimeHelpers.GetObjectValue(first));
            }
            else
            {
                var list = new InvocationListElement(childValues, this.myServices);
                node.AddValue(list);
            }
            return(node);
        }