internal override void Write(CILWriter output) { output.Write(" .field "); if (hasOffset) { output.Write("[ {0} ] ", offset); } WriteFlags(output, flags); if (marshalType != null) { output.Write("marshal "); marshalType.Write(output); } type.WriteType(output); output.Write(" " + name); if (initVal != null) { initVal.Write(output); } else if (constVal != null) { constVal.Write(output); } output.WriteLine(); }
internal override void Write(CILWriter output) { if (twoByteInstr) { output.Write(FEopcode[instr]); } else { output.Write(opcode[instr]); } output.WriteLine(" " + val); }
internal override void Write(CILWriter output) { output.WriteLine("ldstr \"" + val + "\""); }
internal override void Write(CILWriter output) { output.Write(GetInstrString()); theType.WriteName(output); output.WriteLine(); }
internal override void Write(CILWriter output) { output.WriteLine(".assembly " + name + " { }"); }
internal override void Write(CILWriter output) { output.Write(GetInstrString()); signature.Write(output); output.WriteLine(); }
internal override void Write(CILWriter output) { output.WriteLine(opcode[instr] + " " + val); }
internal override void Write(CILWriter output) { output.Write(GetInstrString()); field.WriteType(output); output.WriteLine(); }
internal override void Write(CILWriter output) { output.WriteLine("ldc.r4 " + fVal); }
internal override void Write(CILWriter output) { output.WriteLine("Label" + num + ":"); }
internal override void Write(CILWriter output) { output.WriteLine(".emitbyte " + Hex.Byte(byteVal)); // ???? CHECK THIS ???? }
internal override void Write(CILWriter output) { output.WriteLine(GetInstrString() + dest.GetInstName()); }
/// <summary> /// Write out a line instruction to the CIL file. /// </summary> /// <param name="output">The CIL instruction writer to use to write this instruction.</param> internal override void Write(CILWriter output) { if (output.Debug) { string lineDetails = startLine + ", " + startCol; if (hasEnd) { lineDetails += ", " + endLine + ", " + endCol; if (sourceFile != null) { lineDetails += ", " + sourceFile.Name; } } output.WriteLine(".line " + lineDetails); } }
internal override void Write(CILWriter output) { output.Write(" .method "); WriteFlags(output, methFlags); sig.Write(output); output.Write(" " + name + "("); if (parList != null) { for (int i = 0; i < parList.Length; i++) { parList[i].Write(output); if (i < parList.Length - 1) { output.Write(", "); } } } output.Write(") "); uint codeType = implFlags & (uint)0x11; if (codeType == 0) { output.Write("cil "); } else if (codeType == 1) { output.Write("native "); } else if (codeType == 3) { output.Write("runtime "); } if ((implFlags & (uint)ImplAttr.Unmanaged) == 0) { output.Write("managed "); } else { output.Write("unmanaged "); } if ((implFlags & (uint)ImplAttr.ForwardRef) != 0) { output.Write("forwardref "); } if ((implFlags & (uint)ImplAttr.InternalCall) != 0) { output.Write("internalcall "); } if ((implFlags & (uint)ImplAttr.Synchronized) != 0) { output.Write("synchronized "); } if ((implFlags & (uint)ImplAttr.NoInLining) != 0) { output.Write("noinlining "); } output.WriteLine(" {"); if ((locals != null) && (locals.Length > 0)) { output.Write(" .locals ("); for (int i = 0; i < locals.Length; i++) { if (i > 0) { output.Write(" "); } locals[i].Write(output); if (i < locals.Length - 1) { output.WriteLine(","); } } output.WriteLine(" )"); } if (entryPoint) { output.WriteLine(" .entrypoint"); } if (code != null) code.Write(output); output.WriteLine(" }"); }
internal override void Write(CILWriter output) { output.WriteLine("ldc.i8 " + val); }
internal override void Write(CILWriter output) { output.Write(".class "); WriteFlags(output); if (!string.IsNullOrEmpty(NameSpace)) { output.Write(NameSpace + "."); } output.WriteLine(Name); if (superType != null) { output.Write(" extends "); superType.WriteName(output); } if (interfaces.Count > 0) { output.Write(" implements "); for (int i = 0; i < interfaces.Count; i++) { InterfaceImpl impl = (InterfaceImpl)interfaces[i]; if (i > 0) output.Write(", "); impl.TheInterface().WriteName(output); } } output.WriteLine(); output.WriteLine("{"); for (int i = 0; i < fields.Count; i++) { ((Field)fields[i]).Write(output); output.WriteLine(); } for (int i = 0; i < methods.Count; i++) { ((MethodDef)methods[i]).Write(output); output.WriteLine(); } for (int i = 0; i < methodImpls.Count; i++) { ((MethodImpl)methodImpls[i]).Write(output); output.WriteLine(); } for (int i = 0; i < events.Count; i++) { ((Event)events[i]).Write(output); output.WriteLine(); } for (int i = 0; i < properties.Count; i++) { ((Property)properties[i]).Write(output); output.WriteLine(); } output.WriteLine("}"); output.WriteLine(); }
internal override void Write(CILWriter output) { output.Write(" .method "); WriteFlags(output, methFlags); sig.Write(output); output.Write(" " + name + "("); if (parList != null) { for (int i = 0; i < parList.Length; i++) { parList[i].Write(output); if (i < parList.Length - 1) { output.Write(", "); } } } output.Write(") "); uint codeType = implFlags & (uint)0x11; if (codeType == 0) { output.Write("cil "); } else if (codeType == 1) { output.Write("native "); } else if (codeType == 3) { output.Write("runtime "); } if ((implFlags & (uint)ImplAttr.Unmanaged) == 0) { output.Write("managed "); } else { output.Write("unmanaged "); } if ((implFlags & (uint)ImplAttr.ForwardRef) != 0) { output.Write("forwardref "); } if ((implFlags & (uint)ImplAttr.InternalCall) != 0) { output.Write("internalcall "); } if ((implFlags & (uint)ImplAttr.Synchronized) != 0) { output.Write("synchronized "); } if ((implFlags & (uint)ImplAttr.NoInLining) != 0) { output.Write("noinlining "); } output.WriteLine(" {"); if ((locals != null) && (locals.Length > 0)) { output.Write(" .locals ("); for (int i = 0; i < locals.Length; i++) { if (i > 0) { output.Write(" "); } locals[i].Write(output); if (i < locals.Length - 1) { output.WriteLine(","); } } output.WriteLine(" )"); } if (entryPoint) { output.WriteLine(" .entrypoint"); } if (code != null) { code.Write(output); } output.WriteLine(" }"); }