Exemplo n.º 1
0
        private void writeDoWhileLoop(WhileLoop loop)
        {
            outputLine("do" + Environment.NewLine + "{");
            increaseIndent();
            if (loop.body != null)
                writeBlock(loop.body);

            string cond;
            if (loop.logic == null)
            {
                writeStatements(loop.source);
                decreaseIndent();

                DJumpCondition jcc = (DJumpCondition)loop.source.nodes.last;
                cond = buildExpression(jcc.getOperand(0));
            }
            else
            {
                decreaseIndent();
                cond = buildLogicChain(loop.logic);
            }

            outputLine("}");
            outputLine("while (" + cond + ");");
            if (loop.join != null)
                writeBlock(loop.join);
        }