Esempio n. 1
0
        public IfStmtNode(IfStmtNode rhs) : base(rhs)
        {
            //
            IfExprNode = ProtoCore.Utils.NodeUtils.Clone(rhs.IfExprNode);


            //
            IfBody = new List <ImperativeNode>();
            foreach (ImperativeNode stmt in rhs.IfBody)
            {
                ImperativeNode body = ProtoCore.Utils.NodeUtils.Clone(stmt);
                IfBody.Add(body);
            }

            //
            IfBodyPosition = ProtoCore.Utils.NodeUtils.Clone(rhs.IfBodyPosition);

            //
            ElseIfList = new List <ElseIfBlock>();
            foreach (ElseIfBlock elseBlock in rhs.ElseIfList)
            {
                ImperativeNode elseNode = ProtoCore.Utils.NodeUtils.Clone(elseBlock);
                ElseIfList.Add(elseNode as ElseIfBlock);
            }

            //
            ElseBody = new List <ImperativeNode>();
            foreach (ImperativeNode stmt in rhs.ElseBody)
            {
                ImperativeNode tmpNode = ProtoCore.Utils.NodeUtils.Clone(stmt);
                ElseBody.Add(tmpNode);
            }

            //
            ElseBodyPosition = ProtoCore.Utils.NodeUtils.Clone(rhs.ElseBodyPosition);
        }
Esempio n. 2
0
        private void EmitInlineConditionalNode(ImperativeNode node, ref ProtoCore.Type inferedType, ProtoCore.AST.ImperativeAST.BinaryExpressionNode parentNode = null)
        {
            InlineConditionalNode inlineConNode = node as InlineConditionalNode;
            IfStmtNode ifNode = new IfStmtNode();
            ifNode.IfExprNode = inlineConNode.ConditionExpression;
            List<ImperativeNode> trueBody = new List<ImperativeNode>();
            trueBody.Add(inlineConNode.TrueExpression);
            List<ImperativeNode> falseBody = new List<ImperativeNode>();
            falseBody.Add(inlineConNode.FalseExpression);
            ifNode.IfBody = trueBody;
            ifNode.ElseBody = falseBody;

            DebugProperties.BreakpointOptions oldOptions = compileStateTracker.DebugProps.breakOptions;
            DebugProperties.BreakpointOptions newOptions = oldOptions;
            newOptions |= DebugProperties.BreakpointOptions.EmitInlineConditionalBreakpoint;
            compileStateTracker.DebugProps.breakOptions = newOptions;

            EmitIfStmtNode(ifNode, ref inferedType, parentNode, true);

            compileStateTracker.DebugProps.breakOptions = oldOptions;
        }
Esempio n. 3
0
        private void EmitInlineConditionalNode(ImperativeNode node, ref ProtoCore.Type inferedType)
        {
            InlineConditionalNode inlineConNode = node as InlineConditionalNode;
            IfStmtNode ifNode = new IfStmtNode();
            ifNode.IfExprNode = inlineConNode.ConditionExpression;
            List<ImperativeNode> trueBody = new List<ImperativeNode>();
            trueBody.Add(inlineConNode.TrueExpression);
            List<ImperativeNode> falseBody = new List<ImperativeNode>();
            falseBody.Add(inlineConNode.FalseExpression);
            ifNode.IfBody = trueBody;
            ifNode.ElseBody = falseBody;

            EmitIfStmtNode(ifNode, ref inferedType);
        }
Esempio n. 4
0
        public IfStmtNode(IfStmtNode rhs) : base(rhs)
        {
            //
            IfExprNode = ProtoCore.Utils.NodeUtils.Clone(rhs.IfExprNode);


            //
            IfBody = new List<ImperativeNode>();
            foreach (ImperativeNode stmt in rhs.IfBody)
            {
                ImperativeNode body = ProtoCore.Utils.NodeUtils.Clone(stmt);
                IfBody.Add(body);
            }

            //
            IfBodyPosition = ProtoCore.Utils.NodeUtils.Clone(rhs.IfBodyPosition);

            //
            ElseIfList = new List<ElseIfBlock>();
            foreach (ElseIfBlock elseBlock in rhs.ElseIfList)
            {
                ImperativeNode elseNode = ProtoCore.Utils.NodeUtils.Clone(elseBlock);
                ElseIfList.Add(elseNode as ElseIfBlock);
            }

            //
            ElseBody = new List<ImperativeNode>();
            foreach (ImperativeNode stmt in rhs.ElseBody)
            {
                ImperativeNode tmpNode = ProtoCore.Utils.NodeUtils.Clone(stmt);
                ElseBody.Add(tmpNode);
            }

            //
            ElseBodyPosition = ProtoCore.Utils.NodeUtils.Clone(rhs.ElseBodyPosition);
        }