Exemplo n.º 1
0
            public void Process(char c, SetCharProcessor setState)
            {
                switch (c)
                {
                case '{':
                    setState(new objectReader(s => _done(_name, s), _next), false);
                    break;

                case '[':
                    setState(new arrayReader(s => _done(_name, s), _next), false);
                    break;

                case ':':
                    break;

                case ' ':
                case '\t':
                case '\r':
                case '\n':
                    break;

                default:

                    setState(new ReadValueThatMayOrMayNotBeQuoted(_next, new char[] { ',', '}' }, s => _done(_name, s)), true);
                    break;
                }
            }
Exemplo n.º 2
0
            public void Process(char c, SetCharProcessor setState)
            {
                switch (c)
                {
                case '{':
                    setState(new objectReader(_dl.AddItem, this), false);
                    break;

                case ',':
                    break;

                case ']':

                    _done(_dl);
                    setState(_next, false);
                    break;

                case ' ':
                case '\t':
                case '\r':
                case '\n':
                    break;

                default:
                    error(c, this);
                    break;
                }
            }
Exemplo n.º 3
0
            public void Process(char c, SetCharProcessor setState)
            {
                switch (c)
                {
                case '}':
                    _done(di);
                    setState(_nextProcessor, false);
                    break;

                case ',':
                    break;

                case ' ':
                case '\t':
                case '\r':
                case '\n':
                    break;

                default:
                    var vr = new valueReader((n, v) => di.Set(n, v), this);
                    setState(new ReadValueThatMayOrMayNotBeQuoted(vr, ':', vr.setName), c != ',');
                    break;
                }
            }