示例#1
0
 public static RType GetOrCreateType([NotNull] string name, RTypeAttributes attributes, [CanBeNull] RType parent, [CanBeNull] RType declaringType)
 {
     return Instance.GetOrCreate(name, () => new RType(name, attributes, parent, declaringType));
 }
示例#2
0
        public static TypeAttributes GetTypeAttributes(RTypeAttributes modifiers)
        {
            TypeAttributes attrs = TypeAttributes.Class;
            if (modifiers.HasFlag(RTypeAttributes.Abstract))
            {
                attrs |= TypeAttributes.Abstract;
            }

            if (modifiers.HasFlag(RTypeAttributes.Sealed))
            {
                attrs |= TypeAttributes.Sealed;
            }

            if (modifiers.HasFlag(RTypeAttributes.Public))
            {
                attrs |= TypeAttributes.Public;
            }

            if (modifiers.HasFlag(RTypeAttributes.Private) || modifiers.HasFlag(RTypeAttributes.Protected))
            {
                attrs |= TypeAttributes.NotPublic;
            }

            return attrs;
        }
示例#3
0
文件: RType.cs 项目: dubik/csharprpp
        public RType(string name, RTypeAttributes attributes, RType parent, RType declaringType = null)
        {
            Name = name;
            Attributes = attributes;
            BaseType = parent;
            DeclaringType = declaringType;

            if (IsClass && BaseType == null)
            {
                BaseType = AnyTy;
            }
        }
示例#4
0
文件: RType.cs 项目: dubik/csharprpp
 public RType DefineNestedType(string name, RTypeAttributes attributes, RType parent)
 {
     RType nested = new RType(name, attributes, parent, this);
     _nested.Add(nested);
     return nested;
 }
示例#5
0
文件: RType.cs 项目: dubik/csharprpp
 public RType([NotNull] string name, RTypeAttributes attributes = RTypeAttributes.Class)
 {
     Name = name;
     Attributes = attributes;
     BaseType = AnyTy;
 }