emitClass() 공개 메소드

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 emitClass ( string baseQName, string qname, string interfaces, TypeAttr attr ) : void
baseQName string
qname string
interfaces string
attr TypeAttr
리턴 void
예제 #1
0
파일: FPodEmit.cs 프로젝트: nomit007/f4
        //////////////////////////////////////////////////////////////////////////
        // Emit
        //////////////////////////////////////////////////////////////////////////
        public static void emit(Emitter emitter, FPod pod)
        {
            //FPodEmit emit = new FPodEmit(pod);

              TypeAttr tattr = TypeAttr.Public | TypeAttr.Sealed;
              FieldAttr fattr = FieldAttr.Public | FieldAttr.Static;

              emitter.emitClass("System.Object", FanUtil.toDotnetTypeName(pod.m_podName, "$Pod", false),
            new string[0], tattr);

              pod.readLiterals();

              // generate constant fields other types will reference, we don't
              // initialize them, rather we do that later via reflection
              for (int i=0; i<pod.m_literals.m_ints.size(); i++)
            emitter.emitField("I" + i, "System.Int64", fattr);
              for (int i=0; i<pod.m_literals.m_floats.size(); i++)
            emitter.emitField("F" + i, "System.Double", fattr);
              for (int i=0; i<pod.m_literals.m_decimals.size(); i++)
            emitter.emitField("D" + i, "Fan.Sys.BigDecimal", fattr);
              for (int i=0; i<pod.m_literals.m_strs.size(); i++)
            emitter.emitField("S" + i, "System.String", fattr);
              for (int i=0; i<pod.m_literals.m_durations.size(); i++)
            emitter.emitField("Dur" + i, "Fan.Sys.Duration", fattr);
              for (int i=0; i<pod.m_literals.m_uris.size(); i++)
            emitter.emitField("U" + i, "Fan.Sys.Uri", fattr);
        }
예제 #2
0
파일: FPodEmit.cs 프로젝트: syatanic/fantom
        //////////////////////////////////////////////////////////////////////////
        // Emit
        //////////////////////////////////////////////////////////////////////////

        public static void emit(Emitter emitter, FPod pod)
        {
            //FPodEmit emit = new FPodEmit(pod);

            TypeAttr  tattr = TypeAttr.Public | TypeAttr.Sealed;
            FieldAttr fattr = FieldAttr.Public | FieldAttr.Static;

            emitter.emitClass("System.Object", FanUtil.toDotnetTypeName(pod.m_podName, "$Pod", false),
                              new string[0], tattr);

            pod.readLiterals();

            // generate constant fields other types will reference, we don't
            // initialize them, rather we do that later via reflection
            for (int i = 0; i < pod.m_literals.m_ints.size(); i++)
            {
                emitter.emitField("I" + i, "System.Int64", fattr);
            }
            for (int i = 0; i < pod.m_literals.m_floats.size(); i++)
            {
                emitter.emitField("F" + i, "System.Double", fattr);
            }
            for (int i = 0; i < pod.m_literals.m_decimals.size(); i++)
            {
                emitter.emitField("D" + i, "Fan.Sys.BigDecimal", fattr);
            }
            for (int i = 0; i < pod.m_literals.m_strs.size(); i++)
            {
                emitter.emitField("S" + i, "System.String", fattr);
            }
            for (int i = 0; i < pod.m_literals.m_durations.size(); i++)
            {
                emitter.emitField("Dur" + i, "Fan.Sys.Duration", fattr);
            }
            for (int i = 0; i < pod.m_literals.m_uris.size(); i++)
            {
                emitter.emitField("U" + i, "Fan.Sys.Uri", fattr);
            }
        }