コード例 #1
0
        /// <summary>
        /// Creates new instruction block for given instruction.
        /// </summary>
        /// <param name="instruction">The instruction.</param>
        private void setNewBlock(InstructionBase instruction)
        {
            var newExecutedBlock = new ExecutedBlock(instruction.Info, this);

            CurrentBlock.NextBlock = newExecutedBlock;
            CurrentBlock           = newExecutedBlock;
        }
コード例 #2
0
        /// <summary>
        /// Get next available instrution.
        /// </summary>
        /// <returns>Instruction that is on turn to be processed, if end of execution returns null</returns>
        internal InstructionBase NextInstruction()
        {
            InstructionBase instrution = null;

            while (!IsExecutionEnd && (instrution = CurrentCall.NextInstrution()) == null)
            {
                popContext();
            }

            return(instrution);
        }
コード例 #3
0
        /// <summary>
        /// Prepare instruction to be processed
        /// </summary>
        /// <param name="instruction">Prepared instruction</param>
        internal void Prepare(InstructionBase instruction)
        {
            var call = instruction as Call;

            if (call == null)
            {
                //only calls will have edits provider
                if (!(instruction is DirectInvoke))
                {
                    //Direct invoke shares edits provider (because we want to get edits on call place)
                    Edits = null;
                }
            }
            else
            {
                Edits = new EditsProvider(call.TransformProvider, CurrentCall.CurrentBlock);
            }
        }
コード例 #4
0
ファイル: CallEmitter.cs プロジェクト: m9ra/MEFEditor_v2.0
 /// <summary>
 /// Add given instruction into generated program
 /// <remarks>
 /// All instructions are assigned into current instruction block
 /// </remarks>.
 /// </summary>
 /// <param name="instruction">Added instruction.</param>
 private void emitInstruction(InstructionBase instruction)
 {
     instruction.Info = _currentBlockInfo;
     _instructions.Add(instruction);
 }