コード例 #1
0
            // Token: 0x0600006B RID: 107 RVA: 0x0000409C File Offset: 0x0000249C
            private object ParseByToken(CBJSON.Parser.TOKEN token)
            {
                switch (token)
                {
                case CBJSON.Parser.TOKEN.STRING:
                    return(this.ParseString());

                case CBJSON.Parser.TOKEN.NUMBER:
                    return(this.ParseNumber());

                case CBJSON.Parser.TOKEN.TRUE:
                    return(true);

                case CBJSON.Parser.TOKEN.FALSE:
                    return(false);

                case CBJSON.Parser.TOKEN.NULL:
                    return(null);

                default:
                    switch (token)
                    {
                    case CBJSON.Parser.TOKEN.CURLY_OPEN:
                        return(this.ParseObject());

                    case CBJSON.Parser.TOKEN.SQUARED_OPEN:
                        return(this.ParseArray());
                    }
                    return(null);
                }
            }
コード例 #2
0
            // Token: 0x06000069 RID: 105 RVA: 0x00004008 File Offset: 0x00002408
            private ArrayList ParseArray()
            {
                ArrayList arrayList = new ArrayList();

                this.json.Read();
                bool flag = true;

                while (flag)
                {
                    CBJSON.Parser.TOKEN nextToken = this.NextToken;
                    switch (nextToken)
                    {
                    case CBJSON.Parser.TOKEN.SQUARED_CLOSE:
                        flag = false;
                        break;

                    default:
                    {
                        if (nextToken == CBJSON.Parser.TOKEN.NONE)
                        {
                            return(null);
                        }
                        object value = this.ParseByToken(nextToken);
                        arrayList.Add(value);
                        break;
                    }

                    case CBJSON.Parser.TOKEN.COMMA:
                        break;
                    }
                }
                return(arrayList);
            }
コード例 #3
0
            private ArrayList ParseArray()
            {
                ArrayList arrayList = new ArrayList();

                this.json.Read();
                bool flag = true;

                while (flag)
                {
                    CBJSON.Parser.TOKEN nextToken = this.NextToken;
                    CBJSON.Parser.TOKEN tOKEN     = nextToken;
                    switch (tOKEN)
                    {
                    case CBJSON.Parser.TOKEN.SQUARED_CLOSE:
                        flag = false;
                        continue;

                    case CBJSON.Parser.TOKEN.COLON:
IL_38:
                        if (tOKEN != CBJSON.Parser.TOKEN.NONE)
                        {
                            object value = this.ParseByToken(nextToken);
                            arrayList.Add(value);
                            continue;
                        }
                        return(null);

                    case CBJSON.Parser.TOKEN.COMMA:
                        continue;
                    }
                    goto IL_38;
                }
                return(arrayList);
            }
コード例 #4
0
            private Hashtable ParseObject()
            {
                Hashtable hashtable = new Hashtable();

                this.json.Read();
                while (true)
                {
                    CBJSON.Parser.TOKEN nextToken = this.NextToken;
                    switch (nextToken)
                    {
                    case CBJSON.Parser.TOKEN.NONE:
                        goto IL_37;

                    case CBJSON.Parser.TOKEN.CURLY_OPEN:
                    {
IL_2B:
                        if (nextToken == CBJSON.Parser.TOKEN.COMMA)
                        {
                            continue;
                        }
                        string text = this.ParseString();
                        if (text == null)
                        {
                            goto Block_2;
                        }
                        if (this.NextToken != CBJSON.Parser.TOKEN.COLON)
                        {
                            goto Block_3;
                        }
                        this.json.Read();
                        hashtable[text] = this.ParseValue();
                        continue;
                    }

                    case CBJSON.Parser.TOKEN.CURLY_CLOSE:
                        return(hashtable);
                    }
                    goto IL_2B;
                }
IL_37:
                return(null);

Block_2:
                return(null);

Block_3:
                return(null);
            }
コード例 #5
0
            // Token: 0x06000068 RID: 104 RVA: 0x00003F7C File Offset: 0x0000237C
            private Hashtable ParseObject()
            {
                Hashtable hashtable = new Hashtable();

                this.json.Read();
                for (;;)
                {
                    CBJSON.Parser.TOKEN nextToken = this.NextToken;
                    switch (nextToken)
                    {
                    case CBJSON.Parser.TOKEN.NONE:
                        goto IL_37;

                    default:
                        if (nextToken != CBJSON.Parser.TOKEN.COMMA)
                        {
                            string text = this.ParseString();
                            if (text == null)
                            {
                                goto Block_2;
                            }
                            if (this.NextToken != CBJSON.Parser.TOKEN.COLON)
                            {
                                goto Block_3;
                            }
                            this.json.Read();
                            hashtable[text] = this.ParseValue();
                        }
                        break;

                    case CBJSON.Parser.TOKEN.CURLY_CLOSE:
                        return(hashtable);
                    }
                }
IL_37:
                return(null);

Block_2:
                return(null);

Block_3:
                return(null);
            }
コード例 #6
0
 // Token: 0x0600006A RID: 106 RVA: 0x00004080 File Offset: 0x00002480
 private object ParseValue()
 {
     CBJSON.Parser.TOKEN nextToken = this.NextToken;
     return(this.ParseByToken(nextToken));
 }