예제 #1
0
        public TypeSystemServices(CompilerContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException("context");
            }

            _context = context;

            CodeBuilder = new BooCodeBuilder(this);

            Cache(typeof(Builtins.duck), DuckType = new DuckTypeImpl(this));
            Cache(IQuackFuType             = new ExternalType(this, typeof(IQuackFu)));
            Cache(VoidType                 = new VoidTypeImpl(this));
            Cache(ObjectType               = new ExternalType(this, Types.Object));
            Cache(RegexType                = new ExternalType(this, Types.Regex));
            Cache(ValueTypeType            = new ExternalType(this, typeof(ValueType)));
            Cache(EnumType                 = new ExternalType(this, typeof(Enum)));
            Cache(ArrayType                = new ExternalType(this, Types.Array));
            Cache(TypeType                 = new ExternalType(this, Types.Type));
            Cache(StringType               = new ExternalType(this, Types.String));
            Cache(BoolType                 = new ExternalType(this, Types.Bool));
            Cache(SByteType                = new ExternalType(this, Types.SByte));
            Cache(CharType                 = new ExternalType(this, Types.Char));
            Cache(ShortType                = new ExternalType(this, Types.Short));
            Cache(IntType                  = new ExternalType(this, Types.Int));
            Cache(LongType                 = new ExternalType(this, Types.Long));
            Cache(ByteType                 = new ExternalType(this, Types.Byte));
            Cache(UShortType               = new ExternalType(this, Types.UShort));
            Cache(UIntType                 = new ExternalType(this, Types.UInt));
            Cache(ULongType                = new ExternalType(this, Types.ULong));
            Cache(SingleType               = new ExternalType(this, Types.Single));
            Cache(DoubleType               = new ExternalType(this, Types.Double));
            Cache(DecimalType              = new ExternalType(this, Types.Decimal));
            Cache(TimeSpanType             = new ExternalType(this, Types.TimeSpan));
            Cache(DateTimeType             = new ExternalType(this, Types.DateTime));
            Cache(RuntimeServicesType      = new ExternalType(this, Types.RuntimeServices));
            Cache(BuiltinsType             = new ExternalType(this, Types.Builtins));
            Cache(ListType                 = new ExternalType(this, Types.List));
            Cache(HashType                 = new ExternalType(this, Types.Hash));
            Cache(ICallableType            = new ExternalType(this, Types.ICallable));
            Cache(IEnumerableType          = new ExternalType(this, Types.IEnumerable));
            Cache(IEnumeratorType          = new ExternalType(this, typeof(IEnumerator)));
            Cache(ICollectionType          = new ExternalType(this, Types.ICollection));
            Cache(IListType                = new ExternalType(this, Types.IList));
            Cache(IDictionaryType          = new ExternalType(this, Types.IDictionary));
            Cache(ApplicationExceptionType = new ExternalType(this, Types.ApplicationException));
            Cache(ExceptionType            = new ExternalType(this, Types.Exception));
            Cache(IntPtrType               = new ExternalType(this, Types.IntPtr));
            Cache(MulticastDelegateType    = new ExternalType(this, Types.MulticastDelegate));
            Cache(DelegateType             = new ExternalType(this, Types.Delegate));

            ObjectArrayType = GetArrayType(ObjectType, 1);

            PreparePrimitives();
            PrepareBuiltinFunctions();
        }
예제 #2
0
        public TypeSystemServices(CompilerContext context)
        {
            if (null == context) throw new ArgumentNullException("context");

            _context = context;
            _anonymousCallablesManager = new AnonymousCallablesManager(this);
            _genericsServices = new GenericsServices(context);

            CodeBuilder = new BooCodeBuilder(this);

            Cache(typeof(Builtins.duck), DuckType = new DuckTypeImpl(this));
            Cache(IQuackFuType = new ExternalType(this, typeof(IQuackFu)));
            Cache(VoidType = new VoidTypeImpl(this));
            Cache(ObjectType = new ExternalType(this, Types.Object));
            Cache(RegexType = new ExternalType(this, Types.Regex));
            Cache(ValueTypeType = new ExternalType(this, typeof(ValueType)));
            Cache(EnumType = new ExternalType(this, typeof(Enum)));
            Cache(ArrayType = new ExternalType(this, Types.Array));
            Cache(TypeType = new ExternalType(this, Types.Type));
            Cache(StringType = new ExternalType(this, Types.String));
            Cache(BoolType = new ExternalType(this, Types.Bool));
            Cache(SByteType = new ExternalType(this, Types.SByte));
            Cache(CharType = new ExternalType(this, Types.Char));
            Cache(ShortType = new ExternalType(this, Types.Short));
            Cache(IntType = new ExternalType(this, Types.Int));
            Cache(LongType = new ExternalType(this, Types.Long));
            Cache(ByteType = new ExternalType(this, Types.Byte));
            Cache(UShortType = new ExternalType(this, Types.UShort));
            Cache(UIntType = new ExternalType(this, Types.UInt));
            Cache(ULongType = new ExternalType(this, Types.ULong));
            Cache(SingleType = new ExternalType(this, Types.Single));
            Cache(DoubleType = new ExternalType(this, Types.Double));
            Cache(DecimalType = new ExternalType(this, Types.Decimal));
            Cache(TimeSpanType = new ExternalType(this, Types.TimeSpan));
            Cache(DateTimeType = new ExternalType(this, Types.DateTime));
            Cache(RuntimeServicesType = new ExternalType(this, Types.RuntimeServices));
            Cache(BuiltinsType = new ExternalType(this, Types.Builtins));
            Cache(ListType = new ExternalType(this, Types.List));
            Cache(HashType = new ExternalType(this, Types.Hash));
            Cache(ICallableType = new ExternalType(this, Types.ICallable));
            Cache(IEnumerableType = new ExternalType(this, Types.IEnumerable));
            Cache(IEnumeratorType = new ExternalType(this, typeof(IEnumerator)));
            Cache(ICollectionType = new ExternalType(this, Types.ICollection));
            Cache(IListType = new ExternalType(this, Types.IList));
            Cache(IDictionaryType = new ExternalType(this, Types.IDictionary));
            Cache(IntPtrType = new ExternalType(this, Types.IntPtr));
            Cache(UIntPtrType = new ExternalType(this, Types.UIntPtr));
            Cache(MulticastDelegateType = new ExternalType(this, Types.MulticastDelegate));
            Cache(DelegateType = new ExternalType(this, Types.Delegate));
            Cache(SystemAttribute = new ExternalType(this, typeof(System.Attribute)));
            Cache(ConditionalAttribute = new ExternalType(this, typeof(System.Diagnostics.ConditionalAttribute)));
            Cache(IEnumerableGenericType = new ExternalType(this, typeof(System.Collections.Generic.IEnumerable<>)));
            Cache(IEnumeratorGenericType = new ExternalType(this, typeof(System.Collections.Generic.IEnumerator<>)));

            ObjectArrayType = GetArrayType(ObjectType, 1);

            PreparePrimitives();
            PrepareBuiltinFunctions();
        }