@Override
protected void visit(final ActionConstantPool instruction) {
add(sb, "ConstantPool");
final StringList strings = instruction.getConstantPool();
if (strings.size() != 0) {
sb.append('\n');
}
for (int i = 0; i < strings.size(); i++) {
final AsciiString string = strings.get(i);
sb.append(String.format(" %03d: \"%s\"", i, string.value()));
if (i != strings.size() - 1) {
sb.append('\n');
}
}
}
@Override
protected void visit(final ActionDecrement instruction) {
add(sb, "Decrement");
}
@Override
protected void visit(final ActionDefineFunction instruction) {
add(sb, "DefineFunction");
add(sb, " ");
add(sb, instruction.getFunctionName().value());
sb.append('\n');
sb.append("{\n");
sb.append(getCodeText(instruction.getCode(), " "));
sb.append("\n}");
}
@Override
protected void visit(final ActionDefineFunction2 instruction) {
add(sb, "DefineFunction2");
add(sb, " ");
add(sb, instruction.getFunctionName().value());
sb.append('\n');
sb.append("{\n");
sb.append(getCodeText(instruction.getActionList(), " "));
sb.append("\n}");
}
@Override
protected void visit(final ActionDefineLocal instruction) {
add(sb, "DefineLocal");
}
@Override
protected void visit(final ActionDefineLocal2 instruction) {
add(sb, "DefineLocal2");
}
@Override
protected void visit(final ActionDelete instruction) {
add(sb, "Visit");
}
@Override
protected void visit(final ActionDelete2 instruction) {
add(sb, "Delete2");
}
@Override
protected void visit(final ActionDivide instruction) {
add(sb, "Divide");
}
@Override
protected void visit(final ActionEndDrag instruction) {
add(sb, "EndDrag");
}
@Override
protected void visit(final ActionEnumerate instruction) {
add(sb, "Enumerate");
}
@Override
protected void visit(final ActionEnumerate2 instruction) {
add(sb, "Enumerate2");
}
@Override
protected void visit(final ActionEquals instruction) {
add(sb, "Equals");
}
@Override
protected void visit(final ActionEquals2 instruction) {
add(sb, "Equals2");
}
@Override
protected void visit(final ActionExtends instruction) {
add(sb, "Extends");
}
@Override
protected void visit(final ActionGetMember instruction) {
add(sb, "GetMember");
}
@Override
protected void visit(final ActionGetProperty instruction) {
add(sb, "GetProperty");
}
@Override
protected void visit(final ActionGetTime instruction) {
add(sb, "GetTime");
}
@Override
protected void visit(final ActionGetURL instruction) {
add(sb, "GetURL", instruction.getUrlString().value(), instruction.getTargetString().value());
}
@Override
protected void visit(final ActionGetURL2 instruction) {
add(sb, "GetURL2");
}
@Override
protected void visit(final ActionGetVariable instruction) {
add(sb, "GetVariable");
}
@Override
protected void visit(final ActionGotoFrame instruction) {
add(sb, "GotoFrame", instruction.getFrame().value());
}
@Override
protected void visit(final ActionGotoFrame2 instruction) {
add(sb, "GotoFrame2");
}
@Override
protected void visit(final ActionGotoLabel instruction) {
add(sb, "GotoLabel", instruction.getLabel().value());
}
@Override
protected void visit(final ActionGreater instruction) {
add(sb, "Greater");
}
@Override
protected void visit(final ActionIf instruction) {
addHex(sb, "If", (instruction.getBitPosition() - firstOffset) / 8 + instruction.getBitLength() / 8 + instruction.getBranchOffset().value());
}
@Override
protected void visit(final ActionImplementsOp instruction) {
add(sb, "ImplementsOp");
}
@Override
protected void visit(final ActionIncrement instruction) {
add(sb, "Increment");
}
@Override
protected void visit(final ActionInitArray instruction) {
add(sb, "InitArray");
}
@Override
protected void visit(final ActionInitObject instruction) {
add(sb, "InitObject");
}
@Override
protected void visit(final ActionInstanceOf instruction) {
add(sb, "InstanceOf");
}
@Override
protected void visit(final ActionJump instruction) {
addHex(sb, "Jump", (instruction.getBitPosition() - firstOffset) / 8 + instruction.getBitLength() / 8 + instruction.getBranchOffset().value());
}
@Override
protected void visit(final ActionLess instruction) {
add(sb, "Less");
}
@Override
protected void visit(final ActionLess2 instruction) {
add(sb, "Less2");
}
@Override
protected void visit(final ActionMBAsciiToChar instruction) {
add(sb, "MBASCIIToChar");
}
@Override
protected void visit(final ActionMBCharToAscii instruction) {
add(sb, "MBCharToASCII");
}
@Override
protected void visit(final ActionMBStringExtract instruction) {
add(sb, "MBStringExtract");
}
@Override
protected void visit(final ActionMBStringLength instruction) {
add(sb, "MBStringLength");
}
@Override
protected void visit(final ActionModulo instruction) {
add(sb, "Modulo");
}
@Override
protected void visit(final ActionMultiply instruction) {
add(sb, "Multiply");
}
@Override
protected void visit(final ActionNewMethod instruction) {
add(sb, "NewMethod");
}
@Override
protected void visit(final ActionNewObject instruction) {
add(sb, "NewObject");
}
@Override
protected void visit(final ActionNextFrame instruction) {
add(sb, "NextFrame");
}
@Override
protected void visit(final ActionNot instruction) {
add(sb, "Not");
}
@Override
protected void visit(final ActionOr instruction) {
add(sb, "Or");
}
@Override
protected void visit(final ActionPlay instruction) {
add(sb, "Play");
}
@Override
protected void visit(final ActionPop instruction) {
add(sb, "Pop");
}
@Override
protected void visit(final ActionPreviousFrame instruction) {
add(sb, "PreviousFrame");
}
@Override
protected void visit(final ActionPush instruction) {
add(sb, "Push");
final PushedValueList strings = instruction.getPushedValueList();
if (strings.size() != 0) {
sb.append('\n');
}
for (int i = 0; i < strings.size(); i++) {
final PushedValue<?> string = strings.get(i);
if (string instanceof PushedBoolean) {
sb.append(String.format(" %03d: %b", i, ((PushedBoolean)string).getValue().value()));
}
else if (string instanceof PushedConstant16) {
sb.append(String.format(" %03d: constant : %d", i, ((PushedConstant16)string).getValue().value()));
}
else if (string instanceof PushedConstant8) {
sb.append(String.format(" %03d: constant : %d", i, ((PushedConstant8)string).getValue().value()));
}
else if (string instanceof PushedDouble) {
sb.append(String.format(" %03d: %f", i, ((PushedDouble)string).getValue().value()));
}
else if (string instanceof PushedFloat) {
sb.append(String.format(" %03d: %f", i, ((PushedFloat)string).getValue().value()));
}
else if (string instanceof PushedInteger) {
sb.append(String.format(" %03d: %d", i, ((PushedInteger)string).getValue().value()));
}
else if (string instanceof PushedNull) {
sb.append(String.format(" %03d: null", i));
}
else if (string instanceof PushedRegisterNumber) {
sb.append(String.format(" %03d: r%d", i, ((PushedRegisterNumber)string).getValue().value()));
}
else if (string instanceof PushedString) {
sb.append(String.format(" %03d: \"%s\"", i, ((PushedString)string).getValue().value()));
}
else if (string instanceof PushedUndefined) {
sb.append(String.format(" %03d: undefined", i));
}
else if (string instanceof PushedUnknown) {
sb.append(String.format(" %03d: unknown", i));
}
if (i != strings.size() - 1) {
sb.append('\n');
}
}
}