Exemplo n.º 1
0
        // PL -> P PL' | epsilon
        private IEnumerable <XamlMember> MatchMembersList()
        {
            VerifyTokensExists();

            List <XamlMember> list = new List <XamlMember>();

            if (tokens.Peek().Value != "}")
            {
                list.Add(MatchMember());
                list.AddRange(MatchMembersListEnd());
            }

            return(list);
        }
Exemplo n.º 2
0
        private IPropertyPathElement MatchElement(XamlNamespaces namespaces)
        {
            VerifyTokensExists();

            XamlName             propertyName   = TryMatchPropertyName(namespaces);
            IEnumerable <string> indexRawValues = TryMatchIndexRawValues();

            if (propertyName.IsEmpty && !indexRawValues.Any())
            {
                throw new Granular.Exception("Can't parse \"{0}\", Property name or Index parameters were expected, \"{1}\" was found at index {2}", text, tokens.Peek().Value, tokens.Peek().Start);
            }

            return(indexRawValues.Any() ? (IPropertyPathElement) new IndexPropertyPathElement(propertyName, indexRawValues, namespaces) : new PropertyPathElement(propertyName));
        }
Exemplo n.º 3
0
        private XamlElement Parse()
        {
            this.tokens = new ReadOnlyStack <Token>(lexer.GetTokens(text));

            XamlElement root = MatchElement();

            if (!tokens.IsEmpty)
            {
                throw new Granular.Exception("Can't parse \"{0}\", end of stream is expected at index {1}", text, tokens.Peek().Start);
            }

            return(root);
        }
Exemplo n.º 4
0
        private XamlElement Parse()
        {
            this.tokens = new ReadOnlyStack<Token>(lexer.GetTokens(text));

            XamlElement root = MatchElement();

            if (!tokens.IsEmpty)
            {
                throw new Granular.Exception("Can't parse \"{0}\", end of stream is expected at index {1}", text, tokens.Peek().Start);
            }

            return root;
        }