Example #1
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("xils:" + Name + "(");
            sb.Append(string.Join <ArgumentDescriptor>(", ", Arguments));
            sb.AppendLine(")");
            sb.AppendLine("{");
            foreach (Variable local in Locals)
            {
                sb.Append("  " + local.Type + " " + local.Name);
            }
            sb.AppendLine();
            string fmt = "D" + ((Instructions.Length - 1).ToString()).Length.ToString();

            for (int i = 0; i < Instructions.Length; i++)
            {
                sb.Append(i.ToString(fmt) + ": ");
                XILSInstr instr = Instructions[i];
                sb.AppendLine(instr.ToString());
            }
            sb.AppendLine("}");
            return(sb.ToString());
        }