Exemplo n.º 1
0
        internal static string LogSInstructions(IEnumerable <CodeInstruction> instuctions)
        {
            LabelIndexes.Clear();

            var sb = new StringBuilder();

            using (var ildesc = new System.IO.StringWriter(sb))
            {
                foreach (var instr in instuctions)
                {
                    ildesc.WriteLine(instr.ToString());
                }
            }

            return(sb.ToString());
        }
Exemplo n.º 2
0
        internal static string SerializeInstructions(IEnumerable <CodeInstruction> instuctions)
        {
            LabelIndexes.Clear();

            var sb = new StringBuilder();

            using (var ildesc = new StringWriter(sb))
            {
                foreach (var instr in instuctions)
                {
                    WriteOpcode(ildesc, instr.opcode);
                    WriteOperand(ildesc, instr.operand);
                    WriteLabels(ildesc, instr.labels);
                    WriteBlocks(ildesc, instr.blocks);
                }
            }

            return(sb.ToString());
        }