Esempio n. 1
0
  @Override
  protected void outputLocalInfo(XmlWriter writer) {
    super.outputLocalInfo(writer);

    // Opcode

    if (opcode != null) writer.write("code", opcode.getID());

    // Label

    if (label != null) writer.write("label", label);

    // Immediate operands

    if (reference != null) reference.output(writer);

    if ((targets == null) && (operand != null)) writer.write(operand);

    // Switch-like instructions

    if ((targets != null) && (targets.size() > 0)) {

      ReadOnlyCollection<Integer> labels = targets.keys();

      for (int key : labels) {
        writer.start("target");
        writer.write("key", key);
        writer.write(targets.get(key));
        writer.end("target");
      }

      if (operand != null) {
        writer.start("default");
        writer.write(operand);
        writer.end("default");
      }
    }
  }
Esempio n. 2
0
 public void removeTarget(int key) {
   targets.remove(key);
 }
Esempio n. 3
0
 public int getTargetCount() {
   if (targets != null) return targets.size();
   else return 0;
 }
Esempio n. 4
0
  public void addTarget(int key, String target) {
    if (targets == null) targets = new DynamicDictionary<Integer, String>();

    targets.set(key, target);
  }
Esempio n. 5
0
 public String getTarget(int key) {
   return targets.get(key);
 }