Beispiel #1
0
            public override void CreateCode()
            {
                whileCount++;
                int index = whileCount;

                EmitCode("WHILE_START" + index + ": nop");
                expression.CreateCode();
                EmitCode("brfalse WHILE_END" + index);
                instruction.CreateCode();
                EmitCode("br WHILE_START" + index);
                EmitCode("WHILE_END" + index + ": nop");
            }
Beispiel #2
0
            public override void CreateCode()
            {
                ifCount++;
                int index = ifCount;

                expression.CreateCode();
                EmitCode("brfalse ELSE" + index);
                ifInstruction.CreateCode();
                EmitCode("br END_IF" + index);
                EmitCode("ELSE" + index + ": nop");
                if (elseInstruction != null)
                {
                    elseInstruction.CreateCode();
                }
                EmitCode("END_IF" + index + ": nop");
            }