src/sys/dotnet/fanx/emit/Emitter.cs
/// <summary>
/// Define a new class to emit for this assembly. This class
/// becomes the 'current' class, where subsequent EmitMethod
/// and EmitField calls will popuate this class.
/// </summary>
Define a new class to emit for this assembly. This class
becomes the 'current' class, where subsequent EmitMethod
and EmitField calls will popuate this class.
Define a new class to emit for this assembly . This class becomes the ' current ' class where subsequent EmitMethod and EmitField calls will popuate this class .
public void emitClass(string baseQName, string qname, string[] interfaces, TypeAttr attr)
    {
      string[] s = FanUtil.splitQName(qname);
      className = qname;
      classDef = (ClassDef)types[qname];
      if (classDef == null)
      {
        if (qname.IndexOf("/") != -1)
        {
          PERWAPI.ClassDef cdef = (PERWAPI.ClassDef)findType(s[0]);
          classDef = cdef.AddNestedClass(attr, s[1]);
        }
        else
        {
          classDef = peFile.AddClass(attr, s[0], s[1]);
        }
      }
      else
      {
        classDef.SetAttribute(attr);
      }
      if (baseQName == null)
        classDef.SuperType = null;
      else
        classDef.SuperType = findType(baseQName) as PERWAPI.Class;
      for (int i=0; i<interfaces.Length; i++)
        classDef.AddImplementedInterface(findType(interfaces[i]) as PERWAPI.Class);
      types[qname] = classDef;
    }
public void emitClass ( string baseQName , string qname , string [ ] interfaces , TypeAttr attr ) { string [ ] s = FanUtil . splitQName ( qname ) ; className = qname ; classDef = ( ClassDef ) types [ qname ] ; if ( classDef == null ) { if ( qname . IndexOf ( " " ) != - 1 ) { PERWAPI . ClassDef cdef = ( PERWAPI . ClassDef ) findType ( s [ 0 ] ) ; classDef = cdef . AddNestedClass ( attr , s [ 1 ] ) ; } else { classDef = peFile . AddClass ( attr , s [ 0 ] , s [ 1 ] ) ; } } else { classDef . SetAttribute ( attr ) ; } if ( baseQName == null ) classDef . SuperType = null ; else classDef . SuperType = findType ( baseQName ) as PERWAPI . Class ; for ( int i = 0 ; i < interfaces . Length ; i ++ ) classDef . AddImplementedInterface ( findType ( interfaces [ i ] ) as PERWAPI . Class ) ; types [ qname ] = classDef ; }
Define a new class to emit for this assembly.
Define a new class to emit for this assembly .
// first check if this type was already stubbed out // if not, we need to create it // Nested class // Normal class // if stubbed out, make sure we define the type correctly // base class // interfaces
baseQName
string
qname
string
interfaces
string[]
attr
TypeAttr