예제 #1
0
        private static void ParseClassName(ClassData result, string[] rows)
        {
            var indexClassDesc = ArrayStringExtensions.Contains(rows, "class ");
            var items          = rows[indexClassDesc].Split(' ');
            var className      = items.SkipWhile(it => it != "class").Skip(1).First();

            result.Name = className;
        }
예제 #2
0
        private void GetClassMembers(string[] rows, ClassData parentClass)
        {
            var startClassIndex = ArrayStringExtensions.StartsWith(rows, "{");

            var currentIndex  = startClassIndex + 1;
            var endClassIndex = ArrayStringExtensions.StartsWith(rows, "}");
            var result        = new List <ClassMemberSection>();

            do
            {
                var endSection = ArrayStringExtensions.EqualsWith(rows, "", currentIndex);
                var subSection = ArrayStringExtensions.SubRange(rows, currentIndex, endSection == -1? endClassIndex : endSection);
                result.Add(new ClassMemberSection(subSection, parentClass));
                if (endSection == -1)
                {
                    parentClass.ClassMemberSections = result;
                    return;
                }

                currentIndex = endSection + 1;
            } while (true);
        }
예제 #3
0
        private static void ParseConstantPool(ClassData result, string[] rows)
        {
            var rowsRange = ArrayStringExtensions.RowsInRange(rows, "Constant pool:", "{");

            result.ConstantPoolRaw.AddRange(rowsRange);
        }