コード例 #1
0
ファイル: IfNode.cs プロジェクト: theolivenbaum/RedSharper
 public IfNode(
     ExpressionNode condition,
     RedILNode ifTrue,
     RedILNode ifFalse)
     : base(RedILNodeType.If)
 {
     Condition = condition;
     IfTrue    = ifTrue;
     IfFalse   = ifFalse;
 }
コード例 #2
0
            public State NewState(AstNode currentNode, RedILNode currentRedILNode)
            {
                var lastNode      = currentRedILNode ?? ParentRedILNode;
                var lastIterative = LastIterativeNode;

                if (currentRedILNode is DoWhileNode ||
                    currentRedILNode is WhileNode)
                {
                    lastIterative = currentRedILNode;
                }

                return(new State()
                {
                    ParentState = this,
                    ParentNode = currentNode,
                    LastIterativeNode = lastIterative,
                    ParentRedILNode = lastNode
                });
            }