/// <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); }
/// <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); }