Inheritance: System.IO.StreamWriter
Exemplo n.º 1
0
 internal virtual void Write(CILWriter output)
 {
 }
Exemplo n.º 2
0
 internal override void Write(CILWriter output)
 {
     if (twoByteInstr) {
         output.WriteLine(FEopcode[instr]);
     } else {
         output.WriteLine(opcode[instr]);
     }
 }
Exemplo n.º 3
0
 internal override void Write(CILWriter output)
 {
     output.WriteLine(opcode[instr] + " " + val);
 }
Exemplo n.º 4
0
 internal override void BuildCILInfo(CILWriter output)
 {
     parent.BuildCILInfo(output);
 }
Exemplo n.º 5
0
 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);
         }
     }
 }
Exemplo n.º 6
0
 internal override sealed void BuildCILInfo(CILWriter output)
 {
     if (!type.isDef()) type.BuildCILInfo(output);
 }
Exemplo n.º 7
0
 internal override void BuildCILInfo(CILWriter output)
 {
     if (field == null) throw new InstructionException(IType.fieldOp,instr);
     if (field is FieldRef) field.BuildCILInfo(output);
 }
Exemplo n.º 8
0
        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();
        }
Exemplo n.º 9
0
 internal override void WriteName(CILWriter output)
 {
     if ((nameSpace == null) || (nameSpace == "")) {
         output.Write(name);
     } else {
         output.Write(nameSpace + "." + name);
     }
 }
Exemplo n.º 10
0
 internal override void Write(CILWriter output)
 {
     output.WriteLine("Label" + num + ":");
 }
Exemplo n.º 11
0
 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");
 }
Exemplo n.º 12
0
 internal override void BuildCILInfo(CILWriter output)
 {
     if (num == -1) {
         num = labelNum++;
     }
 }
Exemplo n.º 13
0
 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);
         //}
     }
 }
Exemplo n.º 14
0
 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);
         }
     }
 }
Exemplo n.º 15
0
 internal override void Write(CILWriter output)
 {
     throw new NotYetImplementedException("Write CIL for event");
 }
Exemplo n.º 16
0
 internal override void WriteType(CILWriter output)
 {
     output.Write("class ");
     WriteName(output);
 }
Exemplo n.º 17
0
 internal override void WriteType(CILWriter output)
 {
     type.WriteType(output);
     output.Write(" ");
     parent.WriteName(output);
     output.Write("::" + name);
 }
Exemplo n.º 18
0
 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 ");
     }
 }
Exemplo n.º 19
0
 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();
 }
Exemplo n.º 20
0
 internal override sealed void BuildCILInfo(CILWriter output)
 {
     if (!(elemType is ClassDef))
         elemType.BuildCILInfo(output);
 }
Exemplo n.º 21
0
 internal override void Write(CILWriter output)
 {
     output.Write(GetInstrString());
     field.WriteType(output);
     output.WriteLine();
 }
Exemplo n.º 22
0
 internal override void BuildCILInfo(CILWriter output)
 {
     if (!special && scope != null) {
         output.AddRef(scope);
     }
 }
Exemplo n.º 23
0
 internal override void Write(CILWriter output)
 {
     output.WriteLine("ldc.r4 " + fVal);
 }
Exemplo n.º 24
0
 internal override void WriteType(CILWriter output)
 {
     if ((nameSpace == null) || (nameSpace == "")) {
         output.Write("[" + scope.Name() +"]" + name);
     } else {
         output.Write("[" + scope.Name() +"]" + nameSpace + "." + name);
     }
 }
Exemplo n.º 25
0
 internal virtual void BuildCILInfo(CILWriter output)
 {
 }
Exemplo n.º 26
0
 internal virtual void Write(CILWriter output)
 {
     throw new NotYetImplementedException("Constant values for CIL");
 }
Exemplo n.º 27
0
 internal override void Write(CILWriter output)
 {
     output.WriteLine(".assembly " + name + " { }");
 }
Exemplo n.º 28
0
 internal override void BuildCILInfo(CILWriter output)
 {
     eventType.BuildCILInfo(output);
 }
Exemplo n.º 29
0
 /// <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);
     }
 }
Exemplo n.º 30
0
 internal override void Write(CILWriter output)
 {
     output.WriteLine(".emitbyte " + Hex.Byte(byteVal));  // ???? CHECK THIS ????
 }