Example #1
0
        public void Parse()
        {
            Attributes.Clear();
            using (var stringReader = new StringReader(attributesString))
            {
                tokenReader = new TokenReader(stringReader);

                Token next;
                while (!(next = tokenReader.Peek()).IsEnd)
                {
                    if (next.IsWhiteSpace)
                    {
                        tokenReader.Read();
                        continue;
                    }
                    if ((next.Character) == '\'' || (next.IsEscaped) || (next.Character) == '"' || (next.Character) == ':' || (next.Character) == '}' || (next.Character) == '=')
                    {
                        throw new SyntaxException();
                    }
                    ProcessKey();
                    AddCurrent();
                    currentValue = null;
                    currentKey = null;
                }

                CheckForDuplicates();
            }
        }
 public ExpressionStringParser(string expressionString)
 {
     stringReader = new StringReader(expressionString);
     tokenReader = new TokenReader(stringReader);
     ExpressionStringTokens = new List<ExpressionStringToken>();
 }
Example #3
0
 public ExpressionStringParser(string expressionString)
 {
     stringReader           = new StringReader(expressionString);
     tokenReader            = new TokenReader(stringReader);
     ExpressionStringTokens = new List <ExpressionStringToken>();
 }