internal virtual void Write(CILWriter output) { }
internal override void Write(CILWriter output) { if (twoByteInstr) { output.WriteLine(FEopcode[instr]); } else { output.WriteLine(opcode[instr]); } }
internal override void Write(CILWriter output) { output.WriteLine(opcode[instr] + " " + val); }
internal override void BuildCILInfo(CILWriter output) { parent.BuildCILInfo(output); }
internal override void BuildCILInfo(CILWriter output) { for (int i = 0; i < constraints.Count; i++) { Class cClass = (Class)constraints[i]; if (!cClass.isDef()) { cClass.BuildCILInfo(output); } } }
internal override sealed void BuildCILInfo(CILWriter output) { if (!type.isDef()) type.BuildCILInfo(output); }
internal override void BuildCILInfo(CILWriter output) { if (field == null) throw new InstructionException(IType.fieldOp,instr); if (field is FieldRef) field.BuildCILInfo(output); }
internal override void Write(CILWriter output) { output.Write(".class "); WriteFlags(output); if ((nameSpace != null) && (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 WriteName(CILWriter output) { if ((nameSpace == null) || (nameSpace == "")) { output.Write(name); } else { output.Write(nameSpace + "." + name); } }
internal override void Write(CILWriter output) { output.WriteLine("Label" + num + ":"); }
internal override void BuildCILInfo(CILWriter output) { if ((superType != null) && !(superType is ClassDef)) { superType.BuildCILInfo(output); } for (int i = 0; i < genericParams.Count; i++) { ((GenericParam)genericParams[i]).BuildCILInfo(output); } if (security != null) { for (int i = 0; i < security.Count; i++) { ((DeclSecurity)security[i]).BuildCILInfo(output); } } // Console.WriteLine("Building CIL info for " + name); // Console.WriteLine("adding methods " + methods.Count); for (int i = 0; i < methods.Count; i++) { ((MethodDef)methods[i]).BuildCILInfo(output); } // Console.WriteLine("adding fields"); for (int i = 0; i < fields.Count; i++) { ((FieldDef)fields[i]).BuildCILInfo(output); } // Console.WriteLine("adding interfaceimpls and methodimpls"); if (interfaces.Count > 0) { for (int i = 0; i < interfaces.Count; i++) { ((InterfaceImpl)interfaces[i]).BuildCILInfo(output); } } if (methodImpls.Count > 0) { for (int i = 0; i < methodImpls.Count; i++) { ((MethodImpl)methodImpls[i]).BuildCILInfo(output); } } for (int i = 0; i < events.Count; i++) { ((Event)events[i]).BuildCILInfo(output); } for (int i = 0; i < properties.Count; i++) { ((Property)properties[i]).BuildCILInfo(output); } // Console.WriteLine("Adding nested classes"); for (int i = 0; i < nestedClasses.Count; i++) { ((ClassDef)nestedClasses[i]).BuildCILInfo(output); } // Console.WriteLine("End of building tables"); }
internal override void BuildCILInfo(CILWriter output) { if (num == -1) { num = labelNum++; } }
internal void Write(CILWriter output) { for (int i=0; i < tide; i++) { if (!(buffer[i] is CILLabel)) { output.Write(" "); } output.Write(" "); buffer[i].Write(output); } if (exceptions != null) { throw new NotYetImplementedException("Exceptions not yet implemented for CIL Instructions"); // Console.WriteLine("Writing exceptions"); // Console.WriteLine("header = " + Hex.Short(exceptHeader) + " exceptSize = " + Hex.Int(exceptSize)); //output.Write(exceptHeader); //output.Write3Bytes((uint)exceptSize); //for (int i = 0; i < exceptions.Count; i++) { // TryBlock tryBlock = (TryBlock)exceptions[i]; // tryBlock.Write(output, fatExceptionFormat); //} } }
internal void BuildCILInfo(CILWriter output) { for (int i=0; i < tide; i++) { buffer[i].BuildCILInfo(output); } if (exceptions != null) { for (int i=0; i < exceptions.Count; i++) { ((TryBlock)exceptions[i]).BuildCILInfo(output); } } }
internal override void Write(CILWriter output) { throw new NotYetImplementedException("Write CIL for event"); }
internal override void WriteType(CILWriter output) { output.Write("class "); WriteName(output); }
internal override void WriteType(CILWriter output) { type.WriteType(output); output.Write(" "); parent.WriteName(output); output.Write("::" + name); }
private void WriteFlags(CILWriter output) { uint vis = flags & VisibilityMask; switch (vis) { case 0 : output.Write("private "); break; case 1 : output.Write("public "); break; case 2 : output.Write("nested public "); break; case 3 : output.Write("nested private "); break; case 4 : output.Write("nested family "); break; case 5 : output.Write("nested assembly "); break; case 6 : output.Write("nested famandassem "); break; case 7 : output.Write("nested famorassem "); break; } uint layout = flags & LayoutMask; if (layout == 0) { output.Write("auto "); } else if (layout == (uint)TypeAttr.ExplicitLayout) { output.Write("explicit "); } else { output.Write("sequential "); } if ((flags & (uint)TypeAttr.Interface) != 0) { output.Write("interface "); } if ((flags & (uint)TypeAttr.Abstract) != 0) { output.Write("abstract "); } else if ((flags & (uint)TypeAttr.Sealed) != 0) { output.Write("sealed "); } uint strForm = flags & StringFormatMask; if (strForm == 0) { output.Write("ansi "); } else if (strForm == (uint)TypeAttr.UnicodeClass) { output.Write("unicode "); } else { output.Write("autochar "); } if ((flags & (uint)TypeAttr.BeforeFieldInit) != 0) { output.Write("beforefieldinit "); } if ((flags & (uint)TypeAttr.Serializable) != 0) { output.Write("serializable "); } if ((flags & (uint)TypeAttr.SpecialName) != 0) { output.Write("specialname "); } if ((flags & (uint)TypeAttr.RTSpecialName) != 0) { output.Write("rtsspecialname "); } }
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 sealed void BuildCILInfo(CILWriter output) { if (!(elemType is ClassDef)) elemType.BuildCILInfo(output); }
internal override void Write(CILWriter output) { output.Write(GetInstrString()); field.WriteType(output); output.WriteLine(); }
internal override void BuildCILInfo(CILWriter output) { if (!special && scope != null) { output.AddRef(scope); } }
internal override void Write(CILWriter output) { output.WriteLine("ldc.r4 " + fVal); }
internal override void WriteType(CILWriter output) { if ((nameSpace == null) || (nameSpace == "")) { output.Write("[" + scope.Name() +"]" + name); } else { output.Write("[" + scope.Name() +"]" + nameSpace + "." + name); } }
internal virtual void BuildCILInfo(CILWriter output) { }
internal virtual void Write(CILWriter output) { throw new NotYetImplementedException("Constant values for CIL"); }
internal override void Write(CILWriter output) { output.WriteLine(".assembly " + name + " { }"); }
internal override void BuildCILInfo(CILWriter output) { eventType.BuildCILInfo(output); }
/// <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.WriteLine(".emitbyte " + Hex.Byte(byteVal)); // ???? CHECK THIS ???? }