2 // Mono.ILASM.SwitchInstr
5 // Jackson Harper (Jackson@LatitudeGeo.com)
7 // (C) 2003 Jackson Harper, All rights reserved
12 using System.Collections;
14 namespace Mono.ILASM {
16 public class SwitchInstr : IInstr {
18 private ArrayList label_list;
20 public SwitchInstr (ArrayList label_list)
22 this.label_list = label_list;
25 public void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil)
28 PEAPI.CILLabel[] label_array;
30 if (label_list != null) {
31 label_array = new PEAPI.CILLabel[label_list.Count];
32 foreach (object lab in label_list) {
34 label_array[count++] = meth.GetLabelDef ((string) lab);
36 throw new NotImplementedException ("offsets in switch statements.");
40 label_array = new PEAPI.CILLabel [0];
43 cil.Switch (label_array);