Exemplo n.º 1
0
        public CompiledInitializer CreateInitializer(InitializerDefinition definition, IDefinitionInstallerContext installer)
        {
            PoolBinding poolBinding = installer.GetPoolBinding(this.PoolName);

            if ((poolBinding == null) || (poolBinding.Value == null))
            {
                return(null);
            }
            PoolVariableOrConstantBinding binding = poolBinding.Value[this.PoolItemName];

            if (binding == null)
            {
                return(null);
            }
            return(new RuntimePoolItemInitializer(this.ParseTree, new DebugInfoService(this.SourceCodeService), binding, this.PoolName));
        }
Exemplo n.º 2
0
        public CompiledInitializer CreateInitializer(InitializerDefinition definition, IDefinitionInstallerContext installer)
        {
            GlobalVariableOrConstantBinding globalBinding = installer.GetGlobalVariableOrConstantBinding(this.GlobalName);
            ClassBinding classBinding = installer.GetClassBinding(this.GlobalName);

            // 3. Check that such a binding exists ... but not both
            if (!((globalBinding == null) ^ (classBinding == null)))
            {
                return(null);
            }

            if (classBinding != null)
            {
                return(new RuntimeGlobalInitializer(this.ParseTree, new DebugInfoService(this.SourceCodeService), classBinding));
            }
            if (globalBinding != null)
            {
                return(new RuntimeGlobalInitializer(this.ParseTree, new DebugInfoService(this.SourceCodeService), globalBinding));
            }
            return(null);
        }
 public CompiledInitializer CreateInitializer(InitializerDefinition definition, IDefinitionInstallerContext installer)
 {
     return(new RuntimeProgramInitializer(this.ParseTree, new DebugInfoService(this.SourceCodeService)));
 }