While.AST.Statements.If.Compile C# (CSharp) Method

Compile() public method

public Compile ( ILGenerator il ) : void
il System.Reflection.Emit.ILGenerator
return void
        public override void Compile(ILGenerator il)
        {
            EmitDebugInfo(il, 0, false);
            Expression.Compile(il);
            Label ifFalseLabel = il.DefineLabel();
            Label endLabel = il.DefineLabel();
            il.Emit(OpCodes.Brfalse, ifFalseLabel);
            IfBranch.Compile(il);
            il.Emit(OpCodes.Br, endLabel);
            il.MarkLabel(ifFalseLabel);
            if (ElseBranch != null) {
                ElseBranch.Compile(il);
            }
            il.MarkLabel(endLabel);
        }