Beispiel #1
0
        /// <summary>
        /// Generates code for an if command node
        /// </summary>
        /// <param name="ifCommand">The node to generate code for</param>
        private void GenerateCodeForIfCommand(IfCommandNode ifCommand)
        {
            Debugger.Write("Generating code for If Command");
            GenerateCodeFor(ifCommand.Expression);
            Address ifJumpAddress = code.NextAddress;

            code.AddInstruction(OpCode.JUMPIF, Register.CB, FalseValue, 0);
            GenerateCodeFor(ifCommand.ThenCommand);
            code.PatchInstructionToJumpHere(ifJumpAddress);
        }
Beispiel #2
0
 /// <summary>
 /// Carries out identification on an if command node
 /// </summary>
 /// <param name="ifCommand">The node to perform identification on</param>
 private void PerformIdentificationOnIfCommand(IfCommandNode ifCommand)
 {
     PerformIdentification(ifCommand.Expression);
     PerformIdentification(ifCommand.ThenCommand);
     PerformIdentification(ifCommand.ElseCommand);
 }