internal void Parse() { if (ParentCount > 30) { return; } config.SkipEmpty(); if (config.Peek() == '(') { config.Next(); Name = config.NextString(); config.Next(); Value = config.NextString(); config.Next(); return; } Name = config.NextString(); config.SkipEmpty(); if (config.Peek() == '=') { config.Next(); config.SkipEmpty(); Value = config.NextString(); } else if (config.Peek() == ',') { config.Next(); Childs.Add(new ADLElement { Name = this.Name, Parent = this }); Name = null; while (config.HasChar) { config.SkipEmpty(); Childs.Add(new ADLElement { Value = config.NextString(), Parent = this }); config.SkipEmpty(); if (config.Peek() == ',') { config.Next(); config.SkipEmpty(); } if (config.Peek() == '}') { break; } } //config.Next(); } else if (config.Peek() == '{') { config.Next(); while (config.HasChar) { config.SkipEmpty(); Childs.Add(new ADLElement(config, this)); config.SkipEmpty(); if (config.Peek() == '}') { break; } } config.Next(); if (Childs.Count() == 1 && Childs[0].Name == null) { var c = Childs[0]; Childs.Clear(); Childs.AddRange(c.Childs); } } }