protected override void GenerateCodeForConditionalBranch(CodeGenContext context, BranchTargetLabel label, bool reverse) { Left.GenerateCodeForValueWithPrettyPrint(context, EvaluationIntention.Value); Right.GenerateCodeForValueWithPrettyPrint(context, EvaluationIntention.Value); context.GenerateBinaryCompareConditionalBranch(Op, label, reverse); }
protected override void GenerateCodeForConditionalBranch(CodeGenContext context, BranchTargetLabel target, bool reverse) { // NB: reverse=false is the normal case as would be used in: // if ( a || b ) { c=1; } // where we branch around the then-part ( {c=1; } ) when the sub-expression a || b is false // // Reverse=true would apply in situation such as: // if ( ! (a || b) ) { c=1; } // where we would apply reverse=true toward the inner evaluation of (a || b) // or many other cases involving reversal of evaluation purpose due to the || expression's larger context if (reverse) { context.EvalBoth(Left, Right, target, true); } else { context.EvalEither(Left, Right, target, false); } }
protected override void GenerateCodeForConditionalBranch(CodeGenContext context, BranchTargetLabel label, bool reverse) { Arg.GenerateCodeForConditionalBranchWithPrettyPrint(context, label, !reverse); }