From a8e30c005fd7a070ebb06f3e9c440239c54aac03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Fri, 21 Mar 2014 20:35:37 +0100 Subject: [PATCH] ABC arrays to lists refactoring AS3 parser stub --- trunk/src/com/jpexs/decompiler/flash/SWF.java | 4 +- .../com/jpexs/decompiler/flash/abc/ABC.java | 305 +-- .../decompiler/flash/abc/AVM2LocalData.java | 2 +- .../decompiler/flash/abc/ScriptPack.java | 6 +- .../decompiler/flash/abc/avm2/AVM2Code.java | 9 +- .../flash/abc/avm2/ConstantPool.java | 16 +- .../instructions/InstructionDefinition.java | 2 +- .../avm2/instructions/alchemy/Lf32Ins.java | 2 +- .../avm2/instructions/alchemy/Lf64Ins.java | 2 +- .../avm2/instructions/alchemy/Li16Ins.java | 2 +- .../avm2/instructions/alchemy/Li32Ins.java | 2 +- .../abc/avm2/instructions/alchemy/Li8Ins.java | 2 +- .../avm2/instructions/alchemy/Sf32Ins.java | 2 +- .../avm2/instructions/alchemy/Sf64Ins.java | 2 +- .../avm2/instructions/alchemy/Si16Ins.java | 2 +- .../avm2/instructions/alchemy/Si32Ins.java | 2 +- .../abc/avm2/instructions/alchemy/Si8Ins.java | 2 +- .../avm2/instructions/alchemy/Sxi16Ins.java | 2 +- .../avm2/instructions/alchemy/Sxi1Ins.java | 2 +- .../avm2/instructions/alchemy/Sxi8Ins.java | 2 +- .../avm2/instructions/arithmetic/AddIIns.java | 2 +- .../avm2/instructions/arithmetic/AddIns.java | 2 +- .../arithmetic/DecrementIIns.java | 2 +- .../instructions/arithmetic/DecrementIns.java | 2 +- .../instructions/arithmetic/DivideIns.java | 2 +- .../arithmetic/IncrementIIns.java | 2 +- .../instructions/arithmetic/IncrementIns.java | 2 +- .../instructions/arithmetic/ModuloIns.java | 2 +- .../instructions/arithmetic/MultiplyIIns.java | 2 +- .../instructions/arithmetic/MultiplyIns.java | 2 +- .../instructions/arithmetic/NegateIIns.java | 2 +- .../instructions/arithmetic/NegateIns.java | 2 +- .../avm2/instructions/arithmetic/NotIns.java | 2 +- .../instructions/arithmetic/SubtractIIns.java | 2 +- .../instructions/arithmetic/SubtractIns.java | 2 +- .../avm2/instructions/bitwise/BitAndIns.java | 2 +- .../avm2/instructions/bitwise/BitNotIns.java | 2 +- .../avm2/instructions/bitwise/BitOrIns.java | 2 +- .../avm2/instructions/bitwise/BitXorIns.java | 2 +- .../avm2/instructions/bitwise/LShiftIns.java | 2 +- .../avm2/instructions/bitwise/RShiftIns.java | 2 +- .../avm2/instructions/bitwise/URShiftIns.java | 2 +- .../instructions/comparison/EqualsIns.java | 2 +- .../comparison/GreaterEqualsIns.java | 2 +- .../comparison/GreaterThanIns.java | 2 +- .../comparison/LessEqualsIns.java | 2 +- .../instructions/comparison/LessThanIns.java | 2 +- .../comparison/StrictEqualsIns.java | 2 +- .../construction/ConstructIns.java | 4 +- .../construction/ConstructPropIns.java | 2 +- .../construction/ConstructSuperIns.java | 2 +- .../construction/NewActivationIns.java | 2 +- .../construction/NewArrayIns.java | 2 +- .../construction/NewCatchIns.java | 2 +- .../construction/NewClassIns.java | 4 +- .../construction/NewFunctionIns.java | 2 +- .../construction/NewObjectIns.java | 2 +- .../avm2/instructions/executing/CallIns.java | 2 +- .../instructions/executing/CallMethodIns.java | 4 +- .../executing/CallPropLexIns.java | 2 +- .../executing/CallPropVoidIns.java | 2 +- .../executing/CallPropertyIns.java | 2 +- .../instructions/executing/CallStaticIns.java | 4 +- .../instructions/executing/CallSuperIns.java | 2 +- .../executing/CallSuperVoidIns.java | 2 +- .../abc/avm2/instructions/jumps/IfEqIns.java | 2 +- .../avm2/instructions/jumps/IfFalseIns.java | 2 +- .../abc/avm2/instructions/jumps/IfGeIns.java | 2 +- .../abc/avm2/instructions/jumps/IfGtIns.java | 2 +- .../abc/avm2/instructions/jumps/IfLeIns.java | 2 +- .../abc/avm2/instructions/jumps/IfLtIns.java | 2 +- .../abc/avm2/instructions/jumps/IfNGeIns.java | 2 +- .../abc/avm2/instructions/jumps/IfNGtIns.java | 2 +- .../abc/avm2/instructions/jumps/IfNLeIns.java | 2 +- .../abc/avm2/instructions/jumps/IfNLtIns.java | 2 +- .../abc/avm2/instructions/jumps/IfNeIns.java | 2 +- .../instructions/jumps/IfStrictEqIns.java | 2 +- .../instructions/jumps/IfStrictNeIns.java | 2 +- .../avm2/instructions/jumps/IfTrueIns.java | 2 +- .../abc/avm2/instructions/jumps/JumpIns.java | 2 +- .../instructions/jumps/LookupSwitchIns.java | 2 +- .../instructions/localregs/DecLocalIIns.java | 2 +- .../instructions/localregs/DecLocalIns.java | 2 +- .../instructions/localregs/GetLocal0Ins.java | 8 +- .../localregs/GetLocalTypeIns.java | 2 +- .../instructions/localregs/IncLocalIIns.java | 2 +- .../instructions/localregs/IncLocalIns.java | 2 +- .../avm2/instructions/localregs/KillIns.java | 2 +- .../localregs/SetLocalTypeIns.java | 2 +- .../instructions/other/DeletePropertyIns.java | 2 +- .../avm2/instructions/other/FindDefIns.java | 2 +- .../instructions/other/FindPropertyIns.java | 2 +- .../other/FindPropertyStrictIns.java | 2 +- .../instructions/other/GetDescendantsIns.java | 2 +- .../instructions/other/GetGlobalScopeIns.java | 4 +- .../instructions/other/GetGlobalSlotIns.java | 2 +- .../avm2/instructions/other/GetLexIns.java | 2 +- .../instructions/other/GetPropertyIns.java | 2 +- .../instructions/other/GetScopeObjectIns.java | 2 +- .../avm2/instructions/other/GetSlotIns.java | 6 +- .../avm2/instructions/other/GetSuperIns.java | 2 +- .../avm2/instructions/other/HasNext2Ins.java | 2 +- .../avm2/instructions/other/HasNextIns.java | 2 +- .../abc/avm2/instructions/other/InIns.java | 2 +- .../instructions/other/InitPropertyIns.java | 2 +- .../avm2/instructions/other/NextNameIns.java | 2 +- .../avm2/instructions/other/NextValueIns.java | 2 +- .../instructions/other/ReturnValueIns.java | 2 +- .../instructions/other/ReturnVoidIns.java | 2 +- .../instructions/other/SetGlobalSlotIns.java | 2 +- .../instructions/other/SetPropertyIns.java | 6 +- .../avm2/instructions/other/SetSlotIns.java | 6 +- .../avm2/instructions/other/SetSuperIns.java | 2 +- .../abc/avm2/instructions/other/ThrowIns.java | 2 +- .../abc/avm2/instructions/stack/DupIns.java | 2 +- .../abc/avm2/instructions/stack/PopIns.java | 2 +- .../avm2/instructions/stack/PopScopeIns.java | 2 +- .../avm2/instructions/stack/PushByteIns.java | 2 +- .../instructions/stack/PushDoubleIns.java | 2 +- .../avm2/instructions/stack/PushFalseIns.java | 2 +- .../avm2/instructions/stack/PushIntIns.java | 2 +- .../instructions/stack/PushNamespaceIns.java | 2 +- .../avm2/instructions/stack/PushNanIns.java | 2 +- .../avm2/instructions/stack/PushNullIns.java | 2 +- .../avm2/instructions/stack/PushScopeIns.java | 2 +- .../avm2/instructions/stack/PushShortIns.java | 2 +- .../instructions/stack/PushStringIns.java | 2 +- .../avm2/instructions/stack/PushTrueIns.java | 2 +- .../avm2/instructions/stack/PushUIntIns.java | 2 +- .../instructions/stack/PushUndefinedIns.java | 2 +- .../avm2/instructions/stack/PushWithIns.java | 2 +- .../abc/avm2/instructions/stack/SwapIns.java | 2 +- .../avm2/instructions/types/ApplyTypeIns.java | 2 +- .../avm2/instructions/types/AsTypeIns.java | 2 +- .../instructions/types/AsTypeLateIns.java | 2 +- .../avm2/instructions/types/CoerceAIns.java | 2 +- .../avm2/instructions/types/CoerceIns.java | 2 +- .../avm2/instructions/types/CoerceSIns.java | 2 +- .../avm2/instructions/types/ConvertBIns.java | 2 +- .../avm2/instructions/types/ConvertDIns.java | 2 +- .../avm2/instructions/types/ConvertIIns.java | 2 +- .../avm2/instructions/types/ConvertOIns.java | 2 +- .../avm2/instructions/types/ConvertSIns.java | 2 +- .../avm2/instructions/types/ConvertUIns.java | 2 +- .../instructions/types/InstanceOfIns.java | 2 +- .../avm2/instructions/types/IsTypeIns.java | 2 +- .../instructions/types/IsTypeLateIns.java | 2 +- .../avm2/instructions/types/TypeOfIns.java | 2 +- .../avm2/instructions/xml/CheckFilterIns.java | 2 +- .../abc/avm2/instructions/xml/DXNSIns.java | 2 +- .../avm2/instructions/xml/DXNSLateIns.java | 2 +- .../avm2/instructions/xml/EscXAttrIns.java | 2 +- .../avm2/instructions/xml/EscXElemIns.java | 2 +- .../abc/avm2/model/CallPropertyAVM2Item.java | 4 +- .../flash/abc/avm2/model/CoerceAVM2Item.java | 7 + .../abc/avm2/model/ConstructPropAVM2Item.java | 4 +- .../abc/avm2/model/FindPropertyAVM2Item.java | 5 +- .../abc/avm2/model/GetPropertyAVM2Item.java | 4 +- .../abc/avm2/model/NewFunctionAVM2Item.java | 8 +- .../abc/avm2/model/SetPropertyAVM2Item.java | 4 +- .../operations/DeletePropertyAVM2Item.java | 4 +- .../avm2/parser/{ => pcode}/ASM3Parser.java | 3 +- .../avm2/parser/{ => pcode}/Flasm3Lexer.java | 3 +- .../{ => pcode}/MissingSymbolHandler.java | 2 +- .../avm2/parser/{ => pcode}/ParsedSymbol.java | 2 +- .../abc/avm2/parser/{ => pcode}/flasm3.flex | 2 +- .../parser/script/AVM2SourceGenerator.java | 664 +++++++ .../avm2/parser/script/ActionScriptLexer.java | 1669 +++++++++++++++++ .../parser/script/ActionScriptParser.java | 1449 ++++++++++++++ .../abc/avm2/parser/script/ClassAVM2Item.java | 88 + .../abc/avm2/parser/script/ConstAVM2Item.java | 48 + .../avm2/parser/script/FunctionAVM2Item.java | 53 + .../avm2/parser/script/GetterAVM2Item.java | 33 + .../avm2/parser/script/InterfaceAVM2Item.java | 70 + .../abc/avm2/parser/script/LexBufferer.java | 48 + .../abc/avm2/parser/script/LexListener.java | 28 + .../avm2/parser/script/MethodAVM2Item.java | 55 + .../abc/avm2/parser/script/ParsedSymbol.java | 62 + .../avm2/parser/script/SetterAVM2Item.java | 33 + .../abc/avm2/parser/script/SlotAVM2Item.java | 48 + .../abc/avm2/parser/script/SymbolGroup.java | 37 + .../abc/avm2/parser/script/SymbolType.java | 184 ++ .../avm2/parser/script/VariableAVM2Item.java | 142 ++ .../abc/avm2/parser/script/actionscript.flex | 374 ++++ .../flash/abc/types/MethodBody.java | 30 +- .../flash/abc/types/traits/TraitClass.java | 86 +- .../flash/abc/types/traits/TraitFunction.java | 14 +- .../types/traits/TraitMethodGetterSetter.java | 16 +- .../abc/types/traits/TraitSlotConst.java | 6 +- .../flash/abc/types/traits/Traits.java | 2 +- .../abc/usages/ClassNameMultinameUsage.java | 2 +- .../abc/usages/ConstVarMultinameUsage.java | 8 +- .../abc/usages/InsideClassMultinameUsage.java | 2 +- .../abc/usages/MethodMultinameUsage.java | 8 +- .../parser/script/ActionScriptParser.java | 3 + .../jpexs/decompiler/flash/gui/MainPanel.java | 12 +- .../decompiler/flash/gui/abc/ABCPanel.java | 8 +- .../flash/gui/abc/ASMSourceEditorPane.java | 20 +- .../flash/gui/abc/ClassesListTreeModel.java | 4 +- .../flash/gui/abc/DecompiledEditorPane.java | 14 +- .../gui/abc/DialogMissingSymbolHandler.java | 2 +- .../gui/abc/SlotConstTraitDetailPanel.java | 2 +- .../decompiler/flash/gui/abc/TraitsList.java | 2 +- .../flash/gui/abc/TraitsListItem.java | 18 +- .../flash/gui/abc/TraitsListModel.java | 8 +- .../decompiler/flash/gui/abc/UsageFrame.java | 4 +- 206 files changed, 5588 insertions(+), 484 deletions(-) rename trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/{ => pcode}/ASM3Parser.java (97%) rename trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/{ => pcode}/Flasm3Lexer.java (97%) rename trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/{ => pcode}/MissingSymbolHandler.java (91%) rename trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/{ => pcode}/ParsedSymbol.java (96%) rename trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/{ => pcode}/flasm3.flex (99%) create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/LexBufferer.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/LexListener.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ParsedSymbol.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolGroup.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/VariableAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index db87d2f65..7703145fc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -847,8 +847,8 @@ public final class SWF implements TreeItem, Timelined { ScriptPack scr = abc.findScriptPackByPath(className); if (scr != null) { String cnt = ""; - if (abc.script_info.length > 1) { - cnt = "script " + (i + 1) + "/" + abc.script_info.length + " "; + if (abc.script_info.size() > 1) { + cnt = "script " + (i + 1) + "/" + abc.script_info.size() + " "; } String exStr = "Exporting " + "tag " + (i + 1) + "/" + abcTags.size() + " " + cnt + scr.getPath() + " ..."; informListeners("exporting", exStr); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java index 0067e5abf..71293b80e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -71,43 +71,47 @@ import java.util.logging.Logger; public class ABC { - public int major_version = 0; - public int minor_version = 0; - public ConstantPool constants; - public MethodInfo[] method_info; - public MetadataInfo[] metadata_info; - public InstanceInfo[] instance_info; - public ClassInfo[] class_info; - public ScriptInfo[] script_info; - public MethodBody[] bodies; - private int[] bodyIdxFromMethodIdx; + public int major_version = 46; + public int minor_version = 16; + public ConstantPool constants=new ConstantPool(); + public List method_info = new ArrayList<>(); + public List metadata_info = new ArrayList<>(); + public List instance_info=new ArrayList<>(); + public List class_info = new ArrayList<>(); + public List script_info = new ArrayList<>(); + public List bodies = new ArrayList<>(); + private List bodyIdxFromMethodIdx = new ArrayList<>(); public long[] stringOffsets; public static final int MINORwithDECIMAL = 17; - protected HashSet listeners = new HashSet<>(); + protected Set listeners = new HashSet<>(); private static final Logger logger = Logger.getLogger(ABC.class.getName()); private final AVM2Deobfuscation deobfuscation; public SWF swf; public ABCContainerTag parentTag; + public ABC(SWF swf) { + this.deobfuscation = null; + this.swf = swf; + } + + + public int addMethodBody(MethodBody body) { - bodies = Arrays.copyOf(bodies, bodies.length + 1); - bodies[bodies.length - 1] = body; - if (body.method_info >= bodyIdxFromMethodIdx.length) { + bodies.add(body); + if (body.method_info >= bodyIdxFromMethodIdx.size()) { int newlen = body.method_info + 1; - int oldlen = bodyIdxFromMethodIdx.length; - bodyIdxFromMethodIdx = Arrays.copyOf(bodyIdxFromMethodIdx, newlen); + int oldlen = bodyIdxFromMethodIdx.size(); for (int i = oldlen; i < newlen; i++) { - bodyIdxFromMethodIdx[i] = -1; + bodyIdxFromMethodIdx.add(-1); } - bodyIdxFromMethodIdx[body.method_info] = bodies.length - 1; + bodyIdxFromMethodIdx.set(body.method_info,bodies.size() - 1); } - return bodies.length - 1; + return bodies.size() - 1; } public int addMethodInfo(MethodInfo mi) { - method_info = Arrays.copyOf(method_info, method_info.length + 1); - method_info[method_info.length - 1] = mi; - return method_info.length - 1; + method_info.add(mi); + return method_info.size() - 1; } public void addEventListener(EventListener listener) { @@ -126,8 +130,8 @@ public class ABC { public int removeTraps() throws InterruptedException { int rem = 0; - for (int s = 0; s < script_info.length; s++) { - rem += script_info[s].removeTraps(s, this, ""); + for (int s = 0; s < script_info.size(); s++) { + rem += script_info.get(s).removeTraps(s, this, ""); } return rem; } @@ -135,14 +139,14 @@ public class ABC { public int removeDeadCode() throws InterruptedException { int rem = 0; for (MethodBody body : bodies) { - rem += body.removeDeadCode(constants, null/*FIXME*/, method_info[body.method_info]); + rem += body.removeDeadCode(constants, null/*FIXME*/, method_info.get(body.method_info)); } return rem; } public void restoreControlFlow() throws InterruptedException { for (MethodBody body : bodies) { - body.restoreControlFlow(constants, null/*FIXME*/, method_info[body.method_info]); + body.restoreControlFlow(constants, null/*FIXME*/, method_info.get(body.method_info)); } } @@ -186,14 +190,14 @@ public class ABC { String usageType = ""; if (t instanceof TraitClass) { TraitClass tc = (TraitClass) t; - getStringUsageTypes(ret, class_info[tc.class_info].static_traits, classesOnly); - getStringUsageTypes(ret, instance_info[tc.class_info].instance_traits, classesOnly); + getStringUsageTypes(ret, class_info.get(tc.class_info).static_traits, classesOnly); + getStringUsageTypes(ret, instance_info.get(tc.class_info).instance_traits, classesOnly); - if (instance_info[tc.class_info].name_index != 0) { - setStringUsageType(ret, constants.getMultiname(instance_info[tc.class_info].name_index).name_index, "class"); + if (instance_info.get(tc.class_info).name_index != 0) { + setStringUsageType(ret, constants.getMultiname(instance_info.get(tc.class_info).name_index).name_index, "class"); } - if (instance_info[tc.class_info].super_index != 0) { - setStringUsageType(ret, constants.getMultiname(instance_info[tc.class_info].super_index).name_index, "class"); + if (instance_info.get(tc.class_info).super_index != 0) { + setStringUsageType(ret, constants.getMultiname(instance_info.get(tc.class_info).super_index).name_index, "class"); } usageType = "class"; @@ -256,17 +260,18 @@ public class ABC { Map stringUsageTypes = new HashMap<>(); informListeners("deobfuscate", "Getting usage types..."); getStringUsageTypes(stringUsageTypes, classesOnly); - for (int i = 0; i < instance_info.length; i++) { - informListeners("deobfuscate", "class " + i + "/" + instance_info.length); - if (instance_info[i].name_index != 0) { - constants.getMultiname(instance_info[i].name_index).name_index = deobfuscation.deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.getMultiname(instance_info[i].name_index).name_index, true, renameType); - if (constants.getMultiname(instance_info[i].name_index).namespace_index != 0) { - constants.getNamespace(constants.getMultiname(instance_info[i].name_index).namespace_index).name_index - = deobfuscation.deobfuscatePackageName(stringUsageTypes, stringUsages, namesMap, constants.getNamespace(constants.getMultiname(instance_info[i].name_index).namespace_index).name_index, renameType); + for (int i = 0; i < instance_info.size(); i++) { + informListeners("deobfuscate", "class " + i + "/" + instance_info.size()); + InstanceInfo insti=instance_info.get(i); + if (insti.name_index != 0) { + constants.getMultiname(insti.name_index).name_index = deobfuscation.deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.getMultiname(insti.name_index).name_index, true, renameType); + if (constants.getMultiname(insti.name_index).namespace_index != 0) { + constants.getNamespace(constants.getMultiname(insti.name_index).namespace_index).name_index + = deobfuscation.deobfuscatePackageName(stringUsageTypes, stringUsages, namesMap, constants.getNamespace(constants.getMultiname(insti.name_index).namespace_index).name_index, renameType); } } - if (instance_info[i].super_index != 0) { - constants.getMultiname(instance_info[i].super_index).name_index = deobfuscation.deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.getMultiname(instance_info[i].super_index).name_index, true, renameType); + if (insti.super_index != 0) { + constants.getMultiname(insti.super_index).name_index = deobfuscation.deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.getMultiname(insti.super_index).name_index, true, renameType); } } if (classesOnly) { @@ -429,16 +434,16 @@ public class ABC { //method info int methods_count = ais.readU30(); - method_info = new MethodInfo[methods_count]; - bodyIdxFromMethodIdx = new int[methods_count]; + method_info = new ArrayList<>();//MethodInfo[methods_count]; + bodyIdxFromMethodIdx = new ArrayList<>(); //[methods_count]; for (int i = 0; i < methods_count; i++) { - method_info[i] = ais.readMethodInfo(); - bodyIdxFromMethodIdx[i] = -1; + method_info.add(ais.readMethodInfo()); + bodyIdxFromMethodIdx.add(-1); } //metadata info int metadata_count = ais.readU30(); - metadata_info = new MetadataInfo[metadata_count]; + metadata_info = new ArrayList<>(); for (int i = 0; i < metadata_count; i++) { int name_index = ais.readU30(); int values_count = ais.readU30(); @@ -450,32 +455,32 @@ public class ABC { for (int v = 0; v < values_count; v++) { values[v] = ais.readU30(); } - metadata_info[i] = new MetadataInfo(name_index, keys, values); + metadata_info.add(new MetadataInfo(name_index, keys, values)); } int class_count = ais.readU30(); - instance_info = new InstanceInfo[class_count]; + instance_info = new ArrayList<>(); //InstanceInfo[class_count]; for (int i = 0; i < class_count; i++) { - instance_info[i] = ais.readInstanceInfo(); + instance_info.add(ais.readInstanceInfo()); } - class_info = new ClassInfo[class_count]; + class_info = new ArrayList<>(); //ClassInfo[class_count]; for (int i = 0; i < class_count; i++) { ClassInfo ci = new ClassInfo(); ci.cinit_index = ais.readU30(); ci.static_traits = ais.readTraits(); - class_info[i] = ci; + class_info.add(ci); } int script_count = ais.readU30(); - script_info = new ScriptInfo[script_count]; + script_info = new ArrayList<>(); //ScriptInfo[script_count]; for (int i = 0; i < script_count; i++) { ScriptInfo si = new ScriptInfo(); si.init_index = ais.readU30(); si.traits = ais.readTraits(); - script_info[i] = si; + script_info.add(si); } int bodies_count = ais.readU30(); - bodies = new MethodBody[bodies_count]; + bodies = new ArrayList<>(); //MethodBody[bodies_count]; for (int i = 0; i < bodies_count; i++) { MethodBody mb = new MethodBody(); mb.method_info = ais.readU30(); @@ -504,9 +509,9 @@ public class ABC { mb.exceptions[j] = abce; } mb.traits = ais.readTraits(); - bodies[i] = mb; - method_info[mb.method_info].setBody(mb); - bodyIdxFromMethodIdx[mb.method_info] = i; + bodies.add(mb); + method_info.get(mb.method_info).setBody(mb); + bodyIdxFromMethodIdx.set(mb.method_info,i); } loadNamespaceMap(); } @@ -560,56 +565,56 @@ public class ABC { aos.writeMultiname(constants.getMultiname(i)); } - aos.writeU30(method_info.length); - for (int i = 0; i < method_info.length; i++) { - aos.writeMethodInfo(method_info[i]); + aos.writeU30(method_info.size()); + for (MethodInfo mi:method_info) { + aos.writeMethodInfo(mi); } - aos.writeU30(metadata_info.length); - for (int i = 0; i < metadata_info.length; i++) { - aos.writeU30(metadata_info[i].name_index); - aos.writeU30(metadata_info[i].values.length); - for (int j = 0; j < metadata_info[i].values.length; j++) { - aos.writeU30(metadata_info[i].keys[j]); + aos.writeU30(metadata_info.size()); + for (MetadataInfo mi:metadata_info) { + aos.writeU30(mi.name_index); + aos.writeU30(mi.values.length); + for (int j = 0; j < mi.values.length; j++) { + aos.writeU30(mi.keys[j]); } - for (int j = 0; j < metadata_info[i].values.length; j++) { - aos.writeU30(metadata_info[i].values[j]); + for (int j = 0; j < mi.values.length; j++) { + aos.writeU30(mi.values[j]); } } - aos.writeU30(class_info.length); - for (int i = 0; i < instance_info.length; i++) { - aos.writeInstanceInfo(instance_info[i]); + aos.writeU30(class_info.size()); + for (InstanceInfo ii:instance_info) { + aos.writeInstanceInfo(ii); } - for (int i = 0; i < class_info.length; i++) { - aos.writeU30(class_info[i].cinit_index); - aos.writeTraits(class_info[i].static_traits); + for (ClassInfo ci:class_info) { + aos.writeU30(ci.cinit_index); + aos.writeTraits(ci.static_traits); } - aos.writeU30(script_info.length); - for (int i = 0; i < script_info.length; i++) { - aos.writeU30(script_info[i].init_index); - aos.writeTraits(script_info[i].traits); + aos.writeU30(script_info.size()); + for (ScriptInfo si:script_info) { + aos.writeU30(si.init_index); + aos.writeTraits(si.traits); } - aos.writeU30(bodies.length); - for (int i = 0; i < bodies.length; i++) { - aos.writeU30(bodies[i].method_info); - aos.writeU30(bodies[i].max_stack); - aos.writeU30(bodies[i].max_regs); - aos.writeU30(bodies[i].init_scope_depth); - aos.writeU30(bodies[i].max_scope_depth); - byte[] codeBytes = bodies[i].code.getBytes(); + aos.writeU30(bodies.size()); + for (MethodBody mb: bodies) { + aos.writeU30(mb.method_info); + aos.writeU30(mb.max_stack); + aos.writeU30(mb.max_regs); + aos.writeU30(mb.init_scope_depth); + aos.writeU30(mb.max_scope_depth); + byte[] codeBytes = mb.code.getBytes(); aos.writeU30(codeBytes.length); aos.write(codeBytes); - aos.writeU30(bodies[i].exceptions.length); - for (int j = 0; j < bodies[i].exceptions.length; j++) { - aos.writeU30(bodies[i].exceptions[j].start); - aos.writeU30(bodies[i].exceptions[j].end); - aos.writeU30(bodies[i].exceptions[j].target); - aos.writeU30(bodies[i].exceptions[j].type_index); - aos.writeU30(bodies[i].exceptions[j].name_index); + aos.writeU30(mb.exceptions.length); + for (int j = 0; j < mb.exceptions.length; j++) { + aos.writeU30(mb.exceptions[j].start); + aos.writeU30(mb.exceptions[j].end); + aos.writeU30(mb.exceptions[j].target); + aos.writeU30(mb.exceptions[j].type_index); + aos.writeU30(mb.exceptions[j].name_index); } - aos.writeTraits(bodies[i].traits); + aos.writeTraits(mb.traits); } } @@ -617,20 +622,20 @@ public class ABC { if (methodInfo < 0) { return null; } - return method_info[methodInfo].getBody(); + return method_info.get(methodInfo).getBody(); } public int findBodyIndex(int methodInfo) { if (methodInfo == -1) { return -1; } - return bodyIdxFromMethodIdx[methodInfo]; + return bodyIdxFromMethodIdx.get(methodInfo); } public MethodBody findBodyByClassAndName(String className, String methodName) { - for (int i = 0; i < instance_info.length; i++) { - if (className.equals(constants.getMultiname(instance_info[i].name_index).getName(constants, new ArrayList()))) { - for (Trait t : instance_info[i].instance_traits.traits) { + for (int i = 0; i < instance_info.size(); i++) { + if (className.equals(constants.getMultiname(instance_info.get(i).name_index).getName(constants, new ArrayList()))) { + for (Trait t : instance_info.get(i).instance_traits.traits) { if (t instanceof TraitMethodGetterSetter) { TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t; if (methodName.equals(t2.getName(this).getName(constants, new ArrayList()))) { @@ -645,9 +650,9 @@ public class ABC { //break; } } - for (int i = 0; i < class_info.length; i++) { - if (className.equals(constants.getMultiname(instance_info[i].name_index).getName(constants, new ArrayList()))) { - for (Trait t : class_info[i].static_traits.traits) { + for (int i = 0; i < class_info.size(); i++) { + if (className.equals(constants.getMultiname(instance_info.get(i).name_index).getName(constants, new ArrayList()))) { + for (Trait t : class_info.get(i).static_traits.traits) { if (t instanceof TraitMethodGetterSetter) { TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t; if (methodName.equals(t2.getName(this).getName(constants, new ArrayList()))) { @@ -667,9 +672,9 @@ public class ABC { } public boolean isStaticTraitId(int classIndex, int traitId) { - if (traitId < class_info[classIndex].static_traits.traits.length) { + if (traitId < class_info.get(classIndex).static_traits.traits.length) { return true; - } else if (traitId < class_info[classIndex].static_traits.traits.length + instance_info[classIndex].instance_traits.traits.length) { + } else if (traitId < class_info.get(classIndex).static_traits.traits.length + instance_info.get(classIndex).instance_traits.traits.length) { return false; } else { return true; //Can be class or instance initializer @@ -680,11 +685,11 @@ public class ABC { if (classIndex == -1) { return null; } - if (traitId < class_info[classIndex].static_traits.traits.length) { - return class_info[classIndex].static_traits.traits[traitId]; - } else if (traitId < class_info[classIndex].static_traits.traits.length + instance_info[classIndex].instance_traits.traits.length) { - traitId -= class_info[classIndex].static_traits.traits.length; - return instance_info[classIndex].instance_traits.traits[traitId]; + if (traitId < class_info.get(classIndex).static_traits.traits.length) { + return class_info.get(classIndex).static_traits.traits[traitId]; + } else if (traitId < class_info.get(classIndex).static_traits.traits.length + instance_info.get(classIndex).instance_traits.traits.length) { + traitId -= class_info.get(classIndex).static_traits.traits.length; + return instance_info.get(classIndex).instance_traits.traits[traitId]; } else { return null; //Can be class or instance initializer } @@ -694,25 +699,25 @@ public class ABC { if (classIndex == -1) { return -1; } - if (traitId < class_info[classIndex].static_traits.traits.length) { - if (class_info[classIndex].static_traits.traits[traitId] instanceof TraitMethodGetterSetter) { - return ((TraitMethodGetterSetter) class_info[classIndex].static_traits.traits[traitId]).method_info; + if (traitId < class_info.get(classIndex).static_traits.traits.length) { + if (class_info.get(classIndex).static_traits.traits[traitId] instanceof TraitMethodGetterSetter) { + return ((TraitMethodGetterSetter) class_info.get(classIndex).static_traits.traits[traitId]).method_info; } else { return -1; } - } else if (traitId < class_info[classIndex].static_traits.traits.length + instance_info[classIndex].instance_traits.traits.length) { - traitId -= class_info[classIndex].static_traits.traits.length; - if (instance_info[classIndex].instance_traits.traits[traitId] instanceof TraitMethodGetterSetter) { - return ((TraitMethodGetterSetter) instance_info[classIndex].instance_traits.traits[traitId]).method_info; + } else if (traitId < class_info.get(classIndex).static_traits.traits.length + instance_info.get(classIndex).instance_traits.traits.length) { + traitId -= class_info.get(classIndex).static_traits.traits.length; + if (instance_info.get(classIndex).instance_traits.traits[traitId] instanceof TraitMethodGetterSetter) { + return ((TraitMethodGetterSetter) instance_info.get(classIndex).instance_traits.traits[traitId]).method_info; } else { return -1; } } else { - traitId -= class_info[classIndex].static_traits.traits.length + instance_info[classIndex].instance_traits.traits.length; + traitId -= class_info.get(classIndex).static_traits.traits.length + instance_info.get(classIndex).instance_traits.traits.length; if (traitId == 0) { - return instance_info[classIndex].iinit_index; + return instance_info.get(classIndex).iinit_index; } else if (traitId == 1) { - return class_info[classIndex].cinit_index; + return class_info.get(classIndex).cinit_index; } else { return -1; } @@ -752,8 +757,8 @@ public class ABC { public List> getScriptPacks() { List> ret = new ArrayList<>(); - for (int i = 0; i < script_info.length; i++) { - ret.addAll(script_info[i].getPacks(this, i)); + for (int i = 0; i < script_info.size(); i++) { + ret.addAll(script_info.get(i).getPacks(this, i)); } return ret; } @@ -762,34 +767,34 @@ public class ABC { Utf8PrintWriter output; output = new Utf8PrintWriter(os); constants.dump(output); - for (int i = 0; i < method_info.length; i++) { - output.println("MethodInfo[" + i + "]:" + method_info[i].toString(constants, new ArrayList())); + for (int i = 0; i < method_info.size(); i++) { + output.println("MethodInfo[" + i + "]:" + method_info.get(i).toString(constants, new ArrayList())); } - for (int i = 0; i < metadata_info.length; i++) { - output.println("MetadataInfo[" + i + "]:" + metadata_info[i].toString(constants)); + for (int i = 0; i < metadata_info.size(); i++) { + output.println("MetadataInfo[" + i + "]:" + metadata_info.get(i).toString(constants)); } - for (int i = 0; i < instance_info.length; i++) { - output.println("InstanceInfo[" + i + "]:" + instance_info[i].toString(this, new ArrayList())); + for (int i = 0; i < instance_info.size(); i++) { + output.println("InstanceInfo[" + i + "]:" + instance_info.get(i).toString(this, new ArrayList())); } - for (int i = 0; i < class_info.length; i++) { - output.println("ClassInfo[" + i + "]:" + class_info[i].toString(this, new ArrayList())); + for (int i = 0; i < class_info.size(); i++) { + output.println("ClassInfo[" + i + "]:" + class_info.get(i).toString(this, new ArrayList())); } - for (int i = 0; i < script_info.length; i++) { - output.println("ScriptInfo[" + i + "]:" + script_info[i].toString(this, new ArrayList())); + for (int i = 0; i < script_info.size(); i++) { + output.println("ScriptInfo[" + i + "]:" + script_info.get(i).toString(this, new ArrayList())); } - for (int i = 0; i < bodies.length; i++) { + for (int i = 0; i < bodies.size(); i++) { output.println("MethodBody[" + i + "]:"); //+ bodies[i].toString(this, constants, method_info)); } } private void checkMultinameUsedInMethod(int multinameIndex, int methodInfo, List ret, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) { - for (int p = 0; p < method_info[methodInfo].param_types.length; p++) { - if (method_info[methodInfo].param_types[p] == multinameIndex) { + for (int p = 0; p < method_info.get(methodInfo).param_types.length; p++) { + if (method_info.get(methodInfo).param_types[p] == multinameIndex) { ret.add(new MethodParamsMultinameUsage(multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex)); break; } } - if (method_info[methodInfo].ret_type == multinameIndex) { + if (method_info.get(methodInfo).ret_type == multinameIndex) { ret.add(new MethodReturnTypeMultinameUsage(multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex)); } MethodBody body = findBody(methodInfo); @@ -840,22 +845,22 @@ public class ABC { if (multinameIndex == 0) { return ret; } - for (int c = 0; c < instance_info.length; c++) { - if (instance_info[c].name_index == multinameIndex) { + for (int c = 0; c < instance_info.size(); c++) { + if (instance_info.get(c).name_index == multinameIndex) { ret.add(new ClassNameMultinameUsage(multinameIndex, c)); } - if (instance_info[c].super_index == multinameIndex) { + if (instance_info.get(c).super_index == multinameIndex) { ret.add(new ExtendsMultinameUsage(multinameIndex, c)); } - for (int i = 0; i < instance_info[c].interfaces.length; i++) { - if (instance_info[c].interfaces[i] == multinameIndex) { + for (int i = 0; i < instance_info.get(c).interfaces.length; i++) { + if (instance_info.get(c).interfaces[i] == multinameIndex) { ret.add(new ImplementsMultinameUsage(multinameIndex, c)); } } - checkMultinameUsedInMethod(multinameIndex, instance_info[c].iinit_index, ret, c, 0, false, true, null, -1); - checkMultinameUsedInMethod(multinameIndex, class_info[c].cinit_index, ret, c, 0, true, true, null, -1); - findMultinameUsageInTraits(instance_info[c].instance_traits, multinameIndex, false, c, ret, -1); - findMultinameUsageInTraits(class_info[c].static_traits, multinameIndex, true, c, ret, -1); + checkMultinameUsedInMethod(multinameIndex, instance_info.get(c).iinit_index, ret, c, 0, false, true, null, -1); + checkMultinameUsedInMethod(multinameIndex, class_info.get(c).cinit_index, ret, c, 0, true, true, null, -1); + findMultinameUsageInTraits(instance_info.get(c).instance_traits, multinameIndex, false, c, ret, -1); + findMultinameUsageInTraits(class_info.get(c).static_traits, multinameIndex, true, c, ret, -1); } loopm: for (int m = 1; m < constants.getMultinameCount(); m++) { @@ -876,14 +881,14 @@ public class ABC { } public void autoFillAllBodyParams() { - for (int i = 0; i < bodies.length; i++) { - bodies[i].autoFillStats(this); + for (int i = 0; i < bodies.size(); i++) { + bodies.get(i).autoFillStats(this); } } public int findMethodInfoByName(int classId, String methodName) { if (classId > -1) { - for (Trait t : instance_info[classId].instance_traits.traits) { + for (Trait t : instance_info.get(classId).instance_traits.traits) { if (t instanceof TraitMethodGetterSetter) { if (t.getName(this).getName(constants, new ArrayList()).equals(methodName)) { return ((TraitMethodGetterSetter) t).method_info; @@ -896,7 +901,7 @@ public class ABC { public int findMethodBodyByName(int classId, String methodName) { if (classId > -1) { - for (Trait t : instance_info[classId].instance_traits.traits) { + for (Trait t : instance_info.get(classId).instance_traits.traits) { if (t instanceof TraitMethodGetterSetter) { if (t.getName(this).getName(constants, new ArrayList()).equals(methodName)) { return findBodyIndex(((TraitMethodGetterSetter) t).method_info); @@ -913,8 +918,8 @@ public class ABC { } public int findClassByName(String name) { - for (int c = 0; c < instance_info.length; c++) { - String s = constants.getMultiname(instance_info[c].name_index).getNameWithNamespace(constants); + for (int c = 0; c < instance_info.size(); c++) { + String s = constants.getMultiname(instance_info.get(c).name_index).getNameWithNamespace(constants); if (name.equals(s)) { return c; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java b/trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java index 6a6bc81e8..5673dcc0e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java @@ -39,7 +39,7 @@ public class AVM2LocalData extends BaseLocalData { public HashMap localRegs; public Stack scopeStack; public ConstantPool constants; - public MethodInfo[] methodInfo; + public List methodInfo; public MethodBody methodBody; public ABC abc; public HashMap localRegNames; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index 4359a543d..990c406e9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -72,7 +72,7 @@ public class ScriptPack implements TreeElementItem { public String getPathPackage() { String packageName = ""; for (int t : traitIndices) { - Multiname name = abc.script_info[scriptIndex].traits.traits[t].getName(abc); + Multiname name = abc.script_info.get(scriptIndex).traits.traits[t].getName(abc); Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { packageName = ns.getName(abc.constants); @@ -84,7 +84,7 @@ public class ScriptPack implements TreeElementItem { public String getPathScriptName() { String scriptName = ""; for (int t : traitIndices) { - Multiname name = abc.script_info[scriptIndex].traits.traits[t].getName(abc); + Multiname name = abc.script_info.get(scriptIndex).traits.traits[t].getName(abc); Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { scriptName = name.getName(abc.constants, new ArrayList()); @@ -191,7 +191,7 @@ public class ScriptPack implements TreeElementItem { File file = new File(fileName); try (FileTextWriter writer = new FileTextWriter(Configuration.getCodeFormatting(), new FileOutputStream(file))) { try { - toSource(writer, abcList, abc.script_info[scriptIndex].traits.traits, exportMode, parallel); + toSource(writer, abcList, abc.script_info.get(scriptIndex).traits.traits, exportMode, parallel); } catch (InterruptedException ex) { Logger.getLogger(ScriptPack.class.getName()).log(Level.SEVERE, null, ex); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 5f1e9f9a8..5cbf88ed7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -188,6 +188,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.xml.DXNSLateIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.xml.EscXAttrIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.xml.EscXElemIns; import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.HasNextAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.InitPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item; @@ -199,7 +200,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.SetPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.SetSlotAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.WithAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.clauses.DeclarationAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.parser.ASM3Parser; +import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser; import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.MethodBody; @@ -1244,7 +1245,7 @@ public class AVM2Code implements Serializable { return pos2adr(fixIPAfterDebugLine(adr2pos(addr))); } - public ConvertOutput toSourceOutput(String path, GraphPart part, boolean processJumps, boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ABC abc, ConstantPool constants, MethodInfo[] method_info, MethodBody body, int start, int end, HashMap localRegNames, List fullyQualifiedNames, boolean[] visited, HashMap localRegAssigmentIps, HashMap> refs) throws ConvertException, InterruptedException { + public ConvertOutput toSourceOutput(String path, GraphPart part, boolean processJumps, boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ABC abc, ConstantPool constants, List method_info, MethodBody body, int start, int end, HashMap localRegNames, List fullyQualifiedNames, boolean[] visited, HashMap localRegAssigmentIps, HashMap> refs) throws ConvertException, InterruptedException { boolean debugMode = DEBUG_MODE; if (debugMode) { System.out.println("OPEN SubSource:" + start + "-" + end + " " + code.get(start).toString() + " to " + code.get(end).toString()); @@ -1560,7 +1561,7 @@ public class AVM2Code implements Serializable { ignoredIns = new ArrayList<>(); } - public List toGraphTargetItems(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, MethodInfo[] method_info, MethodBody body, HashMap localRegNames, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap localRegAssigmentIps, HashMap> refs) throws InterruptedException { + public List toGraphTargetItems(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, List method_info, MethodBody body, HashMap localRegNames, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap localRegAssigmentIps, HashMap> refs) throws InterruptedException { initToSource(); List list; HashMap localRegs = new HashMap<>(); @@ -1581,7 +1582,7 @@ public class AVM2Code implements Serializable { value = ((InitPropertyAVM2Item) ti).value; } if (ti instanceof SetPropertyAVM2Item) { - multinameIndex = ((SetPropertyAVM2Item) ti).propertyName.multinameIndex; + multinameIndex = ((FullMultinameAVM2Item)((SetPropertyAVM2Item) ti).propertyName).multinameIndex; value = ((SetPropertyAVM2Item) ti).value; } for (Trait t : initTraits.traits) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java index a42080412..f072599a4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java @@ -26,15 +26,15 @@ import java.util.List; public class ConstantPool { - public List constant_int; - public List constant_uint; - public List constant_double; + public List constant_int = new ArrayList<>(); + public List constant_uint = new ArrayList<>(); + public List constant_double = new ArrayList<>(); /* Only for some minor versions */ - public List constant_decimal; - public List constant_string; - public List constant_namespace; - public List constant_namespace_set; - public List constant_multiname; + public List constant_decimal = new ArrayList<>(); + public List constant_string = new ArrayList<>(); + public List constant_namespace = new ArrayList<>(); + public List constant_namespace_set = new ArrayList<>(); + public List constant_multiname = new ArrayList<>(); public synchronized int addInt(long value) { constant_int.add(value); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java index 4de2a68c0..6e7af9c88 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java @@ -80,7 +80,7 @@ public class InstructionDefinition implements Serializable { throw new UnsupportedOperationException("Instruction " + instructionName + " not implemented"); } - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { } protected FullMultinameAVM2Item resolveMultiname(Stack stack, ConstantPool constants, int multinameIndex, AVM2Instruction ins) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java index d4d182360..eaf77380f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java @@ -50,7 +50,7 @@ public class Lf32Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, instructionName)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java index 337c2bcca..35b53d940 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java @@ -50,7 +50,7 @@ public class Lf64Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, instructionName)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java index 24611de2c..de5d3185b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java @@ -50,7 +50,7 @@ public class Li16Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, instructionName)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java index f80b77e5c..229ea75bd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java @@ -50,7 +50,7 @@ public class Li32Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, instructionName)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java index 413cdc0c4..94bf7a76d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java @@ -50,7 +50,7 @@ public class Li8Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, instructionName)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java index 1b5aa8c1f..1f66543f7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java @@ -50,7 +50,7 @@ public class Sf32Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); stack.push(new AlchemyStoreAVM2Item(ins, value, ofs, instructionName)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java index cb544e93d..84761285e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java @@ -50,7 +50,7 @@ public class Sf64Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); stack.push(new AlchemyStoreAVM2Item(ins, value, ofs, instructionName)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java index 93f9b2719..93e58ce9b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java @@ -50,7 +50,7 @@ public class Si16Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); stack.push(new AlchemyStoreAVM2Item(ins, value, ofs, instructionName)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java index 9e1e27934..aaa309166 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java @@ -50,7 +50,7 @@ public class Si32Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); stack.push(new AlchemyStoreAVM2Item(ins, value, ofs, instructionName)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java index 986c90d6c..5976abcc9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java @@ -50,7 +50,7 @@ public class Si8Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); stack.push(new AlchemyStoreAVM2Item(ins, value, ofs, instructionName)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java index 5badc4b93..011073cbc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java @@ -50,7 +50,7 @@ public class Sxi16Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem value = stack.pop(); stack.push(new AlchemySignExtendAVM2Item(ins, value, instructionName)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java index 64d403fd3..7198b5a60 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java @@ -50,7 +50,7 @@ public class Sxi1Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem value = stack.pop(); stack.push(new AlchemySignExtendAVM2Item(ins, value, instructionName)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java index 8ad69e44a..6a6fb17b5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java @@ -50,7 +50,7 @@ public class Sxi8Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem value = stack.pop(); stack.push(new AlchemySignExtendAVM2Item(ins, value, instructionName)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java index b9563a1c2..f7ab9cf5f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java @@ -36,7 +36,7 @@ public class AddIIns extends AddIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new AddAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java index b87dcefdc..ad1cc9b11 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java @@ -59,7 +59,7 @@ public class AddIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new AddAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java index 9d2514941..345107666 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java @@ -55,7 +55,7 @@ public class DecrementIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new DecrementAVM2Item(ins, (GraphTargetItem) stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java index a51000672..da6034bfd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java @@ -55,7 +55,7 @@ public class DecrementIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new DecrementAVM2Item(ins, (GraphTargetItem) stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java index 708ba43c3..11a0b9258 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java @@ -58,7 +58,7 @@ public class DivideIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new DivideAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java index a35f325b0..98ce0eaea 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java @@ -36,7 +36,7 @@ public class IncrementIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IncrementAVM2Item(ins, (GraphTargetItem) stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java index 41fcc9fbf..ecb377c14 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java @@ -36,7 +36,7 @@ public class IncrementIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IncrementAVM2Item(ins, (GraphTargetItem) stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java index e7f9ecb51..5ab256ff0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java @@ -50,7 +50,7 @@ public class ModuloIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new ModuloAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java index d8fbccdbd..ac1e6a88d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java @@ -36,7 +36,7 @@ public class MultiplyIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new MultiplyAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java index 4943d98a0..df5383bd5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java @@ -58,7 +58,7 @@ public class MultiplyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new MultiplyAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java index 7c92a90eb..b235af625 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java @@ -36,7 +36,7 @@ public class NegateIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = (GraphTargetItem) stack.pop(); stack.push(new NegAVM2Item(ins, v)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java index ead3f195f..b51ae57e7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java @@ -36,7 +36,7 @@ public class NegateIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = (GraphTargetItem) stack.pop(); stack.push(new NegAVM2Item(ins, v)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java index b91b8ec77..c5c7b356e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java @@ -36,7 +36,7 @@ public class NotIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = (GraphTargetItem) stack.pop(); stack.push(new NotItem(ins, v)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java index 2ab067856..940416655 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java @@ -36,7 +36,7 @@ public class SubtractIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new SubtractAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java index 769a780ed..cdb3958f3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java @@ -36,7 +36,7 @@ public class SubtractIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new SubtractAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java index af19a03e3..c77d89672 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java @@ -45,7 +45,7 @@ public class BitAndIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new BitAndAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java index 8bd0bf127..3900ca7f4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java @@ -44,7 +44,7 @@ public class BitNotIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = (GraphTargetItem) stack.pop(); stack.push(new BitNotAVM2Item(ins, v)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java index 6103259c2..02f192564 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java @@ -45,7 +45,7 @@ public class BitOrIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new BitOrAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java index 17c344997..7c9fe246b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java @@ -45,7 +45,7 @@ public class BitXorIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new BitXorAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java index c9d682ced..69dea6f47 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java @@ -36,7 +36,7 @@ public class LShiftIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LShiftAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java index ea7c2197e..85f5e6420 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java @@ -36,7 +36,7 @@ public class RShiftIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new RShiftAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java index 41bc5a8eb..68db6be42 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java @@ -36,7 +36,7 @@ public class URShiftIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new URShiftAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java index c489cb052..4066d802a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java @@ -45,7 +45,7 @@ public class EqualsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new EqAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterEqualsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterEqualsIns.java index 12c0665a4..af99c23ee 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterEqualsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterEqualsIns.java @@ -36,7 +36,7 @@ public class GreaterEqualsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GeAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterThanIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterThanIns.java index 2245a2ed9..659cc68b8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterThanIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterThanIns.java @@ -36,7 +36,7 @@ public class GreaterThanIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GtAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessEqualsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessEqualsIns.java index cd3f248e6..8d12d3dcb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessEqualsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessEqualsIns.java @@ -36,7 +36,7 @@ public class LessEqualsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LeAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessThanIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessThanIns.java index 7a9aa4e7c..0d10a0bf1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessThanIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessThanIns.java @@ -36,7 +36,7 @@ public class LessThanIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LtAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/StrictEqualsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/StrictEqualsIns.java index 71ca36aa4..7213ee911 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/StrictEqualsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/StrictEqualsIns.java @@ -36,7 +36,7 @@ public class StrictEqualsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new StrictEqAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java index 4aed946cc..8522b8f50 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java @@ -75,7 +75,7 @@ public class ConstructIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { @@ -89,7 +89,7 @@ public class ConstructIns extends InstructionDefinition { GetPropertyAVM2Item gpt = (GetPropertyAVM2Item) obj; if (gpt.object instanceof FindPropertyAVM2Item) { FindPropertyAVM2Item fpt = (FindPropertyAVM2Item) gpt.object; - xmlMult = fpt.propertyName; + xmlMult = (FullMultinameAVM2Item)fpt.propertyName; isXML = xmlMult.isXML(constants, localRegNames, fullyQualifiedNames) && xmlMult.isXML(constants, localRegNames, fullyQualifiedNames); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java index 89383f2b9..c6d680453 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java @@ -55,7 +55,7 @@ public class ConstructPropIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java index b2aa0869b..130ec7ea7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java @@ -51,7 +51,7 @@ public class ConstructSuperIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewActivationIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewActivationIns.java index 853a7150c..82c419737 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewActivationIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewActivationIns.java @@ -36,7 +36,7 @@ public class NewActivationIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new NewActivationAVM2Item(ins)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java index 0f4bec622..4095db293 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java @@ -37,7 +37,7 @@ public class NewArrayIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewCatchIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewCatchIns.java index a43c738c8..acdc49cea 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewCatchIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewCatchIns.java @@ -36,7 +36,7 @@ public class NewCatchIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int exInfo = ins.operands[0]; stack.push(new ExceptionAVM2Item(body.exceptions[exInfo])); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java index 9ae24f373..499fb9c86 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java @@ -39,12 +39,12 @@ public class NewClassIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int clsIndex = ins.operands[0]; HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false); stack.pop().toString(writer, LocalData.create(constants, localRegNames, fullyQualifiedNames)); String baseType = writer.toString(); - stack.push(new UnparsedAVM2Item(ins, "new " + abc.constants.getMultiname(abc.instance_info[clsIndex].name_index).getName(constants, fullyQualifiedNames) + ".class extends " + baseType)); + stack.push(new UnparsedAVM2Item(ins, "new " + abc.constants.getMultiname(abc.instance_info.get(clsIndex).name_index).getName(constants, fullyQualifiedNames) + ".class extends " + baseType)); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewFunctionIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewFunctionIns.java index 70f84f10d..2487af241 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewFunctionIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewFunctionIns.java @@ -36,7 +36,7 @@ public class NewFunctionIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int methodIndex = ins.operands[0]; NewFunctionAVM2Item function = new NewFunctionAVM2Item(ins, "", path, isStatic, scriptIndex, classIndex, abc, fullyQualifiedNames, constants, method_info, methodIndex); stack.push(function); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java index b4a9633be..333aaff97 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java @@ -38,7 +38,7 @@ public class NewObjectIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java index 98f20e610..deaecc539 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java @@ -51,7 +51,7 @@ public class CallIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java index 413ba77e7..0a27e9784 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java @@ -51,7 +51,7 @@ public class CallMethodIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int methodIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); @@ -59,7 +59,7 @@ public class CallMethodIns extends InstructionDefinition { args.add(0, (GraphTargetItem) stack.pop()); } GraphTargetItem receiver = (GraphTargetItem) stack.pop(); - String methodName = method_info[methodIndex].getName(constants); + String methodName = method_info.get(methodIndex).getName(constants); stack.push(new CallMethodAVM2Item(ins, receiver, methodName, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java index fcd56b9e2..e90f5118a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java @@ -38,7 +38,7 @@ public class CallPropLexIns extends CallPropertyIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java index dd0cd5285..a2b504b00 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java @@ -56,7 +56,7 @@ public class CallPropVoidIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java index e0c097861..d955cd21e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java @@ -54,7 +54,7 @@ public class CallPropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java index 47ca4b751..e9cd35d4f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java @@ -51,7 +51,7 @@ public class CallStaticIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int methodIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); @@ -59,7 +59,7 @@ public class CallStaticIns extends InstructionDefinition { args.add(0, (GraphTargetItem) stack.pop()); } GraphTargetItem receiver = (GraphTargetItem) stack.pop(); - String methodName = method_info[methodIndex].getName(constants); + String methodName = method_info.get(methodIndex).getName(constants); stack.push(new CallStaticAVM2Item(ins, receiver, methodName, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java index b1633fc4a..dbd69e5f8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java @@ -54,7 +54,7 @@ public class CallSuperIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java index 27a779839..5d274a2bb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java @@ -54,7 +54,7 @@ public class CallSuperVoidIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java index c567decec..1d24ae599 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java @@ -38,7 +38,7 @@ public class IfEqIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new EqAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java index 2965790b6..b1a5bf645 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java @@ -37,7 +37,7 @@ public class IfFalseIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new NotItem(ins, v1)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java index a001bde6a..00f515e06 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java @@ -38,7 +38,7 @@ public class IfGeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GeAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java index 9f9a0060b..8fc30aee8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java @@ -38,7 +38,7 @@ public class IfGtIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GtAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java index aca569ef4..c56ff2c66 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java @@ -38,7 +38,7 @@ public class IfLeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LeAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java index 559b6d179..bf2261ce5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java @@ -38,7 +38,7 @@ public class IfLtIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LtAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java index fd967cd2b..515a49f22 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java @@ -38,7 +38,7 @@ public class IfNGeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LtAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java index 78d3ee5e6..7e38b614b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java @@ -38,7 +38,7 @@ public class IfNGtIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LeAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java index 772d1956f..12ac7507c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java @@ -38,7 +38,7 @@ public class IfNLeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GtAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java index 18423de97..4b3d3a19b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java @@ -38,7 +38,7 @@ public class IfNLtIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GeAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java index 828c8bc9d..0d470317b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java @@ -38,7 +38,7 @@ public class IfNeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new NeqAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java index ab902bb20..b78bda55a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java @@ -38,7 +38,7 @@ public class IfStrictEqIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new StrictEqAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java index 90356ed51..34d6e52c8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java @@ -38,7 +38,7 @@ public class IfStrictNeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = (GraphTargetItem) stack.pop(); GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new StrictNeqAVM2Item(ins, v1, v2)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java index 722f8a5d8..1ee950c28 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java @@ -37,7 +37,7 @@ public class IfTrueIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { //String v1 = stack.pop().toString(); //stack.push("(" + v1 + ")"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java index a5f61d431..75859c659 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java @@ -36,7 +36,7 @@ public class JumpIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { //stack.push(new BooleanAVM2Item(ins, Boolean.TRUE));// + ins.operands[0]); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/LookupSwitchIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/LookupSwitchIns.java index aa9a18f73..a2396fbdd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/LookupSwitchIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/LookupSwitchIns.java @@ -35,7 +35,7 @@ public class LookupSwitchIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { //int defaultOffset = ins.operands[0]; //int caseCount = ins.operands[1]; //stack.push("switch(...)"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java index 0f2600594..0d4ebe365 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java @@ -58,7 +58,7 @@ public class DecLocalIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = ins.operands[0]; output.add(new DecLocalAVM2Item(ins, regId)); if (localRegs.containsKey(regId)) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java index 36cb6eb9f..ad57494c1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java @@ -58,7 +58,7 @@ public class DecLocalIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = ins.operands[0]; output.add(new DecLocalAVM2Item(ins, regId)); if (localRegs.containsKey(regId)) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal0Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal0Ins.java index 8a0e47d79..dadcac48c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal0Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal0Ins.java @@ -43,15 +43,15 @@ public class GetLocal0Ins extends GetLocalTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { - if ((classIndex >= abc.instance_info.length) || classIndex < 0) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + if ((classIndex >= abc.instance_info.size()) || classIndex < 0) { stack.push(new ScriptAVM2Item(scriptIndex)); return; } if (isStatic) { - stack.push(new ClassAVM2Item(abc.instance_info[classIndex].getName(constants))); + stack.push(new ClassAVM2Item(abc.instance_info.get(classIndex).getName(constants))); } else { - stack.push(new ThisAVM2Item(abc.instance_info[classIndex].getName(constants))); + stack.push(new ThisAVM2Item(abc.instance_info.get(classIndex).getName(constants))); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java index 41b330573..78ec1f081 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java @@ -37,7 +37,7 @@ public abstract class GetLocalTypeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = getRegisterId(ins); GraphTargetItem computedValue = localRegs.get(regId); int assignCount = 0; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java index 4b916e2e3..5d075bdf4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java @@ -38,7 +38,7 @@ public class IncLocalIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = ins.operands[0]; output.add(new IncLocalAVM2Item(ins, regId)); if (localRegs.containsKey(regId)) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java index 7e53c7d3e..164ebfc32 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java @@ -38,7 +38,7 @@ public class IncLocalIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = ins.operands[0]; output.add(new IncLocalAVM2Item(ins, regId)); if (localRegs.containsKey(regId)) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/KillIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/KillIns.java index 3491ec3a6..eaebaeb9b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/KillIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/KillIns.java @@ -35,7 +35,7 @@ public class KillIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { //kill local register } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java index 6f2944197..8075a266a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java @@ -47,7 +47,7 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = getRegisterId(ins); GraphTargetItem value = (GraphTargetItem) stack.pop(); /*if (localRegs.containsKey(regId)) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java index d55a80612..52cc319ef 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java @@ -50,7 +50,7 @@ public class DeletePropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); GraphTargetItem obj = (GraphTargetItem) stack.pop(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindDefIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindDefIns.java index 2ee31597a..3bbc86777 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindDefIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindDefIns.java @@ -37,7 +37,7 @@ public class FindDefIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; Multiname multiname = constants.getMultiname(multinameIndex); stack.push(new FindDefAVM2Item(ins, multiname)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java index 863c95391..fcb9e0a20 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java @@ -47,7 +47,7 @@ public class FindPropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); stack.push(new FindPropertyAVM2Item(ins, multiname)); //resolve right object diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java index 90cd22f7e..3da8ee078 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java @@ -46,7 +46,7 @@ public class FindPropertyStrictIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); stack.push(new FindPropertyAVM2Item(ins, multiname)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java index b2f908309..627341f44 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java @@ -47,7 +47,7 @@ public class GetDescendantsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); GraphTargetItem obj = (GraphTargetItem) stack.pop(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java index 40af63e61..00ae12161 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java @@ -43,12 +43,12 @@ public class GetGlobalScopeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { if (scopeStack.isEmpty()) { if (classIndex == -1) { stack.push(new ScriptAVM2Item(scriptIndex)); } else { - stack.push(new ClassAVM2Item(abc.instance_info[classIndex].getName(constants))); + stack.push(new ClassAVM2Item(abc.instance_info.get(classIndex).getName(constants))); } return; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java index 994f9200a..0619483c7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java @@ -39,7 +39,7 @@ public class GetGlobalSlotIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int slotIndex = ins.operands[0]; GraphTargetItem obj = (GraphTargetItem) scopeStack.get(0); //scope Multiname slotname = null; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetLexIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetLexIns.java index e36d87499..4e8a2ecc9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetLexIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetLexIns.java @@ -37,7 +37,7 @@ public class GetLexIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; Multiname multiname = constants.getMultiname(multinameIndex); stack.push(new GetLexAVM2Item(ins, multiname)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java index fa2ab93a0..8217fa0cf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java @@ -37,7 +37,7 @@ public class GetPropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); GraphTargetItem obj = (GraphTargetItem) stack.pop(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java index a2f18d2b2..543c575e1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java @@ -35,7 +35,7 @@ public class GetScopeObjectIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int index = ins.operands[0]; stack.push(scopeStack.get(index)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java index 36b7404cf..15bc53d93 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java @@ -44,7 +44,7 @@ public class GetSlotIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int slotIndex = ins.operands[0]; GraphTargetItem obj = (GraphTargetItem) stack.pop(); //scope obj = obj.getThroughRegister(); @@ -56,8 +56,8 @@ public class GetSlotIns extends InstructionDefinition { } else if (obj instanceof ThisAVM2Item) { slotname = ((ThisAVM2Item) obj).className; } else if (obj instanceof ScriptAVM2Item) { - for (int t = 0; t < abc.script_info[((ScriptAVM2Item) obj).scriptIndex].traits.traits.length; t++) { - Trait tr = abc.script_info[((ScriptAVM2Item) obj).scriptIndex].traits.traits[t]; + for (int t = 0; t < abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits.length; t++) { + Trait tr = abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits[t]; if (tr instanceof TraitWithSlot) { if (((TraitWithSlot) tr).getSlotIndex() == slotIndex) { slotname = tr.getName(abc); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java index a8a667d54..7040dbdf8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java @@ -37,7 +37,7 @@ public class GetSuperIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); GraphTargetItem obj = (GraphTargetItem) stack.pop(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNext2Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNext2Ins.java index 47887d4af..1b48e727b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNext2Ins.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNext2Ins.java @@ -37,7 +37,7 @@ public class HasNext2Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int objectReg = ins.operands[0]; int indexReg = ins.operands[1]; //stack.push("_loc_" + objectReg + ".hasNext(cnt=_loc_" + indexReg + ")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java index 16e3f5f43..9212eadaf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java @@ -36,7 +36,7 @@ public class HasNextIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem curIndex = (GraphTargetItem) stack.pop(); GraphTargetItem obj = (GraphTargetItem) stack.pop(); stack.push(new HasNextAVM2Item(ins, curIndex, obj)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java index 78cf12f7d..607b7b88a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java @@ -36,7 +36,7 @@ public class InIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem obj = (GraphTargetItem) stack.pop(); GraphTargetItem name = (GraphTargetItem) stack.pop(); stack.push(new InAVM2Item(ins, name, obj)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java index a36272f0e..ff8646774 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java @@ -37,7 +37,7 @@ public class InitPropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; GraphTargetItem val = (GraphTargetItem) stack.pop(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextNameIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextNameIns.java index 5273ce9e3..12d70bbf2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextNameIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextNameIns.java @@ -36,7 +36,7 @@ public class NextNameIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem index = stack.pop(); GraphTargetItem obj = stack.pop(); stack.push(new NextNameAVM2Item(ins, index, obj)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextValueIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextValueIns.java index d0d68a423..0d3d0907c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextValueIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextValueIns.java @@ -36,7 +36,7 @@ public class NextValueIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem index = stack.pop(); GraphTargetItem obj = stack.pop(); stack.push(new NextValueAVM2Item(ins, index, obj)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java index a30fc6e9c..454d67747 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java @@ -36,7 +36,7 @@ public class ReturnValueIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { output.add(new ReturnValueAVM2Item(ins, (GraphTargetItem) stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java index e707a1643..275ea8798 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java @@ -36,7 +36,7 @@ public class ReturnVoidIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { output.add(new ReturnVoidAVM2Item(ins)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java index edebce9e3..c4fd6c634 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java @@ -38,7 +38,7 @@ public class SetGlobalSlotIns extends InstructionDefinition implements SetTypeIn } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { output.add(new SetGlobalSlotAVM2Item(ins, ins.operands[0], (GraphTargetItem) stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java index 8f55060db..70c82d255 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java @@ -47,7 +47,7 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; GraphTargetItem value = (GraphTargetItem) stack.pop(); FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); @@ -56,7 +56,7 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns GraphTargetItem inside = ((IncrementAVM2Item) value.getThroughDuplicate().getThroughRegister().getThroughDuplicate()).value.getThroughRegister().getNotCoerced().getThroughDuplicate(); if (inside instanceof GetPropertyAVM2Item) { GetPropertyAVM2Item insideProp = ((GetPropertyAVM2Item) inside); - if (insideProp.propertyName.compareSame(multiname)) { + if (((FullMultinameAVM2Item)insideProp.propertyName).compareSame(multiname)) { GraphTargetItem insideObj = obj.getThroughDuplicate(); if (insideObj instanceof LocalRegAVM2Item) { if (((LocalRegAVM2Item) insideObj).computedValue != null) { @@ -88,7 +88,7 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns GraphTargetItem inside = ((DecrementAVM2Item) value.getThroughDuplicate().getThroughRegister().getThroughDuplicate()).value.getThroughRegister().getNotCoerced().getThroughDuplicate(); if (inside instanceof GetPropertyAVM2Item) { GetPropertyAVM2Item insideProp = ((GetPropertyAVM2Item) inside); - if (insideProp.propertyName.compareSame(multiname)) { + if (((FullMultinameAVM2Item)insideProp.propertyName).compareSame(multiname)) { GraphTargetItem insideObj = obj.getThroughDuplicate(); if (insideObj instanceof LocalRegAVM2Item) { if (((LocalRegAVM2Item) insideObj).computedValue != null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java index e4aeedc79..4a0483021 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java @@ -55,7 +55,7 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int slotIndex = ins.operands[0]; GraphTargetItem value = (GraphTargetItem) stack.pop(); GraphTargetItem obj = (GraphTargetItem) stack.pop(); //scopeId @@ -73,8 +73,8 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { } else if (obj instanceof ThisAVM2Item) { slotname = ((ThisAVM2Item) obj).className; } else if (obj instanceof ScriptAVM2Item) { - for (int t = 0; t < abc.script_info[((ScriptAVM2Item) obj).scriptIndex].traits.traits.length; t++) { - Trait tr = abc.script_info[((ScriptAVM2Item) obj).scriptIndex].traits.traits[t]; + for (int t = 0; t < abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits.length; t++) { + Trait tr = abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits[t]; if (tr instanceof TraitWithSlot) { if (((TraitWithSlot) tr).getSlotIndex() == slotIndex) { slotname = tr.getName(abc); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java index 0eaffcb7e..dae44658a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java @@ -42,7 +42,7 @@ public class SetSuperIns extends InstructionDefinition implements SetTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; GraphTargetItem value = (GraphTargetItem) stack.pop(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java index dc4b5b406..80e32d32d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java @@ -36,7 +36,7 @@ public class ThrowIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { output.add(new ThrowAVM2Item(ins, (GraphTargetItem) stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java index b6f6a1db4..ded77249f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java @@ -44,7 +44,7 @@ public class DupIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = stack.pop(); stack.push(v); stack.push(new DuplicateItem(ins, v)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java index e78047f14..435d5b083 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java @@ -47,7 +47,7 @@ public class PopIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { if (stack.size() > 0) { GraphTargetItem top = stack.pop(); if (top instanceof CallPropertyAVM2Item) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java index 3c411c921..26f90ca58 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java @@ -43,7 +43,7 @@ public class PopScopeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem scope = (GraphTargetItem) scopeStack.pop(); if (scope instanceof WithObjectAVM2Item) { scope = ((WithObjectAVM2Item) scope).scope; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java index 1250a9e74..670740d4a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java @@ -42,7 +42,7 @@ public class PushByteIns extends InstructionDefinition implements PushIntegerTyp } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IntegerValueAVM2Item(ins, Long.valueOf(ins.operands[0]))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java index af37ef76a..6ffc48495 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java @@ -42,7 +42,7 @@ public class PushDoubleIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new FloatValueAVM2Item(ins, constants.getDouble(ins.operands[0]))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java index 673778c5b..572752c39 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java @@ -42,7 +42,7 @@ public class PushFalseIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new BooleanAVM2Item(ins, Boolean.FALSE)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java index bb33b6ddd..c071efedb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java @@ -42,7 +42,7 @@ public class PushIntIns extends InstructionDefinition implements PushIntegerType } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IntegerValueAVM2Item(ins, constants.getInt(ins.operands[0]))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNamespaceIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNamespaceIns.java index b1c996fda..c86c91885 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNamespaceIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNamespaceIns.java @@ -36,7 +36,7 @@ public class PushNamespaceIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new NameSpaceAVM2Item(ins, ins.operands[0])); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNanIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNanIns.java index 3421805a0..2af933893 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNanIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNanIns.java @@ -36,7 +36,7 @@ public class PushNanIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new NanAVM2Item(ins)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNullIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNullIns.java index 4628e6f16..eddd07d58 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNullIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNullIns.java @@ -36,7 +36,7 @@ public class PushNullIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new NullAVM2Item(ins)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java index 927e6e68e..0cad1314b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java @@ -41,7 +41,7 @@ public class PushScopeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { scopeStack.push(stack.pop()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java index d314899b3..bfb64cfb0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java @@ -42,7 +42,7 @@ public class PushShortIns extends InstructionDefinition implements PushIntegerTy } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IntegerValueAVM2Item(ins, Long.valueOf(ins.operands[0]))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java index 08132c73b..dbfea4b89 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java @@ -42,7 +42,7 @@ public class PushStringIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new StringAVM2Item(ins, constants.getString(ins.operands[0]))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java index f951c3646..4740fe516 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java @@ -42,7 +42,7 @@ public class PushTrueIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new BooleanAVM2Item(ins, Boolean.TRUE)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java index b0a598d29..8d2ca76d2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java @@ -42,7 +42,7 @@ public class PushUIntIns extends InstructionDefinition implements PushIntegerTyp } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IntegerValueAVM2Item(ins, constants.getUInt(ins.operands[0]))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUndefinedIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUndefinedIns.java index bf51f00be..80581e9c4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUndefinedIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUndefinedIns.java @@ -36,7 +36,7 @@ public class PushUndefinedIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new UndefinedAVM2Item(ins)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java index 03e8cade7..5fc640de9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java @@ -37,7 +37,7 @@ public class PushWithIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem w = (GraphTargetItem) stack.pop(); WithObjectAVM2Item wot = new WithObjectAVM2Item(ins, w); scopeStack.push(wot); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java index 65b19f02e..19d41ef9e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java @@ -45,7 +45,7 @@ public class SwapIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem o1 = stack.pop(); GraphTargetItem o2 = stack.pop(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java index 27bb22326..dedee575e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java @@ -50,7 +50,7 @@ public class ApplyTypeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int argCount = ins.operands[0]; List params = new ArrayList<>(); for (int i = 0; i < argCount; i++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java index 7e59227b2..0bfbf5f07 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java @@ -48,7 +48,7 @@ public class AsTypeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem val = (GraphTargetItem) stack.pop(); stack.push(new AsTypeAVM2Item(ins, val, new FullMultinameAVM2Item(ins, ins.operands[0]))); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java index 48c8e352b..169d6c86d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java @@ -46,7 +46,7 @@ public class AsTypeLateIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem cls = (GraphTargetItem) stack.pop(); GraphTargetItem val = (GraphTargetItem) stack.pop(); stack.push(new AsTypeAVM2Item(ins, val, cls)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java index a283a3dba..daec32e3a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java @@ -46,7 +46,7 @@ public class CoerceAIns extends InstructionDefinition implements CoerceOrConvert } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new CoerceAVM2Item(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java index 322d43a6d..d70ac462a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java @@ -43,7 +43,7 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; stack.push(new CoerceAVM2Item(ins, (GraphTargetItem) stack.pop(), constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java index ec3d275da..bcc1057c6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java @@ -43,7 +43,7 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new CoerceAVM2Item(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java index c08179681..0df3194c9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java @@ -53,7 +53,7 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java index ceb7acbae..714fd8b24 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java @@ -61,7 +61,7 @@ public class ConvertDIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java index 476aa5d5b..bba2c7d33 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java @@ -59,7 +59,7 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java index 2d759e6c4..74e630bea 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java @@ -42,7 +42,7 @@ public class ConvertOIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java index 1a02b49ac..92a2c7806 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java @@ -43,7 +43,7 @@ public class ConvertSIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java index 0fbca80a2..67efcbda1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java @@ -42,7 +42,7 @@ public class ConvertUIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java index 4893e5e1b..951b4cce2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java @@ -36,7 +36,7 @@ public class InstanceOfIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem type = (GraphTargetItem) stack.pop(); GraphTargetItem value = (GraphTargetItem) stack.pop(); stack.push(new InstanceOfAVM2Item(ins, value, type)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java index 641cd602e..5ac1ca02d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java @@ -37,7 +37,7 @@ public class IsTypeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; GraphTargetItem value = (GraphTargetItem) stack.pop(); stack.push(new IsTypeAVM2Item(ins, value, new FullMultinameAVM2Item(ins, multinameIndex))); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java index c0f2889f1..98d8d0618 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java @@ -36,7 +36,7 @@ public class IsTypeLateIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem type = (GraphTargetItem) stack.pop(); GraphTargetItem value = (GraphTargetItem) stack.pop(); stack.push(new IsTypeAVM2Item(ins, value, type)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java index 3aa47bceb..682cb4b44 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java @@ -36,7 +36,7 @@ public class TypeOfIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new TypeOfAVM2Item(ins, (GraphTargetItem) stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java index b6bf77678..91009a1a9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java @@ -42,7 +42,7 @@ public class CheckFilterIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem obj = stack.pop(); stack.push(new FilteredCheckAVM2Item(ins, obj)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java index 73ee52a67..55c807ae9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java @@ -46,7 +46,7 @@ public class DXNSIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { output.add(new DefaultXMLNamespace(ins, new StringAVM2Item(ins, constants.getString(ins.operands[0])))); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java index 434dfa416..f588cad47 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java @@ -43,7 +43,7 @@ public class DXNSLateIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem xmlns = stack.pop(); output.add(new DefaultXMLNamespace(ins, xmlns)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java index 789d72af1..5583a028e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java @@ -44,7 +44,7 @@ public class EscXAttrIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new EscapeXAttrAVM2Item(ins, stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java index 4b5b191ff..4ff0d7a0e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java @@ -44,7 +44,7 @@ public class EscXElemIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new EscapeXElemAVM2Item(ins, stack.pop())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java index 0bad8583d..f5ec24a3d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java @@ -25,11 +25,11 @@ import java.util.List; public class CallPropertyAVM2Item extends AVM2Item { public GraphTargetItem receiver; - public FullMultinameAVM2Item propertyName; + public GraphTargetItem propertyName; public List arguments; public boolean isVoid; - public CallPropertyAVM2Item(AVM2Instruction instruction, boolean isVoid, GraphTargetItem receiver, FullMultinameAVM2Item propertyName, List arguments) { + public CallPropertyAVM2Item(AVM2Instruction instruction, boolean isVoid, GraphTargetItem receiver, GraphTargetItem propertyName, List arguments) { super(instruction, PRECEDENCE_PRIMARY); this.receiver = receiver; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java index c5953a71f..fe1742f1f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java @@ -28,12 +28,19 @@ public class CoerceAVM2Item extends AVM2Item { //public GraphTargetItem value; public String type; + public GraphTargetItem typeObj; public CoerceAVM2Item(AVM2Instruction instruction, GraphTargetItem value, String type) { super(instruction, NOPRECEDENCE); this.value = value; this.type = type; } + + public CoerceAVM2Item(AVM2Instruction instruction, GraphTargetItem value, GraphTargetItem typeObj) { + super(instruction, NOPRECEDENCE); + this.value = value; + this.typeObj = typeObj; + } @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java index 01108c4e8..1987e0911 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java @@ -25,10 +25,10 @@ import java.util.List; public class ConstructPropAVM2Item extends AVM2Item { public GraphTargetItem object; - public FullMultinameAVM2Item propertyName; + public GraphTargetItem propertyName; public List args; - public ConstructPropAVM2Item(AVM2Instruction instruction, GraphTargetItem object, FullMultinameAVM2Item propertyName, List args) { + public ConstructPropAVM2Item(AVM2Instruction instruction, GraphTargetItem object, GraphTargetItem propertyName, List args) { super(instruction, PRECEDENCE_PRIMARY); this.object = object; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java index 273ff2690..06f761338 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java @@ -18,13 +18,14 @@ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.model.LocalData; public class FindPropertyAVM2Item extends AVM2Item { - public FullMultinameAVM2Item propertyName; + public GraphTargetItem propertyName; - public FindPropertyAVM2Item(AVM2Instruction instruction, FullMultinameAVM2Item propertyName) { + public FindPropertyAVM2Item(AVM2Instruction instruction, GraphTargetItem propertyName) { super(instruction, PRECEDENCE_PRIMARY); this.propertyName = propertyName; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java index 5b1803a7a..60d42e722 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java @@ -24,9 +24,9 @@ import com.jpexs.decompiler.graph.model.LocalData; public class GetPropertyAVM2Item extends AVM2Item { public GraphTargetItem object; - public FullMultinameAVM2Item propertyName; + public GraphTargetItem propertyName; - public GetPropertyAVM2Item(AVM2Instruction instruction, GraphTargetItem object, FullMultinameAVM2Item propertyName) { + public GetPropertyAVM2Item(AVM2Instruction instruction, GraphTargetItem object, GraphTargetItem propertyName) { super(instruction, PRECEDENCE_PRIMARY); this.object = object; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java index 54ee5d3c7..19d9def7f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java @@ -39,10 +39,10 @@ public class NewFunctionAVM2Item extends AVM2Item { public ABC abc; public List fullyQualifiedNames; public ConstantPool constants; - public MethodInfo[] methodInfo; + public List methodInfo; public int methodIndex; - public NewFunctionAVM2Item(AVM2Instruction instruction, String functionName, String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, List fullyQualifiedNames, ConstantPool constants, MethodInfo[] methodInfo, int methodIndex) { + public NewFunctionAVM2Item(AVM2Instruction instruction, String functionName, String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, List fullyQualifiedNames, ConstantPool constants, List methodInfo, int methodIndex) { super(instruction, PRECEDENCE_PRIMARY); this.functionName = functionName; this.path = path; @@ -62,9 +62,9 @@ public class NewFunctionAVM2Item extends AVM2Item { writer.append("function" + (!functionName.isEmpty() ? " " + functionName : "")); writer.startMethod(methodIndex); writer.appendNoHilight("("); - methodInfo[methodIndex].getParamStr(writer, constants, body, abc, fullyQualifiedNames); + methodInfo.get(methodIndex).getParamStr(writer, constants, body, abc, fullyQualifiedNames); writer.appendNoHilight("):"); - methodInfo[methodIndex].getReturnTypeStr(writer, constants, fullyQualifiedNames); + methodInfo.get(methodIndex).getReturnTypeStr(writer, constants, fullyQualifiedNames); writer.endMethod(); writer.newLine(); writer.append("{").newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java index 4d3d400e4..036bdc7be 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java @@ -26,7 +26,7 @@ import com.jpexs.decompiler.graph.model.LocalData; public class SetPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, AssignmentAVM2Item { public GraphTargetItem object; - public FullMultinameAVM2Item propertyName; + public GraphTargetItem propertyName; public GraphTargetItem value; @Override @@ -34,7 +34,7 @@ public class SetPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, As return value.getFirstPart(); } - public SetPropertyAVM2Item(AVM2Instruction instruction, GraphTargetItem object, FullMultinameAVM2Item propertyName, GraphTargetItem value) { + public SetPropertyAVM2Item(AVM2Instruction instruction, GraphTargetItem object, GraphTargetItem propertyName, GraphTargetItem value) { super(instruction, PRECEDENCE_ASSIGMENT); this.object = object; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java index 8b8683d2e..5654ee9e0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java @@ -26,9 +26,9 @@ import com.jpexs.decompiler.graph.model.LocalData; public class DeletePropertyAVM2Item extends AVM2Item { public GraphTargetItem object; - public FullMultinameAVM2Item propertyName; + public GraphTargetItem propertyName; - public DeletePropertyAVM2Item(AVM2Instruction instruction, GraphTargetItem object, FullMultinameAVM2Item propertyName) { + public DeletePropertyAVM2Item(AVM2Instruction instruction, GraphTargetItem object, GraphTargetItem propertyName) { super(instruction, PRECEDENCE_UNARY); this.object = object; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java similarity index 97% rename from trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java rename to trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java index 474a8574f..b11939718 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java @@ -14,8 +14,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.abc.avm2.parser; +package com.jpexs.decompiler.flash.abc.avm2.parser.pcode; +import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/Flasm3Lexer.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/Flasm3Lexer.java similarity index 97% rename from trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/Flasm3Lexer.java rename to trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/Flasm3Lexer.java index 76dbb9988..f1bddc364 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/Flasm3Lexer.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/Flasm3Lexer.java @@ -17,8 +17,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.abc.avm2.parser; +package com.jpexs.decompiler.flash.abc.avm2.parser.pcode; +import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import java.util.Stack; /** diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/MissingSymbolHandler.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/MissingSymbolHandler.java similarity index 91% rename from trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/MissingSymbolHandler.java rename to trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/MissingSymbolHandler.java index aac785a23..64393df71 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/MissingSymbolHandler.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/MissingSymbolHandler.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.abc.avm2.parser; +package com.jpexs.decompiler.flash.abc.avm2.parser.pcode; public interface MissingSymbolHandler { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ParsedSymbol.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ParsedSymbol.java similarity index 96% rename from trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ParsedSymbol.java rename to trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ParsedSymbol.java index ffdb40158..ca75c53eb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ParsedSymbol.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ParsedSymbol.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.abc.avm2.parser; +package com.jpexs.decompiler.flash.abc.avm2.parser.pcode; public class ParsedSymbol { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/flasm3.flex b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/flasm3.flex similarity index 99% rename from trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/flasm3.flex rename to trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/flasm3.flex index c3295aabb..1bf827d08 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/flasm3.flex +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/flasm3.flex @@ -1,6 +1,6 @@ /* Flash assembler language lexer specification */ -package com.jpexs.decompiler.flash.abc.avm2.parser; +package com.jpexs.decompiler.flash.abc.avm2.parser.pcode; import java.util.Stack; %% diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java new file mode 100644 index 000000000..c8933d6a9 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -0,0 +1,664 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.NotIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.comparison.StrictEqualsIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfTrueIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocalIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.DupIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns; +import com.jpexs.decompiler.flash.abc.avm2.model.GetPropertyAVM2Item; +import com.jpexs.decompiler.flash.abc.types.ClassInfo; +import com.jpexs.decompiler.flash.abc.types.InstanceInfo; +import com.jpexs.decompiler.flash.abc.types.ScriptInfo; +import com.jpexs.decompiler.flash.abc.types.traits.Trait; +import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; +import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; +import com.jpexs.decompiler.flash.abc.types.traits.Traits; +import com.jpexs.decompiler.flash.action.swf4.ActionPush; +import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable; +import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; +import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; +import com.jpexs.decompiler.flash.action.swf5.ActionGetMember; +import com.jpexs.decompiler.flash.action.swf5.ActionPushDuplicate; +import com.jpexs.decompiler.flash.action.swf5.ActionSetMember; +import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; +import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals; +import com.jpexs.decompiler.flash.helpers.collections.MyEntry; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; +import com.jpexs.decompiler.graph.model.AndItem; +import com.jpexs.decompiler.graph.model.BreakItem; +import com.jpexs.decompiler.graph.model.CommaExpressionItem; +import com.jpexs.decompiler.graph.model.ContinueItem; +import com.jpexs.decompiler.graph.model.DoWhileItem; +import com.jpexs.decompiler.graph.model.DuplicateItem; +import com.jpexs.decompiler.graph.model.ForItem; +import com.jpexs.decompiler.graph.model.IfItem; +import com.jpexs.decompiler.graph.model.NotItem; +import com.jpexs.decompiler.graph.model.OrItem; +import com.jpexs.decompiler.graph.model.SwitchItem; +import com.jpexs.decompiler.graph.model.TernarOpItem; +import com.jpexs.decompiler.graph.model.WhileItem; +import com.jpexs.helpers.Helper; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author JPEXS + */ +public class AVM2SourceGenerator implements SourceGenerator { + + private AVM2Instruction ins(InstructionDefinition def,int...operands) + { + return new AVM2Instruction(0, def, operands, new byte[0]); + } + + @Override + public List generate(SourceGeneratorLocalData localData, AndItem item) { + List ret = new ArrayList<>(); + ret.addAll(generateToActionList(localData, item.leftSide)); + ret.add(new ActionPushDuplicate()); + ret.add(ins(new NotIns())); + List andExpr = generateToActionList(localData, item.rightSide); + andExpr.add(0, ins(new PopIns())); + int andExprLen = insToBytes(andExpr).length; + ret.add(ins(new IfTrueIns(),andExprLen)); + ret.addAll(andExpr); + return ret; + + } + + private byte[] insToBytes(List code){ + try { + ByteArrayOutputStream baos=new ByteArrayOutputStream(); + for (AVM2Instruction instruction : code) { + + baos.write(instruction.getBytes()); + + } + return baos.toByteArray(); + } catch (IOException ex) { + Logger.getLogger(AVM2SourceGenerator.class.getName()).log(Level.SEVERE, null, ex); + } + return new byte[0]; + } + + @Override + public List generate(SourceGeneratorLocalData localData, OrItem item) { + List ret = new ArrayList<>(); + ret.addAll(generateToActionList(localData, item.leftSide)); + ret.add(new ActionPushDuplicate()); + List orExpr = generateToActionList(localData, item.rightSide); + orExpr.add(0, ins(new PopIns())); + int orExprLen = insToBytes(orExpr).length; + ret.add(ins(new IfTrueIns(),orExprLen)); + ret.addAll(orExpr); + return ret; + } + + public List toActionList(List items) { + List ret = new ArrayList<>(); + for (GraphSourceItem s : items) { + if (s instanceof AVM2Instruction) { + ret.add((AVM2Instruction) s); + } + } + return ret; + } + + private List nonempty(List list) { + if (list == null) { + return new ArrayList<>(); + } + return list; + } + + private List generateIf(SourceGeneratorLocalData localData, GraphTargetItem expression, List onTrueCmds, List onFalseCmds, boolean ternar) { + List ret = new ArrayList<>(); + if (false){//expression instanceof Inverted) { + //ret.addAll(((Inverted) expression).invert().toSource(localData, this)); + } else { + ret.addAll(expression.toSource(localData, this)); + ret.add(ins(new NotIns())); + } + List onTrue = null; + List onFalse = null; + if (ternar) { + onTrue = toActionList(onTrueCmds.get(0).toSource(localData, this)); + } else { + onTrue = generateToActionList(localData, onTrueCmds); + } + + if (onFalseCmds != null && !onFalseCmds.isEmpty()) { + if (ternar) { + onFalse = toActionList(onFalseCmds.get(0).toSource(localData, this)); + } else { + onFalse = generateToActionList(localData, onFalseCmds); + } + } + byte[] onTrueBytes = insToBytes(onTrue); + int onTrueLen = onTrueBytes.length; + + AVM2Instruction ifaif = ins(new IfTrueIns(),0); + ret.add(ifaif); + ret.addAll(onTrue); + ifaif.operands[0]=(onTrueLen); + AVM2Instruction ajmp = null; + if (onFalse != null) { + if (!((!nonempty(onTrue).isEmpty()) + && (onTrue.get(onTrue.size() - 1).definition instanceof JumpIns) + //&& ((((ActionJump) onTrue.get(onTrue.size() - 1)).isContinue) + //|| (((ActionJump) onTrue.get(onTrue.size() - 1)).isBreak)) //TODO + ) + ) { + ajmp = ins(new JumpIns(),0); + ret.add(ajmp); + onTrueLen += ajmp.getBytes().length; + } + ifaif.operands[0]=onTrueLen; + byte[] onFalseBytes = insToBytes(onFalse); + int onFalseLen = onFalseBytes.length; + if (ajmp != null) { + ajmp.operands[0]=onFalseLen; + } + ret.addAll(onFalse); + } + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, IfItem item) { + return generateIf(localData, item.expression, item.onTrue, item.onFalse, false); + } + + private void fixLoop(List code, int breakOffset) { + fixLoop(code, breakOffset, Integer.MAX_VALUE); + } + + private void fixLoop(List code, int breakOffset, int continueOffset) { + int pos = 0; + //TODO: handle loops - continue, break + for (AVM2Instruction a : code) { + pos += a.getBytes().length; + if (a.definition instanceof JumpIns) { + /*ActionJump aj = (ActionJump) a; + if (aj.isContinue && (continueOffset != Integer.MAX_VALUE)) { + aj.operands[0]=(-pos + continueOffset); + aj.isContinue = false; + } + if (aj.isBreak) { + aj.operands[0]=(-pos + breakOffset); + aj.isBreak = false; + }*/ + } + } + } + + @Override + public List generate(SourceGeneratorLocalData localData, TernarOpItem item) { + List onTrue = new ArrayList<>(); + onTrue.add(item.onTrue); + List onFalse = new ArrayList<>(); + onFalse.add(item.onFalse); + return generateIf(localData, item.expression, onTrue, onFalse, true); + } + + @Override + public List generate(SourceGeneratorLocalData localData, WhileItem item) { + List ret = new ArrayList<>(); + List whileExpr = new ArrayList<>(); + + List ex = new ArrayList<>(item.expression); + if (!ex.isEmpty()) { + GraphTargetItem lastItem = ex.remove(ex.size() - 1); + whileExpr.addAll(generateToActionList(localData, ex)); + whileExpr.addAll(toActionList(lastItem.toSource(localData, this))); //Want result + } + + List whileBody = generateToActionList(localData, item.commands); + whileExpr.add(ins(new NotIns())); + AVM2Instruction whileaif = ins(new IfTrueIns(),0); + whileExpr.add(whileaif); + AVM2Instruction whileajmp = ins(new JumpIns(),0); + whileBody.add(whileajmp); + int whileExprLen = insToBytes(whileExpr).length; + int whileBodyLen = insToBytes(whileBody).length; + whileajmp.operands[0]=(-(whileExprLen + + whileBodyLen)); + whileaif.operands[0]=(whileBodyLen); + ret.addAll(whileExpr); + fixLoop(whileBody, whileBodyLen, -whileExprLen); + ret.addAll(whileBody); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, DoWhileItem item) { + List ret = new ArrayList<>(); + List doExpr = generateToActionList(localData, item.expression); + List doBody = generateToActionList(localData, item.commands); + + int doBodyLen = insToBytes(doBody).length; + int doExprLen = insToBytes(doExpr).length; + + ret.addAll(doBody); + ret.addAll(doExpr); + AVM2Instruction doif = ins(new IfTrueIns(),0); + ret.add(doif); + doif.operands[0]=(-doBodyLen - doExprLen - doif.getBytes().length); + fixLoop(doBody, doBodyLen + doExprLen + doif.getBytes().length, doBodyLen); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, ForItem item) { + List ret = new ArrayList<>(); + List forExpr = generateToActionList(localData, item.expression); + List forBody = generateToActionList(localData, item.commands); + List forFinalCommands = generateToActionList(localData, item.finalCommands); + + forExpr.add(ins(new NotIns())); + AVM2Instruction foraif = ins(new IfTrueIns(),0); + forExpr.add(foraif); + AVM2Instruction forajmp = ins(new JumpIns(),0); + int forajmpLen = forajmp.getBytes().length; + int forExprLen = insToBytes(forExpr).length; + int forBodyLen = insToBytes(forBody).length; + int forFinalLen = insToBytes(forFinalCommands).length; + forajmp.operands[0]=(-(forExprLen + + forBodyLen + forFinalLen + forajmpLen)); + foraif.operands[0]=(forBodyLen + forFinalLen + forajmpLen); + ret.addAll(forExpr); + ret.addAll(forBody); + ret.addAll(forFinalCommands); + ret.add(forajmp); + fixLoop(forBody, forBodyLen + forFinalLen + forajmpLen, forBodyLen); + return ret; + } + private long uniqLast = 0; + + public String uniqId() { + uniqLast++; + return "" + uniqLast; + } + + @Override + public List generate(SourceGeneratorLocalData localData, SwitchItem item) { + List ret = new ArrayList<>(); + HashMap registerVars = getRegisterVars(localData); + int exprReg = 0; + for (int i = 0; i < 256; i++) { + if (!registerVars.containsValue(i)) { + registerVars.put("__switch" + uniqId(), i); + exprReg = i; + break; + } + } + + ret.addAll(toActionList(item.switchedObject.toSource(localData, this))); + + boolean firstCase = true; + List> caseIfs = new ArrayList<>(); + List> caseCmds = new ArrayList<>(); + List>> caseExprsAll = new ArrayList<>(); + + loopm: + for (int m = 0; m < item.caseValues.size(); m++) { + List> caseExprs = new ArrayList<>(); + List caseIfsOne = new ArrayList<>(); + int mapping = item.valuesMapping.get(m); + for (; m < item.caseValues.size(); m++) { + int newmapping = item.valuesMapping.get(m); + if (newmapping != mapping) { + m--; + break; + } + List curCaseExpr = generateToActionList(localData, item.caseValues.get(m)); + caseExprs.add(curCaseExpr); + if (firstCase) { + curCaseExpr.add(0, ins(new DupIns(),exprReg)); + curCaseExpr.add(0, ins(new SetLocalIns(),exprReg)); + } else { + curCaseExpr.add(0, ins(new GetLocalIns(),exprReg)); + } + curCaseExpr.add(ins(new StrictEqualsIns())); + AVM2Instruction aif = ins(new IfTrueIns(),0); + caseIfsOne.add(aif); + curCaseExpr.add(aif); + ret.addAll(curCaseExpr); + firstCase = false; + } + caseExprsAll.add(caseExprs); + caseIfs.add(caseIfsOne); + List caseCmd = generateToActionList(localData, item.caseCommands.get(mapping)); + caseCmds.add(caseCmd); + } + AVM2Instruction defJump = ins(new JumpIns(),0); + ret.add(defJump); + List defCmd = new ArrayList<>(); + if (!item.defaultCommands.isEmpty()) { + defCmd = generateToActionList(localData, item.defaultCommands); + } + for (List caseCmd : caseCmds) { + ret.addAll(caseCmd); + } + ret.addAll(defCmd); + + List> exprLengths = new ArrayList<>(); + for (List> caseExprs : caseExprsAll) { + List lengths = new ArrayList<>(); + for (List caseExpr : caseExprs) { + lengths.add(insToBytes(caseExpr).length); + } + exprLengths.add(lengths); + } + List caseLengths = new ArrayList<>(); + for (List caseCmd : caseCmds) { + caseLengths.add(insToBytes(caseCmd).length); + } + int defLength = insToBytes(defCmd).length; + + for (int i = 0; i < caseIfs.size(); i++) { + for (int c = 0; c < caseIfs.get(i).size(); c++) { + int jmpPos = 0; + for (int j = c + 1; j < caseIfs.get(i).size(); j++) { + jmpPos += exprLengths.get(i).get(j); + } + for (int k = i + 1; k < caseIfs.size(); k++) { + for (int m = 0; m < caseIfs.get(k).size(); m++) { + jmpPos += exprLengths.get(k).get(m); + } + } + jmpPos += defJump.getBytes().length; + for (int n = 0; n < i; n++) { + jmpPos += caseLengths.get(n); + } + caseIfs.get(i).get(c).operands[0]=(jmpPos); + } + } + int defJmpPos = 0; + for (int i = 0; i < caseIfs.size(); i++) { + defJmpPos += caseLengths.get(i); + } + + defJump.operands[0]=(defJmpPos); + List caseCmdsAll = new ArrayList<>(); + int breakOffset = 0; + for (int i = 0; i < caseCmds.size(); i++) { + caseCmdsAll.addAll(caseCmds.get(i)); + breakOffset += caseLengths.get(i); + } + breakOffset += defLength; + fixLoop(caseCmdsAll, breakOffset); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, NotItem item) { + /*if (item.getOriginal() instanceof Inverted) { + GraphTargetItem norig = ((Inverted) item).invert(); + return norig.toSource(localData, this); + }*/ + List ret = new ArrayList<>(); + ret.addAll(item.getOriginal().toSource(localData, this)); + ret.add(ins(new NotIns())); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, DuplicateItem item) { + List ret = new ArrayList<>(); + ret.add(new ActionPushDuplicate()); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, BreakItem item) { + List ret = new ArrayList<>(); + AVM2Instruction abreak = ins(new JumpIns(),0); + //TODO: handle break + //abreak.isBreak = true; + ret.add(abreak); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, ContinueItem item) { + List ret = new ArrayList<>(); + AVM2Instruction acontinue = ins(new JumpIns(),0); + //TODO: handle continue + //acontinue.isContinue = true; + ret.add(acontinue); + return ret; + } + + private List generateToActionList(SourceGeneratorLocalData localData, List commands) { + return toActionList(generate(localData, commands)); + } + + private List generateToActionList(SourceGeneratorLocalData localData, GraphTargetItem command) { + return toActionList(command.toSource(localData, this)); + } + + @Override + public List generate(SourceGeneratorLocalData localData, List commands) { + List ret = new ArrayList<>(); + for (GraphTargetItem item : commands) { + ret.addAll(item.toSourceIgnoreReturnValue(localData, this)); + } + return ret; + } + + public HashMap getRegisterVars(SourceGeneratorLocalData localData) { + return localData.registerVars; + } + + public void setRegisterVars(SourceGeneratorLocalData localData, HashMap value) { + localData.registerVars = value; + } + + public void setInFunction(SourceGeneratorLocalData localData, int value) { + localData.inFunction = value; + } + + public int isInFunction(SourceGeneratorLocalData localData) { + return localData.inFunction; + } + + public boolean isInMethod(SourceGeneratorLocalData localData) { + return localData.inMethod; + } + + public void setInMethod(SourceGeneratorLocalData localData, boolean value) { + localData.inMethod = value; + } + + public int getForInLevel(SourceGeneratorLocalData localData) { + return localData.forInLevel; + } + + public void setForInLevel(SourceGeneratorLocalData localData, int value) { + localData.forInLevel = value; + } + + public int getTempRegister(SourceGeneratorLocalData localData) { + HashMap registerVars = getRegisterVars(localData); + int tmpReg = 0; + for (int i = 0; i < 256; i++) { + if (!registerVars.containsValue(i)) { + tmpReg = i; + break; + } + } + return tmpReg; + } + + private String getName(GraphTargetItem item) { + if (item instanceof VariableAVM2Item) { + return ((VariableAVM2Item) item).getVariableName(); + } + if (item instanceof GetPropertyAVM2Item) { + GetPropertyAVM2Item mem = (GetPropertyAVM2Item) item; + return getName(mem.propertyName); + } + return null; + } + + private List getVarParts(GraphTargetItem item) { + List ret = new ArrayList<>(); + do { + if (item instanceof GetPropertyAVM2Item) { + GetPropertyAVM2Item mem = (GetPropertyAVM2Item) item; + ret.add(0, getName(mem)); + item = mem.object; + } + } while (item instanceof GetPropertyAVM2Item); + String f = getName(item); + if (f != null) { + ret.add(0, f); + } + return ret; + } + + + private final ABC abc; + + public AVM2SourceGenerator(ABC abc) { + this.abc = abc; + } + + public ABC getABC() { + return abc; + } + + + public void generateClass(ClassInfo classInfo,InstanceInfo instanceInfo,SourceGeneratorLocalData localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List functions, List> vars, List staticFunctions, List> staticVars) { + List extendsStr = getVarParts(extendsVal); + List ret = new ArrayList<>(); + + classInfo.cinit_index = 0; //class_initializer + + ParsedSymbol s = null; + List constr = new ArrayList<>(); + + if (constructor == null) { + instanceInfo.iinit_index = 0; //TODO + //TODO: default constr + } else { + instanceInfo.iinit_index = 0; //TODO: set constructor + } + List staticTraits=new ArrayList(); + List instanceTraits=new ArrayList(); + if (!isInterface) { + for (GraphTargetItem f : staticFunctions) { + TraitMethodGetterSetter tmgs = new TraitMethodGetterSetter(); + tmgs.method_info = 0; //TODO + tmgs.name_index = 0; //TODO + staticTraits.add(tmgs); + } + for (GraphTargetItem f : functions) { + TraitMethodGetterSetter tmgs = new TraitMethodGetterSetter(); + tmgs.method_info = 0; //TODO + tmgs.name_index = 0; //TODO + instanceTraits.add(tmgs); + } + for (MyEntry en : staticVars) { + TraitSlotConst tsc=new TraitSlotConst(); + tsc.type_index = 0; //TODO + tsc.value_index = 0; //TODO + tsc.value_kind = 0; //TODO + staticTraits.add(tsc); + + } + for (MyEntry en : vars) { + TraitSlotConst tsc=new TraitSlotConst(); + tsc.type_index = 0; //TODO + tsc.value_index = 0; //TODO + tsc.value_kind = 0; //TODO + instanceTraits.add(tsc); + } + } + + if (!extendsStr.isEmpty()) { + instanceInfo.super_index = 0;//TODO + } + if (!isInterface) { + + } + + if (!implementsStr.isEmpty()) { + for (GraphTargetItem imp : implementsStr) { + instanceInfo.interfaces[0] = 0; //TODO + } + } + + } + + @Override + public List generate(SourceGeneratorLocalData localData, CommaExpressionItem item) { + if (item.commands.isEmpty()) { + return new ArrayList<>(); + } + + //We need to handle commands and last expression separately, otherwise last expression result will be popped + List cmds = new ArrayList<>(item.commands); + GraphTargetItem lastExpr = cmds.remove(cmds.size() - 1); + List ret = new ArrayList<>(); + ret.addAll(generate(localData, cmds)); + ret.addAll(lastExpr.toSource(localData, this)); + return ret; + } + + + public Traits generateScriptTraits(SourceGeneratorLocalData localData, List commands){ + Traits t=new Traits(); + for(GraphTargetItem item:commands) + { + if(item instanceof ClassAVM2Item){ + + } + if(item instanceof VariableAVM2Item) + { + + } + } + return t; + } + + public ScriptInfo generateScriptInfo(SourceGeneratorLocalData localData, List commands){ + ScriptInfo si=new ScriptInfo(); + si.init_index = 0; //TODO + si.traits = generateScriptTraits(localData, commands); + return si; + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java new file mode 100644 index 000000000..6858c6665 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java @@ -0,0 +1,1669 @@ +/* The following code was generated by JFlex 1.4.3 on 20.3.14 15:36 */ + +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; +import java.util.Stack; +import java.util.List; +import java.util.ArrayList; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 20.3.14 15:36 from the specification file + * C:/Dropbox/Programovani/JavaSE/FFDec/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex + */ +public final class ActionScriptLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int XML = 8; + public static final int XMLSTARTTAG = 6; + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int CHARLITERAL = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\14\1\72"+ + "\1\16\1\0\1\6\1\101\1\75\1\30\1\62\1\63\1\5\1\77"+ + "\1\71\1\26\1\11\1\4\1\17\3\23\4\24\2\20\1\10\1\70"+ + "\1\12\1\15\1\13\1\74\1\102\4\22\1\25\1\22\2\6\1\60"+ + "\4\6\1\61\11\6\1\21\2\6\1\66\1\27\1\67\1\100\1\6"+ + "\1\0\1\34\1\31\1\36\1\45\1\33\1\46\1\57\1\51\1\43"+ + "\1\6\1\35\1\47\1\54\1\41\1\40\1\52\1\6\1\32\1\37"+ + "\1\42\1\44\1\55\1\50\1\56\1\53\1\6\1\64\1\76\1\65"+ + "\1\73\41\7\2\0\4\6\4\0\1\6\2\0\1\7\7\0\1\6"+ + "\4\0\1\6\5\0\27\6\1\0\37\6\1\0\u01ca\6\4\0\14\6"+ + "\16\0\5\6\7\0\1\6\1\0\1\6\21\0\160\7\5\6\1\0"+ + "\2\6\2\0\4\6\10\0\1\6\1\0\3\6\1\0\1\6\1\0"+ + "\24\6\1\0\123\6\1\0\213\6\1\0\5\7\2\0\236\6\11\0"+ + "\46\6\2\0\1\6\7\0\47\6\11\0\55\7\1\0\1\7\1\0"+ + "\2\7\1\0\2\7\1\0\1\7\10\0\33\6\5\0\3\6\15\0"+ + "\4\7\7\0\1\6\4\0\13\7\5\0\53\6\37\7\4\0\2\6"+ + "\1\7\143\6\1\0\1\6\10\7\1\0\6\7\2\6\2\7\1\0"+ + "\4\7\2\6\12\7\3\6\2\0\1\6\17\0\1\7\1\6\1\7"+ + "\36\6\33\7\2\0\131\6\13\7\1\6\16\0\12\7\41\6\11\7"+ + "\2\6\4\0\1\6\5\0\26\6\4\7\1\6\11\7\1\6\3\7"+ + "\1\6\5\7\22\0\31\6\3\7\244\0\4\7\66\6\3\7\1\6"+ + "\22\7\1\6\7\7\12\6\2\7\2\0\12\7\1\0\7\6\1\0"+ + "\7\6\1\0\3\7\1\0\10\6\2\0\2\6\2\0\26\6\1\0"+ + "\7\6\1\0\1\6\3\0\4\6\2\0\1\7\1\6\7\7\2\0"+ + "\2\7\2\0\3\7\1\6\10\0\1\7\4\0\2\6\1\0\3\6"+ + "\2\7\2\0\12\7\4\6\7\0\1\6\5\0\3\7\1\0\6\6"+ + "\4\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0\2\6"+ + "\1\0\2\6\2\0\1\7\1\0\5\7\4\0\2\7\2\0\3\7"+ + "\3\0\1\7\7\0\4\6\1\0\1\6\7\0\14\7\3\6\1\7"+ + "\13\0\3\7\1\0\11\6\1\0\3\6\1\0\26\6\1\0\7\6"+ + "\1\0\2\6\1\0\5\6\2\0\1\7\1\6\10\7\1\0\3\7"+ + "\1\0\3\7\2\0\1\6\17\0\2\6\2\7\2\0\12\7\1\0"+ + "\1\6\17\0\3\7\1\0\10\6\2\0\2\6\2\0\26\6\1\0"+ + "\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6\7\7\2\0"+ + "\2\7\2\0\3\7\10\0\2\7\4\0\2\6\1\0\3\6\2\7"+ + "\2\0\12\7\1\0\1\6\20\0\1\7\1\6\1\0\6\6\3\0"+ + "\3\6\1\0\4\6\3\0\2\6\1\0\1\6\1\0\2\6\3\0"+ + "\2\6\3\0\3\6\3\0\14\6\4\0\5\7\3\0\3\7\1\0"+ + "\4\7\2\0\1\6\6\0\1\7\16\0\12\7\11\0\1\6\7\0"+ + "\3\7\1\0\10\6\1\0\3\6\1\0\27\6\1\0\12\6\1\0"+ + "\5\6\3\0\1\6\7\7\1\0\3\7\1\0\4\7\7\0\2\7"+ + "\1\0\2\6\6\0\2\6\2\7\2\0\12\7\22\0\2\7\1\0"+ + "\10\6\1\0\3\6\1\0\27\6\1\0\12\6\1\0\5\6\2\0"+ + "\1\7\1\6\7\7\1\0\3\7\1\0\4\7\7\0\2\7\7\0"+ + "\1\6\1\0\2\6\2\7\2\0\12\7\1\0\2\6\17\0\2\7"+ + "\1\0\10\6\1\0\3\6\1\0\51\6\2\0\1\6\7\7\1\0"+ + "\3\7\1\0\4\7\1\6\10\0\1\7\10\0\2\6\2\7\2\0"+ + "\12\7\12\0\6\6\2\0\2\7\1\0\22\6\3\0\30\6\1\0"+ + "\11\6\1\0\1\6\2\0\7\6\3\0\1\7\4\0\6\7\1\0"+ + "\1\7\1\0\10\7\22\0\2\7\15\0\60\6\1\7\2\6\7\7"+ + "\4\0\10\6\10\7\1\0\12\7\47\0\2\6\1\0\1\6\2\0"+ + "\2\6\1\0\1\6\2\0\1\6\6\0\4\6\1\0\7\6\1\0"+ + "\3\6\1\0\1\6\1\0\1\6\2\0\2\6\1\0\4\6\1\7"+ + "\2\6\6\7\1\0\2\7\1\6\2\0\5\6\1\0\1\6\1\0"+ + "\6\7\2\0\12\7\2\0\2\6\42\0\1\6\27\0\2\7\6\0"+ + "\12\7\13\0\1\7\1\0\1\7\1\0\1\7\4\0\2\7\10\6"+ + "\1\0\44\6\4\0\24\7\1\0\2\7\5\6\13\7\1\0\44\7"+ + "\11\0\1\7\71\0\53\6\24\7\1\6\12\7\6\0\6\6\4\7"+ + "\4\6\3\7\1\6\3\7\2\6\7\7\3\6\4\7\15\6\14\7"+ + "\1\6\17\7\2\0\46\6\12\0\53\6\1\0\1\6\3\0\u0149\6"+ + "\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0\51\6"+ + "\1\0\4\6\2\0\41\6\1\0\4\6\2\0\7\6\1\0\1\6"+ + "\1\0\4\6\2\0\17\6\1\0\71\6\1\0\4\6\2\0\103\6"+ + "\2\0\3\7\40\0\20\6\20\0\125\6\14\0\u026c\6\2\0\21\6"+ + "\1\0\32\6\5\0\113\6\3\0\3\6\17\0\15\6\1\0\4\6"+ + "\3\7\13\0\22\6\3\7\13\0\22\6\2\7\14\0\15\6\1\0"+ + "\3\6\1\0\2\7\14\0\64\6\40\7\3\0\1\6\3\0\2\6"+ + "\1\7\2\0\12\7\41\0\3\7\2\0\12\7\6\0\130\6\10\0"+ + "\51\6\1\7\1\6\5\0\106\6\12\0\35\6\3\0\14\7\4\0"+ + "\14\7\12\0\12\7\36\6\2\0\5\6\13\0\54\6\4\0\21\7"+ + "\7\6\2\7\6\0\12\7\46\0\27\6\5\7\4\0\65\6\12\7"+ + "\1\0\35\7\2\0\13\7\6\0\12\7\15\0\1\6\130\0\5\7"+ + "\57\6\21\7\7\6\4\0\12\7\21\0\11\7\14\0\3\7\36\6"+ + "\12\7\3\0\2\6\12\7\6\0\46\6\16\7\14\0\44\6\24\7"+ + "\10\0\12\7\3\0\3\6\12\7\44\6\122\0\3\7\1\0\25\7"+ + "\4\6\1\7\4\6\1\7\15\0\300\6\47\7\25\0\4\7\u0116\6"+ + "\2\0\6\6\2\0\46\6\2\0\6\6\2\0\10\6\1\0\1\6"+ + "\1\0\1\6\1\0\1\6\1\0\37\6\2\0\65\6\1\0\7\6"+ + "\1\0\1\6\3\0\3\6\1\0\7\6\3\0\4\6\2\0\6\6"+ + "\4\0\15\6\5\0\3\6\1\0\7\6\16\0\5\7\32\0\5\7"+ + "\20\0\2\6\23\0\1\6\13\0\5\7\5\0\6\7\1\0\1\6"+ + "\15\0\1\6\20\0\15\6\3\0\32\6\26\0\15\7\4\0\1\7"+ + "\3\0\14\7\21\0\1\6\4\0\1\6\2\0\12\6\1\0\1\6"+ + "\3\0\5\6\6\0\1\6\1\0\1\6\1\0\1\6\1\0\4\6"+ + "\1\0\13\6\2\0\4\6\5\0\5\6\4\0\1\6\21\0\51\6"+ + "\u0a77\0\57\6\1\0\57\6\1\0\205\6\6\0\4\6\3\7\16\0"+ + "\46\6\12\0\66\6\11\0\1\6\17\0\1\7\27\6\11\0\7\6"+ + "\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6"+ + "\1\0\7\6\1\0\7\6\1\0\40\7\57\0\1\6\u01d5\0\3\6"+ + "\31\0\11\6\6\7\1\0\5\6\2\0\5\6\4\0\126\6\2\0"+ + "\2\7\2\0\3\6\1\0\132\6\1\0\4\6\5\0\51\6\3\0"+ + "\136\6\21\0\33\6\65\0\20\6\u0200\0\u19b6\6\112\0\u51cc\6\64\0"+ + "\u048d\6\103\0\56\6\2\0\u010d\6\3\0\20\6\12\7\2\6\24\0"+ + "\57\6\1\7\14\0\2\7\1\0\31\6\10\0\120\6\2\7\45\0"+ + "\11\6\2\0\147\6\2\0\4\6\1\0\2\6\16\0\12\6\120\0"+ + "\10\6\1\7\3\6\1\7\4\6\1\7\27\6\5\7\20\0\1\6"+ + "\7\0\64\6\14\0\2\7\62\6\21\7\13\0\12\7\6\0\22\7"+ + "\6\6\3\0\1\6\4\0\12\7\34\6\10\7\2\0\27\6\15\7"+ + "\14\0\35\6\3\0\4\7\57\6\16\7\16\0\1\6\12\7\46\0"+ + "\51\6\16\7\11\0\3\6\1\7\10\6\2\7\2\0\12\7\6\0"+ + "\27\6\3\0\1\6\1\7\4\0\60\6\1\7\1\6\3\7\2\6"+ + "\2\7\5\6\2\7\1\6\1\7\1\6\30\0\3\6\43\0\6\6"+ + "\2\0\6\6\2\0\6\6\11\0\7\6\1\0\7\6\221\0\43\6"+ + "\10\7\1\0\2\7\2\0\12\7\6\0\u2ba4\6\14\0\27\6\4\0"+ + "\61\6\u2104\0\u012e\6\2\0\76\6\2\0\152\6\46\0\7\6\14\0"+ + "\5\6\5\0\1\6\1\7\12\6\1\0\15\6\1\0\5\6\1\0"+ + "\1\6\1\0\2\6\1\0\2\6\1\0\154\6\41\0\u016b\6\22\0"+ + "\100\6\2\0\66\6\50\0\15\6\3\0\20\7\20\0\7\7\14\0"+ + "\2\6\30\0\3\6\31\0\1\6\6\0\5\6\1\0\207\6\2\0"+ + "\1\7\4\0\1\6\13\0\12\7\7\0\32\6\4\0\1\6\1\0"+ + "\32\6\13\0\131\6\3\0\6\6\2\0\6\6\2\0\6\6\2\0"+ + "\3\6\3\0\2\6\3\0\2\6\22\0\3\7\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\5\0\1\1\2\2\1\3\1\4\1\5\1\6\1\7"+ + "\1\10\1\11\1\12\1\13\1\14\2\15\1\16\1\17"+ + "\23\6\1\20\1\21\1\22\1\23\1\24\1\25\1\26"+ + "\1\27\1\30\1\31\1\32\1\33\1\34\1\35\1\36"+ + "\1\37\1\40\1\41\2\42\1\43\1\1\1\41\2\44"+ + "\1\41\1\1\1\45\3\41\1\3\1\0\1\46\1\47"+ + "\1\50\2\0\1\51\1\0\1\52\1\53\1\54\1\55"+ + "\1\56\1\57\1\51\1\0\2\57\1\0\1\60\1\61"+ + "\5\6\1\62\16\6\1\63\1\64\1\65\4\6\1\66"+ + "\17\6\1\67\1\70\1\71\1\72\1\73\1\74\1\75"+ + "\1\76\1\77\1\100\1\101\2\102\1\103\1\104\1\105"+ + "\1\106\1\107\1\110\1\111\6\0\2\3\2\0\1\112"+ + "\3\0\1\113\1\0\1\114\1\115\1\116\1\117\2\120"+ + "\1\57\1\51\1\0\11\6\1\121\4\6\1\122\3\6"+ + "\1\123\6\6\1\124\5\6\1\125\10\6\1\126\1\6"+ + "\1\127\1\6\1\130\1\131\1\102\7\0\1\132\5\0"+ + "\1\133\1\120\1\57\2\6\1\134\1\135\1\6\1\136"+ + "\11\6\1\137\1\140\1\6\1\141\14\6\1\142\5\6"+ + "\1\143\1\6\1\41\1\0\1\144\12\0\1\120\1\57"+ + "\1\145\2\6\1\146\1\147\1\6\1\150\1\6\1\151"+ + "\3\6\1\152\11\6\1\153\2\6\1\154\5\6\10\0"+ + "\1\120\1\57\1\155\2\6\1\156\1\157\2\6\1\160"+ + "\3\6\1\161\3\6\1\162\6\6\1\163\1\6\2\0"+ + "\1\113\1\120\1\57\1\164\10\6\1\165\1\166\1\167"+ + "\2\6\1\170\1\171\1\6\1\41\1\120\1\57\1\172"+ + "\1\173\2\6\1\174\3\6\1\175\1\6\1\176\1\120"+ + "\1\57\1\177\1\6\1\200\1\6\1\201\1\202\1\120"+ + "\1\57\1\203\1\204\6\57"; + + private static int [] zzUnpackAction() { + int [] result = new int[418]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\103\0\206\0\311\0\u010c\0\u014f\0\u0192\0\u014f"+ + "\0\u01d5\0\u0218\0\u025b\0\u029e\0\u02e1\0\u0324\0\u0367\0\u03aa"+ + "\0\u03ed\0\u014f\0\u0430\0\u0473\0\u04b6\0\u014f\0\u04f9\0\u053c"+ + "\0\u057f\0\u05c2\0\u0605\0\u0648\0\u068b\0\u06ce\0\u0711\0\u0754"+ + "\0\u0797\0\u07da\0\u081d\0\u0860\0\u08a3\0\u08e6\0\u0929\0\u096c"+ + "\0\u09af\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f"+ + "\0\u014f\0\u09f2\0\u014f\0\u014f\0\u0a35\0\u0a78\0\u0abb\0\u0afe"+ + "\0\u0b41\0\u014f\0\u0b84\0\u0bc7\0\u014f\0\u014f\0\u0c0a\0\u0c4d"+ + "\0\u0c90\0\u014f\0\u0cd3\0\u0d16\0\u014f\0\u0d59\0\u014f\0\u0d9c"+ + "\0\u0ddf\0\u0e22\0\u014f\0\u014f\0\u014f\0\u0e65\0\u0ea8\0\u0eeb"+ + "\0\u0f2e\0\u0f71\0\u014f\0\u0fb4\0\u014f\0\u0ff7\0\u103a\0\u107d"+ + "\0\u10c0\0\u1103\0\u1146\0\u1189\0\u014f\0\u014f\0\u11cc\0\u120f"+ + "\0\u1252\0\u1295\0\u12d8\0\u029e\0\u131b\0\u135e\0\u13a1\0\u13e4"+ + "\0\u1427\0\u146a\0\u14ad\0\u14f0\0\u1533\0\u1576\0\u15b9\0\u15fc"+ + "\0\u163f\0\u1682\0\u029e\0\u16c5\0\u029e\0\u1708\0\u174b\0\u178e"+ + "\0\u17d1\0\u029e\0\u1814\0\u1857\0\u189a\0\u18dd\0\u1920\0\u1963"+ + "\0\u19a6\0\u19e9\0\u1a2c\0\u1a6f\0\u1ab2\0\u1af5\0\u1b38\0\u1b7b"+ + "\0\u1bbe\0\u1c01\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f"+ + "\0\u014f\0\u014f\0\u014f\0\u014f\0\u1c44\0\u1c87\0\u014f\0\u014f"+ + "\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f\0\u0d16\0\u1cca\0\u1d0d"+ + "\0\u1d50\0\u1d93\0\u1dd6\0\u1e19\0\u014f\0\u1e5c\0\u1e9f\0\u014f"+ + "\0\u1ee2\0\u1f25\0\u1f68\0\u014f\0\u1fab\0\u014f\0\u1fee\0\u014f"+ + "\0\u014f\0\u10c0\0\u2031\0\u2074\0\u20b7\0\u20b7\0\u20fa\0\u213d"+ + "\0\u2180\0\u21c3\0\u2206\0\u2249\0\u228c\0\u22cf\0\u2312\0\u029e"+ + "\0\u2355\0\u2398\0\u23db\0\u241e\0\u029e\0\u2461\0\u24a4\0\u24e7"+ + "\0\u029e\0\u252a\0\u256d\0\u25b0\0\u25f3\0\u2636\0\u2679\0\u029e"+ + "\0\u26bc\0\u26ff\0\u2742\0\u2785\0\u27c8\0\u029e\0\u280b\0\u284e"+ + "\0\u2891\0\u28d4\0\u2917\0\u295a\0\u299d\0\u29e0\0\u029e\0\u2a23"+ + "\0\u029e\0\u2a66\0\u029e\0\u014f\0\u014f\0\u2aa9\0\u2aec\0\u2b2f"+ + "\0\u2b72\0\u2bb5\0\u2bf8\0\u2c3b\0\u014f\0\u2c7e\0\u2cc1\0\u2d04"+ + "\0\u2d47\0\u2d8a\0\u014f\0\u2dcd\0\u2e10\0\u2e53\0\u2e96\0\u029e"+ + "\0\u029e\0\u2ed9\0\u029e\0\u2f1c\0\u2f5f\0\u2fa2\0\u2fe5\0\u3028"+ + "\0\u306b\0\u30ae\0\u30f1\0\u3134\0\u029e\0\u029e\0\u3177\0\u029e"+ + "\0\u31ba\0\u31fd\0\u3240\0\u3283\0\u32c6\0\u3309\0\u334c\0\u338f"+ + "\0\u33d2\0\u3415\0\u3458\0\u349b\0\u029e\0\u34de\0\u3521\0\u3564"+ + "\0\u35a7\0\u35ea\0\u029e\0\u362d\0\u3670\0\u36b3\0\u014f\0\u36f6"+ + "\0\u3739\0\u377c\0\u37bf\0\u3802\0\u3845\0\u3888\0\u38cb\0\u390e"+ + "\0\u3951\0\u3994\0\u39d7\0\u029e\0\u3a1a\0\u3a5d\0\u029e\0\u029e"+ + "\0\u3aa0\0\u029e\0\u3ae3\0\u029e\0\u3b26\0\u3b69\0\u3bac\0\u029e"+ + "\0\u3bef\0\u3c32\0\u3c75\0\u3cb8\0\u3cfb\0\u3d3e\0\u3d81\0\u3dc4"+ + "\0\u3e07\0\u029e\0\u3e4a\0\u3e8d\0\u029e\0\u3ed0\0\u3f13\0\u3f56"+ + "\0\u3f99\0\u3fdc\0\u401f\0\u4062\0\u40a5\0\u40e8\0\u412b\0\u416e"+ + "\0\u41b1\0\u41f4\0\u4237\0\u427a\0\u029e\0\u42bd\0\u4300\0\u029e"+ + "\0\u029e\0\u4343\0\u4386\0\u029e\0\u43c9\0\u440c\0\u444f\0\u029e"+ + "\0\u4492\0\u44d5\0\u4518\0\u029e\0\u455b\0\u459e\0\u45e1\0\u4624"+ + "\0\u4667\0\u46aa\0\u029e\0\u46ed\0\u4730\0\u4773\0\u3888\0\u47b6"+ + "\0\u47f9\0\u029e\0\u483c\0\u487f\0\u48c2\0\u4905\0\u4948\0\u498b"+ + "\0\u49ce\0\u4a11\0\u029e\0\u029e\0\u029e\0\u4a54\0\u4a97\0\u029e"+ + "\0\u029e\0\u4ada\0\u40a5\0\u4b1d\0\u4b60\0\u029e\0\u029e\0\u4ba3"+ + "\0\u4be6\0\u029e\0\u4c29\0\u4c6c\0\u4caf\0\u029e\0\u4cf2\0\u029e"+ + "\0\u4d35\0\u4d78\0\u029e\0\u4dbb\0\u029e\0\u4dfe\0\u029e\0\u029e"+ + "\0\u014f\0\u4e41\0\u029e\0\u029e\0\u4e84\0\u4ec7\0\u4f0a\0\u4f4d"+ + "\0\u4f90\0\u107d"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[418]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1\6"+ + "\1\15\1\16\1\17\1\20\1\11\1\21\1\22\1\23"+ + "\1\24\2\14\2\24\1\14\1\25\1\6\1\26\1\27"+ + "\1\30\1\31\1\32\1\14\1\33\1\34\1\35\1\36"+ + "\1\37\1\40\1\41\1\42\1\43\1\14\1\44\1\14"+ + "\1\45\2\14\1\46\1\14\1\47\1\50\1\51\1\52"+ + "\1\53\1\54\1\55\1\56\1\57\1\60\1\61\1\62"+ + "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72"+ + "\1\73\1\74\1\75\13\73\1\76\10\73\1\77\53\73"+ + "\1\100\1\74\1\75\24\100\1\77\1\76\52\100\1\6"+ + "\1\101\1\102\1\103\2\6\1\104\4\6\1\105\1\106"+ + "\4\6\2\104\2\6\1\104\3\6\31\104\21\6\1\107"+ + "\1\101\1\102\7\107\1\110\70\107\105\0\1\10\103\0"+ + "\1\11\10\0\1\11\72\0\1\111\1\112\7\0\1\113"+ + "\102\0\1\114\73\0\2\14\7\0\7\14\3\0\31\14"+ + "\31\0\1\115\103\0\1\116\1\117\4\0\2\120\2\0"+ + "\2\120\64\0\1\121\3\0\1\122\2\0\1\123\3\0"+ + "\2\121\2\0\1\121\3\0\31\121\34\0\1\124\1\0"+ + "\1\125\102\0\1\126\76\0\1\120\5\0\1\127\1\130"+ + "\1\131\1\0\1\132\1\133\1\134\5\0\1\134\22\0"+ + "\1\131\35\0\1\120\5\0\2\24\2\0\2\24\1\134"+ + "\5\0\1\134\64\0\1\135\10\0\1\136\62\0\2\14"+ + "\7\0\7\14\3\0\1\14\1\137\27\14\27\0\2\14"+ + "\7\0\7\14\3\0\2\14\1\140\26\14\27\0\2\14"+ + "\7\0\7\14\3\0\3\14\1\141\12\14\1\142\6\14"+ + "\1\143\3\14\27\0\2\14\7\0\7\14\3\0\6\14"+ + "\1\144\22\14\27\0\2\14\7\0\7\14\3\0\3\14"+ + "\1\145\3\14\1\146\6\14\1\147\12\14\27\0\2\14"+ + "\7\0\7\14\3\0\2\14\1\150\6\14\1\151\1\14"+ + "\1\152\3\14\1\153\11\14\27\0\2\14\7\0\7\14"+ + "\3\0\24\14\1\154\4\14\27\0\2\14\7\0\7\14"+ + "\3\0\2\14\1\155\1\156\7\14\1\157\15\14\27\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\160\16\14\1\161"+ + "\1\14\1\162\6\14\27\0\2\14\7\0\7\14\3\0"+ + "\6\14\1\163\1\14\1\164\4\14\1\165\5\14\1\166"+ + "\5\14\27\0\2\14\7\0\7\14\3\0\6\14\1\167"+ + "\1\14\1\170\20\14\27\0\2\14\7\0\7\14\3\0"+ + "\2\14\1\171\4\14\1\172\12\14\1\173\6\14\27\0"+ + "\2\14\7\0\7\14\3\0\3\14\1\174\3\14\1\175"+ + "\2\14\1\176\1\177\15\14\27\0\2\14\7\0\7\14"+ + "\3\0\12\14\1\200\5\14\1\201\10\14\27\0\2\14"+ + "\7\0\7\14\3\0\1\14\1\202\1\14\1\203\7\14"+ + "\1\204\15\14\27\0\2\14\7\0\7\14\3\0\3\14"+ + "\1\205\3\14\1\206\21\14\27\0\2\14\7\0\7\14"+ + "\3\0\2\14\1\207\26\14\27\0\2\14\7\0\7\14"+ + "\3\0\10\14\1\210\20\14\27\0\2\14\7\0\7\14"+ + "\3\0\3\14\1\211\25\14\36\0\1\212\102\0\1\213"+ + "\57\0\1\214\22\0\1\215\60\0\1\216\21\0\1\217"+ + "\61\0\1\220\20\0\1\221\102\0\1\222\65\0\1\73"+ + "\2\0\13\73\1\0\10\73\1\0\53\73\2\0\1\75"+ + "\100\0\2\223\1\0\13\223\1\224\1\225\3\223\1\225"+ + "\1\226\2\223\1\227\1\230\1\231\1\232\6\223\1\233"+ + "\1\234\3\223\1\235\34\223\1\100\2\0\24\100\2\0"+ + "\52\100\2\0\1\102\103\0\1\103\10\0\1\103\74\0"+ + "\2\236\1\237\3\0\1\240\1\241\1\0\7\236\3\0"+ + "\31\236\24\0\1\103\2\0\1\236\5\0\1\106\4\0"+ + "\2\236\2\0\1\236\3\0\31\236\25\0\1\242\1\0"+ + "\1\243\12\0\2\243\2\0\1\243\3\0\31\243\21\0"+ + "\1\111\1\244\1\245\100\111\5\246\1\247\75\246\11\0"+ + "\1\250\77\0\1\251\12\0\2\251\2\0\1\251\3\0"+ + "\31\251\40\0\2\120\2\0\2\120\1\134\5\0\1\134"+ + "\55\0\1\252\1\121\1\253\2\0\1\254\1\255\2\0"+ + "\2\121\2\252\2\121\1\252\3\0\31\252\36\0\1\256"+ + "\100\0\1\257\1\0\1\260\102\0\1\261\76\0\1\120"+ + "\5\0\1\127\1\130\2\0\1\132\1\133\1\134\5\0"+ + "\1\134\60\0\1\120\5\0\2\130\2\0\2\130\1\134"+ + "\5\0\1\134\66\0\1\262\1\263\1\0\4\263\3\0"+ + "\1\263\1\0\2\263\1\0\1\263\6\0\2\263\45\0"+ + "\1\120\5\0\1\133\1\130\2\0\2\133\1\134\5\0"+ + "\1\134\60\0\1\120\5\0\1\264\1\130\2\0\2\264"+ + "\1\134\5\0\1\134\66\0\2\265\2\0\2\265\1\0"+ + "\1\266\50\0\1\266\11\0\2\14\7\0\7\14\3\0"+ + "\2\14\1\267\26\14\27\0\2\14\7\0\7\14\3\0"+ + "\11\14\1\270\17\14\27\0\2\14\7\0\7\14\3\0"+ + "\5\14\1\271\23\14\27\0\2\14\7\0\7\14\3\0"+ + "\6\14\1\272\22\14\27\0\2\14\7\0\7\14\3\0"+ + "\11\14\1\273\17\14\27\0\2\14\7\0\7\14\3\0"+ + "\6\14\1\274\2\14\1\275\17\14\27\0\2\14\7\0"+ + "\7\14\3\0\10\14\1\276\20\14\27\0\2\14\7\0"+ + "\7\14\3\0\3\14\1\277\25\14\27\0\2\14\7\0"+ + "\7\14\3\0\11\14\1\300\17\14\27\0\2\14\7\0"+ + "\7\14\3\0\3\14\1\301\25\14\27\0\2\14\7\0"+ + "\7\14\3\0\21\14\1\302\7\14\27\0\2\14\7\0"+ + "\7\14\3\0\12\14\1\303\16\14\27\0\2\14\7\0"+ + "\7\14\3\0\2\14\1\304\26\14\27\0\2\14\7\0"+ + "\7\14\3\0\17\14\1\305\11\14\27\0\2\14\7\0"+ + "\7\14\3\0\23\14\1\306\5\14\27\0\2\14\7\0"+ + "\7\14\3\0\16\14\1\307\12\14\27\0\2\14\7\0"+ + "\7\14\3\0\13\14\1\310\6\14\1\311\6\14\27\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\312\10\14\1\313"+ + "\16\14\27\0\2\14\7\0\7\14\3\0\21\14\1\314"+ + "\7\14\27\0\2\14\7\0\7\14\3\0\6\14\1\315"+ + "\2\14\1\316\17\14\27\0\2\14\7\0\7\14\3\0"+ + "\21\14\1\317\7\14\27\0\2\14\7\0\7\14\3\0"+ + "\2\14\1\320\26\14\27\0\2\14\7\0\7\14\3\0"+ + "\14\14\1\321\14\14\27\0\2\14\7\0\7\14\3\0"+ + "\15\14\1\322\1\323\12\14\27\0\2\14\7\0\7\14"+ + "\3\0\10\14\1\324\20\14\27\0\2\14\7\0\7\14"+ + "\3\0\16\14\1\325\12\14\27\0\2\14\7\0\7\14"+ + "\3\0\1\14\1\326\27\14\27\0\2\14\7\0\7\14"+ + "\3\0\10\14\1\327\20\14\27\0\2\14\7\0\7\14"+ + "\3\0\10\14\1\330\20\14\27\0\2\14\7\0\7\14"+ + "\3\0\11\14\1\331\17\14\27\0\2\14\7\0\7\14"+ + "\3\0\12\14\1\332\16\14\27\0\2\14\7\0\7\14"+ + "\3\0\7\14\1\333\2\14\1\334\16\14\27\0\2\14"+ + "\7\0\7\14\3\0\5\14\1\335\23\14\27\0\2\14"+ + "\7\0\7\14\3\0\1\336\30\14\27\0\2\14\7\0"+ + "\7\14\3\0\1\14\1\337\27\14\27\0\2\14\7\0"+ + "\7\14\3\0\12\14\1\340\16\14\27\0\2\14\7\0"+ + "\7\14\3\0\11\14\1\341\17\14\27\0\2\14\7\0"+ + "\7\14\3\0\15\14\1\342\13\14\27\0\2\14\7\0"+ + "\7\14\3\0\30\14\1\343\36\0\1\344\104\0\1\226"+ + "\3\0\2\226\75\0\1\345\3\0\2\345\64\0\1\346"+ + "\12\0\2\346\2\0\1\346\3\0\31\346\35\0\1\240"+ + "\1\241\101\0\1\241\1\0\1\347\72\0\1\350\12\0"+ + "\2\350\2\0\1\350\3\0\31\350\27\0\1\351\1\243"+ + "\1\352\2\0\1\107\1\353\2\0\2\243\2\351\2\243"+ + "\1\351\3\0\31\351\23\0\1\245\100\0\5\246\1\354"+ + "\75\246\4\0\1\245\1\247\103\0\2\251\3\0\1\355"+ + "\3\0\7\251\3\0\31\251\27\0\2\252\1\356\2\0"+ + "\1\254\1\357\1\360\1\0\7\252\3\0\31\252\27\0"+ + "\1\361\12\0\2\361\2\0\1\361\3\0\31\361\27\0"+ + "\1\362\5\0\1\255\4\0\2\362\2\0\1\362\3\0"+ + "\31\362\36\0\1\363\104\0\2\364\1\0\4\364\3\0"+ + "\1\364\1\0\2\364\1\0\1\364\6\0\2\364\45\0"+ + "\1\120\5\0\1\365\1\130\2\0\2\365\1\134\5\0"+ + "\1\134\66\0\2\265\2\0\2\265\64\0\2\14\7\0"+ + "\7\14\3\0\3\14\1\366\25\14\27\0\2\14\7\0"+ + "\7\14\3\0\13\14\1\367\15\14\27\0\2\14\7\0"+ + "\7\14\3\0\20\14\1\370\10\14\27\0\2\14\7\0"+ + "\7\14\3\0\2\14\1\371\26\14\27\0\2\14\7\0"+ + "\7\14\3\0\2\14\1\372\26\14\27\0\2\14\7\0"+ + "\7\14\3\0\2\14\1\373\26\14\27\0\2\14\7\0"+ + "\7\14\3\0\5\14\1\374\23\14\27\0\2\14\7\0"+ + "\7\14\3\0\6\14\1\375\2\14\1\376\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\6\14\1\377\22\14\27\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0100\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0101\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0102\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\u0103\27\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0104\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\16\14\1\u0105\12\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0106\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\7\14\1\u0107\21\14\27\0"+ + "\2\14\7\0\7\14\3\0\6\14\1\u0108\22\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0109\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u010a\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u010b\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\7\14\1\u010c\6\14\1\u010d"+ + "\12\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u010e"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u010f"+ + "\25\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0110"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0111"+ + "\25\14\27\0\2\14\7\0\7\14\3\0\6\14\1\u0112"+ + "\22\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0113"+ + "\25\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u0114"+ + "\23\14\27\0\2\14\7\0\7\14\3\0\20\14\1\u0115"+ + "\10\14\27\0\2\14\7\0\7\14\3\0\16\14\1\u0116"+ + "\12\14\27\0\2\14\7\0\7\14\3\0\11\14\1\u0117"+ + "\17\14\27\0\2\14\7\0\7\14\3\0\24\14\1\u0118"+ + "\4\14\27\0\2\14\7\0\7\14\3\0\4\14\1\u0119"+ + "\24\14\27\0\2\14\7\0\7\14\3\0\16\14\1\u011a"+ + "\12\14\27\0\2\14\7\0\7\14\3\0\14\14\1\u011b"+ + "\14\14\27\0\2\14\7\0\7\14\3\0\12\14\1\u011c"+ + "\16\14\27\0\2\346\4\0\1\240\1\241\1\0\7\346"+ + "\3\0\31\346\21\0\1\347\2\0\13\347\1\u011d\64\347"+ + "\6\0\2\350\1\u011e\2\0\1\u011f\3\0\7\350\3\0"+ + "\31\350\27\0\2\351\1\u0120\2\0\1\107\1\u0121\1\u0122"+ + "\1\0\7\351\3\0\31\351\27\0\1\u0123\12\0\2\u0123"+ + "\2\0\1\u0123\3\0\31\u0123\27\0\1\u0124\5\0\1\353"+ + "\4\0\2\u0124\2\0\1\u0124\3\0\31\u0124\21\0\4\246"+ + "\1\245\1\354\75\246\6\0\1\u0125\12\0\2\u0125\2\0"+ + "\1\u0125\3\0\31\u0125\27\0\1\362\5\0\1\357\1\360"+ + "\3\0\2\362\2\0\1\362\3\0\31\362\35\0\1\360"+ + "\1\0\1\u0126\72\0\1\u0127\1\361\3\0\1\254\1\255"+ + "\2\0\2\361\2\u0127\2\361\1\u0127\3\0\31\u0127\27\0"+ + "\2\362\1\u0128\3\0\1\u0129\1\360\1\0\7\362\3\0"+ + "\31\362\40\0\2\u012a\1\0\4\u012a\3\0\1\u012a\1\0"+ + "\2\u012a\1\0\1\u012a\6\0\2\u012a\45\0\1\120\5\0"+ + "\1\u012b\1\130\2\0\2\u012b\1\134\5\0\1\134\55\0"+ + "\2\14\7\0\7\14\3\0\4\14\1\u012c\24\14\27\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\u012d\27\14\27\0"+ + "\2\14\7\0\7\14\3\0\10\14\1\u012e\20\14\27\0"+ + "\2\14\7\0\7\14\3\0\20\14\1\u012f\10\14\27\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0130\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\12\14\1\u0131\16\14\27\0"+ + "\2\14\7\0\7\14\3\0\6\14\1\u0132\22\14\27\0"+ + "\2\14\7\0\7\14\3\0\12\14\1\u0133\16\14\27\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\u0134\27\14\27\0"+ + "\2\14\7\0\7\14\3\0\5\14\1\u0135\23\14\27\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\u0136\27\14\27\0"+ + "\2\14\7\0\7\14\3\0\6\14\1\u0137\22\14\27\0"+ + "\2\14\7\0\7\14\3\0\17\14\1\u0138\11\14\27\0"+ + "\2\14\7\0\7\14\3\0\7\14\1\u0139\21\14\27\0"+ + "\2\14\7\0\7\14\3\0\3\14\1\u013a\25\14\27\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\u013b\27\14\27\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\u013c\27\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u013d\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\15\14\1\u013e\13\14\27\0"+ + "\2\14\7\0\7\14\3\0\13\14\1\u013f\15\14\27\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0140\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\23\14\1\u0141\5\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0142\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\16\14\1\u0143\12\14\27\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0144\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0145\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0146\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\3\14\1\u0147\25\14\27\0"+ + "\2\14\7\0\7\14\3\0\3\14\1\u0148\25\14\27\0"+ + "\2\14\7\0\7\14\3\0\12\14\1\u0149\16\14\27\0"+ + "\2\14\7\0\7\14\3\0\10\14\1\u014a\20\14\21\0"+ + "\1\347\2\0\11\347\1\u011d\1\347\1\u011d\64\347\6\0"+ + "\1\u014b\12\0\2\u014b\2\0\1\u014b\3\0\31\u014b\27\0"+ + "\1\u014c\12\0\2\u014c\2\0\1\u014c\3\0\31\u014c\27\0"+ + "\1\u0124\5\0\1\u0121\1\u0122\3\0\2\u0124\2\0\1\u0124"+ + "\3\0\31\u0124\35\0\1\u0122\1\0\1\u014d\72\0\1\u014e"+ + "\1\u0123\3\0\1\107\1\353\2\0\2\u0123\2\u014e\2\u0123"+ + "\1\u014e\3\0\31\u014e\27\0\2\u0124\1\u014f\3\0\1\u0150"+ + "\1\u0122\1\0\7\u0124\3\0\31\u0124\27\0\1\u0127\1\u0125"+ + "\3\0\1\254\1\357\1\360\1\0\2\u0125\2\u0127\2\u0125"+ + "\1\u0127\3\0\31\u0127\21\0\1\u0126\2\0\13\u0126\1\u0151"+ + "\64\u0126\6\0\2\u0127\1\u0128\2\0\1\254\1\357\1\360"+ + "\1\0\7\u0127\3\0\31\u0127\27\0\1\u0152\12\0\2\u0152"+ + "\2\0\1\u0152\3\0\31\u0152\35\0\1\u0129\1\360\104\0"+ + "\2\u0153\1\0\4\u0153\3\0\1\u0153\1\0\2\u0153\1\0"+ + "\1\u0153\6\0\2\u0153\45\0\1\120\5\0\1\u0154\1\130"+ + "\2\0\2\u0154\1\134\5\0\1\134\55\0\2\14\7\0"+ + "\7\14\3\0\10\14\1\u0155\20\14\27\0\2\14\7\0"+ + "\7\14\3\0\14\14\1\u0156\14\14\27\0\2\14\7\0"+ + "\7\14\3\0\10\14\1\u0157\20\14\27\0\2\14\7\0"+ + "\7\14\3\0\5\14\1\u0158\23\14\27\0\2\14\7\0"+ + "\7\14\3\0\20\14\1\u0159\10\14\27\0\2\14\7\0"+ + "\7\14\3\0\12\14\1\u015a\16\14\27\0\2\14\7\0"+ + "\7\14\3\0\21\14\1\u015b\7\14\27\0\2\14\7\0"+ + "\7\14\3\0\15\14\1\u015c\13\14\27\0\2\14\7\0"+ + "\7\14\3\0\10\14\1\u015d\20\14\27\0\2\14\7\0"+ + "\7\14\3\0\10\14\1\u015e\4\14\1\u015f\13\14\27\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0160\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\23\14\1\u0161\5\14\27\0"+ + "\2\14\7\0\7\14\3\0\12\14\1\u0162\16\14\27\0"+ + "\2\14\7\0\7\14\3\0\16\14\1\u0163\12\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0164\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\12\14\1\u0165\16\14\27\0"+ + "\2\14\7\0\7\14\3\0\16\14\1\u0166\12\14\27\0"+ + "\2\14\7\0\7\14\3\0\12\14\1\u0167\16\14\27\0"+ + "\2\14\7\0\7\14\3\0\5\14\1\u0168\23\14\27\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0169\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\26\14\1\u016a\2\14\27\0"+ + "\2\14\7\0\7\14\3\0\5\14\1\u016b\23\14\27\0"+ + "\2\14\7\0\7\14\3\0\12\14\1\u016c\16\14\27\0"+ + "\2\u014b\3\0\1\u011f\3\0\7\u014b\3\0\31\u014b\27\0"+ + "\1\u014e\1\u014c\3\0\1\107\1\u0121\1\u0122\1\0\2\u014c"+ + "\2\u014e\2\u014c\1\u014e\3\0\31\u014e\21\0\1\u014d\2\0"+ + "\13\u014d\1\u016d\64\u014d\6\0\2\u014e\1\u014f\2\0\1\107"+ + "\1\u0121\1\u0122\1\0\7\u014e\3\0\31\u014e\27\0\1\u016e"+ + "\12\0\2\u016e\2\0\1\u016e\3\0\31\u016e\35\0\1\u0150"+ + "\1\u0122\65\0\1\u0126\2\0\10\u0126\1\u016f\1\u0151\1\u0126"+ + "\1\u0151\64\u0126\6\0\2\u0152\4\0\1\u0129\1\360\1\0"+ + "\7\u0152\3\0\31\u0152\40\0\2\u0170\1\0\4\u0170\3\0"+ + "\1\u0170\1\0\2\u0170\1\0\1\u0170\6\0\2\u0170\45\0"+ + "\1\120\5\0\1\u0171\1\130\2\0\2\u0171\1\134\5\0"+ + "\1\134\55\0\2\14\7\0\7\14\3\0\6\14\1\u0172"+ + "\22\14\27\0\2\14\7\0\7\14\3\0\13\14\1\u0173"+ + "\15\14\27\0\2\14\7\0\7\14\3\0\14\14\1\u0174"+ + "\14\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0175"+ + "\25\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u0176"+ + "\23\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0177"+ + "\25\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0178"+ + "\25\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0179"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\10\14\1\u017a"+ + "\20\14\27\0\2\14\7\0\7\14\3\0\11\14\1\u017b"+ + "\17\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u017c"+ + "\23\14\27\0\2\14\7\0\7\14\3\0\22\14\1\u017d"+ + "\6\14\27\0\2\14\7\0\7\14\3\0\7\14\1\u017e"+ + "\21\14\27\0\2\14\7\0\7\14\3\0\11\14\1\u017f"+ + "\17\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0180"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0181"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\11\14\1\u0182"+ + "\17\14\21\0\1\u014d\2\0\10\u014d\1\u0183\1\u016d\1\u014d"+ + "\1\u016d\64\u014d\6\0\2\u016e\4\0\1\u0150\1\u0122\1\0"+ + "\7\u016e\3\0\31\u016e\40\0\2\u0184\1\0\4\u0184\3\0"+ + "\1\u0184\1\0\2\u0184\1\0\1\u0184\6\0\2\u0184\45\0"+ + "\1\120\5\0\1\u0185\1\130\2\0\2\u0185\1\134\5\0"+ + "\1\134\55\0\2\14\7\0\7\14\3\0\2\14\1\u0186"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0187"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u0188"+ + "\23\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0189"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\16\14\1\u018a"+ + "\12\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u018b"+ + "\23\14\27\0\2\14\7\0\7\14\3\0\10\14\1\u018c"+ + "\20\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u018d"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\10\14\1\u018e"+ + "\20\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u018f"+ + "\26\14\27\0\2\14\7\0\7\14\3\0\22\14\1\u0190"+ + "\6\14\40\0\2\u0191\1\0\4\u0191\3\0\1\u0191\1\0"+ + "\2\u0191\1\0\1\u0191\6\0\2\u0191\45\0\1\120\5\0"+ + "\1\u0192\1\130\2\0\2\u0192\1\134\5\0\1\134\55\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0193\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\7\14\1\u0194\21\14\27\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0195\26\14\27\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0196\17\14\27\0"+ + "\2\14\7\0\7\14\3\0\14\14\1\u0197\14\14\27\0"+ + "\2\14\7\0\7\14\3\0\14\14\1\u0198\14\14\40\0"+ + "\2\u0199\1\0\4\u0199\3\0\1\u0199\1\0\2\u0199\1\0"+ + "\1\u0199\6\0\2\u0199\45\0\1\120\5\0\1\u019a\1\130"+ + "\2\0\2\u019a\1\134\5\0\1\134\55\0\2\14\7\0"+ + "\7\14\3\0\15\14\1\u019b\13\14\27\0\2\14\7\0"+ + "\7\14\3\0\6\14\1\u019c\22\14\32\0\1\120\5\0"+ + "\1\u019d\1\130\2\0\2\u019d\1\134\5\0\1\134\60\0"+ + "\1\120\5\0\1\u019e\1\130\2\0\2\u019e\1\134\5\0"+ + "\1\134\60\0\1\120\5\0\1\u019f\1\130\2\0\2\u019f"+ + "\1\134\5\0\1\134\60\0\1\120\5\0\1\u01a0\1\130"+ + "\2\0\2\u01a0\1\134\5\0\1\134\60\0\1\120\5\0"+ + "\1\u01a1\1\130\2\0\2\u01a1\1\134\5\0\1\134\60\0"+ + "\1\120\5\0\1\u01a2\1\130\2\0\2\u01a2\1\134\5\0"+ + "\1\134\47\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[20435]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\5\0\1\11\1\1\1\11\11\1\1\11\3\1\1\11"+ + "\23\1\10\11\1\1\2\11\5\1\1\11\2\1\2\11"+ + "\3\1\1\11\2\1\1\11\1\1\1\11\2\1\1\0"+ + "\3\11\2\0\1\1\1\0\1\1\1\11\1\1\1\11"+ + "\3\1\1\0\2\1\1\0\2\11\54\1\12\11\2\1"+ + "\7\11\6\0\1\1\1\11\2\0\1\11\3\0\1\11"+ + "\1\0\1\11\1\1\2\11\4\1\1\0\55\1\2\11"+ + "\7\0\1\11\5\0\1\11\52\1\1\0\1\11\12\0"+ + "\41\1\10\0\32\1\2\0\52\1\1\11\11\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[418]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + + StringBuffer string = new StringBuffer(); + + private static String xmlTagName=""; + + public int yychar() { + return yychar; + } + + private Stack pushedBack=new Stack(); + + public int yyline() { + return yyline+1; + } + private List listeners=new ArrayList<>(); + + public void addListener(LexListener listener){ + listeners.add(listener); + } + + public void removeListener(LexListener listener){ + listeners.remove(listener); + } + + public void informListenersLex(ParsedSymbol s){ + for(LexListener l:listeners){ + l.onLex(s); + } + } + + public void informListenersPushBack(ParsedSymbol s){ + for(LexListener l:listeners){ + l.onPushBack(s); + } + } + + public void pushback(ParsedSymbol symb) { + pushedBack.push(symb); + last = null; + informListenersPushBack(symb); + } + ParsedSymbol last; + public ParsedSymbol lex() throws java.io.IOException, ParseException{ + ParsedSymbol ret=null; + if(!pushedBack.isEmpty()){ + ret = last = pushedBack.pop(); + }else{ + ret = last = yylex(); + } + informListenersLex(ret); + return ret; + } + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public ActionScriptLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public ActionScriptLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 2236) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public ParsedSymbol yylex() throws java.io.IOException, ParseException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 27: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BITAND,yytext()); + } + case 133: break; + case 58: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_BITOR,yytext()); + } + case 134: break; + case 60: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_PLUS,yytext()); + } + case 135: break; + case 105: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SUPER,yytext()); + } + case 136: break; + case 109: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.RETURN,yytext()); + } + case 137: break; + case 20: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BRACKET_OPEN,yytext()); + } + case 138: break; + case 42: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.SHIFT_LEFT,yytext()); + } + case 139: break; + case 11: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN,yytext()); + } + case 140: break; + case 100: + { string.append( yytext() ); + String endtagname=yytext(); + endtagname=endtagname.substring(2,endtagname.length()-1); + if(endtagname.equals(xmlTagName)){ + yybegin(YYINITIAL); + return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML, string.toString()); + } + } + case 141: break; + case 51: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.IS,yytext()); + } + case 142: break; + case 84: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.USE,yytext()); + } + case 143: break; + case 5: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.MULTIPLY,yytext()); + } + case 144: break; + case 131: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.INSTANCEOF,yytext()); + } + case 145: break; + case 52: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IN,yytext()); + } + case 146: break; + case 125: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FUNCTION,yytext()); + } + case 147: break; + case 120: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PRIVATE,yytext()); + } + case 148: break; + case 22: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.SEMICOLON,yytext()); + } + case 149: break; + case 99: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.VOID,yytext()); + } + case 150: break; + case 85: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FOR,yytext()); + } + case 151: break; + case 3: + { /*ignore*/ + } + case 152: break; + case 123: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.OVERRIDE,yytext()); + } + case 153: break; + case 72: + { string.append( '\t' ); + } + case 154: break; + case 66: + { char val = (char) Integer.parseInt(yytext().substring(1),8); + string.append( val ); + } + case 155: break; + case 132: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPLEMENTS,yytext()); + } + case 156: break; + case 49: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DECREMENT,yytext()); + } + case 157: break; + case 18: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.CURLY_OPEN,yytext()); + } + case 158: break; + case 64: + { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); + } + case 159: break; + case 59: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.OR,yytext()); + } + case 160: break; + case 10: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.GREATER_THAN,yytext()); + } + case 161: break; + case 34: + { yybegin(YYINITIAL); yyline++; + } + case 162: break; + case 106: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.THROW,yytext()); + } + case 163: break; + case 98: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WITH,yytext()); + } + case 164: break; + case 75: + { string.setLength(0); + yybegin(XML); + String s=yytext(); + s=s.substring(1,s.length()-1); + if(s.contains(" ")){ + s=s.substring(0,s.indexOf(" ")); + } + xmlTagName = s; + string.append(yytext()); + } + case 165: break; + case 13: + { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong((yytext())))); + } + case 166: break; + case 15: + { string.setLength(0); + yybegin(CHARLITERAL); + } + case 167: break; + case 54: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DO,yytext()); + } + case 168: break; + case 53: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IF,yytext()); + } + case 169: break; + case 81: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SET,yytext()); + } + case 170: break; + case 29: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.PLUS,yytext()); + } + case 171: break; + case 21: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BRACKET_CLOSE,yytext()); + } + case 172: break; + case 103: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONST,yytext()); + } + case 173: break; + case 71: + { string.append( '\n' ); + } + case 174: break; + case 76: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_SHIFT_LEFT,yytext()); + } + case 175: break; + case 43: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.LOWER_EQUAL,yytext()); + } + case 176: break; + case 56: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_BITAND,yytext()); + } + case 177: break; + case 41: + { return new ParsedSymbol(SymbolGroup.DOUBLE,SymbolType.DOUBLE,new Double(Double.parseDouble((yytext())))); + } + case 178: break; + case 87: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.GET,yytext()); + } + case 179: break; + case 35: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return new ParsedSymbol(SymbolGroup.STRING,SymbolType.STRING,string.toString()); + } + case 180: break; + case 130: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PROTECTED,yytext()); + } + case 181: break; + case 114: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DELETE,yytext()); + } + case 182: break; + case 94: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CASE,yytext()); + } + case 183: break; + case 89: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.STRICT_NOT_EQUAL,yytext()); + } + case 184: break; + case 107: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FALSE,yytext()); + } + case 185: break; + case 4: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DIVIDE,yytext()); + } + case 186: break; + case 40: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NAMESPACE_OP,yytext()); + } + case 187: break; + case 17: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.PARENT_CLOSE,yytext()); + } + case 188: break; + case 31: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.MODULO,yytext()); + } + case 189: break; + case 118: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DYNAMIC,yytext()); + } + case 190: break; + case 93: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.ELSE,yytext()); + } + case 191: break; + case 79: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.STRICT_EQUALS,yytext()); + } + case 192: break; + case 88: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NAN,yytext()); + } + case 193: break; + case 126: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.INFINITY,yytext()); + } + case 194: break; + case 116: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EXTENDS,yytext()); + } + case 195: break; + case 110: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.STATIC,yytext()); + } + case 196: break; + case 14: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.MINUS,yytext()); + } + case 197: break; + case 82: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NEW,yytext()); + } + case 198: break; + case 19: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.CURLY_CLOSE,yytext()); + } + case 199: break; + case 92: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EACH,yytext()); + } + case 200: break; + case 28: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BITOR,yytext()); + } + case 201: break; + case 113: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPORT,yytext()); + } + case 202: break; + case 70: + { string.append( '\r' ); + } + case 203: break; + case 26: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.TERNAR,yytext()); + } + case 204: break; + case 2: + { yyline++; + } + case 205: break; + case 86: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.VAR,yytext()); + } + case 206: break; + case 69: + { string.append( '\b' ); + } + case 207: break; + case 83: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.TRY,yytext()); + } + case 208: break; + case 46: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.EQUALS,yytext()); + } + case 209: break; + case 62: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_XOR,yytext()); + } + case 210: break; + case 102: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CATCH,yytext()); + } + case 211: break; + case 65: + { string.append( '\"' ); + } + case 212: break; + case 8: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DOT,yytext()); + } + case 213: break; + case 30: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.XOR,yytext()); + } + case 214: break; + case 9: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.LOWER_THAN,yytext()); + } + case 215: break; + case 78: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_SHIFT_RIGHT,yytext()); + } + case 216: break; + case 50: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.AS,yytext()); + } + case 217: break; + case 68: + { string.append( '\'' ); + } + case 218: break; + case 67: + { string.append( '\\' ); + } + case 219: break; + case 129: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.UNDEFINED,yytext()); + } + case 220: break; + case 128: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERFACE,yytext()); + } + case 221: break; + case 115: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PUBLIC,yytext()); + } + case 222: break; + case 108: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE,yytext()); + } + case 223: break; + case 38: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_DIVIDE,yytext()); + } + case 224: break; + case 121: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PACKAGE,yytext()); + } + case 225: break; + case 112: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.TYPEOF,yytext()); + } + case 226: break; + case 63: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_MODULO,yytext()); + } + case 227: break; + case 111: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SWITCH,yytext()); + } + case 228: break; + case 77: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.USHIFT_RIGHT,yytext()); + } + case 229: break; + case 124: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERNAL,yytext()); + } + case 230: break; + case 37: + { yybegin(XML); string.append( yytext() ); + } + case 231: break; + case 117: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DEFAULT,yytext()); + } + case 232: break; + case 32: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ATTRIBUTE,yytext()); + } + case 233: break; + case 16: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.PARENT_OPEN,yytext()); + } + case 234: break; + case 44: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.SHIFT_RIGHT,yytext()); + } + case 235: break; + case 104: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CLASS,yytext()); + } + case 236: break; + case 73: + { string.append( '\f' ); + } + case 237: break; + case 91: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_USHIFT_RIGHT,yytext()); + } + case 238: break; + case 39: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_MULTIPLY,yytext()); + } + case 239: break; + case 80: + { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext().substring(2),16))); + } + case 240: break; + case 96: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.TRUE,yytext()); + } + case 241: break; + case 23: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.COMMA,yytext()); + } + case 242: break; + case 74: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.REST,yytext()); + } + case 243: break; + case 61: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.INCREMENT,yytext()); + } + case 244: break; + case 47: + { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext(),8))); + } + case 245: break; + case 95: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NULL,yytext()); + } + case 246: break; + case 33: + { string.append( yytext() ); + } + case 247: break; + case 12: + { string.setLength(0); + yybegin(STRING); + } + case 248: break; + case 101: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.BREAK,yytext()); + } + case 249: break; + case 57: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.AND,yytext()); + } + case 250: break; + case 7: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.COLON,yytext()); + } + case 251: break; + case 127: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.NAMESPACE,yytext()); + } + case 252: break; + case 122: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONTINUE,yytext()); + } + case 253: break; + case 6: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.IDENTIFIER, yytext()); + } + case 254: break; + case 119: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FINALLY,yytext()); + } + case 255: break; + case 90: + { String t=yytext(); return new ParsedSymbol(SymbolGroup.TYPENAME,SymbolType.TYPENAME,t.substring(2,t.length()-1)); + } + case 256: break; + case 24: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NOT,yytext()); + } + case 257: break; + case 25: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NEGATE,yytext()); + } + case 258: break; + case 45: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.GREATER_EQUAL,yytext()); + } + case 259: break; + case 48: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_MINUS,yytext()); + } + case 260: break; + case 55: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NOT_EQUAL,yytext()); + } + case 261: break; + case 36: + { string.append( yytext() ); yyline++; + } + case 262: break; + case 97: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.THIS,yytext()); + } + case 263: break; + case 1: + { + } + case 264: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return new ParsedSymbol(SymbolGroup.EOF,SymbolType.EOF,null); + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java new file mode 100644 index 000000000..554a54797 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java @@ -0,0 +1,1449 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.CallPropertyAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.CallSuperAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.ConstructAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.ConstructPropAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.FindPropertyAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.FloatValueAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.GetPropertyAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.InAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.NameValuePair; +import com.jpexs.decompiler.flash.abc.avm2.model.NanAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.NewArrayAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.NewObjectAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.PostDecrementAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.PostIncrementAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.ReturnValueAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.ReturnVoidAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.SetPropertyAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.ThrowAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.UndefinedAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.WithAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.clauses.ForEachInAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.clauses.ForInAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.clauses.TryAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitAndAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitOrAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitXorAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.DeletePropertyAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.DivideAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.EqAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.GeAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.GtAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.InstanceOfAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.LShiftAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.LeAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.LtAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.ModuloAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.MultiplyAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.NeqAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreDecrementAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreIncrementAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.RShiftAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.StrictEqAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.StrictNeqAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.SubtractAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.TypeOfAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.URShiftAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; +import com.jpexs.decompiler.flash.abc.types.ABCException; +import com.jpexs.decompiler.flash.abc.types.Namespace; +import com.jpexs.decompiler.flash.abc.types.ScriptInfo; +import com.jpexs.decompiler.flash.action.swf4.ActionIf; +import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; +import com.jpexs.decompiler.flash.action.swf5.ActionConstantPool; +import com.jpexs.decompiler.flash.ecma.Null; +import com.jpexs.decompiler.flash.ecma.Undefined; +import com.jpexs.decompiler.flash.helpers.collections.MyEntry; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.Loop; +import com.jpexs.decompiler.graph.model.AndItem; +import com.jpexs.decompiler.graph.model.BinaryOp; +import com.jpexs.decompiler.graph.model.BlockItem; +import com.jpexs.decompiler.graph.model.BreakItem; +import com.jpexs.decompiler.graph.model.CommaExpressionItem; +import com.jpexs.decompiler.graph.model.ContinueItem; +import com.jpexs.decompiler.graph.model.DoWhileItem; +import com.jpexs.decompiler.graph.model.ForItem; +import com.jpexs.decompiler.graph.model.IfItem; +import com.jpexs.decompiler.graph.model.LocalData; +import com.jpexs.decompiler.graph.model.NotItem; +import com.jpexs.decompiler.graph.model.OrItem; +import com.jpexs.decompiler.graph.model.ParenthesisItem; +import com.jpexs.decompiler.graph.model.SwitchItem; +import com.jpexs.decompiler.graph.model.TernarOpItem; +import com.jpexs.decompiler.graph.model.WhileItem; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class ActionScriptParser { + + private long uniqLast = 0; + private final boolean debugMode = false; + + private long uniqId() { + uniqLast++; + return uniqLast; + } + + private List commands(Stack loops, Map loopLabels, HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel, List variables) throws IOException, ParseException { + List ret = new ArrayList<>(); + if (debugMode) { + System.out.println("commands:"); + } + GraphTargetItem cmd = null; + while ((cmd = command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables)) != null) { + ret.add(cmd); + } + if (debugMode) { + System.out.println("/commands"); + } + return ret; + } + + private GraphTargetItem type(List variables) throws IOException, ParseException { + GraphTargetItem ret = null; + + ParsedSymbol s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.STRING_OP); + ret = new VariableAVM2Item(s.value.toString(), null, false); + variables.add((VariableAVM2Item) ret); + s = lex(); + while (s.type == SymbolType.DOT) { + s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.STRING_OP); + VariableAVM2Item var = new VariableAVM2Item(s.value.toString(), null, false); + ret = new GetPropertyAVM2Item(null, ret, createMultiname(var)); + s = lex(); + } + lexer.pushback(s); + return ret; + } + + private GraphTargetItem memberOrCall(GraphTargetItem newcmds, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, ParseException { + ParsedSymbol s = lex(); + GraphTargetItem ret = newcmds; + while (s.isType(SymbolType.DOT, SymbolType.BRACKET_OPEN, SymbolType.PARENT_OPEN)) { + switch (s.type) { + case DOT: + case BRACKET_OPEN: + lexer.pushback(s); + ret = member(ret, registerVars, inFunction, inMethod, variables); + break; + case PARENT_OPEN: + if (ret instanceof GetPropertyAVM2Item) { + GetPropertyAVM2Item mem = (GetPropertyAVM2Item) ret; + ret = new CallPropertyAVM2Item(null, false, mem.object, mem.propertyName, call(registerVars, inFunction, inMethod, variables)); + } else if (ret instanceof VariableAVM2Item) { + VariableAVM2Item var = (VariableAVM2Item) ret; + ret = new CallPropertyAVM2Item(null, false, new FindPropertyAVM2Item(null, var), var, call(registerVars, inFunction, inMethod, variables)); + //ret = new CallFunctionAVM2Item(null, pushConst(var.getVariableName()), call(registerVars, inFunction, inMethod, variables)); + } else { + //ret = new CallPropertyAVM2Item(null,false, ret, call(registerVars, inFunction, inMethod, variables)); + //FIXME? + } + break; + } + s = lex(); + } + lexer.pushback(s); + return ret; + } + + private GraphTargetItem member(GraphTargetItem obj, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, ParseException { + GraphTargetItem ret = obj; + ParsedSymbol s = lex(); + while (s.isType(SymbolType.DOT)) { + VariableAVM2Item var = name(registerVars, inFunction, inMethod, variables); + ret = new GetPropertyAVM2Item(null, ret, var); + s = lex(); + } + lexer.pushback(s); + return ret; + } + + private VariableAVM2Item qname(List variables) throws IOException, ParseException { + ParsedSymbol s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.THIS, SymbolType.SUPER, SymbolType.STRING_OP); + VariableAVM2Item ret = new VariableAVM2Item(s.value.toString(), null, false); + variables.add((VariableAVM2Item) ret); + return ret; + } + + private VariableAVM2Item name(HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, ParseException { + ParsedSymbol s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.THIS, SymbolType.SUPER, SymbolType.STRING_OP); + VariableAVM2Item ret = new VariableAVM2Item(s.value.toString(), null, false); + s = lex(); + if (s.type == SymbolType.BRACKET_OPEN) { + ret.setIndex(expression(registerVars, inFunction, inMethod, true, variables)); + expectedType(SymbolType.BRACKET_CLOSE); + } else { + lexer.pushback(s); + } + variables.add((VariableAVM2Item) ret); + return ret; + } + + private void expected(ParsedSymbol symb, int line, Object... expected) throws IOException, ParseException { + boolean found = false; + for (Object t : expected) { + if (symb.type == t) { + found = true; + } + if (symb.group == t) { + found = true; + } + } + if (!found) { + String expStr = ""; + boolean first = true; + for (Object e : expected) { + if (!first) { + expStr += " or "; + } + expStr += e; + first = false; + } + throw new ParseException("" + expStr + " expected but " + symb.type + " found", line); + } + } + + private ParsedSymbol expectedType(Object... type) throws IOException, ParseException { + ParsedSymbol symb = lex(); + expected(symb, lexer.yyline(), type); + return symb; + } + + private ParsedSymbol lex() throws IOException, ParseException { + ParsedSymbol ret = lexer.lex(); + if (debugMode) { + System.out.println(ret); + } + return ret; + } + + private List call(HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, ParseException { + List ret = new ArrayList<>(); + //expected(SymbolType.PARENT_OPEN); //MUST BE HANDLED BY CALLER + ParsedSymbol s = lex(); + while (s.type != SymbolType.PARENT_CLOSE) { + if (s.type != SymbolType.COMMA) { + lexer.pushback(s); + } + ret.add(expression(registerVars, inFunction, inMethod, true, variables)); + s = lex(); + expected(s, lexer.yyline(), SymbolType.COMMA, SymbolType.PARENT_CLOSE); + } + return ret; + } + + private MethodAVM2Item method(int namespaceKind, boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { + FunctionAVM2Item f = function(withBody, functionName, isMethod, variables); + return new MethodAVM2Item(namespaceKind, functionName, f.paramNames, f.body, variables); + } + + private FunctionAVM2Item function(boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { + ParsedSymbol s; + expectedType(SymbolType.PARENT_OPEN); + s = lex(); + List paramNames = new ArrayList<>(); + + while (s.type != SymbolType.PARENT_CLOSE) { + if (s.type != SymbolType.COMMA) { + lexer.pushback(s); + } + s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); + paramNames.add(s.value.toString()); + s = lex(); + if (s.type == SymbolType.COLON) { + type(variables); + s = lex(); + } + + if (!s.isType(SymbolType.COMMA, SymbolType.PARENT_CLOSE)) { + expected(s, lexer.yyline(), SymbolType.COMMA, SymbolType.PARENT_CLOSE); + } + } + List body = null; + List subvariables = new ArrayList<>(); + if (withBody) { + expectedType(SymbolType.CURLY_OPEN); + + body = commands(new Stack(), new HashMap(), new HashMap(), true, isMethod, 0, subvariables); + expectedType(SymbolType.CURLY_CLOSE); + } + + //return new FunctionAVM2Item(null, functionName, paramNames, body, constantPool, -1, subvariables); + return new FunctionAVM2Item(functionName, paramNames, body, subvariables); + } + + private GraphTargetItem traits(boolean isInterface, GraphTargetItem nameStr, GraphTargetItem extendsStr, List implementsStr, List variables) throws IOException, ParseException { + + GraphTargetItem ret = null; + + ParsedSymbol s = null; + MethodAVM2Item constr = null; + List staticFunctions = new ArrayList<>(); + List staticVars = new ArrayList<>(); + List functions = new ArrayList<>(); + List vars = new ArrayList<>(); + + String classNameStr = ""; + if (nameStr instanceof GetPropertyAVM2Item) { + GetPropertyAVM2Item mem = (GetPropertyAVM2Item) nameStr; + if (mem.propertyName instanceof VariableAVM2Item) { + classNameStr = ((VariableAVM2Item) mem.propertyName).getVariableName(); + } + } else if (nameStr instanceof VariableAVM2Item) { + VariableAVM2Item var = (VariableAVM2Item) nameStr; + classNameStr = var.getVariableName(); + } + + looptrait: + while (true) { + s = lex(); + boolean isStatic = false; + int nsKind = -1; + boolean isGetter = false; + boolean isSetter = false; + //TODO: namespace name + while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.GET, SymbolType.SET)) { + if (s.type == SymbolType.STATIC) { + if (isStatic) { + throw new ParseException("Only one static identifier allowed", lexer.yyline()); + } + isStatic = true; + } else if (s.type == SymbolType.GET) { + if (isGetter || isSetter) { + throw new ParseException("Only one get/set keyword allowed", lexer.yyline()); + } + isGetter = true; + } else if (s.type == SymbolType.SET) { + if (isGetter || isSetter) { + throw new ParseException("Only one get/set keyword allowed", lexer.yyline()); + } + isSetter = true; + } else { + if (nsKind != -1) { + throw new ParseException("Only one access identifier allowed", lexer.yyline()); + } + } + switch (s.type) { + case PUBLIC: + nsKind = Namespace.KIND_PACKAGE; + break; + case PRIVATE: + nsKind = Namespace.KIND_PRIVATE; + break; + case PROTECTED: + nsKind = Namespace.KIND_PROTECTED; + break; + } + s = lex(); + } + if (nsKind == -1) { + nsKind = Namespace.KIND_PACKAGE_INTERNAL; + } + if (nsKind == Namespace.KIND_PROTECTED && isStatic) { + nsKind = Namespace.KIND_STATIC_PROTECTED; + } + switch (s.type) { + case FUNCTION: + s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); + String fname = s.value.toString(); + if (fname.equals(classNameStr)) { //constructor + constr = (method(nsKind, !isInterface, "", true, variables)); + } else { + //if (!isInterface) { + if (isStatic) { + //Can interfa + GraphTargetItem t; + MethodAVM2Item ft = method(nsKind, !isInterface, "", true, variables); + ft.calculatedFunctionName = fname; + if (isGetter) { + GetterAVM2Item g = new GetterAVM2Item(ft.namespaceKind, ft.methodName, ft.paramNames, ft.body, ft.subvariables); + g.calculatedFunctionName = fname; + } else if (isSetter) { + SetterAVM2Item st = new SetterAVM2Item(ft.namespaceKind, ft.methodName, ft.paramNames, ft.body, ft.subvariables); + st.calculatedFunctionName = fname; + t = st; + } else { + t = ft; + } + staticFunctions.add(ft); + } else { + MethodAVM2Item ft = method(nsKind, !isInterface, "", true, variables); + ft.calculatedFunctionName = fname; + functions.add(ft); + } + } + //} + break; + case CONST: + case VAR: + boolean isConst = s.type == SymbolType.CONST; + VariableAVM2Item var = qname(variables); + var.setNsKind(nsKind); + s = lex(); + if (s.type == SymbolType.COLON) { + type(variables); + s = lex(); + } + if (s.type == SymbolType.ASSIGN) { + GraphTargetItem tar; + if (isConst) { + tar = new ConstAVM2Item(nsKind, var, expression(new HashMap(), false, false, true, variables)); + } else { + tar = new SlotAVM2Item(nsKind, var, expression(new HashMap(), false, false, true, variables)); + } + if (isStatic) { + staticVars.add(tar); + } else { + vars.add(tar); + } + s = lex(); + } + if (s.type != SymbolType.SEMICOLON) { + lexer.pushback(s); + } + break; + default: + lexer.pushback(s); + break looptrait; + + } + } + + if (isInterface) { + return new InterfaceAVM2Item(nameStr, implementsStr, functions); + } else { + return new ClassAVM2Item(nameStr, extendsStr, implementsStr, constr, functions, vars, staticFunctions, staticVars); + } + } + + private GraphTargetItem expressionCommands(ParsedSymbol s, HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel, List variables) throws IOException, ParseException { + GraphTargetItem ret = null; + switch (s.type) { + /*case INT: + expectedType(SymbolType.PARENT_OPEN); + ret = new ToIntegerAVM2Item(null, expression(registerVars, inFunction, inMethod, true, variables)); + expectedType(SymbolType.PARENT_CLOSE); + break; + case NUMBER_OP: + s = lex(); + if (s.type == SymbolType.DOT) { + VariableAVM2Item vi = new VariableAVM2Item(s.value.toString(), null, false); + variables.add(vi); + ret = memberOrCall(vi, registerVars, inFunction, inMethod, variables); + } else { + expected(s, lexer.yyline(), SymbolType.PARENT_OPEN); + ret = new ToNumberAVM2Item(null, expression(registerVars, inFunction, inMethod, true, variables)); + expectedType(SymbolType.PARENT_CLOSE); + } + break; + case STRING_OP: + ParsedSymbol sop = s; + s = lex(); + if (s.type == SymbolType.DOT) { + lexer.pushback(s); + VariableAVM2Item vi2 = new VariableAVM2Item(sop.value.toString(), null, false); + variables.add(vi2); + ret = memberOrCall(vi2, registerVars, inFunction, inMethod, variables); + } else { + expected(s, lexer.yyline(), SymbolType.PARENT_OPEN); + ret = new ToStringAVM2Item(null, expression(registerVars, inFunction, inMethod, true, variables)); + expectedType(SymbolType.PARENT_CLOSE); + ret = memberOrCall(ret, registerVars, inFunction, inMethod, variables); + } + break;*/ + default: + return null; + } + //return ret; + } + + private GraphTargetItem command(Stack loops, Map loopLabels, HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel, boolean mustBeCommand, List variables) throws IOException, ParseException { + LexBufferer buf = new LexBufferer(); + lexer.addListener(buf); + GraphTargetItem ret = null; + if (debugMode) { + System.out.println("command:"); + } + ParsedSymbol s = lex(); + if (s.type == SymbolType.EOF) { + return null; + } + String loopLabel = null; + + if (s.type == SymbolType.IDENTIFIER) { + ParsedSymbol sc = lex(); + if (sc.type == SymbolType.COLON) { + loopLabel = s.value.toString(); + s = lex(); + } else { + lexer.pushback(sc); + } + } + + switch (s.type) { + case WITH: + expectedType(SymbolType.PARENT_OPEN); + GraphTargetItem wvar = (name(registerVars, inFunction, inMethod, variables)); + expectedType(SymbolType.PARENT_CLOSE); + expectedType(SymbolType.CURLY_OPEN); + List wcmd = commands(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, variables); + expectedType(SymbolType.CURLY_CLOSE); + ret = new WithAVM2Item(null, wvar, wcmd); + break; + case DELETE: + GraphTargetItem varDel = name(registerVars, inFunction, inMethod, variables); + if (varDel instanceof GetPropertyAVM2Item) { + GetPropertyAVM2Item gm = (GetPropertyAVM2Item) varDel; + ret = new DeletePropertyAVM2Item(null, gm.object, gm.propertyName); + } else if (varDel instanceof VariableAVM2Item) { + variables.remove(varDel); + ret = new DeletePropertyAVM2Item(null, null, (VariableAVM2Item) varDel); + } else { + throw new ParseException("Not a property", lexer.yyline()); + } + break; + case CLASS: + GraphTargetItem classTypeStr = type(variables); + s = lex(); + GraphTargetItem extendsTypeStr = null; + if (s.type == SymbolType.EXTENDS) { + extendsTypeStr = type(variables); + s = lex(); + } + List implementsTypeStrs = new ArrayList<>(); + if (s.type == SymbolType.IMPLEMENTS) { + do { + GraphTargetItem implementsTypeStr = type(variables); + implementsTypeStrs.add(implementsTypeStr); + s = lex(); + } while (s.type == SymbolType.COMMA); + } + expected(s, lexer.yyline(), SymbolType.CURLY_OPEN); + ret = (traits(false, classTypeStr, extendsTypeStr, implementsTypeStrs, variables)); + expectedType(SymbolType.CURLY_CLOSE); + break; + case INTERFACE: + GraphTargetItem interfaceTypeStr = type(variables); + s = lex(); + List intExtendsTypeStrs = new ArrayList<>(); + + if (s.type == SymbolType.EXTENDS) { + do { + GraphTargetItem intExtendsTypeStr = type(variables); + intExtendsTypeStrs.add(intExtendsTypeStr); + s = lex(); + } while (s.type == SymbolType.COMMA); + } + expected(s, lexer.yyline(), SymbolType.CURLY_OPEN); + ret = (traits(true, interfaceTypeStr, null, intExtendsTypeStrs, variables)); + expectedType(SymbolType.CURLY_CLOSE); + break; + case FUNCTION: + s = lexer.lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); + ret = (function(true, s.value.toString(), false, variables)); + break; + case VAR: + s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); + String varIdentifier = s.value.toString(); + s = lex(); + if (s.type == SymbolType.COLON) { + type(variables); + s = lex(); + //TODO: handle value type + } + + if (s.type == SymbolType.ASSIGN) { + GraphTargetItem varval = (expression(registerVars, inFunction, inMethod, true, variables)); + ret = new VariableAVM2Item(varIdentifier, varval, true); + variables.add((VariableAVM2Item) ret); + } else { + ret = new VariableAVM2Item(varIdentifier, null, true); + variables.add((VariableAVM2Item) ret); + lexer.pushback(s); + } + break; + case CURLY_OPEN: + ret = new BlockItem(null, commands(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, variables)); + expectedType(SymbolType.CURLY_CLOSE); + break; + case INCREMENT: //preincrement + case DECREMENT: //predecrement + GraphTargetItem varincdec = name(registerVars, inFunction, inMethod, variables); + if (s.type == SymbolType.INCREMENT) { + ret = new PreIncrementAVM2Item(null, varincdec); + } else if (s.type == SymbolType.DECREMENT) { + ret = new PreDecrementAVM2Item(null, varincdec); + } + break; + case SUPER: //constructor call + ParsedSymbol ss2 = lex(); + if (ss2.type == SymbolType.PARENT_OPEN) { + List args = call(registerVars, inFunction, inMethod, variables); + ret = new ConstructAVM2Item(null, new VariableAVM2Item(s.value.toString(), null, false), args); + } else {//no costructor call, but it could be calling parent methods... => handle in expression + lexer.pushback(ss2); + lexer.pushback(s); + } + break; + case IF: + expectedType(SymbolType.PARENT_OPEN); + GraphTargetItem ifExpr = (expression(registerVars, inFunction, inMethod, true, variables)); + expectedType(SymbolType.PARENT_CLOSE); + GraphTargetItem onTrue = command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables); + List onTrueList = new ArrayList<>(); + onTrueList.add(onTrue); + s = lex(); + List onFalseList = null; + if (s.type == SymbolType.ELSE) { + onFalseList = new ArrayList<>(); + onFalseList.add(command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables)); + } else { + lexer.pushback(s); + } + ret = new IfItem(null, ifExpr, onTrueList, onFalseList); + break; + case WHILE: + expectedType(SymbolType.PARENT_OPEN); + List whileExpr = new ArrayList<>(); + whileExpr.add(commaExpression(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, variables)); + expectedType(SymbolType.PARENT_CLOSE); + List whileBody = new ArrayList<>(); + Loop wloop = new Loop(uniqId(), null, null); + if (loopLabel != null) { + loopLabels.put(wloop, loopLabel); + } + loops.push(wloop); + whileBody.add(command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables)); + ret = new WhileItem(null, wloop, whileExpr, whileBody); + break; + case DO: + List doBody = new ArrayList<>(); + Loop dloop = new Loop(uniqId(), null, null); + loops.push(dloop); + if (loopLabel != null) { + loopLabels.put(dloop, loopLabel); + } + doBody.add(command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables)); + expectedType(SymbolType.WHILE); + expectedType(SymbolType.PARENT_OPEN); + List doExpr = new ArrayList<>(); + doExpr.add(commaExpression(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, variables)); + expectedType(SymbolType.PARENT_CLOSE); + ret = new DoWhileItem(null, dloop, doBody, doExpr); + break; + case FOR: + expectedType(SymbolType.PARENT_OPEN); + s = lex(); + boolean forin = false; + boolean each = false; + GraphTargetItem collection = null; + String objIdent = null; + int innerExprReg = 0; + if (s.type == SymbolType.EACH) { + each = true; + forin = true; + } + if (s.type == SymbolType.VAR || s.type == SymbolType.IDENTIFIER || each) { + ParsedSymbol s2 = null; + ParsedSymbol ssel = s; + if (s.type == SymbolType.VAR) { + s2 = lex(); + ssel = s2; + } + + if (forin) { + expected(ssel, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.VAR); + } + + if (ssel.type == SymbolType.IDENTIFIER) { + objIdent = ssel.value.toString(); + + ParsedSymbol s3 = lex(); + if (s3.type == SymbolType.IN) { + if (inFunction) { + for (int i = 0; i < 256; i++) { + if (!registerVars.containsValue(i)) { + registerVars.put(objIdent, i); + innerExprReg = i; + break; + } + } + } + collection = expression(registerVars, inFunction, inMethod, true, variables); + forin = true; + } else { + lexer.pushback(s3); + if (s2 != null) { + lexer.pushback(s2); + } + lexer.pushback(s); + } + } else { + if (s2 != null) { + lexer.pushback(s2); + } + lexer.pushback(s); + } + } else { + lexer.pushback(s); + } + Loop floop = new Loop(uniqId(), null, null); + loops.push(floop); + if (loopLabel != null) { + loopLabels.put(floop, loopLabel); + } + List forFinalCommands = new ArrayList<>(); + GraphTargetItem forExpr = null; + List forFirstCommands = new ArrayList<>(); + if (!forin) { + GraphTargetItem fc = command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables); + if (fc != null) { //can be empty command + forFirstCommands.add(fc); + } + forExpr = (expression(registerVars, inFunction, inMethod, true, variables)); + expectedType(SymbolType.SEMICOLON); + forFinalCommands.add(command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables)); + } + expectedType(SymbolType.PARENT_CLOSE); + List forBody = new ArrayList<>(); + forBody.add(command(loops, loopLabels, registerVars, inFunction, inMethod, forin ? forinlevel + 1 : forinlevel, true, variables)); + if (forin) { + + VariableAVM2Item obj = new VariableAVM2Item(objIdent, null, false); + variables.add(obj); + if (each) { + ret = new ForEachInAVM2Item(null, floop, new InAVM2Item(null, obj, collection), forBody); + } else { + + ret = new ForInAVM2Item(null, floop, new InAVM2Item(null, obj, collection), forBody); + } + } else { + ret = new ForItem(null, floop, forFirstCommands, forExpr, forFinalCommands, forBody); + } + break; + case SWITCH: + Loop sloop = new Loop(-uniqId(), null, null); //negative id marks switch = no continue + loops.push(sloop); + if (loopLabel != null) { + loopLabels.put(sloop, loopLabel); + } + expectedType(SymbolType.PARENT_OPEN); + GraphTargetItem switchExpr = expression(registerVars, inFunction, inMethod, true, variables); + expectedType(SymbolType.PARENT_CLOSE); + expectedType(SymbolType.CURLY_OPEN); + s = lex(); + //ret.addAll(switchExpr); + int exprReg = 0; + for (int i = 0; i < 256; i++) { + if (!registerVars.containsValue(i)) { + registerVars.put("__switch" + uniqId(), i); + exprReg = i; + break; + } + } + List> caseIfs = new ArrayList<>(); + List> caseCmds = new ArrayList<>(); + List caseExprsAll = new ArrayList<>(); + List valueMapping = new ArrayList<>(); + int pos = 0; + while (s.type == SymbolType.CASE) { + List caseExprs = new ArrayList<>(); + while (s.type == SymbolType.CASE) { + GraphTargetItem curCaseExpr = expression(registerVars, inFunction, inMethod, true, variables); + caseExprs.add(curCaseExpr); + expectedType(SymbolType.COLON); + s = lex(); + caseExprsAll.add(curCaseExpr); + valueMapping.add(pos); + } + pos++; + lexer.pushback(s); + List caseCmd = commands(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, variables); + caseCmds.add(caseCmd); + s = lex(); + } + List defCmd = new ArrayList<>(); + if (s.type == SymbolType.DEFAULT) { + expectedType(SymbolType.COLON); + defCmd = commands(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, variables); + s = lexer.lex(); + } + expected(s, lexer.yyline(), SymbolType.CURLY_CLOSE); + ret = new SwitchItem(null, sloop, switchExpr, caseExprsAll, caseCmds, defCmd, valueMapping); + break; + case BREAK: + s = lex(); + long bloopId = 0; + if (loops.isEmpty()) { + throw new ParseException("No loop to break", lexer.yyline()); + } + if (s.type == SymbolType.IDENTIFIER) { + String breakLabel = s.value.toString(); + for (Loop l : loops) { + if (breakLabel.equals(loopLabels.get(l))) { + bloopId = l.id; + break; + } + } + if (bloopId == 0) { + throw new ParseException("Identifier of loop expected", lexer.yyline()); + } + } else { + lexer.pushback(s); + bloopId = loops.peek().id; + } + ret = new BreakItem(null, bloopId); + break; + case CONTINUE: + s = lex(); + long cloopId = 0; + if (loops.isEmpty()) { + throw new ParseException("No loop to continue", lexer.yyline()); + } + if (s.type == SymbolType.IDENTIFIER) { + String continueLabel = s.value.toString(); + for (Loop l : loops) { + if (l.id < 0) { //negative id marks switch => no continue + continue; + } + if (continueLabel.equals(loopLabels.get(l))) { + cloopId = l.id; + break; + } + } + if (cloopId == -1) { + throw new ParseException("Identifier of loop expected", lexer.yyline()); + } + } else { + lexer.pushback(s); + for (int i = loops.size() - 1; i >= 0; i--) { + if (loops.get(i).id >= 0) {//no switches + cloopId = loops.peek().id; + break; + } + } + if (cloopId <= 0) { + throw new ParseException("No loop to continue", lexer.yyline()); + } + } + //TODO: handle switch + ret = new ContinueItem(null, cloopId); + break; + case RETURN: + GraphTargetItem retexpr = expression(true, registerVars, inFunction, inMethod, true, variables); + if (retexpr == null) { + ret = new ReturnVoidAVM2Item(null); + } else { + ret = new ReturnValueAVM2Item(null, retexpr); + } + break; + case TRY: + List tryCommands = new ArrayList<>(); + tryCommands.add(command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables)); + s = lex(); + boolean found = false; + List> catchCommands = null; + List catchExceptions = new ArrayList<>(); + if (s.type == SymbolType.CATCH) { + expectedType(SymbolType.PARENT_OPEN); + VariableAVM2Item ename = qname(variables); + expectedType(SymbolType.COLON); + VariableAVM2Item etype = name(registerVars, inFunction, inMethod, variables); + ABCException e = new ABCException(); + //TODO:handle exceptions !!! + catchExceptions.add(e); + expectedType(SymbolType.PARENT_CLOSE); + catchCommands = new ArrayList<>(); + List cc = new ArrayList<>(); + cc.add(command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables)); + catchCommands.add(cc); + s = lex(); + found = true; + } + List finallyCommands = null; + if (s.type == SymbolType.FINALLY) { + finallyCommands = new ArrayList<>(); + finallyCommands.add(command(loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables)); + found = true; + s = lex(); + } + if (!found) { + expected(s, lexer.yyline(), SymbolType.CATCH, SymbolType.FINALLY); + } + lexer.pushback(s); + ret = new TryAVM2Item(tryCommands, catchExceptions, catchCommands, finallyCommands); + break; + case THROW: + ret = new ThrowAVM2Item(null, expression(registerVars, inFunction, inMethod, true, variables)); + break; + default: + GraphTargetItem valcmd = expressionCommands(s, registerVars, inFunction, inMethod, forinlevel, variables); + if (valcmd != null) { + ret = valcmd; + break; + } + if (s.type == SymbolType.SEMICOLON) { + return null; + } + lexer.pushback(s); + ret = expression(registerVars, inFunction, inMethod, true, variables); + if (debugMode) { + System.out.println("/command"); + } + } + if (debugMode) { + System.out.println("/command"); + } + lexer.removeListener(buf); + if (ret == null) { //can be popped expression + buf.pushAllBack(lexer); + ret = expression(registerVars, inFunction, inMethod, true, variables); + } + s = lex(); + if ((s != null) && (s.type != SymbolType.SEMICOLON)) { + lexer.pushback(s); + } + + return ret; + + } + + private GraphTargetItem expression(HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, ParseException { + return expression(false, registerVars, inFunction, inMethod, allowRemainder, variables); + } + + private GraphTargetItem fixPrecedence(GraphTargetItem expr) { + GraphTargetItem ret = expr; + if (expr instanceof BinaryOp) { + BinaryOp bo = (BinaryOp) expr; + GraphTargetItem left = bo.getLeftSide(); + //GraphTargetItem right=bo.getRightSide(); + if (left.getPrecedence() > bo.getPrecedence()) { + if (left instanceof BinaryOp) { + BinaryOp leftBo = (BinaryOp) left; + bo.setLeftSide(leftBo.getRightSide()); + leftBo.setRightSide(expr); + return left; + } + } + } + return ret; + } + + private GraphTargetItem expressionRemainder(GraphTargetItem expr, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, ParseException { + GraphTargetItem ret = null; + ParsedSymbol s = lex(); + switch (s.type) { + case TERNAR: + GraphTargetItem terOnTrue = expression(registerVars, inFunction, inMethod, true, variables); + expectedType(SymbolType.COLON); + GraphTargetItem terOnFalse = expression(registerVars, inFunction, inMethod, true, variables); + ret = new TernarOpItem(null, expr, terOnTrue, terOnFalse); + break; + case SHIFT_LEFT: + ret = new LShiftAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case SHIFT_RIGHT: + ret = new RShiftAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case USHIFT_RIGHT: + ret = new URShiftAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case BITAND: + ret = new BitAndAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case BITOR: + ret = new BitOrAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case DIVIDE: + ret = new DivideAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case MODULO: + ret = new ModuloAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case EQUALS: + ret = new EqAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case STRICT_EQUALS: + ret = new StrictEqAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case NOT_EQUAL: + ret = new NeqAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case STRICT_NOT_EQUAL: + ret = new StrictNeqAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case LOWER_THAN: + ret = new LtAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case LOWER_EQUAL: + ret = new LeAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case GREATER_THAN: + ret = new GtAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case GREATER_EQUAL: + ret = new GeAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case AND: + ret = new AndItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case OR: + ret = new OrItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case MINUS: + ret = new SubtractAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case MULTIPLY: + ret = new MultiplyAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case PLUS: + ret = new AddAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case XOR: + ret = new BitXorAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case AS: + //TODO + break; + case INSTANCEOF: + ret = new InstanceOfAVM2Item(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; + case IS: + + break; + + case ASSIGN: + case ASSIGN_BITAND: + case ASSIGN_BITOR: + case ASSIGN_DIVIDE: + case ASSIGN_MINUS: + case ASSIGN_MODULO: + case ASSIGN_MULTIPLY: + case ASSIGN_PLUS: + case ASSIGN_SHIFT_LEFT: + case ASSIGN_SHIFT_RIGHT: + case ASSIGN_USHIFT_RIGHT: + case ASSIGN_XOR: + GraphTargetItem assigned = expression(registerVars, inFunction, inMethod, true, variables); + switch (s.type) { + case ASSIGN: + //assigned = assigned; + break; + case ASSIGN_BITAND: + assigned = new BitAndAVM2Item(null, expr, assigned); + break; + case ASSIGN_BITOR: + assigned = new BitOrAVM2Item(null, expr, assigned); + break; + case ASSIGN_DIVIDE: + assigned = new DivideAVM2Item(null, expr, assigned); + break; + case ASSIGN_MINUS: + assigned = new SubtractAVM2Item(null, expr, assigned); + break; + case ASSIGN_MODULO: + assigned = new ModuloAVM2Item(null, expr, assigned); + break; + case ASSIGN_MULTIPLY: + assigned = new MultiplyAVM2Item(null, expr, assigned); + break; + case ASSIGN_PLUS: + assigned = new AddAVM2Item(null, expr, assigned); + break; + case ASSIGN_SHIFT_LEFT: + assigned = new LShiftAVM2Item(null, expr, assigned); + break; + case ASSIGN_SHIFT_RIGHT: + assigned = new RShiftAVM2Item(null, expr, assigned); + break; + case ASSIGN_USHIFT_RIGHT: + assigned = new URShiftAVM2Item(null, expr, assigned); + break; + case ASSIGN_XOR: + assigned = new BitXorAVM2Item(null, expr, assigned); + break; + } + if (expr instanceof VariableAVM2Item) { + ((VariableAVM2Item) expr).setStoreValue(assigned); + ((VariableAVM2Item) expr).setDefinition(false); + ret = expr; + } else if (expr instanceof GetPropertyAVM2Item) { + ret = new SetPropertyAVM2Item(null, ((GetPropertyAVM2Item) expr).object, ((GetPropertyAVM2Item) expr).propertyName, assigned); + } else { + throw new ParseException("Invalid assignment", lexer.yyline()); + } + break; + case INCREMENT: //postincrement + if (!(expr instanceof VariableAVM2Item) && !(expr instanceof GetPropertyAVM2Item)) { + throw new ParseException("Invalid assignment", lexer.yyline()); + } + ret = new PostIncrementAVM2Item(null, expr); + break; + case DECREMENT: //postdecrement + if (!(expr instanceof VariableAVM2Item) && !(expr instanceof GetPropertyAVM2Item)) { + throw new ParseException("Invalid assignment", lexer.yyline()); + } + ret = new PostDecrementAVM2Item(null, expr); + break; + case DOT: //member + case BRACKET_OPEN: //member + case PARENT_OPEN: //function call + lexer.pushback(s); + ret = memberOrCall(expr, registerVars, inFunction, inMethod, variables); + break; + + default: + lexer.pushback(s); + if (expr instanceof ParenthesisItem) { + if (isType(((ParenthesisItem) expr).value)) { + GraphTargetItem expr2 = expression(false, registerVars, inFunction, inMethod, true, variables); + if (expr2 != null) { + ret = new CoerceAVM2Item(null, ((ParenthesisItem) expr).value, expr2); + } + } + } + + } + ret = fixPrecedence(ret); + return ret; + } + + private boolean isType(GraphTargetItem item) { + if (item == null) { + return false; + } + while (item instanceof GetPropertyAVM2Item) { + item = ((GetPropertyAVM2Item) item).object; + } + if (item instanceof VariableAVM2Item) { + return true; + } + return false; + } + + private int brackets(List ret, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, ParseException { + ParsedSymbol s = lex(); + int arrCnt = 0; + if (s.type == SymbolType.BRACKET_OPEN) { + s = lex(); + + while (s.type != SymbolType.BRACKET_CLOSE) { + if (s.type != SymbolType.COMMA) { + lexer.pushback(s); + } + arrCnt++; + ret.add(expression(registerVars, inFunction, inMethod, true, variables)); + s = lex(); + if (!s.isType(SymbolType.COMMA, SymbolType.BRACKET_CLOSE)) { + expected(s, lexer.yyline(), SymbolType.COMMA, SymbolType.BRACKET_CLOSE); + } + } + } else { + lexer.pushback(s); + return -1; + } + return arrCnt; + } + + private GraphTargetItem commaExpression(Stack loops, Map loopLabels, HashMap registerVars, boolean inFunction, boolean inMethod, int forInLevel, List variables) throws IOException, ParseException { + GraphTargetItem cmd = null; + List expr = new ArrayList<>(); + ParsedSymbol s; + do { + cmd = command(loops, loopLabels, registerVars, inFunction, inMethod, forInLevel, false, variables); + if (cmd != null) { + expr.add(cmd); + } + s = lex(); + } while (s.type == SymbolType.COMMA && cmd != null); + lexer.pushback(s); + if (cmd == null) { + expr.add(expression(registerVars, inFunction, inMethod, true, variables)); + } else { + if (!cmd.hasReturnValue()) { + throw new ParseException("Expression expected", lexer.yyline()); + } + } + return new CommaExpressionItem(null, expr); + } + + private GraphTargetItem expression(boolean allowEmpty, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, ParseException { + if (debugMode) { + System.out.println("expression:"); + } + GraphTargetItem ret = null; + ParsedSymbol s = lex(); + boolean existsRemainder = false; + boolean assocRight = false; + switch (s.type) { + case MINUS: + s = lex(); + if (s.isType(SymbolType.DOUBLE)) { + ret = new FloatValueAVM2Item(null, (Double) s.value); + existsRemainder = true; + } else if (s.isType(SymbolType.INTEGER)) { + ret = new IntegerValueAVM2Item(null, (Long) s.value); + existsRemainder = true; + } else { + lexer.pushback(s); + GraphTargetItem num = expression(registerVars, inFunction, inMethod, true, variables); + if (num instanceof IntegerValueAVM2Item) { + ((IntegerValueAVM2Item) num).value = -(Long) ((IntegerValueAVM2Item) num).value; + ret = num; + } else if (num instanceof FloatValueAVM2Item) { + Double d = (Double) ((FloatValueAVM2Item) num).value; + if (d.isInfinite()) { + ((FloatValueAVM2Item) num).value = Double.NEGATIVE_INFINITY; + } else { + ((FloatValueAVM2Item) num).value = -d; + } + ret = (num); + } else { + ret = (new SubtractAVM2Item(null, new IntegerValueAVM2Item(null, 0L), num)); + } + } + break; + case TYPEOF: + expectedType(SymbolType.PARENT_OPEN); + ret = new TypeOfAVM2Item(null, expression(registerVars, inFunction, inMethod, true, variables)); + expectedType(SymbolType.PARENT_CLOSE); + existsRemainder = true; + break; + case TRUE: + ret = new BooleanAVM2Item(null, true); + existsRemainder = true; + break; + case NULL: + ret = new NullAVM2Item(null); + existsRemainder = true; + break; + case UNDEFINED: + ret = new UndefinedAVM2Item(null); + break; + case FALSE: + ret = new BooleanAVM2Item(null, false); + existsRemainder = true; + break; + case CURLY_OPEN: //Object literal + s = lex(); + List nvs = new ArrayList<>(); + + while (s.type != SymbolType.CURLY_CLOSE) { + if (s.type != SymbolType.COMMA) { + lexer.pushback(s); + } + + GraphTargetItem n = expression(registerVars, inFunction, inMethod, allowRemainder, variables); + expectedType(SymbolType.COLON); + GraphTargetItem v = expression(registerVars, inFunction, inMethod, allowRemainder, variables); + + NameValuePair nv = new NameValuePair(n, v); + nvs.add(nv); + s = lex(); + if (!s.isType(SymbolType.COMMA, SymbolType.CURLY_CLOSE)) { + expected(s, lexer.yyline(), SymbolType.COMMA, SymbolType.CURLY_CLOSE); + } + } + ret = new NewObjectAVM2Item(null, nvs); + break; + case BRACKET_OPEN: //Array literal or just brackets + lexer.pushback(s); + List inBrackets = new ArrayList<>(); + int arrCnt = brackets(inBrackets, registerVars, inFunction, inMethod, variables); + ret = new NewArrayAVM2Item(null, inBrackets); + break; + case FUNCTION: + s = lexer.lex(); + String fname = ""; + if (s.isType(SymbolType.IDENTIFIER)) { + fname = s.value.toString(); + } else { + lexer.pushback(s); + } + ret = function(true, fname, false, variables); + break; + case NAN: + ret = new NanAVM2Item(null); + existsRemainder = true; + break; + case INFINITY: + ret = new FloatValueAVM2Item(null, Double.POSITIVE_INFINITY); + existsRemainder = true; + break; + case INTEGER: + ret = new IntegerValueAVM2Item(null, (Long) s.value); + existsRemainder = true; + break; + case DOUBLE: + ret = new FloatValueAVM2Item(null, (Double) s.value); + existsRemainder = true; + break; + case DELETE: + GraphTargetItem varDel = name(registerVars, inFunction, inMethod, variables); + if (varDel instanceof GetPropertyAVM2Item) { + GetPropertyAVM2Item gm = (GetPropertyAVM2Item) varDel; + ret = new DeletePropertyAVM2Item(null, gm.object, gm.propertyName); + } else { + throw new ParseException("Not a property", lexer.yyline()); + } + break; + case INCREMENT: + case DECREMENT: //preincrement + GraphTargetItem prevar = name(registerVars, inFunction, inMethod, variables); + if (s.type == SymbolType.INCREMENT) { + ret = new PreIncrementAVM2Item(null, prevar); + } + if (s.type == SymbolType.DECREMENT) { + ret = new PreDecrementAVM2Item(null, prevar); + } + existsRemainder = true; + break; + case NOT: + ret = new NotItem(null, expression(registerVars, inFunction, inMethod, true, variables)); + existsRemainder = true; + break; + case PARENT_OPEN: + ret = new ParenthesisItem(null, expression(registerVars, inFunction, inMethod, true, variables)); + expectedType(SymbolType.PARENT_CLOSE); + ret = memberOrCall(ret, registerVars, inFunction, inMethod, variables); + existsRemainder = true; + break; + case NEW: + GraphTargetItem newvar = name(registerVars, inFunction, inMethod, variables); + expectedType(SymbolType.PARENT_OPEN); + if (newvar instanceof GetPropertyAVM2Item) { + GetPropertyAVM2Item mem = (GetPropertyAVM2Item) newvar; + ret = new ConstructPropAVM2Item(null, mem.object, mem.propertyName, call(registerVars, inFunction, inMethod, variables)); + } else if (newvar instanceof VariableAVM2Item) { + ret = new ConstructAVM2Item(null, newvar, call(registerVars, inFunction, inMethod, variables)); + } else { + throw new ParseException("Invalid new item", lexer.yyline()); + } + existsRemainder = true; + break; + case IDENTIFIER: + case THIS: + case SUPER: + default: + GraphTargetItem excmd = expressionCommands(s, registerVars, inFunction, inMethod, -1, variables); + if (excmd != null) { + existsRemainder = true; //? + ret = excmd; + break; + } + lexer.pushback(s); + } + if (allowRemainder && existsRemainder) { + GraphTargetItem rem = ret; + do { + rem = expressionRemainder(rem, registerVars, inFunction, inMethod, assocRight, variables); + if (rem != null) { + ret = rem; + } + } while ((!assocRight) && (rem != null)); + } + if (debugMode) { + System.out.println("/expression"); + } + return ret; + } + + private FullMultinameAVM2Item createMultiname(VariableAVM2Item s) throws IOException, ParseException { + /*int index = constantPool.indexOf(s); + if (index == -1) { + constantPool.add(s); + index = constantPool.indexOf(s); + } + return new FullMultinameAVM2Item(null, index);*/ + return null; + } + private ActionScriptLexer lexer = null; + private List constantPool; + + public List treeFromString(String str, List constantPool) throws ParseException, IOException { + List retTree = new ArrayList<>(); + this.constantPool = constantPool; + lexer = new ActionScriptLexer(new StringReader(str)); + + List vars = new ArrayList<>(); + retTree.addAll(commands(new Stack(), new HashMap(), new HashMap(), false, false, 0, vars)); + for (VariableAVM2Item v : vars) { + String varName = v.getVariableName(); + GraphTargetItem stored = v.getStoreValue(); + if (v.isDefinition()) { + //v.setBoxedValue(new DefineLocalAVM2Item(null, pushConst(varName), stored)); //FIXME!!! + } else { + if (stored != null) { + //v.setBoxedValue(new SetVariableAVM2Item(null, pushConst(varName), stored)); //FIXME!!! + } else { + //v.setBoxedValue(new GetVariableAVM2Item(null, pushConst(varName))); //FIXME!!! + } + } + } + if (lexer.lex().type != SymbolType.EOF) { + throw new ParseException("Parsing finisned before end of the file", lexer.yyline()); + } + return retTree; + } + + public ScriptInfo scriptFromTree(List tree, ABC abc) { + AVM2SourceGenerator gen = new AVM2SourceGenerator(abc); + List ret = new ArrayList<>(); + SourceGeneratorLocalData localData = new SourceGeneratorLocalData( + new HashMap(), 0, Boolean.FALSE, 0); + return gen.generateScriptInfo(localData, tree); + } + + public ScriptInfo scriptFromString(String s,ABC abc) throws ParseException, IOException { + List constantPool = new ArrayList<>(); + List tree = treeFromString(s, constantPool); + return scriptFromTree(tree, abc); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java new file mode 100644 index 000000000..29fd25f39 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.Block; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.model.ContinueItem; +import com.jpexs.decompiler.graph.model.LocalData; +import java.util.ArrayList; +import java.util.List; + +public class ClassAVM2Item extends AVM2Item implements Block { + + public List functions; + public List staticFunctions; + public GraphTargetItem extendsOp; + public List implementsOp; + public GraphTargetItem className; + public GraphTargetItem constructor; + public List vars; + public List staticVars; + + @Override + public List> getSubs() { + List> ret = new ArrayList<>(); + if (functions != null) { + ret.add(functions); + } + if (staticFunctions != null) { + ret.add(staticFunctions); + } + return ret; + } + + public ClassAVM2Item(GraphTargetItem className, GraphTargetItem extendsOp, List implementsOp, GraphTargetItem constructor, List functions, List vars, List staticFunctions, List staticVars) { + super(null, NOPRECEDENCE); + this.className = className; + this.functions = functions; + this.vars = vars; + this.extendsOp = extendsOp; + this.implementsOp = implementsOp; + this.staticFunctions = staticFunctions; + this.staticVars = staticVars; + this.constructor = constructor; + + List allFunc = new ArrayList<>(functions); + if (constructor != null) { + allFunc.add(constructor); + } + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return writer; + } + + @Override + public List getContinues() { + List ret = new ArrayList<>(); + return ret; + } + + @Override + public boolean needsSemicolon() { + return false; + } + + @Override + public boolean hasReturnValue() { + return false; + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java new file mode 100644 index 000000000..1b0bd5cdd --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.model.LocalData; + +/** + * + * @author JPEXS + */ +public class ConstAVM2Item extends AVM2Item { + private final int nsKind; + + public int getNsKind() { + return nsKind; + } + + + public ConstAVM2Item(int nsKind,VariableAVM2Item var,GraphTargetItem value) { + super(null,NOPRECEDENCE); + this.nsKind = nsKind; + this.value = value; + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return writer; //TODO + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java new file mode 100644 index 000000000..e3f411cf8 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.model.LocalData; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class FunctionAVM2Item extends AVM2Item{ + + public String calculatedFunctionName; + public String functionName; + public List paramNames; + public List body; + public List subvariables; + + public FunctionAVM2Item(String functionName,List paramNames,List body, List subvariables) { + super(null, NOPRECEDENCE); + this.paramNames = paramNames; + this.body = body; + this.functionName = functionName; + this.subvariables = subvariables; + } + + + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return writer; //todo? + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java new file mode 100644 index 000000000..d8023f693 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2014 petrik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.graph.GraphTargetItem; +import java.util.List; + +/** + * + * @author petrik + */ +public class GetterAVM2Item extends MethodAVM2Item{ + + public GetterAVM2Item(int namespaceKind, String methodName, List paramNames, List body, List subvariables) { + super(namespaceKind, methodName, paramNames, body, subvariables); + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java new file mode 100644 index 000000000..bce239e23 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; +import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.action.model.ActionItem; +import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; +import com.jpexs.decompiler.graph.model.LocalData; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class InterfaceAVM2Item extends ActionItem { + + public GraphTargetItem name; + public List superInterfaces; + public List methods; + + public InterfaceAVM2Item(GraphTargetItem name, List superInterfaces, List methods) { + super(null, NOPRECEDENCE); + this.name = name; + this.superInterfaces = superInterfaces; + this.methods = methods; + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return writer; + } + + @Override + public boolean needsSemicolon() { + return false; + } + + @Override + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { + List ret = new ArrayList<>(); + ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; + ret.addAll(asGenerator.generateTraits(localData, true, name, null, superInterfaces, null, null, null, null, null)); + return ret; + } + + @Override + public boolean hasReturnValue() { + return false; + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/LexBufferer.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/LexBufferer.java new file mode 100644 index 000000000..4650f224b --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/LexBufferer.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class LexBufferer implements LexListener { + + private final List items = new ArrayList<>(); + + @Override + public void onLex(ParsedSymbol s) { + items.add(s); + } + + @Override + public void onPushBack(ParsedSymbol s) { + if (items.get(items.size() - 1) == s) { + items.remove(items.size() - 1); + } + } + + public void pushAllBack(ActionScriptLexer lexer) { + for (int i = items.size() - 1; i >= 0; i--) { + lexer.pushback(items.get(i)); + } + items.clear(); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/LexListener.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/LexListener.java new file mode 100644 index 000000000..e272011a4 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/LexListener.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +/** + * + * @author JPEXS + */ +public interface LexListener { + + public void onLex(ParsedSymbol s); + + public void onPushBack(ParsedSymbol s); +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java new file mode 100644 index 000000000..d3b118a95 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.model.LocalData; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class MethodAVM2Item extends AVM2Item{ + + public String calculatedFunctionName; + public int namespaceKind; + public String methodName; + public List paramNames; + public List body; + public List subvariables; + + public MethodAVM2Item(int namespaceKind,String methodName,List paramNames,List body, List subvariables) { + super(null, NOPRECEDENCE); + this.namespaceKind = namespaceKind; + this.paramNames = paramNames; + this.body = body; + this.methodName = methodName; + this.subvariables = subvariables; + } + + + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return writer; //todo? + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ParsedSymbol.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ParsedSymbol.java new file mode 100644 index 000000000..b9d2613e6 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ParsedSymbol.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + + +/** + * + * @author JPEXS + */ +public class ParsedSymbol { + + public SymbolGroup group; + public Object value; + public SymbolType type; + + public ParsedSymbol(SymbolGroup group, SymbolType type) { + this.group = group; + this.type = type; + this.value = null; + } + + public ParsedSymbol(SymbolGroup group, SymbolType type, Object value) { + this.group = group; + this.type = type; + this.value = value; + } + + @Override + public String toString() { + return group.toString() + " " + type.toString() + " " + (value != null ? value.toString() : ""); + } + + public boolean isType(Object... types) { + for (Object t : types) { + if (t instanceof SymbolGroup) { + if (group == t) { + return true; + } + } + if (t instanceof SymbolType) { + if (type == t) { + return true; + } + } + } + return false; + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java new file mode 100644 index 000000000..0bc83844c --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2014 petrik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.graph.GraphTargetItem; +import java.util.List; + +/** + * + * @author petrik + */ +public class SetterAVM2Item extends MethodAVM2Item{ + + public SetterAVM2Item(int namespaceKind, String methodName, List paramNames, List body, List subvariables) { + super(namespaceKind, methodName, paramNames, body, subvariables); + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java new file mode 100644 index 000000000..44cd27b34 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.model.LocalData; + +/** + * + * @author JPEXS + */ +public class SlotAVM2Item extends AVM2Item { + private final int nsKind; + + public int getNsKind() { + return nsKind; + } + + + public SlotAVM2Item(int nsKind,VariableAVM2Item var, GraphTargetItem value) { + super(null,NOPRECEDENCE); + this.nsKind = nsKind; + this.value = value; + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return writer; //TODO + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolGroup.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolGroup.java new file mode 100644 index 000000000..87d7674fc --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolGroup.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +/** + * + * @author JPEXS + */ +public enum SymbolGroup { + + OPERATOR, + KEYWORD, + STRING, + COMMENT, + XML, + IDENTIFIER, + INTEGER, + DOUBLE, + TYPENAME, + EOF, + //GLOBALFUNC, + GLOBALCONST +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java new file mode 100644 index 000000000..62a11177c --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +/** + * + * @author JPEXS + */ +public enum SymbolType { + //Keywords + + BREAK, + CASE, + CONTINUE, + DEFAULT, + DO, + WHILE, + ELSE, + FOR, + EACH, + IN, + IF, + RETURN, + SUPER, + SWITCH, + THROW, + TRY, + CATCH, + FINALLY, + WITH, + DYNAMIC, + INTERNAL, + OVERRIDE, + PRIVATE, + PROTECTED, + PUBLIC, + STATIC, + CLASS, + CONST, + EXTENDS, + FUNCTION, + GET, + IMPLEMENTS, + INTERFACE, + NAMESPACE, + PACKAGE, + SET, + VAR, + IMPORT, + USE, + FALSE, + NULL, + THIS, + TRUE, + //Operators + PARENT_OPEN, + PARENT_CLOSE, + CURLY_OPEN, + CURLY_CLOSE, + BRACKET_OPEN, + BRACKET_CLOSE, + SEMICOLON, + COMMA, + REST, + DOT, + ASSIGN, + GREATER_THAN, + LOWER_THAN, + NOT, + NEGATE, + TERNAR, + COLON, + EQUALS, + STRICT_EQUALS, + LOWER_EQUAL, + GREATER_EQUAL, + NOT_EQUAL, + STRICT_NOT_EQUAL, + AND, + OR, + INCREMENT, + DECREMENT, + PLUS, + MINUS, + MULTIPLY, + DIVIDE, + BITAND, + BITOR, + XOR, + MODULO, + SHIFT_LEFT, + SHIFT_RIGHT, + USHIFT_RIGHT, + ASSIGN_PLUS, + ASSIGN_MINUS, + ASSIGN_MULTIPLY, + ASSIGN_DIVIDE, + ASSIGN_BITAND, + ASSIGN_BITOR, + ASSIGN_XOR, + ASSIGN_MODULO, + ASSIGN_SHIFT_LEFT, + ASSIGN_SHIFT_RIGHT, + ASSIGN_USHIFT_RIGHT, + AS, + DELETE, + INSTANCEOF, + IS, + NAMESPACE_OP, + NEW, + TYPEOF, + VOID, + ATTRIBUTE, + //Other + STRING, + COMMENT, + XML, + IDENTIFIER, + INTEGER, + DOUBLE, + TYPENAME, + EOF, + //TRACE, + //GETURL, + //GOTOANDSTOP, + //NEXTFRAME, + //PLAY, + //PREVFRAME, + //TELLTARGET, + //STOP, + //STOPALLSOUNDS, + //TOGGLEHIGHQUALITY, + //ORD, + //CHR, + //DUPLICATEMOVIECLIP, + //STOPDRAG, + //GETTIMER, + //LOADVARIABLES, + //LOADMOVIE, + //GOTOANDPLAY, + //MBORD, + //MBCHR, + //MBLENGTH, + //MBSUBSTRING, + //RANDOM, + //REMOVEMOVIECLIP, + //STARTDRAG, + //SUBSTR, + //LENGTH, //string.length + INT, + //TARGETPATH, + NUMBER_OP, + STRING_OP, + //IFFRAMELOADED, + INFINITY, + //EVAL, + UNDEFINED, + //NEWLINE, + NAN, + //GETVERSION, + //CALL, + //LOADMOVIENUM, + //LOADVARIABLESNUM, + //PRINT, + //PRINTNUM, + //PRINTASBITMAP, + //PRINTASBITMAPNUM, + //UNLOADMOVIE, + //UNLOADMOVIENUM +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/VariableAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/VariableAVM2Item.java new file mode 100644 index 000000000..f6d76cb92 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/VariableAVM2Item.java @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; +import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; +import com.jpexs.decompiler.graph.model.LocalData; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class VariableAVM2Item extends AVM2Item { + + private AVM2Item it; + + private final String variableName; + private GraphTargetItem storeValue; + private boolean definition; + private GraphTargetItem index; + private int nsKind=-1; + + public void setDefinition(boolean definition) { + this.definition = definition; + } + + public void setIndex(GraphTargetItem index) { + this.index = index; + } + + public GraphTargetItem getIndex() { + return index; + } + + public void setNsKind(int nsKind) { + this.nsKind = nsKind; + } + + public int getNsKind() { + return nsKind; + } + + + + + + + public void setStoreValue(GraphTargetItem storeValue) { + this.storeValue = storeValue; + } + + public String getVariableName() { + return variableName; + } + + public VariableAVM2Item(String variableName, GraphTargetItem storeValue, boolean definition) { + super(null, PRECEDENCE_PRIMARY); + this.variableName = variableName; + this.storeValue = storeValue; + this.definition = definition; + } + + public boolean isDefinition() { + return definition; + } + + public void setBoxedValue(AVM2Item it) { + this.it = it; + if (it != null) { + this.precedence = it.getPrecedence(); + } + } + + public AVM2Item getBoxedValue() { + return it; + } + + public GraphTargetItem getStoreValue() { + return storeValue; + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + if (it == null) { + return writer; + } + return it.appendTo(writer, localData); + } + + @Override + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { + if (it == null) { + return new ArrayList<>(); + } + return it.toSource(localData, generator); + } + + @Override + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { + if (it == null) { + return new ArrayList<>(); + } + return it.toSourceIgnoreReturnValue(localData, generator); + } + + @Override + public boolean hasReturnValue() { + if (definition) { + return false; + } + return true; + } + + @Override + public boolean needsSemicolon() { + if (definition) { + return true; + } + return false; + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex new file mode 100644 index 000000000..c16962c81 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex @@ -0,0 +1,374 @@ +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; +import java.util.Stack; +import java.util.List; +import java.util.ArrayList; + +%% + +%public +%class ActionScriptLexer +%final +%unicode +%char +%type ParsedSymbol +%throws ParseException + +%{ + + StringBuffer string = new StringBuffer(); + + private static String xmlTagName=""; + + public int yychar() { + return yychar; + } + + private Stack pushedBack=new Stack(); + + public int yyline() { + return yyline+1; + } + private List listeners=new ArrayList<>(); + + public void addListener(LexListener listener){ + listeners.add(listener); + } + + public void removeListener(LexListener listener){ + listeners.remove(listener); + } + + public void informListenersLex(ParsedSymbol s){ + for(LexListener l:listeners){ + l.onLex(s); + } + } + + public void informListenersPushBack(ParsedSymbol s){ + for(LexListener l:listeners){ + l.onPushBack(s); + } + } + + public void pushback(ParsedSymbol symb) { + pushedBack.push(symb); + last = null; + informListenersPushBack(symb); + } + ParsedSymbol last; + public ParsedSymbol lex() throws java.io.IOException, ParseException{ + ParsedSymbol ret=null; + if(!pushedBack.isEmpty()){ + ret = last = pushedBack.pop(); + }else{ + ret = last = yylex(); + } + informListenersLex(ret); + return ret; + } + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? + + + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +IdentifierNs = {Identifier} ":" {Identifier} + +TypeNameSpec = ".<" {Identifier} ">" + +/* XML */ +XMLIdentifier = {Identifier} | {IdentifierNs} +XMLAttribute = " "* {XMLIdentifier} " "* "=" " "* \" {InputCharacter}* \" " "* +XMLBeginOneTag = "<" {XMLIdentifier} {XMLAttribute}* ">" +XMLEndTag = "" + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctDigit = [0-7] + +/* floating point literals */ +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] + +%state STRING, CHARLITERAL, XMLSTARTTAG, XML + +%% + + { + + /* keywords */ + "break" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.BREAK,yytext()); } + "case" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CASE,yytext()); } + "continue" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONTINUE,yytext()); } + "default" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DEFAULT,yytext()); } + "do" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DO,yytext()); } + "while" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE,yytext()); } + "else" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.ELSE,yytext()); } + "for" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FOR,yytext()); } + "each" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EACH,yytext()); } + "in" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IN,yytext()); } + "if" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IF,yytext()); } + "return" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.RETURN,yytext()); } + "super" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SUPER,yytext()); } + "switch" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SWITCH,yytext()); } + "throw" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.THROW,yytext()); } + "try" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.TRY,yytext()); } + "catch" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CATCH,yytext()); } + "finally" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FINALLY,yytext()); } + "while" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE,yytext()); } + "with" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WITH,yytext()); } + "dynamic" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DYNAMIC,yytext()); } + "internal" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERNAL,yytext()); } + "override" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.OVERRIDE,yytext()); } + "private" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PRIVATE,yytext()); } + "protected" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PROTECTED,yytext()); } + "public" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PUBLIC,yytext()); } + "static" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.STATIC,yytext()); } + "class" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CLASS,yytext()); } + "const" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONST,yytext()); } + "extends" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EXTENDS,yytext()); } + "function" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FUNCTION,yytext()); } + "get" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.GET,yytext()); } + "implements" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPLEMENTS,yytext()); } + "interface" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERFACE,yytext()); } + "namespace" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.NAMESPACE,yytext()); } + "package" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PACKAGE,yytext()); } + "set" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SET,yytext()); } + "var" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.VAR,yytext()); } + "import" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPORT,yytext()); } + "use" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.USE,yytext()); } + "false" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FALSE,yytext()); } + "null" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NULL,yytext()); } + "this" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.THIS,yytext()); } + "true" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.TRUE,yytext()); } + "undefined" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.UNDEFINED,yytext()); } + "Infinity" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.INFINITY,yytext()); } + "NaN" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NAN,yytext()); } + + + /* operators */ + + "(" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.PARENT_OPEN,yytext()); } + ")" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.PARENT_CLOSE,yytext()); } + "{" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.CURLY_OPEN,yytext()); } + "}" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.CURLY_CLOSE,yytext()); } + "[" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BRACKET_OPEN,yytext()); } + "]" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BRACKET_CLOSE,yytext()); } + ";" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.SEMICOLON,yytext()); } + "," { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.COMMA,yytext()); } + "..." { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.REST,yytext()); } + "." { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DOT,yytext()); } + "=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN,yytext()); } + ">" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.GREATER_THAN,yytext()); } + "<" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.LOWER_THAN,yytext()); } + "!" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NOT,yytext()); } + "~" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NEGATE,yytext()); } + "?" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.TERNAR,yytext()); } + ":" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.COLON,yytext()); } + "===" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.STRICT_EQUALS,yytext()); } + "==" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.EQUALS,yytext()); } + "<=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.LOWER_EQUAL,yytext()); } + ">=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.GREATER_EQUAL,yytext()); } + "!==" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.STRICT_NOT_EQUAL,yytext()); } + "!=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NOT_EQUAL,yytext()); } + "&&" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.AND,yytext()); } + "||" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.OR,yytext()); } + "++" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.INCREMENT,yytext()); } + "--" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DECREMENT,yytext()); } + "+" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.PLUS,yytext()); } + "-" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.MINUS,yytext()); } + "*" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.MULTIPLY,yytext()); } + "/" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DIVIDE,yytext()); } + "&" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BITAND,yytext()); } + "|" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BITOR,yytext()); } + "^" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.XOR,yytext()); } + "%" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.MODULO,yytext()); } + "<<" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.SHIFT_LEFT,yytext()); } + ">>" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.SHIFT_RIGHT,yytext()); } + ">>>" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.USHIFT_RIGHT,yytext()); } + "+=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_PLUS,yytext()); } + "-=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_MINUS,yytext()); } + "*=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_MULTIPLY,yytext()); } + "/=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_DIVIDE,yytext()); } + "&=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_BITAND,yytext()); } + "|=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_BITOR,yytext()); } + "^=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_XOR,yytext()); } + "%=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_MODULO,yytext()); } + "<<=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_SHIFT_LEFT,yytext()); } + ">>=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_SHIFT_RIGHT,yytext()); } + ">>>=" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_USHIFT_RIGHT,yytext()); } + "as" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.AS,yytext()); } + "delete" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DELETE,yytext()); } + "instanceof" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.INSTANCEOF,yytext()); } + "is" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.IS,yytext()); } + "::" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NAMESPACE_OP,yytext()); } + "new" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NEW,yytext()); } + "typeof" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.TYPEOF,yytext()); } + "void" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.VOID,yytext()); } + "@" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ATTRIBUTE,yytext()); } + + /* string literal */ + \" { + string.setLength(0); + yybegin(STRING); + } + + /* character literal */ + \' { + string.setLength(0); + yybegin(CHARLITERAL); + } + + /* numeric literals */ + + {DecIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong((yytext())))); } + + {HexIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext().substring(2),16))); } + + {OctIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext(),8))); } + + {DoubleLiteral} { return new ParsedSymbol(SymbolGroup.DOUBLE,SymbolType.DOUBLE,new Double(Double.parseDouble((yytext())))); } + + /* comments */ + {Comment} { /*ignore*/ } + + {LineTerminator} { yyline++;} + /* whitespace */ + {WhiteSpace} { /*ignore*/ } + {TypeNameSpec} { String t=yytext(); return new ParsedSymbol(SymbolGroup.TYPENAME,SymbolType.TYPENAME,t.substring(2,t.length()-1)); } + {XMLBeginOneTag} {string.setLength(0); + yybegin(XML); + String s=yytext(); + s=s.substring(1,s.length()-1); + if(s.contains(" ")){ + s=s.substring(0,s.indexOf(" ")); + } + xmlTagName = s; + string.append(yytext()); + } + /* identifiers */ + {Identifier} { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.IDENTIFIER, yytext()); } +} + + { + {XMLAttribute} { string.append( yytext() );} + {LineTerminator} { string.append( yytext() ); yyline++;} + {WhiteSpace} { string.append( yytext() ); } + ">" { yybegin(XML); string.append( yytext() );} +} + { + {XMLBeginOneTag} { string.append( yytext() );} + {XMLEndTag} { string.append( yytext() ); + String endtagname=yytext(); + endtagname=endtagname.substring(2,endtagname.length()-1); + if(endtagname.equals(xmlTagName)){ + yybegin(YYINITIAL); + return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML, string.toString()); + } + } + {LineTerminator} { string.append( yytext() ); yyline++;} + .|\n { string.append( yytext() ); } +} + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return new ParsedSymbol(SymbolGroup.STRING,SymbolType.STRING,string.toString()); + } + + {StringCharacter}+ { string.append( yytext() ); } + + /* escape sequences */ + "\\b" { string.append( '\b' ); } + "\\t" { string.append( '\t' ); } + "\\n" { string.append( '\n' ); } + "\\f" { string.append( '\f' ); } + "\\r" { string.append( '\r' ); } + "\\\"" { string.append( '\"' ); } + "\\'" { string.append( '\'' ); } + "\\\\" { string.append( '\\' ); } + \\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8); + string.append( val ); } + + /* escape sequences */ + + \\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); } + {LineTerminator} { yybegin(YYINITIAL); yyline++;} +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return new ParsedSymbol(SymbolGroup.STRING,SymbolType.STRING,string.toString()); + } + + {SingleCharacter}+ { string.append( yytext() ); } + + /* escape sequences */ +/* escape sequences */ + "\\b" { string.append( '\b' ); } + "\\t" { string.append( '\t' ); } + "\\n" { string.append( '\n' ); } + "\\f" { string.append( '\f' ); } + "\\r" { string.append( '\r' ); } + "\\\"" { string.append( '\"' ); } + "\\'" { string.append( '\'' ); } + "\\\\" { string.append( '\\' ); } + \\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8); + string.append( val ); } + + /* escape sequences */ + + \\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); } + {LineTerminator} { yybegin(YYINITIAL); yyline++;} +} + +/* error fallback */ +.|\n { } +<> { return new ParsedSymbol(SymbolGroup.EOF,SymbolType.EOF,null); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index aef390fcc..b89ae04c4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -85,24 +85,24 @@ public class MethodBody implements Cloneable, Serializable { } public int removeTraps(ConstantPool constants, ABC abc, Trait trait, int scriptIndex, int classIndex, boolean isStatic, String path) throws InterruptedException { - return code.removeTraps(constants, trait, abc.method_info[method_info], this, abc, scriptIndex, classIndex, isStatic, path); + return code.removeTraps(constants, trait, abc.method_info.get(method_info), this, abc, scriptIndex, classIndex, isStatic, path); } public HashMap getLocalRegNames(ABC abc) { HashMap ret = new HashMap<>(); - for (int i = 1; i <= abc.method_info[this.method_info].param_types.length; i++) { + for (int i = 1; i <= abc.method_info.get(this.method_info).param_types.length; i++) { String paramName = "param" + i; - if (abc.method_info[this.method_info].flagHas_paramnames() && Configuration.paramNamesEnable.get()) { - paramName = abc.constants.getString(abc.method_info[this.method_info].paramNames[i - 1]); + if (abc.method_info.get(this.method_info).flagHas_paramnames() && Configuration.paramNamesEnable.get()) { + paramName = abc.constants.getString(abc.method_info.get(this.method_info).paramNames[i - 1]); } ret.put(i, paramName); } - int pos = abc.method_info[this.method_info].param_types.length + 1; - if (abc.method_info[this.method_info].flagNeed_arguments()) { + int pos = abc.method_info.get(this.method_info).param_types.length + 1; + if (abc.method_info.get(this.method_info).flagNeed_arguments()) { ret.put(pos, "arguments"); pos++; } - if (abc.method_info[this.method_info].flagNeed_rest()) { + if (abc.method_info.get(this.method_info).flagNeed_rest()) { ret.put(pos, "rest"); pos++; } @@ -114,12 +114,12 @@ public class MethodBody implements Cloneable, Serializable { return ret; } - public void convert(final String path, ScriptExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack scopeStack, final boolean isStaticInitializer, final GraphTextWriter writer, final List fullyQualifiedNames, final Traits initTraits, boolean firstLevel) throws InterruptedException { + public void convert(final String path, ScriptExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final List method_info, final Stack scopeStack, final boolean isStaticInitializer, final GraphTextWriter writer, final List fullyQualifiedNames, final Traits initTraits, boolean firstLevel) throws InterruptedException { if (debugMode) { System.err.println("Decompiling " + path); } if (exportMode != ScriptExportMode.AS) { - code.toASMSource(constants, trait, method_info[this.method_info], this, exportMode, writer); + code.toASMSource(constants, trait, method_info.get(this.method_info), this, exportMode, writer); } else { if (!Configuration.decompile.get()) { writer.appendNoHilight("//" + AppStrings.translate("decompilation.skipped")).newLine(); @@ -154,10 +154,10 @@ public class MethodBody implements Cloneable, Serializable { } } - public GraphTextWriter toString(final String path, ScriptExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack scopeStack, final boolean isStaticInitializer, final GraphTextWriter writer, final List fullyQualifiedNames, final Traits initTraits) throws InterruptedException { + public GraphTextWriter toString(final String path, ScriptExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final List method_info, final Stack scopeStack, final boolean isStaticInitializer, final GraphTextWriter writer, final List fullyQualifiedNames, final Traits initTraits) throws InterruptedException { if (exportMode != ScriptExportMode.AS) { writer.indent(); - code.toASMSource(constants, trait, method_info[this.method_info], this, exportMode, writer); + code.toASMSource(constants, trait, method_info.get(this.method_info), this, exportMode, writer); writer.unindent(); } else { if (!Configuration.decompile.get()) { @@ -188,13 +188,13 @@ public class MethodBody implements Cloneable, Serializable { return writer; } - public MethodBody convertMethodBody(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, Trait trait, ConstantPool constants, MethodInfo[] method_info, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) throws InterruptedException { + public MethodBody convertMethodBody(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, Trait trait, ConstantPool constants, List method_info, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) throws InterruptedException { MethodBody b = Helper.deepCopy(this); AVM2Code deobfuscated = b.code; deobfuscated.markMappedOffsets(); if (Configuration.autoDeobfuscate.get()) { try { - deobfuscated.removeTraps(constants, trait, method_info[this.method_info], b, abc, scriptIndex, classIndex, isStatic, path); + deobfuscated.removeTraps(constants, trait, method_info.get(this.method_info), b, abc, scriptIndex, classIndex, isStatic, path); } catch (StackOverflowError ex) { Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Error during remove traps in " + path, ex); } @@ -227,8 +227,8 @@ public class MethodBody implements Cloneable, Serializable { max_stack = stats.maxstack; max_scope_depth = init_scope_depth + stats.maxscope; max_regs = stats.maxlocal; - abc.method_info[method_info].setFlagSetsdxns(stats.has_set_dxns); - abc.method_info[method_info].setFlagNeed_activation(stats.has_activation); + abc.method_info.get(method_info).setFlagSetsdxns(stats.has_set_dxns); + abc.method_info.get(method_info).setFlagNeed_activation(stats.has_activation); return true; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java index 874396f7b..894e7e964 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java @@ -225,14 +225,14 @@ public class TraitClass extends Trait implements TraitWithSlot { } private void parseImportsUsagesFromMethodInfo(List abcTags, ABC abc, int method_index, List imports, List uses, String ignorePackage, List fullyQualifiedNames, List visitedMethods) { - if ((method_index < 0) || (method_index >= abc.method_info.length)) { + if ((method_index < 0) || (method_index >= abc.method_info.size())) { return; } visitedMethods.add(method_index); - if (abc.method_info[method_index].ret_type != 0) { - parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.method_info[method_index].ret_type), ignorePackage, fullyQualifiedNames); + if (abc.method_info.get(method_index).ret_type != 0) { + parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.method_info.get(method_index).ret_type), ignorePackage, fullyQualifiedNames); } - for (int t : abc.method_info[method_index].param_types) { + for (int t : abc.method_info.get(method_index).param_types) { if (t != 0) { parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(t), ignorePackage, fullyQualifiedNames); } @@ -298,34 +298,34 @@ public class TraitClass extends Trait implements TraitWithSlot { private List getImportsUsages(List abcTags, ABC abc, List imports, List uses, List fullyQualifiedNames) { //constructor - String packageName = abc.instance_info[class_info].getName(abc.constants).getNamespace(abc.constants).getName(abc.constants); + String packageName = abc.instance_info.get(class_info).getName(abc.constants).getNamespace(abc.constants).getName(abc.constants); - parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.instance_info[class_info].name_index), packageName, fullyQualifiedNames); + parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.instance_info.get(class_info).name_index), packageName, fullyQualifiedNames); - if (abc.instance_info[class_info].super_index > 0) { - parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.instance_info[class_info].super_index), packageName, fullyQualifiedNames); + if (abc.instance_info.get(class_info).super_index > 0) { + parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.instance_info.get(class_info).super_index), packageName, fullyQualifiedNames); } - for (int i : abc.instance_info[class_info].interfaces) { + for (int i : abc.instance_info.get(class_info).interfaces) { parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(i), packageName, fullyQualifiedNames); } //static - parseImportsUsagesFromTraits(abcTags, abc, abc.class_info[class_info].static_traits, imports, uses, packageName, fullyQualifiedNames); + parseImportsUsagesFromTraits(abcTags, abc, abc.class_info.get(class_info).static_traits, imports, uses, packageName, fullyQualifiedNames); //static initializer - parseImportsUsagesFromMethodInfo(abcTags, abc, abc.class_info[class_info].cinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList()); + parseImportsUsagesFromMethodInfo(abcTags, abc, abc.class_info.get(class_info).cinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList()); //instance - parseImportsUsagesFromTraits(abcTags, abc, abc.instance_info[class_info].instance_traits, imports, uses, packageName, fullyQualifiedNames); + parseImportsUsagesFromTraits(abcTags, abc, abc.instance_info.get(class_info).instance_traits, imports, uses, packageName, fullyQualifiedNames); //instance initializer - parseImportsUsagesFromMethodInfo(abcTags, abc, abc.instance_info[class_info].iinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList()); + parseImportsUsagesFromMethodInfo(abcTags, abc, abc.instance_info.get(class_info).iinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList()); return imports; } @Override public GraphTextWriter toStringHeader(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { - String classHeader = abc.instance_info[class_info].getClassHeaderStr(abc, fullyQualifiedNames); + String classHeader = abc.instance_info.get(class_info).getClassHeaderStr(abc, fullyQualifiedNames); return writer.appendNoHilight(classHeader); } @@ -337,7 +337,7 @@ public class TraitClass extends Trait implements TraitWithSlot { public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { writer.startClass(class_info); - String packageName = abc.instance_info[class_info].getName(abc.constants).getNamespace(abc.constants).getName(abc.constants); + String packageName = abc.instance_info.get(class_info).getName(abc.constants).getNamespace(abc.constants).getName(abc.constants); List namesInThisPackage = new ArrayList<>(); for (ABCContainerTag tag : abcTags) { for (ScriptInfo si : tag.getABC().script_info) { @@ -424,7 +424,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } //class header - String classHeader = abc.instance_info[class_info].getClassHeaderStr(abc, fullyQualifiedNames); + String classHeader = abc.instance_info.get(class_info).getClassHeaderStr(abc, fullyQualifiedNames); if (classHeader.startsWith("private ")) { classHeader = classHeader.substring("private ".length()); } @@ -432,13 +432,13 @@ public class TraitClass extends Trait implements TraitWithSlot { writer.appendNoHilight("{").newLine(); writer.indent(); - int bodyIndex = abc.findBodyIndex(abc.class_info[class_info].cinit_index); + int bodyIndex = abc.findBodyIndex(abc.class_info.get(class_info).cinit_index); if (bodyIndex != -1) { if (!classInitializerIsEmpty) { writer.newLine(); - writer.startTrait(abc.class_info[class_info].static_traits.traits.length + abc.instance_info[class_info].instance_traits.traits.length + 1); + writer.startTrait(abc.class_info.get(class_info).static_traits.traits.length + abc.instance_info.get(class_info).instance_traits.traits.length + 1); writer.appendNoHilight("{").newLine(); - abc.bodies[bodyIndex].toString(path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".staticinitializer", exportMode, true, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack(), true, writer, fullyQualifiedNames, abc.class_info[class_info].static_traits); + abc.bodies.get(bodyIndex).toString(path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".staticinitializer", exportMode, true, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack(), true, writer, fullyQualifiedNames, abc.class_info.get(class_info).static_traits); writer.appendNoHilight("}").newLine(); writer.endTrait(); } @@ -447,9 +447,9 @@ public class TraitClass extends Trait implements TraitWithSlot { } //constructor - if (!abc.instance_info[class_info].isInterface()) { + if (!abc.instance_info.get(class_info).isInterface()) { String modifier = ""; - Multiname m = abc.constants.getMultiname(abc.instance_info[class_info].name_index); + Multiname m = abc.constants.getMultiname(abc.instance_info.get(class_info).name_index); if (m != null) { Namespace ns = m.getNamespace(abc.constants); if (ns != null) { @@ -464,29 +464,29 @@ public class TraitClass extends Trait implements TraitWithSlot { } writer.newLine(); - writer.startTrait(abc.class_info[class_info].static_traits.traits.length + abc.instance_info[class_info].instance_traits.traits.length); + writer.startTrait(abc.class_info.get(class_info).static_traits.traits.length + abc.instance_info.get(class_info).instance_traits.traits.length); writer.appendNoHilight(modifier); writer.appendNoHilight("function "); - writer.appendNoHilight(abc.constants.getMultiname(abc.instance_info[class_info].name_index).getName(abc.constants, new ArrayList()/*do not want full names here*/)); + writer.appendNoHilight(abc.constants.getMultiname(abc.instance_info.get(class_info).name_index).getName(abc.constants, new ArrayList()/*do not want full names here*/)); writer.appendNoHilight("("); - bodyIndex = abc.findBodyIndex(abc.instance_info[class_info].iinit_index); + bodyIndex = abc.findBodyIndex(abc.instance_info.get(class_info).iinit_index); if (bodyIndex != -1) { - abc.method_info[abc.instance_info[class_info].iinit_index].getParamStr(writer, abc.constants, abc.bodies[bodyIndex], abc, fullyQualifiedNames); + abc.method_info.get(abc.instance_info.get(class_info).iinit_index).getParamStr(writer, abc.constants, abc.bodies.get(bodyIndex), abc, fullyQualifiedNames); } else { - abc.method_info[abc.instance_info[class_info].iinit_index].getParamStr(writer, abc.constants, null, abc, fullyQualifiedNames); + abc.method_info.get(abc.instance_info.get(class_info).iinit_index).getParamStr(writer, abc.constants, null, abc, fullyQualifiedNames); } writer.appendNoHilight(") {").newLine(); if (bodyIndex != -1) { - abc.bodies[bodyIndex].toString(path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".initializer", exportMode, false, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, abc.instance_info[class_info].instance_traits); + abc.bodies.get(bodyIndex).toString(path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".initializer", exportMode, false, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, abc.instance_info.get(class_info).instance_traits); } writer.appendNoHilight("}").newLine(); writer.endTrait(); } //static variables,constants & methods - abc.class_info[class_info].static_traits.toString(this, path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, true, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel); + abc.class_info.get(class_info).static_traits.toString(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, true, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel); - abc.instance_info[class_info].instance_traits.toString(this, path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, false, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel); + abc.instance_info.get(class_info).instance_traits.toString(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, false, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel); writer.unindent(); writer.appendNoHilight("}"); // class @@ -500,45 +500,45 @@ public class TraitClass extends Trait implements TraitWithSlot { fullyQualifiedNames = new ArrayList<>(); - int bodyIndex = abc.findBodyIndex(abc.class_info[class_info].cinit_index); + int bodyIndex = abc.findBodyIndex(abc.class_info.get(class_info).cinit_index); if (bodyIndex != -1) { writer.mark(); - abc.bodies[bodyIndex].convert(path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".staticinitializer", exportMode, true, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack(), true, writer, fullyQualifiedNames, abc.class_info[class_info].static_traits, true); + abc.bodies.get(bodyIndex).convert(path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".staticinitializer", exportMode, true, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack(), true, writer, fullyQualifiedNames, abc.class_info.get(class_info).static_traits, true); classInitializerIsEmpty = !writer.getMark(); } //constructor - if (!abc.instance_info[class_info].isInterface()) { - bodyIndex = abc.findBodyIndex(abc.instance_info[class_info].iinit_index); + if (!abc.instance_info.get(class_info).isInterface()) { + bodyIndex = abc.findBodyIndex(abc.instance_info.get(class_info).iinit_index); if (bodyIndex != -1) { - abc.bodies[bodyIndex].convert(path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".initializer", exportMode, false, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, abc.instance_info[class_info].instance_traits, true); + abc.bodies.get(bodyIndex).convert(path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".initializer", exportMode, false, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, abc.instance_info.get(class_info).instance_traits, true); } } //static variables,constants & methods - abc.class_info[class_info].static_traits.convert(this, path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, true, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel); + abc.class_info.get(class_info).static_traits.convert(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, true, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel); - abc.instance_info[class_info].instance_traits.convert(this, path +/*packageName +*/ "/" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, false, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel); + abc.instance_info.get(class_info).instance_traits.convert(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, false, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel); } @Override public Multiname getName(ABC abc) { - return abc.constants.getMultiname(abc.instance_info[class_info].name_index); + return abc.constants.getMultiname(abc.instance_info.get(class_info).name_index); } @Override public int removeTraps(int scriptIndex, int classIndex, boolean isStatic, ABC abc, String path) throws InterruptedException { - int iInitializer = abc.findBodyIndex(abc.instance_info[class_info].iinit_index); + int iInitializer = abc.findBodyIndex(abc.instance_info.get(class_info).iinit_index); int ret = 0; if (iInitializer != -1) { - ret += abc.bodies[iInitializer].removeTraps(abc.constants, abc, this, scriptIndex, class_info, false, path); + ret += abc.bodies.get(iInitializer).removeTraps(abc.constants, abc, this, scriptIndex, class_info, false, path); } - int sInitializer = abc.findBodyIndex(abc.class_info[class_info].cinit_index); + int sInitializer = abc.findBodyIndex(abc.class_info.get(class_info).cinit_index); if (sInitializer != -1) { - ret += abc.bodies[sInitializer].removeTraps(abc.constants, abc, this, scriptIndex, class_info, true, path); + ret += abc.bodies.get(sInitializer).removeTraps(abc.constants, abc, this, scriptIndex, class_info, true, path); } - ret += abc.instance_info[class_info].instance_traits.removeTraps(scriptIndex, class_info, false, abc, path); - ret += abc.class_info[class_info].static_traits.removeTraps(scriptIndex, class_info, true, abc, path); + ret += abc.instance_info.get(class_info).instance_traits.removeTraps(scriptIndex, class_info, false, abc, path); + ret += abc.class_info.get(class_info).static_traits.removeTraps(scriptIndex, class_info, true, abc, path); return ret; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java index 87d426dce..84640aa13 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java @@ -56,9 +56,9 @@ public class TraitFunction extends Trait implements TraitWithSlot { writer.hilightSpecial("function ", "traittype"); writer.hilightSpecial(abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), "traitname"); writer.appendNoHilight("("); - abc.method_info[method_info].getParamStr(writer, abc.constants, body, abc, fullyQualifiedNames); + abc.method_info.get(method_info).getParamStr(writer, abc.constants, body, abc, fullyQualifiedNames); writer.appendNoHilight(") : "); - abc.method_info[method_info].getReturnTypeStr(writer, abc.constants, fullyQualifiedNames); + abc.method_info.get(method_info).getReturnTypeStr(writer, abc.constants, fullyQualifiedNames); return writer; } @@ -69,13 +69,13 @@ public class TraitFunction extends Trait implements TraitWithSlot { @Override public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { toStringHeader(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); - if (abc.instance_info[classIndex].isInterface()) { + if (abc.instance_info.get(classIndex).isInterface()) { writer.appendNoHilight(";"); } else { writer.appendNoHilight(" {").newLine(); int bodyIndex = abc.findBodyIndex(method_info); if (bodyIndex != -1) { - abc.bodies[bodyIndex].toString(path + "." + abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, null); + abc.bodies.get(bodyIndex).toString(path + "." + abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, null); } writer.newLine(); writer.appendNoHilight("}"); @@ -87,10 +87,10 @@ public class TraitFunction extends Trait implements TraitWithSlot { @Override public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { convertHeader(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); - if (!abc.instance_info[classIndex].isInterface()) { + if (!abc.instance_info.get(classIndex).isInterface()) { int bodyIndex = abc.findBodyIndex(method_info); if (bodyIndex != -1) { - abc.bodies[bodyIndex].convert(path + "." + abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, null, true); + abc.bodies.get(bodyIndex).convert(path + "." + abc.constants.getMultiname(name_index).getName(abc.constants, fullyQualifiedNames), exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, null, true); } } } @@ -99,7 +99,7 @@ public class TraitFunction extends Trait implements TraitWithSlot { public int removeTraps(int scriptIndex, int classIndex, boolean isStatic, ABC abc, String path) throws InterruptedException { int bodyIndex = abc.findBodyIndex(method_info); if (bodyIndex != -1) { - return abc.bodies[bodyIndex].removeTraps(abc.constants, abc, this, scriptIndex, classIndex, isStatic, path); + return abc.bodies.get(bodyIndex).removeTraps(abc.constants, abc, this, scriptIndex, classIndex, isStatic, path); } return 0; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java index 200289549..dc925b05a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java @@ -56,7 +56,7 @@ public class TraitMethodGetterSetter extends Trait { } MethodBody body = abc.findBody(method_info); - if (((classIndex == -1) || (!abc.instance_info[classIndex].isInterface())) && (body == null)) { + if (((classIndex == -1) || (!abc.instance_info.get(classIndex).isInterface())) && (body == null)) { modifier = "native " + modifier; } @@ -64,9 +64,9 @@ public class TraitMethodGetterSetter extends Trait { writer.hilightSpecial("function " + addKind, "traittype"); writer.hilightSpecial(getName(abc).getName(abc.constants, fullyQualifiedNames), "traitname"); writer.appendNoHilight("("); - abc.method_info[method_info].getParamStr(writer, abc.constants, body, abc, fullyQualifiedNames); + abc.method_info.get(method_info).getParamStr(writer, abc.constants, body, abc, fullyQualifiedNames); writer.appendNoHilight(") : "); - abc.method_info[method_info].getReturnTypeStr(writer, abc.constants, fullyQualifiedNames); + abc.method_info.get(method_info).getReturnTypeStr(writer, abc.constants, fullyQualifiedNames); return writer; } @@ -75,9 +75,9 @@ public class TraitMethodGetterSetter extends Trait { path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames); convertHeader(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); int bodyIndex = abc.findBodyIndex(method_info); - if (!(classIndex != -1 && abc.instance_info[classIndex].isInterface() || bodyIndex == -1)) { + if (!(classIndex != -1 && abc.instance_info.get(classIndex).isInterface() || bodyIndex == -1)) { if (bodyIndex != -1) { - abc.bodies[bodyIndex].convert(path, exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, null, true); + abc.bodies.get(bodyIndex).convert(path, exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, null, true); } } } @@ -87,12 +87,12 @@ public class TraitMethodGetterSetter extends Trait { path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames); toStringHeader(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); int bodyIndex = abc.findBodyIndex(method_info); - if (classIndex != -1 && abc.instance_info[classIndex].isInterface() || bodyIndex == -1) { + if (classIndex != -1 && abc.instance_info.get(classIndex).isInterface() || bodyIndex == -1) { writer.appendNoHilight(";"); } else { writer.appendNoHilight(" {").newLine(); if (bodyIndex != -1) { - abc.bodies[bodyIndex].toString(path, exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, null); + abc.bodies.get(bodyIndex).toString(path, exportMode, isStatic, scriptIndex, classIndex, abc, this, abc.constants, abc.method_info, new Stack(), false, writer, fullyQualifiedNames, null); } writer.appendNoHilight("}"); } @@ -104,7 +104,7 @@ public class TraitMethodGetterSetter extends Trait { public int removeTraps(int scriptIndex, int classIndex, boolean isStatic, ABC abc, String path) throws InterruptedException { int bodyIndex = abc.findBodyIndex(method_info); if (bodyIndex != -1) { - return abc.bodies[bodyIndex].removeTraps(abc.constants, abc, this, scriptIndex, classIndex, isStatic, path); + return abc.bodies.get(bodyIndex).removeTraps(abc.constants, abc, this, scriptIndex, classIndex, isStatic, path); } return 0; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java index 7f4f6e05f..37cc3299d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java @@ -90,9 +90,9 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { if (assignedValue != null) { if (parent instanceof TraitClass) { TraitClass tc = (TraitClass) parent; - int traitInitId = abc.class_info[tc.class_info].static_traits.traits.length - + abc.instance_info[tc.class_info].instance_traits.traits.length + 1; - int initMethod = abc.class_info[tc.class_info].cinit_index; + int traitInitId = abc.class_info.get(tc.class_info).static_traits.traits.length + + abc.instance_info.get(tc.class_info).instance_traits.traits.length + 1; + int initMethod = abc.class_info.get(tc.class_info).cinit_index; writer.startTrait(traitInitId); writer.startMethod(initMethod); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java index d666c3bda..d19137968 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java @@ -127,7 +127,7 @@ public class Traits implements Serializable { int h = t; if (classIndex != -1) { if (!isStatic) { - h += abc.class_info[classIndex].static_traits.traits.length; + h += abc.class_info.get(classIndex).static_traits.traits.length; } } if (trait instanceof TraitClass) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ClassNameMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ClassNameMultinameUsage.java index 0aafcc5bc..e61948606 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ClassNameMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ClassNameMultinameUsage.java @@ -32,6 +32,6 @@ public class ClassNameMultinameUsage extends InsideClassMultinameUsage { @Override public String toString(List abcTags, ABC abc) { - return "class " + abc.constants.getMultiname(abc.instance_info[classIndex].name_index).getNameWithNamespace(abc.constants); + return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java index de6ec534c..8b92fb865 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java @@ -43,9 +43,9 @@ public abstract class ConstVarMultinameUsage extends TraitMultinameUsage { NulWriter nulWriter = new NulWriter(); if (parentTraitIndex > -1) { if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info[classIndex].static_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); } else { - ((TraitMethodGetterSetter) abc.instance_info[classIndex].instance_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); } } ((TraitSlotConst) traits.traits[traitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); @@ -54,9 +54,9 @@ public abstract class ConstVarMultinameUsage extends TraitMultinameUsage { writer.appendNoHilight(super.toString(abcTags, abc) + " "); if (parentTraitIndex > -1) { if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info[classIndex].static_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); } else { - ((TraitMethodGetterSetter) abc.instance_info[classIndex].instance_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); } } ((TraitSlotConst) traits.traits[traitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java index ab112b3a8..e69069b16 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java @@ -36,7 +36,7 @@ public abstract class InsideClassMultinameUsage extends MultinameUsage { @Override public String toString(List abcTags, ABC abc) throws InterruptedException { - return "class " + abc.constants.getMultiname(abc.instance_info[classIndex].name_index).getNameWithNamespace(abc.constants); + return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants); } public int getMultinameIndex() { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java index ac1f2969b..ce20464df 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java @@ -50,9 +50,9 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage { if (!isInitializer) { if (parentTraitIndex > -1) { if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info[classIndex].static_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); } else { - ((TraitMethodGetterSetter) abc.instance_info[classIndex].instance_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); } } ((TraitMethodGetterSetter) traits.traits[traitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); @@ -70,9 +70,9 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage { } else { if (parentTraitIndex > -1) { if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info[classIndex].static_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); } else { - ((TraitMethodGetterSetter) abc.instance_info[classIndex].instance_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); } writer.appendNoHilight(" "); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptParser.java b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptParser.java index f9e921f79..9216c56aa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptParser.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptParser.java @@ -1242,6 +1242,9 @@ public class ActionScriptParser { case SHIFT_RIGHT: ret = new RShiftActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; + case USHIFT_RIGHT: + ret = new URShiftActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); + break; case BITAND: ret = new BitAndActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java index e44bc83d3..090b58c8b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -2037,7 +2037,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } else { int bi = abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex(); if (bi != -1) { - abcPanel.abc.bodies[bi].restoreControlFlow(abcPanel.abc.constants, abcPanel.decompiledTextArea.getCurrentTrait(), abcPanel.abc.method_info[abcPanel.abc.bodies[bi].method_info]); + abcPanel.abc.bodies.get(bi).restoreControlFlow(abcPanel.abc.constants, abcPanel.decompiledTextArea.getCurrentTrait(), abcPanel.abc.method_info.get(abcPanel.abc.bodies.get(bi).method_info)); } abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi, abcPanel.abc, abcPanel.decompiledTextArea.getCurrentTrait()); } @@ -2131,12 +2131,12 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec Trait t = abcPanel.decompiledTextArea.getCurrentTrait(); if (bi != -1) { if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_DEAD_CODE) { - abcPanel.abc.bodies[bi].removeDeadCode(abcPanel.abc.constants, t, abcPanel.abc.method_info[abcPanel.abc.bodies[bi].method_info]); + abcPanel.abc.bodies.get(bi).removeDeadCode(abcPanel.abc.constants, t, abcPanel.abc.method_info.get(abcPanel.abc.bodies.get(bi).method_info)); } else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_TRAPS) { - abcPanel.abc.bodies[bi].removeTraps(abcPanel.abc.constants, abcPanel.abc, t, abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex, abcPanel.decompiledTextArea.getClassIndex(), abcPanel.decompiledTextArea.getIsStatic(), ""/*FIXME*/); + abcPanel.abc.bodies.get(bi).removeTraps(abcPanel.abc.constants, abcPanel.abc, t, abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex, abcPanel.decompiledTextArea.getClassIndex(), abcPanel.decompiledTextArea.getIsStatic(), ""/*FIXME*/); } else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_RESTORE_CONTROL_FLOW) { - abcPanel.abc.bodies[bi].removeTraps(abcPanel.abc.constants, abcPanel.abc, t, abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex, abcPanel.decompiledTextArea.getClassIndex(), abcPanel.decompiledTextArea.getIsStatic(), ""/*FIXME*/); - abcPanel.abc.bodies[bi].restoreControlFlow(abcPanel.abc.constants, t, abcPanel.abc.method_info[abcPanel.abc.bodies[bi].method_info]); + abcPanel.abc.bodies.get(bi).removeTraps(abcPanel.abc.constants, abcPanel.abc, t, abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex, abcPanel.decompiledTextArea.getClassIndex(), abcPanel.decompiledTextArea.getIsStatic(), ""/*FIXME*/); + abcPanel.abc.bodies.get(bi).restoreControlFlow(abcPanel.abc.constants, t, abcPanel.abc.method_info.get(abcPanel.abc.bodies.get(bi).method_info)); } } abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi, abcPanel.abc, t); @@ -2585,7 +2585,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec @Override protected Void doInBackground() throws Exception { int classIndex = -1; - for (Trait t : scriptLeaf.abc.script_info[scriptLeaf.scriptIndex].traits.traits) { + for (Trait t : scriptLeaf.abc.script_info.get(scriptLeaf.scriptIndex).traits.traits) { if (t instanceof TraitClass) { classIndex = ((TraitClass) t).class_info; break; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 492b46630..5dbf6c1dd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -583,14 +583,14 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se if (mid == 0) { break; } - for (Trait tr : abc.class_info[class_index].static_traits.traits) { + for (Trait tr : abc.class_info.get(class_index).static_traits.traits) { if (tr.name_index == mid) { again = true; break; } } - for (Trait tr : abc.instance_info[class_index].instance_traits.traits) { + for (Trait tr : abc.instance_info.get(class_index).instance_traits.traits) { if (tr.name_index == mid) { again = true; break; @@ -638,9 +638,9 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se t.name_index = abc.constants.getMultinameId(m, true); int traitId; if (isStatic) { - traitId = abc.class_info[class_index].static_traits.addTrait(t); + traitId = abc.class_info.get(class_index).static_traits.addTrait(t); } else { - traitId = abc.class_info[class_index].static_traits.traits.length + abc.instance_info[class_index].instance_traits.addTrait(t); + traitId = abc.class_info.get(class_index).static_traits.traits.length + abc.instance_info.get(class_index).instance_traits.addTrait(t); } reload(); decompiledTextArea.gotoTrait(traitId); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java index 4695374df..d1557909e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java @@ -21,8 +21,8 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.UnknownInstructionCode; import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2Graph; -import com.jpexs.decompiler.flash.abc.avm2.parser.ASM3Parser; -import com.jpexs.decompiler.flash.abc.avm2.parser.MissingSymbolHandler; +import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser; +import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.MissingSymbolHandler; import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.traits.Trait; @@ -69,7 +69,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi private HilightedText getHilightedText(ScriptExportMode exportMode) { HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), true); - abc.bodies[bodyIndex].code.toASMSource(abc.constants, trait, abc.method_info[abc.bodies[bodyIndex].method_info], abc.bodies[bodyIndex], exportMode, writer); + abc.bodies.get(bodyIndex).code.toASMSource(abc.constants, trait, abc.method_info.get(abc.bodies.get(bodyIndex).method_info), abc.bodies.get(bodyIndex), exportMode, writer); return new HilightedText(writer); } @@ -95,7 +95,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi setContentType("text/plain"); if (textHexOnly == null) { HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), true); - Helper.byteArrayToHexWithHeader(writer, abc.bodies[bodyIndex].code.getBytes()); + Helper.byteArrayToHexWithHeader(writer, abc.bodies.get(bodyIndex).code.getBytes()); textHexOnly = new HilightedText(writer); } setText(textHexOnly); @@ -167,7 +167,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi public void graph() { try { - AVM2Graph gr = new AVM2Graph(abc.bodies[bodyIndex].code, abc, abc.bodies[bodyIndex], false, -1, -1, new HashMap(), new Stack(), new HashMap(), new ArrayList(), new HashMap(), abc.bodies[bodyIndex].code.visitCode(abc.bodies[bodyIndex])); + AVM2Graph gr = new AVM2Graph(abc.bodies.get(bodyIndex).code, abc, abc.bodies.get(bodyIndex), false, -1, -1, new HashMap(), new Stack(), new HashMap(), new ArrayList(), new HashMap(), abc.bodies.get(bodyIndex).code.visitCode(abc.bodies.get(bodyIndex))); (new GraphFrame(gr, name)).setVisible(true); } catch (InterruptedException ex) { Logger.getLogger(ASMSourceEditorPane.class.getName()).log(Level.SEVERE, null, ex); @@ -178,7 +178,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi HashMap args = new HashMap<>(); args.put(0, new Object()); //object "this" args.put(1, new Long(466561)); //param1 - Object o = abc.bodies[bodyIndex].code.execute(args, abc.constants); + Object o = abc.bodies.get(bodyIndex).code.execute(args, abc.constants); View.showMessageDialog(this, "Returned object:" + o.toString()); } @@ -187,7 +187,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi String text = getText(); if (text.trim().startsWith("#hexdata")) { byte[] data = Helper.getBytesFromHexaText(text); - MethodBody mb = abc.bodies[bodyIndex]; + MethodBody mb = abc.bodies.get(bodyIndex); mb.codeBytes = data; try { mb.code = new AVM2Code(new ByteArrayInputStream(mb.codeBytes)); @@ -218,9 +218,9 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi public boolean missingDouble(double value) { return true; } - }, abc.bodies[bodyIndex], abc.method_info[abc.bodies[bodyIndex].method_info]); - acode.getBytes(abc.bodies[bodyIndex].codeBytes); - abc.bodies[bodyIndex].code = acode; + }, abc.bodies.get(bodyIndex), abc.method_info.get(abc.bodies.get(bodyIndex).method_info)); + acode.getBytes(abc.bodies.get(bodyIndex).codeBytes); + abc.bodies.get(bodyIndex).code = acode; } ((Tag) abc.parentTag).setModified(true); } catch (IOException ex) { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java index 228098a27..c48d44f9a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java @@ -49,7 +49,7 @@ class ClassIndexVisitor implements TreeVisitor { return; } ScriptPack sc = (ScriptPack) o; - for (Trait t : sc.abc.script_info[sc.scriptIndex].traits.traits) { + for (Trait t : sc.abc.script_info.get(sc.scriptIndex).traits.traits) { if (t instanceof TraitClass) { if (((TraitClass) t).class_info == classIndex) { found = branch; @@ -66,7 +66,7 @@ class ClassIndexVisitor implements TreeVisitor { return; } ScriptPack sc = (ScriptPack) o; - for (Trait t : sc.abc.script_info[sc.scriptIndex].traits.traits) { + for (Trait t : sc.abc.script_info.get(sc.scriptIndex).traits.traits) { if (t instanceof TraitClass) { if (((TraitClass) t).class_info == classIndex) { found = leaf; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index e9bdb8c71..12ccf64bd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -209,7 +209,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL int pos = getCaretPosition(); Highlighting h = Highlighting.search(highlights, pos); if (h != null) { - List list = abc.bodies[abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex()].code.code; + List list = abc.bodies.get(abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex()).code.code; AVM2Instruction lastIns = null; long inspos = 0; AVM2Instruction selIns = null; @@ -256,12 +256,12 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL break; case "returns": if (currentMethod > -1) { - return abc.method_info[currentMethod].ret_type; + return abc.method_info.get(currentMethod).ret_type; } break; case "param": if (currentMethod > -1) { - return abc.method_info[currentMethod].param_types[(int) (long) sh.getPropertyLong("index")]; + return abc.method_info.get(currentMethod).param_types[(int) (long) sh.getPropertyLong("index")]; } break; } @@ -302,7 +302,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL String name = ""; if (abc != null) { if (classIndex > -1) { - name = abc.instance_info[classIndex].getName(abc.constants).getNameWithNamespace(abc.constants); + name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants); } } currentTrait = null; @@ -351,7 +351,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL String name = ""; currentTrait = null; if (abc != null) { - name = abc.instance_info[classIndex].getName(abc.constants).getNameWithNamespace(abc.constants); + name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants); currentTrait = abc.findTraitByTraitId(classIndex, lastTraitIndex); isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex); if (currentTrait != null) { @@ -442,7 +442,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL ScriptInfo script = null; ABC abc = scriptLeaf.abc; if (scriptIndex > -1) { - script = abc.script_info[scriptIndex]; + script = abc.script_info.get(scriptIndex); } if (!cache.contains(scriptLeaf)) { boolean parallel = Configuration.parallelSpeedUp.get(); @@ -459,7 +459,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL ScriptInfo script = null; ABC abc = scriptLeaf.abc; if (scriptIndex > -1) { - script = abc.script_info[scriptIndex]; + script = abc.script_info.get(scriptIndex); } if (script == null) { highlights = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/DialogMissingSymbolHandler.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/DialogMissingSymbolHandler.java index 847048072..8aa8193c4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/DialogMissingSymbolHandler.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/DialogMissingSymbolHandler.java @@ -17,7 +17,7 @@ package com.jpexs.decompiler.flash.gui.abc; import com.jpexs.decompiler.flash.AppStrings; -import com.jpexs.decompiler.flash.abc.avm2.parser.MissingSymbolHandler; +import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.MissingSymbolHandler; import com.jpexs.decompiler.flash.gui.View; import javax.swing.JOptionPane; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java index a5bdbaf0c..db4600b4b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java @@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.gui.abc; import com.jpexs.decompiler.flash.AppStrings; import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.avm2.parser.ASM3Parser; +import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser; import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import com.jpexs.decompiler.flash.abc.types.ValueKind; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsList.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsList.java index ea2492a1d..521a0c738 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsList.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsList.java @@ -69,7 +69,7 @@ public class TraitsList extends JList implements ListSelectionListener { } public void setClassIndex(int classIndex, int scriptIndex) { - if (classIndex >= abc.instance_info.length) { + if (classIndex >= abc.instance_info.size()) { return; } this.classIndex = classIndex; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java index b0e7fb183..cc787ea30 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java @@ -60,23 +60,23 @@ public class TraitsListItem { public int getGlobalTraitId() { if (type == Type.INITIALIZER) { if (!isStatic) { - return abc.class_info[classIndex].static_traits.traits.length + abc.instance_info[classIndex].instance_traits.traits.length; + return abc.class_info.get(classIndex).static_traits.traits.length + abc.instance_info.get(classIndex).instance_traits.traits.length; } else { - return abc.class_info[classIndex].static_traits.traits.length + abc.instance_info[classIndex].instance_traits.traits.length + 1; + return abc.class_info.get(classIndex).static_traits.traits.length + abc.instance_info.get(classIndex).instance_traits.traits.length + 1; } } if (isStatic) { return index; } else { - return abc.class_info[classIndex].static_traits.traits.length + index; + return abc.class_info.get(classIndex).static_traits.traits.length + index; } } public String toStringName() { if ((type != Type.INITIALIZER) && isStatic) { - return abc.class_info[classIndex].static_traits.traits[index].getName(abc).getName(abc.constants, new ArrayList()); + return abc.class_info.get(classIndex).static_traits.traits[index].getName(abc).getName(abc.constants, new ArrayList()); } else if ((type != Type.INITIALIZER) && (!isStatic)) { - return abc.instance_info[classIndex].instance_traits.traits[index].getName(abc).getName(abc.constants, new ArrayList()); + return abc.instance_info.get(classIndex).instance_traits.traits[index].getName(abc).getName(abc.constants, new ArrayList()); } else if (!isStatic) { return "__" + STR_INSTANCE_INITIALIZER; } else { @@ -89,14 +89,14 @@ public class TraitsListItem { String s = ""; try { if ((type != Type.INITIALIZER) && isStatic) { - abc.class_info[classIndex].static_traits.traits[index].convertHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); + abc.class_info.get(classIndex).static_traits.traits[index].convertHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false); - abc.class_info[classIndex].static_traits.traits[index].toStringHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); + abc.class_info.get(classIndex).static_traits.traits[index].toStringHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); s = writer.toString(); } else if ((type != Type.INITIALIZER) && (!isStatic)) { - abc.instance_info[classIndex].instance_traits.traits[index].convertHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); + abc.instance_info.get(classIndex).instance_traits.traits[index].convertHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false); - abc.instance_info[classIndex].instance_traits.traits[index].toStringHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); + abc.instance_info.get(classIndex).instance_traits.traits[index].toStringHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); s = writer.toString(); } else if (!isStatic) { s = STR_INSTANCE_INITIALIZER; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListModel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListModel.java index 3900cfa8f..971dfa424 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListModel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListModel.java @@ -48,11 +48,11 @@ public final class TraitsListModel implements ListModel { private void reset() { items = new ArrayList<>(); - for (int t = 0; t < abc.class_info[classIndex].static_traits.traits.length; t++) { - items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.class_info[classIndex].static_traits.traits[t]), t, true, abcTags, abc, classIndex, scriptIndex)); + for (int t = 0; t < abc.class_info.get(classIndex).static_traits.traits.length; t++) { + items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.class_info.get(classIndex).static_traits.traits[t]), t, true, abcTags, abc, classIndex, scriptIndex)); } - for (int t = 0; t < abc.instance_info[classIndex].instance_traits.traits.length; t++) { - items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.instance_info[classIndex].instance_traits.traits[t]), t, false, abcTags, abc, classIndex, scriptIndex)); + for (int t = 0; t < abc.instance_info.get(classIndex).instance_traits.traits.length; t++) { + items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.instance_info.get(classIndex).instance_traits.traits[t]), t, false, abcTags, abc, classIndex, scriptIndex)); } items.add(new TraitsListItem(TraitsListItem.Type.INITIALIZER, 0, false, abcTags, abc, classIndex, scriptIndex)); items.add(new TraitsListItem(TraitsListItem.Type.INITIALIZER, 0, true, abcTags, abc, classIndex, scriptIndex)); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java index 3d7c2b87f..ab30ec76e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java @@ -102,12 +102,12 @@ public class UsageFrame extends AppFrame implements ActionListener, MouseListene traitIndex = tmu.traitIndex; } if (!tmu.isStatic) { - traitIndex += abc.class_info[tmu.classIndex].static_traits.traits.length; + traitIndex += abc.class_info.get(tmu.classIndex).static_traits.traits.length; } if (tmu instanceof MethodMultinameUsage) { MethodMultinameUsage mmu = (MethodMultinameUsage) usage; if (mmu.isInitializer == true) { - traitIndex = abc.class_info[mmu.classIndex].static_traits.traits.length + abc.instance_info[mmu.classIndex].instance_traits.traits.length + (mmu.isStatic ? 1 : 0); + traitIndex = abc.class_info.get(mmu.classIndex).static_traits.traits.length + abc.instance_info.get(mmu.classIndex).instance_traits.traits.length + (mmu.isStatic ? 1 : 0); } } abcPanel.decompiledTextArea.gotoTrait(traitIndex);