예제 #1
0
        internal static JMember Json_Member(string text, ref int index)
        {
            JMember member = new JMember();
            int     start  = index;
            char    c      = SkipWS(text, ref index);

            if (c == '"')
            {
                try
                {
                    index++;
                    member.Name = Json_String(text, ref index);
                    c           = SkipWS(text, ref index);
                    if (c == ':')
                    {
                        index++;
                        dynamic Val = Json_Value(text, ref index);
                        member.Value = Val;
                        SkipWS(text, ref index);
                        return(member);
                    }
                }
                catch (Exception e)
                {
                    throw new Exception(e.Message);
                }
            }
            throw new Exception($"Error: Invalid Object Member ['\"name\":value] at char #{index}\n[{text.Substring(index, 80)}]");
        }
예제 #2
0
        private static void visitMember(Member me, JMember me2)
        {
            me2.Name = me.Name;
            int modifiers = me.Modifiers;

            visitModifiers(me2, modifiers);
            me2.IsSynthetic = me.IsSynthetic;
        }
예제 #3
0
 private static void visitModifiers(JMember fe2, int modifiers)
 {
     fe2.IsPublic    = Modifier.isPublic(modifiers);
     fe2.IsPrivate   = Modifier.isPrivate(modifiers);
     fe2.IsProtected = Modifier.isProtected(modifiers);
     fe2.IsStatic    = Modifier.isStatic(modifiers);
     fe2.IsFinal     = Modifier.isFinal(modifiers);
     fe2.IsAbstract  = Modifier.isAbstract(modifiers);
 }
예제 #4
0
 static bool IsNonPublic(JMember me)
 {
     return(!me.IsPublic && !me.IsProtected);
 }