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;
   }
 }
Exemplo 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;
  }
Exemplo 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;
 }