public emitClass ( string baseQName, string qname, string interfaces, TypeAttr attr ) : void | ||
baseQName | string | |
qname | string | |
interfaces | string | |
attr | TypeAttr | |
Результат | void |
////////////////////////////////////////////////////////////////////////// // 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); }
////////////////////////////////////////////////////////////////////////// // 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); } }