System.Xml.Xsl.IlGen.XmlILVisitor.VisitNot C# (CSharp) Метод

VisitNot() защищенный Метод

Generate code for QilNodeType.Not.
BranchingContext.OnFalse context: not(expr1) ==> if (expr1) goto LabelParent; BranchingContext.OnTrue context: not(expr1) ==> if (!expr1) goto LabelParent; BranchingContext.None context: not(expr1) ==> if (expr1) goto LabelTemp; push false(); goto LabelSkip; LabelTemp: push true(); LabelSkip:
protected VisitNot ( QilUnary ndNot ) : QilNode
ndNot QilUnary
Результат QilNode
        protected override QilNode VisitNot(QilUnary ndNot) {
            Label lblTemp = new Label();

            // Visit operand
            // Reverse branch types
            switch (this.iterCurr.CurrentBranchingContext) {
                case BranchingContext.OnFalse:
                    NestedVisitWithBranch(ndNot.Child, BranchingContext.OnTrue, this.iterCurr.LabelBranch);
                    break;

                case BranchingContext.OnTrue:
                    NestedVisitWithBranch(ndNot.Child, BranchingContext.OnFalse, this.iterCurr.LabelBranch);
                    break;

                default:
                    // Replace boolean argument on top of stack with its inverse
                    Debug.Assert(this.iterCurr.CurrentBranchingContext == BranchingContext.None);
                    lblTemp = this.helper.DefineLabel();
                    NestedVisitWithBranch(ndNot.Child, BranchingContext.OnTrue, lblTemp);
                    break;
            }

            if (this.iterCurr.CurrentBranchingContext == BranchingContext.None) {
                // If condition evaluates to true, then jump to code that pushes false
                this.helper.ConvBranchToBool(lblTemp, false);
                this.iterCurr.Storage = StorageDescriptor.Stack(typeof(bool), false);
            }
            else {
                this.iterCurr.Storage = StorageDescriptor.None();
            }

            return ndNot;
        }
XmlILVisitor