コード例 #1
0
ファイル: RppTypeSystem.cs プロジェクト: dubik/csharprpp
 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
ファイル: RTypeUtils.cs プロジェクト: dubik/csharprpp
        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;
 }