use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXCodeAdapter method visitTableSwitchInsn.
public final void visitTableSwitchInsn(final int min, final int max, final Label dflt, final Label[] labels) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", "min", "min", "", Integer.toString(min));
attrs.addAttribute("", "max", "max", "", Integer.toString(max));
attrs.addAttribute("", "dflt", "dflt", "", getLabel(dflt));
String o = AbstractVisitor.OPCODES[Opcodes.TABLESWITCH];
addStart(o, attrs);
for (int i = 0; i < labels.length; i++) {
AttributesImpl att2 = new AttributesImpl();
att2.addAttribute("", "name", "name", "", getLabel(labels[i]));
addElement("label", att2);
}
addEnd(o);
}
use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXCodeAdapter method visitFrame.
public void visitFrame(final int type, final int nLocal, final Object[] local, final int nStack, final Object[] stack) {
AttributesImpl attrs = new AttributesImpl();
switch(type) {
case Opcodes.F_NEW:
case Opcodes.F_FULL:
if (type == Opcodes.F_NEW) {
attrs.addAttribute("", "type", "type", "", "NEW");
} else {
attrs.addAttribute("", "type", "type", "", "FULL");
}
addStart("frame", attrs);
appendFrameTypes(true, nLocal, local);
appendFrameTypes(false, nStack, stack);
break;
case Opcodes.F_APPEND:
attrs.addAttribute("", "type", "type", "", "APPEND");
addStart("frame", attrs);
appendFrameTypes(true, nLocal, local);
break;
case Opcodes.F_CHOP:
attrs.addAttribute("", "type", "type", "", "CHOP");
attrs.addAttribute("", "count", "count", "", Integer.toString(nLocal));
addStart("frame", attrs);
break;
case Opcodes.F_SAME:
attrs.addAttribute("", "type", "type", "", "SAME");
addStart("frame", attrs);
break;
case Opcodes.F_SAME1:
attrs.addAttribute("", "type", "type", "", "SAME1");
addStart("frame", attrs);
appendFrameTypes(false, 1, stack);
break;
}
addEnd("frame");
}
use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXCodeAdapter method visitTryCatchBlock.
public final void visitTryCatchBlock(final Label start, final Label end, final Label handler, final String type) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", "start", "start", "", getLabel(start));
attrs.addAttribute("", "end", "end", "", getLabel(end));
attrs.addAttribute("", "handler", "handler", "", getLabel(handler));
if (type != null) {
attrs.addAttribute("", "type", "type", "", type);
}
addElement("TryCatch", attrs);
}
use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXCodeAdapter method visitJumpInsn.
public final void visitJumpInsn(final int opcode, final Label label) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", "label", "label", "", getLabel(label));
addElement(AbstractVisitor.OPCODES[opcode], attrs);
}
use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXCodeAdapter method visitLabel.
public final void visitLabel(final Label label) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", "name", "name", "", getLabel(label));
addElement("Label", attrs);
}
Aggregations