示例#1
0
        public override bool EnsureBuilt(
            bool force,
            PcodeSystem.IEvaluationContext pcodeEnvironment,
            BuildFailedCallback failedCallback)
        {
            if (!force && (_instrument != null))
            {
                return(true);
            }
            _instrument = null;

            Synthesizer.InstrumentRec TheInstrument;

            int    ErrorLine;
            string ErrorExtraMessage;

            Synthesizer.BuildInstrErrors Error = Synthesizer.BuildInstrumentFromText(
                InstrDefinition,
                ((Document)Parent).CodeCenter,
                out ErrorLine,
                out ErrorExtraMessage,
                out TheInstrument);
            if (Error != Synthesizer.BuildInstrErrors.eBuildInstrNoError)
            {
                failedCallback(this, new LiteralBuildErrorInfo(Synthesizer.BuildInstrGetErrorMessageText(Error, ErrorExtraMessage), ErrorLine));
                return(false);
            }

            _instrument = TheInstrument;
            return(true);
        }
示例#2
0
 public override void Unbuild()
 {
     _instrument = null;
 }