public XElement Visit(LookupSwitchOpcode opcode, AbcMethodBodyInstruction arg) { var res = new XElement("lookupswitch"); res.Add(new XAttribute("default", FormatRelativeOffset(opcode.DefaultRelativeOffset, arg))); for (var i = 0; i < opcode.CasesRelativeOffset.Count; i++) { res.Add(new XElement("case", new XAttribute("index", i), new XAttribute("target", FormatRelativeOffset(opcode.CasesRelativeOffset[i], arg)))); } return(res); }
public BaseAvm2Opcode Visit(LookupSwitchOpcode opcode, AbcDataReader arg) { opcode.DefaultRelativeOffset = arg.ReadS24(); var cases = arg.ReadU30(); for (var i = 0; i <= cases; i++) { opcode.CasesRelativeOffset.Add(arg.ReadS24()); } return(opcode); }