示例#1
0
        private static State ParseBeforeMember(Reader r, IList <ExpressionNode> nodes)
        {
            var identifier = IdentifierParser.Parse(r);

            if (identifier != null)
            {
                nodes.Add(new PropertyAccessorNode(identifier));
                return(State.AfterMember);
            }

            return(State.End);
        }
示例#2
0
        private static State ParseAttachedProperty(Reader r, List <ExpressionNode> nodes)
        {
            var owner = IdentifierParser.Parse(r);

            if (r.End || !r.TakeIf('.'))
            {
                throw new ExpressionParseException(r.Position, "Invalid attached property name.");
            }

            var name = IdentifierParser.Parse(r);

            if (r.End || !r.TakeIf(')'))
            {
                throw new ExpressionParseException(r.Position, "Expected ')'.");
            }

            nodes.Add(new PropertyAccessorNode(owner + '.' + name));
            return(State.AfterMember);
        }
示例#3
0
        private static State ParseStart(Reader r, IList <ExpressionNode> nodes)
        {
            if (ParseNot(r))
            {
                nodes.Add(new LogicalNotNode());
                return(State.Start);
            }
            else
            {
                var identifier = IdentifierParser.Parse(r);

                if (identifier != null)
                {
                    nodes.Add(new PropertyAccessorNode(identifier));
                    return(State.AfterMember);
                }
            }

            return(State.End);
        }