protected override Expression <Func <object, ExecutionContext, object> > Compile(SmalltalkRuntime runtime, SmalltalkNameScope globalScope)
        {
            PoolBinding poolBinding = globalScope.GetPoolBinding(this.PoolName);

            if ((poolBinding == null) || (poolBinding.Value == null))
            {
                throw new RuntimeCodeGenerationException(String.Format("Cannot find pool named {0}", this.PoolName)); // May be better exception type
            }
            return(this.Compile(runtime,
                                BindingScope.ForPoolInitializer(poolBinding.Value, globalScope),
                                ReservedScope.ForPoolInitializer(),
                                String.Format("{0} initializerFor: {1}", this.PoolName, this.Binding.Name.Value)));
        }
Ejemplo n.º 2
0
        protected override InitializerCompiler GetInitializerCompiler(NativeLiteralEncodingStrategy literalEncodingStrategy, NativeDynamicCallStrategy dynamicCallStrategy, NativeDiscreteBindingEncodingStrategy discreteBindingEncodingStrategy)
        {
            PoolBinding poolBinding = this.Compiler.Parameters.Runtime.GlobalScope.GetPoolBinding(this.Initializer.PoolName);

            if ((poolBinding == null) || (poolBinding.Value == null))
            {
                throw new Exception(String.Format("Cannot find pool named {0}", this.Initializer.PoolName)); // May be better exception type
            }
            BindingScope globalScope   = BindingScope.ForPoolInitializer(poolBinding.Value, this.Compiler.Parameters.Runtime.GlobalScope);
            BindingScope reservedScope = ReservedScope.ForPoolInitializer();

            return(this.GetInitializerCompiler(globalScope, reservedScope, literalEncodingStrategy, dynamicCallStrategy, discreteBindingEncodingStrategy));
        }