コード例 #1
0
        private void PrintCondition(string levelTabulatiion, bool isNewLine)
        {
            bool isConditionBelongToCicle = ASMregisters.isContitionBelongsToCicle;

            ASMregisters.isContitionBelongsToCicle = false;
            string markerJumpPrevBody  = "";
            string markerJumpAfterBody = "";

            if (condition != null)
            {
                condition.PrintASM(levelTabulatiion);
                markerJumpPrevBody  = ASMregisters.MarkerJumpPrevBody;
                markerJumpAfterBody = ASMregisters.MarkerJumpAfterBody;

                ASMregisters.ClearMarkerks();
            }
            BinaryExprAST.ClearStaicFlags();

            if (markerJumpPrevBody != null && markerJumpPrevBody != "")
            {
                ASM.WriteASMCode(levelTabulatiion + markerJumpPrevBody + ":");
            }

            body.PrintASM(levelTabulatiion + "\t", isNewLine);

            if (markerJumpAfterBody != null && markerJumpAfterBody != "" && !isConditionBelongToCicle)
            {
                ASM.WriteASMCode(levelTabulatiion + markerJumpAfterBody + ":");
            }
        }
コード例 #2
0
        public override void PrintASM(string levelTabulatiion, bool isNewLine = false)
        {
            bool isConditionBelongToCicle = ASMregisters.isContitionBelongsToCicle;

            ASMregisters.isContitionBelongsToCicle = false;
            string markerJumpPrevBody  = "";
            string markerJumpAfterBody = "";

            if (bodyCondition != null)
            {
                bodyCondition.PrintASM(levelTabulatiion);
                markerJumpPrevBody  = ASMregisters.MarkerJumpPrevBody;
                markerJumpAfterBody = ASMregisters.MarkerJumpAfterBody;
            }
            BinaryExprAST.ClearStaicFlags();

            bool isNextNodeElse = IsNextNodeElse(markerJumpPrevBody, markerJumpAfterBody);

            ASMregisters.ClearMarkerks();

            if (markerJumpPrevBody != null && markerJumpPrevBody != "")
            {
                ASM.WriteASMCode(levelTabulatiion + markerJumpPrevBody + ":");
            }

            (body as BodyMethodAST).PrintASM(levelTabulatiion + "\t", isNewLine);

            if (!isNextNodeElse)
            {
                if (markerJumpAfterBody != null && markerJumpAfterBody != "" && !isConditionBelongToCicle)
                {
                    ASM.WriteASMCode(levelTabulatiion + markerJumpAfterBody + ":");
                }
            }
        }