protected int resolveLabel(LabelNode label) {
   if (labels.containsKey(label)) {
     return labels.get(label);
   } else {
     int newLabelIndex = labels.size() + 1;
     labels.put(label, newLabelIndex);
     return newLabelIndex;
   }
 }
Esempio n. 2
0
  public LabelNode getOrCreateGotoLabel(String name) {
    name = name.toLowerCase();
    if (gotoLabels == null) gotoLabels = new HashMap<String, LabelNode>();

    LabelNode label = gotoLabels.get(name);
    if (label == null) gotoLabels.put(name, label = new LabelNode());

    return label;
  }
Esempio n. 3
0
 public LocalVariable addLocalVariable(String variable, LabelNode label, Class clazz) {
   LocalVariable result;
   localVariables.put(
       variable, result = new LocalVariable(variable, localVariables.size(), label, clazz));
   return result;
 }