public IEnumerable <TypedCH> GetCHs(OPCode opcode) { D.Assert(opcode.GetType() == opcode_type); foreach (var fi in CH_FIs) { yield return((TypedCH)fi.GetValue(opcode)); } }
public static JsonObject conv(OPCode opc) { var J_opc = new JsonObject(); J_opc["kind"] = "opcode"; J_opc["id"] = ID(opc); J_opc["name"] = opc.GetType().Name; return(J_opc); }
public IEnumerable <CH_Edge> GetCH_edges(OPCode opcode) { D.Assert(opcode.GetType() == opcode_type); foreach (var fi in CH_FIs) { yield return new CH_Edge { CH = (TypedCH)fi.GetValue(opcode), fieldname = fi.Name } } ; } }
public static IEnumerable <CH_Edge> OP2CH_edge(OPCode op) => new OPC_reflector(op.GetType()).GetCH_edges(op); // todo cache the reflectors per type somewhere
// evilish and reflectiony because i don't want to put additional demands on the base types // ... at least yet public static IEnumerable <TypedCH> OP2CHs(OPCode op) => new OPC_reflector(op.GetType()).GetCHs(op); // todo cache the reflectors per type somewhere