コード例 #1
0
ファイル: ILSerializer.cs プロジェクト: krypt-lynx/RWLayout
        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());
        }
コード例 #2
0
ファイル: ILSerializer.cs プロジェクト: krypt-lynx/RWLayout
        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());
        }