diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index 4da22b05b..014e09fec 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -2316,6 +2316,7 @@ public final class SWF implements TreeItem { Matrix mat = new Matrix(layer.matrix); mat = mat.preConcatenate(transformation); + boolean showPlaceholder = false; if (character instanceof DrawableTag) { DrawableTag drawable = (DrawableTag) character; SerializableImage img; @@ -2332,12 +2333,9 @@ public final class SWF implements TreeItem { drawMatrix.translate(rect.xMin, rect.yMin); drawable.toImage(layer.ratio < 0 ? 0 : layer.ratio/*layer.duration*/, allTags, characters, visited, img, m); } else { + // only DefineFont tags img = drawable.toImage(layer.ratio < 0 ? 0 : layer.ratio/*layer.duration*/, allTags, characters, visited, transformation); } - /*if (character instanceof BoundedTag) { - BoundedTag bounded = (BoundedTag) character; - RECT rect = bounded.getRect(characters, visited); - }*/ if (layer.filters != null) { for (FILTER filter : layer.filters) { img = filter.apply(img); @@ -2404,6 +2402,10 @@ public final class SWF implements TreeItem { g.setTransform(drawMatrix.toTransform()); g.drawImage(img.getBufferedImage(), 0, 0, null); } else if (character instanceof BoundedTag) { + showPlaceholder = true; + } + + if (showPlaceholder) { mat.translateX /= unzoom; mat.translateY /= unzoom; AffineTransform trans = mat.toTransform(); @@ -2418,17 +2420,9 @@ public final class SWF implements TreeItem { g.drawLine(r.Xmin / div, r.Ymin / div, r.Xmax / div, r.Ymax / div); g.drawLine(r.Xmax / div, r.Ymin / div, r.Xmin / div, r.Ymax / div); g.setComposite(AlphaComposite.Dst); - } + } } g.setTransform(AffineTransform.getScaleInstance(1, 1)); - /*g.setPaint(Color.yellow); - g.draw(new ExportRectangle(ret.getWidth()-1,ret.getHeight()-1));*/ - - /*try { - ImageIO.write(ret, "png", new File("tst_id_" + containerId + "_time_" + System.currentTimeMillis() + ".png")); - } catch (IOException ex) { - Logger.getLogger(SWF.class.getName()).log(Level.SEVERE, null, ex); - }*/ } public static void frameToImage(int containerId, int frame, List allTags, List controlTags, RECT displayRect, int totalFrameCount, Stack visited, SerializableImage image, Matrix transformation) { diff --git a/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java b/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java index 1a6b86cb7..3da98930f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java +++ b/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java @@ -26,11 +26,12 @@ import java.util.HashMap; public class SourceGeneratorLocalData implements Serializable { public HashMap registerVars; - public Boolean inFunction; + public Integer inFunction; public Boolean inMethod; public Integer forInLevel; + - public SourceGeneratorLocalData(HashMap registerVars, Boolean inFunction, Boolean inMethod, Integer forInLevel) { + public SourceGeneratorLocalData(HashMap registerVars, Integer inFunction, Boolean inMethod, Integer forInLevel) { this.registerVars = registerVars; this.inFunction = inFunction; this.inMethod = inMethod; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java index 2fb60e719..6cdfc8841 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java @@ -37,7 +37,7 @@ public class AlchemyLoadAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("op_" + name + "("); ofs.toString(writer, localData); return writer.append(") /*Alchemy*/"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java index a9772d9b4..d9eb8df32 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java @@ -36,7 +36,7 @@ public class AlchemySignExtendAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("op_" + name + "("); value.toString(writer, localData); return writer.append(") /*Alchemy*/"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java index 361ec9b01..a57d960d4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java @@ -38,7 +38,7 @@ public class AlchemyStoreAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("op_" + name + "("); ofs.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java index 8f9c9a1f6..06d4d8fb8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java @@ -34,7 +34,7 @@ public class ApplyTypeAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); if (!params.isEmpty()) { writer.append(".<"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/BooleanAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/BooleanAVM2Item.java index f9d5a469b..b3663f81f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/BooleanAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/BooleanAVM2Item.java @@ -32,7 +32,7 @@ public class BooleanAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append(value ? "true" : "false"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java index 05a2c7626..f38fb95f1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java @@ -36,7 +36,7 @@ public class CallAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { /*String recPart = ""; receiver.toString(constants, localRegNames) + writer.append("."); if (receiver instanceof NewActivationAVM2Item) { recPart = ""; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java index 4c7724e45..d945633ca 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java @@ -36,7 +36,7 @@ public class CallMethodAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { receiver.toString(writer, localData); writer.append("."); writer.append(methodName); 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 b6c731428..0bad8583d 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 @@ -38,7 +38,7 @@ public class CallPropertyAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { formatProperty(writer, receiver, propertyName, localData); writer.append("("); for (int a = 0; a < arguments.size(); a++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java index d9076d363..0543209ad 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java @@ -36,7 +36,7 @@ public class CallStaticAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { receiver.toString(writer, localData); writer.append("."); writer.append(methodName); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java index f33074f96..0bbe38a86 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java @@ -38,7 +38,7 @@ public class CallSuperAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!receiver.toString().equals("this")) { receiver.toString(writer, localData); writer.append("."); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ClassAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ClassAVM2Item.java index d47b6638d..b25ddf9eb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ClassAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ClassAVM2Item.java @@ -30,7 +30,7 @@ public class ClassAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append(className.getName(localData.constantsAvm2, localData.fullyQualifiedNames)); } } 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 b55f253e1..c5953a71f 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 @@ -36,7 +36,7 @@ public class CoerceAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { //return hilight("("+type+")", highlight)+ return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java index 55b490e4e..6d0ab52eb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java @@ -34,7 +34,7 @@ public class ConstructAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (object instanceof NewFunctionAVM2Item) { writer.append("new "); return object.toString(writer, localData); 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 0d716d423..01108c4e8 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 @@ -36,7 +36,7 @@ public class ConstructPropAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("new "); int idx = writer.getLength(); object.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java index aa954a272..eee91f616 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java @@ -34,7 +34,7 @@ public class ConstructSuperAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!object.toString().equals("this")) { object.toString(writer, localData); writer.append("."); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java index d2d77ab59..07e319265 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java @@ -35,7 +35,7 @@ public class ConvertAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecLocalAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecLocalAVM2Item.java index 794c4fa7a..1b5ba25ea 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecLocalAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecLocalAVM2Item.java @@ -30,7 +30,7 @@ public class DecLocalAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append(localRegName(localData.localRegNames, regIndex)); return writer.append("--"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java index d1367afbb..bd3b9de32 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java @@ -31,7 +31,7 @@ public class DecrementAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { value.toString(writer, localData); return writer.append("-1"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java index 56ad2a0d3..90b2686af 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java @@ -35,7 +35,7 @@ public class DefaultXMLNamespace extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("default xml namespace = "); return ns.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java index 0026fa7e9..58d78e58b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java @@ -33,7 +33,7 @@ public class EscapeXAttrAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("{"); value.toString(writer, localData); return writer.append("}"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java index 580ffcfab..0995ff555 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java @@ -35,7 +35,7 @@ public class EscapeXElemAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("{"); expression.toString(writer, localData); return writer.append("}"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java index 300874f72..714cc2262 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java @@ -35,7 +35,7 @@ public class FilteredCheckAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return object.toString(writer, localData); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java index d520a509b..a66554b0c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java @@ -31,7 +31,7 @@ public class FindDefAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append(propertyName.getNamespace(localData.constantsAvm2).getName(localData.constantsAvm2)); } } 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 a6fc0817a..273ff2690 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 @@ -30,7 +30,7 @@ public class FindPropertyAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java index 5d43796fa..7c8cab3e6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java @@ -32,7 +32,7 @@ public class FloatValueAVM2Item extends NumberValueAVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("" + value); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java index e92ebf472..f03445e35 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java @@ -76,7 +76,7 @@ public class FullMultinameAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (namespace != null) { namespace.toString(writer, localData); writer.append("::"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java index 067d57925..ad1e1a760 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java @@ -33,7 +33,7 @@ public class GetDescendantsAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); writer.append(".."); return multiname.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetLexAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetLexAVM2Item.java index 3d81f1e43..21423b25d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetLexAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetLexAVM2Item.java @@ -31,7 +31,7 @@ public class GetLexAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append(propertyName.getName(localData.constantsAvm2, localData.fullyQualifiedNames)); } } 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 dc66d7c34..5b1803a7a 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 @@ -33,7 +33,7 @@ public class GetPropertyAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return formatProperty(writer, object, propertyName, localData); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSlotAVM2Item.java index 3c19e8d84..f803202d2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSlotAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSlotAVM2Item.java @@ -34,7 +34,7 @@ public class GetSlotAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { if (slotName == null) { return writer.append("/*UnknownSlot*/"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java index fce01006c..d27a6e234 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java @@ -33,7 +33,7 @@ public class GetSuperAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!object.toString().equals("this")) { object.toString(writer, localData); writer.append("."); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java index d3a9f0c38..cad30c678 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java @@ -37,7 +37,7 @@ public class HasNextAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { collection.toString(writer, localData); writer.append(" hasNext "); return object.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java index 9666d8600..9d07c590d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java @@ -33,7 +33,7 @@ public class InAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); writer.append(" in "); return collection.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncLocalAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncLocalAVM2Item.java index f8a52dc90..ac106b001 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncLocalAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncLocalAVM2Item.java @@ -30,7 +30,7 @@ public class IncLocalAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append(localRegName(localData.localRegNames, regIndex)); return writer.append("++"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java index bacd19912..3740db10c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java @@ -31,7 +31,7 @@ public class IncrementAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { value.toString(writer, localData); return writer.append("+1"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java index 837b6f015..8eb876413 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java @@ -36,7 +36,7 @@ public class InitPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, A } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { formatProperty(writer, object, propertyName, localData); writer.append(" = "); return value.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java index 2de4b1c88..e61bf92a3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java @@ -32,7 +32,7 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("" + value); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java index 8543abc18..8db2a056d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java @@ -48,7 +48,7 @@ public class LocalRegAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (computedValue instanceof FilterAVM2Item) { return computedValue.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameSpaceAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameSpaceAVM2Item.java index dccd46c22..b64f75cb8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameSpaceAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameSpaceAVM2Item.java @@ -31,7 +31,7 @@ public class NameSpaceAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { if (namespaceIndex == 0) { return writer.append("*"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java index 7d2d8dc82..c414cad8e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java @@ -33,7 +33,7 @@ public class NameValuePair extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { name.toString(writer, localData); writer.append(":"); if (value instanceof TernarOpItem) { //Ternar operator contains ":" diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java index 98a7e937c..af9a4d56c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java @@ -27,7 +27,7 @@ public class NanAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("NaN"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java index 6ced2c4ad..5b2d2fa6e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java @@ -31,7 +31,7 @@ public class NewActivationAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("newactivation()"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java index ee22ead17..d6c5b7d5c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java @@ -32,7 +32,7 @@ public class NewArrayAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("["); for (int a = 0; a < values.size(); a++) { if (a > 0) { 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 718e5538a..132057498 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 @@ -57,7 +57,7 @@ public class NewFunctionAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { MethodBody body = abc.findBody(methodIndex); writer.append("function" + (!functionName.isEmpty() ? " " + functionName : "")); writer.startMethod(methodIndex); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java index e904cb472..3165818ac 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java @@ -31,7 +31,7 @@ public class NewObjectAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean singleLine = pairs.size() < 2; if (!singleLine) { writer.newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java index 0fd74d821..d6466f12f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java @@ -37,7 +37,7 @@ public class NextNameAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("nextName("); index.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java index 490932914..8a54b04d6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java @@ -37,7 +37,7 @@ public class NextValueAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("nextValue("); index.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java index 7a589ef12..b7bc2d2dc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java @@ -30,7 +30,7 @@ public class NullAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("null"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java index 0e1cb6bb2..707e54405 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java @@ -32,7 +32,7 @@ public class PostDecrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append("--"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java index 918a66ef1..7e7371eeb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java @@ -32,7 +32,7 @@ public class PostIncrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append("++"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java index 024c08978..b37ed5f65 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java @@ -31,7 +31,7 @@ public class ReturnValueAVM2Item extends AVM2Item implements ExitItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("return "); return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnVoidAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnVoidAVM2Item.java index 43f6233a0..8c22330bd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnVoidAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnVoidAVM2Item.java @@ -28,7 +28,7 @@ public class ReturnVoidAVM2Item extends AVM2Item implements ExitItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("return"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java index 8a5b1675f..508f3ceb8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java @@ -33,7 +33,7 @@ public class ScriptAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("script" + scriptIndex); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java index 4c0671e53..cebda09db 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java @@ -39,7 +39,7 @@ public class SetGlobalSlotAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("setglobalslot(" + slotId + ","); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java index c3d95cebc..e8053b1e6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java @@ -34,7 +34,7 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append(localRegName(localData.localRegNames, regIndex) + " = "); return value.toString(writer, localData); } 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 2837218b4..4d3d400e4 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 @@ -42,7 +42,7 @@ public class SetPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, As } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { formatProperty(writer, object, propertyName, localData); writer.append(" = "); return value.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java index eb87e4860..cac3e1085 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java @@ -43,7 +43,7 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { getName(writer, localData); writer.append(" = "); return value.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java index 80daf3012..af2bfbbef 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java @@ -41,7 +41,7 @@ public class SetSuperAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!object.toString().equals("this")) { object.toString(writer, localData); writer.append("."); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java index 4b771d6f4..d22cb5919 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java @@ -33,7 +33,7 @@ public class StringAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("\"" + Helper.escapeString(value) + "\""); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThisAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThisAVM2Item.java index 1b69f4e79..479bcf0ec 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThisAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThisAVM2Item.java @@ -35,7 +35,7 @@ public class ThisAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("this"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java index eb0ba066b..0b2d7e9b6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java @@ -30,7 +30,7 @@ public class ThrowAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("throw "); return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java index 54f9c52f1..eb541ec43 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java @@ -30,7 +30,7 @@ public class UndefinedAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("undefined"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UnparsedAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UnparsedAVM2Item.java index 8cae93a92..944fe827b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UnparsedAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UnparsedAVM2Item.java @@ -30,7 +30,7 @@ public class UnparsedAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append(value); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java index a52e554aa..b430bdac2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java @@ -41,7 +41,7 @@ public class WithAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("with("); scope.toString(writer, localData); writer.append(")").newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithEndAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithEndAVM2Item.java index bc5b07add..312b55be7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithEndAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithEndAVM2Item.java @@ -31,7 +31,7 @@ public class WithEndAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("}"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithObjectAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithObjectAVM2Item.java index 196296339..656e076a1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithObjectAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithObjectAVM2Item.java @@ -31,7 +31,7 @@ public class WithObjectAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java index 4306d9e30..d7ca2c21c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java @@ -36,7 +36,7 @@ public class XMLAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { for (GraphTargetItem part : parts) { if (part instanceof StringAVM2Item) { writer.append(((StringAVM2Item) part).value); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java index 6f4386dec..04e42c8a1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java @@ -45,7 +45,7 @@ public class DeclarationAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (assignment instanceof SetLocalAVM2Item) { SetLocalAVM2Item lti = (SetLocalAVM2Item) assignment; String type = "*"; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ExceptionAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ExceptionAVM2Item.java index ef6967c9e..f71ce1adb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ExceptionAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ExceptionAVM2Item.java @@ -31,7 +31,7 @@ public class ExceptionAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append(exception.getVarName(localData.constantsAvm2, localData.fullyQualifiedNames)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java index 6584ccc66..185f73734 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java @@ -38,7 +38,7 @@ public class FilterAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { collection.toString(writer, localData); writer.append(".("); expression.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java index 6af14388e..400144aa4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java @@ -72,7 +72,7 @@ public class ForEachInAVM2Item extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java index 13db1d287..440d6557a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java @@ -72,7 +72,7 @@ public class ForInAVM2Item extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java index d76459aca..dca7c2a38 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java @@ -51,7 +51,7 @@ public class TryAVM2Item extends AVM2Item implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("try").newLine(); writer.append("{").newLine(); writer.indent(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java index 4c3d33288..10d2a9b8f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java @@ -31,7 +31,7 @@ public class AddAVM2Item extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.getPrecedence() >= precedence) { //string + vs number + if (leftSide.getPrecedence() > precedence) { writer.append("("); 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 5a0f897f9..8b8683d2e 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 @@ -35,7 +35,7 @@ public class DeletePropertyAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("delete "); object.toString(writer, localData); writer.append("["); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DivideAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DivideAVM2Item.java index 75c47e7a9..6f6b4aa7b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DivideAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DivideAVM2Item.java @@ -38,7 +38,7 @@ public class DivideAVM2Item extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.getPrecedence() >= precedence) { // >= add or subtract too if (leftSide.getPrecedence() > precedence) { writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/ModuloAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/ModuloAVM2Item.java index 44cb76311..6377b7454 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/ModuloAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/ModuloAVM2Item.java @@ -38,7 +38,7 @@ public class ModuloAVM2Item extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.getPrecedence() >= precedence) { // >= add or subtract too if (leftSide.getPrecedence() > precedence) { writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/MultiplyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/MultiplyAVM2Item.java index 76c4b5372..c6420af26 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/MultiplyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/MultiplyAVM2Item.java @@ -35,7 +35,7 @@ public class MultiplyAVM2Item extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide instanceof ModuloAVM2Item) { if (leftSide.getPrecedence() > precedence) { writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/SubtractAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/SubtractAVM2Item.java index 2735dc394..749d35be7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/SubtractAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/SubtractAVM2Item.java @@ -35,7 +35,7 @@ public class SubtractAVM2Item extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.getPrecedence() >= precedence) { // >= add or subtract too if (leftSide.getPrecedence() > precedence) { writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index c84a7af2a..495738b2b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.action.model.ActionItem; import com.jpexs.decompiler.flash.action.model.ConstantPool; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.model.ExtendsActionItem; @@ -43,6 +44,7 @@ import com.jpexs.decompiler.flash.action.parser.ParseException; import com.jpexs.decompiler.flash.action.parser.pcode.ASMParsedSymbol; import com.jpexs.decompiler.flash.action.parser.pcode.ASMParser; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; +import com.jpexs.decompiler.flash.action.parser.script.VariableActionItem; import com.jpexs.decompiler.flash.action.special.ActionEnd; import com.jpexs.decompiler.flash.action.swf4.ActionEquals; import com.jpexs.decompiler.flash.action.swf4.ActionIf; @@ -1266,8 +1268,13 @@ public class Action implements GraphSourceItem { return 0; } - public static GraphTargetItem gettoset(GraphTargetItem get, GraphTargetItem value) { + public static GraphTargetItem gettoset(GraphTargetItem get, GraphTargetItem value,List variables) { GraphTargetItem ret = get; + boolean boxed = false; + if(get instanceof VariableActionItem){ + boxed = true; + ret = ((VariableActionItem)ret).getBoxedValue(); + } if (ret instanceof GetVariableActionItem) { GetVariableActionItem gv = (GetVariableActionItem) ret; ret = new SetVariableActionItem(null, gv.name, value); @@ -1280,6 +1287,13 @@ public class Action implements GraphSourceItem { GetPropertyActionItem gp = (GetPropertyActionItem) ret; ret = new SetPropertyActionItem(null, gp.target, gp.propertyIndex, value); } + if(boxed){ + GraphTargetItem b=ret; + ret = new VariableActionItem(((VariableActionItem)get).getVariableName(), value,((VariableActionItem)get).isDefinition()); + ((VariableActionItem)ret).setBoxedValue((ActionItem)b); + variables.remove((VariableActionItem)get); + variables.add((VariableActionItem)ret); + } return ret; } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java index 429a29458..86f536d63 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java @@ -34,7 +34,7 @@ public class AsciiToCharActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("chr("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java index 8787c5066..bdd938341 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java @@ -34,7 +34,7 @@ public class CallActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("call("); stripQuotes(value, localData, writer); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java index 29500946e..4dcf235ae 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java @@ -45,7 +45,7 @@ public class CallFunctionActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String paramStr = ""; stripQuotes(functionName, localData, writer); writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java index fab686cb5..07d19c5d0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java @@ -50,7 +50,7 @@ public class CallMethodActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean blankMethod = false; if (methodName instanceof DirectValueActionItem) { if (((DirectValueActionItem) methodName).value instanceof Undefined) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java index c59acdf17..f2708268d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java @@ -47,7 +47,7 @@ public class CastOpActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("("); stripQuotes(constructor, localData, writer); writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java index 13c1b36bf..d074574c2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java @@ -35,7 +35,7 @@ public class CharToAsciiActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("ord("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java index 4cbf0e029..449c8de2d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java @@ -50,7 +50,7 @@ public class CloneSpriteActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("duplicateMovieClip("); target.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java index 33d895bc2..97a471d7e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java @@ -46,7 +46,7 @@ public class DecrementActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append(" - 1"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java index e8b7d2072..acd7c7a55 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java @@ -71,7 +71,7 @@ public class DefineLocalActionItem extends ActionItem implements SetTypeActionIt } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("var "); stripQuotes(name, localData, writer); if (value == null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java index 7756c0d60..2e644ee5e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java @@ -35,7 +35,7 @@ public class DefineRegisterActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("var " + identifier); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java index 5e602f511..21a3f5701 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java @@ -47,7 +47,7 @@ public class DeleteActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("delete "); if (object == null) { return propertyName.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java index 8a0edbdd4..6211aff81 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java @@ -110,7 +110,7 @@ public class DirectValueActionItem extends ActionItem { } @Override - protected GraphTextWriter appendToNoQuotes(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendToNoQuotes(GraphTextWriter writer, LocalData localData) { if (value instanceof Double) { if (Double.compare((double) (Double) value, 0) == 0) { return writer.append("0"); @@ -151,7 +151,7 @@ public class DirectValueActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { if (value instanceof Double) { if (Double.compare((double) (Double) value, 0) == 0) { return writer.append("0"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java index 1ce7dc6c9..8214d459e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java @@ -41,7 +41,7 @@ public class EnumerateActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("enumerate "); return object.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java index f1e1e4236..f8ab744eb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java @@ -37,7 +37,7 @@ public class EvalActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("eval("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java index d5a59558e..352a3f8e5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java @@ -35,7 +35,7 @@ public class ExtendsActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { subclass.toString(writer, localData); writer.append(" extends "); return stripQuotes(superclass, localData, writer); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java index f4cca46cc..affb99f2c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java @@ -49,7 +49,7 @@ public class FSCommand2ActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("FSCommand2("); command.toString(writer, localData); for (int t = 0; t < arguments.size(); t++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java index 9a8714786..5804a6d1c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java @@ -39,7 +39,7 @@ public class FSCommandActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("fscommand(\""); writer.append(Helper.escapeString(command)); return writer.append("\")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java index 0c8fea85a..f8721abcf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java @@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; +import com.jpexs.decompiler.flash.action.parser.script.VariableActionItem; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction; @@ -35,6 +36,7 @@ import com.jpexs.decompiler.graph.model.LocalData; import com.jpexs.helpers.Helper; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.TreeSet; @@ -47,6 +49,8 @@ public class FunctionActionItem extends ActionItem { public List paramNames; public GraphTargetItem calculatedFunctionName; private int regStart; + private List variables; + public static final int REGISTER_THIS = 1; public static final int REGISTER_ARGUMENTS = 2; public static final int REGISTER_SUPER = 3; @@ -65,20 +69,18 @@ public class FunctionActionItem extends ActionItem { super(null, PRECEDENCE_PRIMARY); } - public FunctionActionItem(GraphSourceItem instruction, String functionName, List paramNames, List actions, List constants, int regStart) { + public FunctionActionItem(GraphSourceItem instruction, String functionName, List paramNames, List actions, List constants, int regStart, List variables) { super(instruction, PRECEDENCE_PRIMARY); this.actions = actions; this.constants = constants; this.functionName = functionName; this.paramNames = paramNames; this.regStart = regStart; + this.variables = variables; } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - if (true) { - //return writer.appendNoHilight("") - } + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("function"); if (calculatedFunctionName != null) { writer.append(" "); @@ -88,6 +90,7 @@ public class FunctionActionItem extends ActionItem { writer.append(functionName); } writer.append("("); + for (int p = 0; p < paramNames.size(); p++) { if (p > 0) { writer.append(", "); @@ -101,6 +104,7 @@ public class FunctionActionItem extends ActionItem { writer.append(")").newLine(); writer.append("{").newLine(); writer.indent(); + Graph.graphToString(actions, writer, localData); writer.unindent(); return writer.append("}"); @@ -152,21 +156,18 @@ public class FunctionActionItem extends ActionItem { @Override public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { + + Set usedNames = new HashSet<>(); + for (VariableActionItem v : variables) { + usedNames.add(v.getVariableName()); + } + List ret = new ArrayList<>(); ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; List paramRegs = new ArrayList<>(); @SuppressWarnings("unchecked") SourceGeneratorLocalData localDataCopy = (SourceGeneratorLocalData) Helper.deepCopy(localData); - HashMap registerVars = asGenerator.getRegisterVars(localDataCopy); - registerVars.put("_parent", REGISTER_PARENT); - registerVars.put("_root", REGISTER_ROOT); - registerVars.put("super", REGISTER_SUPER); - registerVars.put("arguments", REGISTER_ARGUMENTS); - registerVars.put("this", REGISTER_THIS); - registerVars.put("_global", REGISTER_GLOBAL); - for (int i = 0; i < paramNames.size(); i++) { - registerVars.put(paramNames.get(i), (7 + i)); //(paramNames.size() - i))); - } + localDataCopy.inFunction++; boolean preloadParentFlag = false; boolean preloadRootFlag = false; boolean preloadSuperFlag = false; @@ -177,135 +178,100 @@ public class FunctionActionItem extends ActionItem { boolean suppressParentFlag = false; boolean suppressArgumentsFlag = false; boolean suppressThisFlag = false; - TreeSet usedRegisters = new TreeSet<>(); - if (actions != null && !actions.isEmpty()) { - asGenerator.setInFunction(localDataCopy, true); - List body = asGenerator.toActionList(asGenerator.generate(localDataCopy, actions)); - for (Action a : body) { - if (a instanceof ActionStoreRegister) { - usedRegisters.add(((ActionStoreRegister) a).registerNumber); - } - if (a instanceof ActionPush) { - ActionPush ap = (ActionPush) a; - for (Object o : ap.values) { - if (o instanceof RegisterNumber) { - usedRegisters.add(((RegisterNumber) o).number); - } - } - } - } - if (usedRegisters.contains(REGISTER_PARENT)) { - preloadParentFlag = true; - } else { - suppressParentFlag = true; - } - if (usedRegisters.contains(REGISTER_ROOT)) { - preloadRootFlag = true; - } - if (usedRegisters.contains(REGISTER_SUPER)) { - preloadSuperFlag = true; - } - if (usedRegisters.contains(REGISTER_ARGUMENTS)) { - preloadArgumentsFlag = true; - } else { - suppressArgumentsFlag = true; - } - if (usedRegisters.contains(REGISTER_THIS)) { - preloadThisFlag = true; - } else { - suppressThisFlag = true; - } - if (usedRegisters.contains(REGISTER_GLOBAL)) { - preloadGlobalFlag = true; - } - int newpos = 1; - HashMap registerMap = new HashMap<>(); - if (preloadThisFlag) { - registerMap.put(REGISTER_THIS, newpos); - newpos++; - } - if (preloadArgumentsFlag) { - registerMap.put(REGISTER_ARGUMENTS, newpos); - newpos++; - } - if (preloadSuperFlag) { - registerMap.put(REGISTER_SUPER, newpos); - newpos++; - } - if (preloadRootFlag) { - registerMap.put(REGISTER_ROOT, newpos); - newpos++; - } - if (preloadParentFlag) { - registerMap.put(REGISTER_PARENT, newpos); - newpos++; - } - if (preloadGlobalFlag) { - registerMap.put(REGISTER_GLOBAL, newpos); - newpos++; - } - if (newpos < 1) { - newpos = 1; - } - for (int i = 0; i < 256; i++) { - if (usedRegisters.contains(7 + i)) { - registerMap.put(7 + i, newpos); - if (i < paramNames.size()) { - paramRegs.add(newpos); - } - newpos++; - } else { - if (i < paramNames.size()) { - paramRegs.add(0); - } - } - } + boolean needsFun2 = false; - TreeSet usedRegisters2 = new TreeSet<>(); - for (int i : usedRegisters) { - if (registerMap.get(i) == null) { - usedRegisters2.add(i); - } else { - usedRegisters2.add(registerMap.get(i)); - } - } - usedRegisters = usedRegisters2; - - for (Action a : body) { - if (a instanceof ActionStoreRegister) { - if (registerMap.containsKey(((ActionStoreRegister) a).registerNumber)) { - ((ActionStoreRegister) a).registerNumber = registerMap.get(((ActionStoreRegister) a).registerNumber); - } - } - if (a instanceof ActionPush) { - ActionPush ap = (ActionPush) a; - for (Object o : ap.values) { - if (o instanceof RegisterNumber) { - if (registerMap.containsKey(((RegisterNumber) o).number)) { - ((RegisterNumber) o).number = registerMap.get(((RegisterNumber) o).number); - } - } - } - } - } - ret.addAll(body); + List registerNames = new ArrayList<>(); + registerNames.add("***** ZERO *****"); + if (usedNames.contains("this")) { + needsFun2 = true; + preloadThisFlag = true; + registerNames.add("this"); } else { + suppressThisFlag = true; + } + if (usedNames.contains("arguments")) { + preloadArgumentsFlag = true; + needsFun2 = true; + registerNames.add("arguments"); + } else { + suppressArgumentsFlag = true; + } + if (usedNames.contains("super")) { + preloadSuperFlag = true; + needsFun2 = true; + registerNames.add("super"); + } + if (usedNames.contains("_root")) { + preloadRootFlag = true; + needsFun2 = true; + registerNames.add("_root"); + } + if (usedNames.contains("_parent")) { + preloadParentFlag = true; + needsFun2 = true; + registerNames.add("_parent"); + } else { + suppressParentFlag = true; + } + if (usedNames.contains("_global")) { + needsFun2 = true; + preloadGlobalFlag = true; + registerNames.add("_global"); + } + + int preloadedNumber = registerNames.size(); + if (!paramNames.isEmpty()) { + needsFun2 = true; + } + if (localData.inMethod) { + needsFun2 = true; + } + if (localData.inFunction > 1) { + needsFun2 = true; + } + if (needsFun2) { for (int i = 0; i < paramNames.size(); i++) { - paramRegs.add(1 + i); + paramRegs.add(registerNames.size()); + registerNames.add(paramNames.get(i)); } } + + if (actions != null && !actions.isEmpty()) { + localDataCopy.inFunction++; + + for (VariableActionItem v : variables) { + String varName = v.getVariableName(); + GraphTargetItem stored = v.getStoreValue(); + if (needsFun2) { + if (v.isDefinition() && !registerNames.contains(varName)) { + registerNames.add(varName); + } + } + + if (registerNames.contains(varName)) { + if (stored != null) { + v.setBoxedValue(new StoreRegisterActionItem(null, new RegisterNumber(registerNames.indexOf(varName), varName), stored, false)); + } else { + v.setBoxedValue(new DirectValueActionItem(new RegisterNumber(registerNames.indexOf(varName), varName))); + } + } else { + if (v.isDefinition()) { + v.setBoxedValue(new DefineLocalActionItem(null, ((ActionSourceGenerator) generator).pushConstTargetItem(varName), stored)); + } else { + if (stored != null) { + v.setBoxedValue(new SetVariableActionItem(null, ((ActionSourceGenerator) generator).pushConstTargetItem(varName), stored)); + } else { + v.setBoxedValue(new GetVariableActionItem(null, ((ActionSourceGenerator) generator).pushConstTargetItem(varName))); + } + } + } + + } + ret.addAll(asGenerator.toActionList(asGenerator.generate(localDataCopy, actions))); + } int len = Action.actionsToBytes(asGenerator.toActionList(ret), false, SWF.DEFAULT_VERSION).length; - if ((!preloadParentFlag) - && (!preloadRootFlag) - && (!preloadSuperFlag) - && (!preloadArgumentsFlag) - && (!preloadThisFlag) - && (!preloadGlobalFlag) - && (suppressArgumentsFlag) - && (suppressThisFlag) - && (suppressParentFlag) - && usedRegisters.isEmpty()) { + if (!needsFun2 && paramNames.isEmpty()) { ret.add(0, new ActionDefineFunction(functionName, paramNames, len, SWF.DEFAULT_VERSION)); } else { ret.add(0, new ActionDefineFunction2(functionName, @@ -318,8 +284,9 @@ public class FunctionActionItem extends ActionItem { suppressThisFlag, preloadThisFlag, preloadGlobalFlag, - usedRegisters.isEmpty() ? 0 : (usedRegisters.last() + 1), len, SWF.DEFAULT_VERSION, paramNames, paramRegs)); + registerNames.size() - 1, len, SWF.DEFAULT_VERSION, paramNames, paramRegs)); } + return ret; } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java index 0e7377f30..ff7e7dd3f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java @@ -46,7 +46,7 @@ public class GetMemberActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!((memberName instanceof DirectValueActionItem) && (((DirectValueActionItem) memberName).value instanceof String))) { //if(!(functionName instanceof GetVariableActionItem)) object.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java index 2286dbc16..0e291367b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java @@ -48,7 +48,7 @@ public class GetPropertyActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (isEmptyString(target)) { return writer.append(Action.propertyNames[propertyIndex]); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java index e297329c2..5e132233e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java @@ -34,7 +34,7 @@ public class GetTimeActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("getTimer()"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java index 2dd2db0b0..a8a58dca1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java @@ -42,7 +42,7 @@ public class GetURL2ActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (sendVarsMethod == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java index d1a9b4906..a5ff79a1e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java @@ -31,7 +31,7 @@ public class GetURLActionItem extends ActionItem { public String targetString; @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("getUrl(\""); writer.append(Helper.escapeString(urlString) + "\", \"" + Helper.escapeString(targetString)); return writer.append("\")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java index 4c64404fa..9db1f46f0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java @@ -50,7 +50,7 @@ public class GetVariableActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return stripQuotes(name, localData, writer); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java index 72b0f5f05..24ca7cb69 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java @@ -36,7 +36,7 @@ public class GetVersionActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("getVersion()"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java index dee18046e..2f2b227b1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java @@ -50,7 +50,7 @@ public class GotoFrame2ActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String prefix = "gotoAndStop"; if (playFlag) { prefix = "gotoAndPlay"; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java index fd240bf05..008d4b096 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java @@ -34,7 +34,7 @@ public class GotoFrameActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("gotoAndStop("); writer.append("" + (frame + 1)); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java index 4a7311f87..e6fba5aad 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java @@ -35,7 +35,7 @@ public class GotoLabelActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("gotoAndStop(\""); writer.append(Helper.escapeString(label)); return writer.append("\")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java index 9026e298c..100c3e30b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java @@ -35,7 +35,7 @@ public class ImplementsOpActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { subclass.toString(writer, localData); writer.append(" implements "); for (int i = 0; i < superclasses.size(); i++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java index 08217f15e..7876c7f0f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java @@ -46,7 +46,7 @@ public class IncrementActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append(" + 1"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java index 4e7739ecc..29f515364 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java @@ -44,7 +44,7 @@ public class InitArrayActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("["); for (int i = 0; i < values.size(); i++) { if (i > 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java index 2a4b56375..85824e246 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java @@ -48,7 +48,7 @@ public class InitObjectActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("{"); for (int i = 0; i < values.size(); i++) { if (i > 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java index 227e2c85d..b7dc434aa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java @@ -52,7 +52,7 @@ public class LoadMovieActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java index 4ff319035..6b537c8cb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java @@ -54,7 +54,7 @@ public class LoadMovieNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java index b45f7ec78..7035aff71 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java @@ -52,7 +52,7 @@ public class LoadVariablesActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java index 4341bd7d8..71af378e5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java @@ -54,7 +54,7 @@ public class LoadVariablesNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java index 30e17b54f..89664459a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java @@ -34,7 +34,7 @@ public class MBAsciiToCharActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("mbchr("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java index 8068d4e48..c6cbfb8a4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java @@ -34,7 +34,7 @@ public class MBCharToAsciiActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("mbord("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java index 49876ee67..070646bf0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java @@ -50,7 +50,7 @@ public class MBStringExtractActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("mbsubstring("); value.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java index d3daabdef..0d0fdaaf6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java @@ -35,7 +35,7 @@ public class MBStringLengthActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("mblength("); if (value.getPrecedence() > precedence) { writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java index 136c9c9e9..fb8fcabf0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java @@ -50,7 +50,7 @@ public class NewMethodActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean blankMethod = false; if (methodName instanceof DirectValueActionItem) { if (((DirectValueActionItem) methodName).value instanceof Undefined) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java index bcff1c038..fb1caac3e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java @@ -47,7 +47,7 @@ public class NewObjectActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("new "); stripQuotes(objectName, localData, writer); writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java index dee12aafc..99f534bad 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java @@ -27,7 +27,7 @@ import java.util.List; public class NextFrameActionItem extends ActionItem { @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("nextFrame()"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java index 6f53e0486..d4704f96b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java @@ -27,7 +27,7 @@ import java.util.List; public class PlayActionItem extends ActionItem { @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("play()"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java index 57126344a..cdc3402d0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java @@ -35,7 +35,7 @@ public class PopActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer; } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java index 415d78951..9cb2d01d7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java @@ -52,7 +52,7 @@ public class PostDecrementActionItem extends ActionItem implements SetTypeAction } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append("--"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java index b2c43a0ee..5f8249480 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java @@ -52,7 +52,7 @@ public class PostIncrementActionItem extends ActionItem implements SetTypeAction } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append("++"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java index f6e3b7866..6d26c1412 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java @@ -27,7 +27,7 @@ import java.util.List; public class PrevFrameActionItem extends ActionItem { @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("prevFrame()"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java index 15076c76b..71858729c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java @@ -52,7 +52,7 @@ public class PrintActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("print("); target.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java index 1d829fda2..1c6534de9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java @@ -52,7 +52,7 @@ public class PrintAsBitmapActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("printAsBitmap("); target.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java index e5a266cd8..909b6bdde 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java @@ -52,7 +52,7 @@ public class PrintAsBitmapNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("printAsBitmapNum("); num.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java index 8138b712d..4694503df 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java @@ -52,7 +52,7 @@ public class PrintNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("printNum("); num.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java index 23c23d26f..21f064bb4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java @@ -34,7 +34,7 @@ public class RandomNumberActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("random("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java index 0e7dab55d..f0f4b1aec 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java @@ -34,7 +34,7 @@ public class RemoveSpriteActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("removeMovieClip("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java index 272a397c8..ed1232070 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java @@ -47,7 +47,7 @@ public class ReturnActionItem extends ActionItem implements ExitItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("return "); return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java index 1c311ca5f..9e3e12521 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java @@ -80,7 +80,7 @@ public class SetMemberActionItem extends ActionItem implements SetTypeActionItem } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!((objectName instanceof DirectValueActionItem) && (((DirectValueActionItem) objectName).value instanceof String))) { //if(!(functionName instanceof GetVariableActionItem)) object.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java index d2a716cee..6de490fd4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java @@ -72,7 +72,7 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (isEmptyString(target)) { writer.append(Action.propertyNames[propertyIndex] + " = "); return value.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java index 7cb4b4294..b43eb1cee 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java @@ -35,7 +35,7 @@ public class SetTarget2ActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("tellTarget("); target.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java index 00ff8225f..45405146f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java @@ -34,7 +34,7 @@ public class SetTargetActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("tellTarget(\""); writer.append(Helper.escapeString(target)); return writer.append("\")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java index a8bb72a77..e64abc819 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java @@ -70,7 +70,7 @@ public class SetVariableActionItem extends ActionItem implements SetTypeActionIt } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (name instanceof DirectValueActionItem || name instanceof GetVariableActionItem) { stripQuotes(name, localData, writer); writer.append(" = "); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java index 581e9aff9..26b61037c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java @@ -49,7 +49,7 @@ public class StartDragActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean hasConstrains = true; if (constrain instanceof DirectValueActionItem) { if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java index 355714a0a..203cac528 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java @@ -27,7 +27,7 @@ import java.util.List; public class StopActionItem extends ActionItem { @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("stop()"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java index f79b56813..155939ebc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java @@ -27,7 +27,7 @@ import java.util.List; public class StopAllSoundsActionItem extends ActionItem { @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("stopAllSounds()"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java index 580fa4f22..effe3b318 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java @@ -27,7 +27,7 @@ import java.util.List; public class StopDragActionItem extends ActionItem { @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("stopDrag()"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java index d0654dffe..40d4c38b0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java @@ -70,7 +70,7 @@ public class StoreRegisterActionItem extends ActionItem implements SetTypeAction } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (temporary) { value.toString(writer, localData); } else { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java index 823b4687d..7d2c8200e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java @@ -30,7 +30,7 @@ public class StrictModeActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("StrictMode(" + mode + ");"); //I still don't know how AS source of Strict Mode instruction looks like, assuming this... } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java index bb2ff1929..2ac6cb59a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java @@ -40,7 +40,7 @@ public class StringExtractActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { value.toString(writer, localData); writer.append(".substr("); index.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java index 858bf6b32..56bb44639 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java @@ -35,7 +35,7 @@ public class StringLengthActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("length("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java index 33251496f..ff23af982 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java @@ -34,7 +34,7 @@ public class TargetPathActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("targetPath("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java index cab44d47b..1e963b13a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java @@ -46,7 +46,7 @@ public class TemporaryRegister extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java index 5932d6311..9665d0e86 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java @@ -34,7 +34,7 @@ public class ThrowActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("throw "); return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java index dcc1937d3..663d56b3c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java @@ -34,7 +34,7 @@ public class ToIntegerActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("int("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java index b9f73a121..188187ba6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java @@ -34,7 +34,7 @@ public class ToNumberActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("Number("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java index 7b9be8ccd..ded746bb1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java @@ -34,7 +34,7 @@ public class ToStringActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("String("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java index 355c44e78..8b21cfba9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java @@ -27,7 +27,7 @@ import java.util.List; public class ToggleHighQualityActionItem extends ActionItem { @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("toggleHighQuality()"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java index 3ff765edb..0c17253f0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java @@ -34,7 +34,7 @@ public class TraceActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("trace("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java index fb1d176a8..c81a05d72 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java @@ -37,7 +37,7 @@ public class TypeOfActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("typeof("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java index f890901b6..38b28c4d5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java @@ -48,7 +48,7 @@ public class UnLoadMovieActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("unloadMovie("); targetString.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java index c450f55e1..17d9cb71f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java @@ -50,7 +50,7 @@ public class UnLoadMovieNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("unloadMovieNum("); num.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java index f6cfc40aa..bd108c66b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java @@ -31,7 +31,7 @@ public class UnsupportedActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("//" + AppStrings.translate("decompilation.unsupported") + ":" + value); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java index 5c1acc241..442e45120 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java @@ -156,7 +156,7 @@ public class ClassActionItem extends ActionItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("class "); className.toStringNoQuotes(writer, localData); if (extendsOp != null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java index c032890c4..acd1d5f78 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java @@ -72,7 +72,7 @@ public class ForInActionItem extends LoopActionItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } @@ -140,7 +140,7 @@ public class ForInActionItem extends LoopActionItem implements Block { loopExpr.add(forInEndIf); List loopBody = new ArrayList<>(); loopBody.add(new ActionPush(new RegisterNumber(exprReg))); - if (asGenerator.isInFunction(localData)) { + if (asGenerator.isInFunction(localData)==2) { loopBody.add(new ActionStoreRegister(innerExprReg)); loopBody.add(new ActionPop()); } else { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java index 01ac90b4d..8c4f2f838 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java @@ -46,7 +46,7 @@ public class IfFrameLoadedActionItem extends ActionItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("ifFrameLoaded("); frame.toString(writer, localData); writer.append(")").newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java index 68f779424..72ee8cc5b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java @@ -44,7 +44,7 @@ public class InterfaceActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("interface "); name.toStringNoQuotes(writer, localData); boolean first = true; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java index 50eccb434..17b1b56a1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java @@ -41,7 +41,7 @@ public class TellTargetActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("tellTarget("); target.toString(writer, localData); writer.append(")").newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java index 2ffd1c98a..aad568071 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java @@ -59,7 +59,7 @@ public class TryActionItem extends ActionItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("try").newLine(); writer.append("{").newLine(); writer.indent(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java index 9f9ebb042..867dbd77f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java @@ -47,7 +47,7 @@ public class WithActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("with("); scope.toString(writer, localData); writer.append(")").newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java index b125f1f61..ae963e18a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java @@ -39,7 +39,7 @@ public class AddActionItem extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.getPrecedence() >= precedence) { //string + vs number + String ret = ""; if (leftSide.getPrecedence() > precedence) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java index ca1f4ebfe..05bf16e4e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java @@ -39,7 +39,7 @@ public class SubtractActionItem extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.getPrecedence() >= precedence) { // >= add or subtract too String ret = ""; if (leftSide.getPrecedence() > precedence) { 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 0b987068e..0960bfc20 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 @@ -157,13 +157,13 @@ public class ActionScriptParser { return "" + uniqLast; } - private List commands(HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel) throws IOException, ParseException { + private List commands(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(registerVars, inFunction, inMethod, forinlevel, true)) != null) { + while ((cmd = command(registerVars, inFunction, inMethod, forinlevel, true, variables)) != null) { ret.add(cmd); } if (debugMode) { @@ -179,12 +179,13 @@ public class ActionScriptParser { return list; } - private GraphTargetItem type() throws IOException, ParseException { + private GraphTargetItem type(List variables) throws IOException, ParseException { GraphTargetItem ret = null; ParsedSymbol s = lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER); - ret = new GetVariableActionItem(null, pushConst(s.value.toString())); + ret = new VariableActionItem(s.value.toString(), null, false); + variables.add((VariableActionItem) ret); s = lex(); while (s.type == SymbolType.DOT) { s = lex(); @@ -196,7 +197,7 @@ public class ActionScriptParser { return ret; } - private GraphTargetItem memberOrCall(GraphTargetItem newcmds, HashMap registerVars, boolean inFunction, boolean inMethod) throws IOException, ParseException { + 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)) { @@ -204,17 +205,17 @@ public class ActionScriptParser { case DOT: case BRACKET_OPEN: lexer.pushback(s); - ret = member(ret, registerVars, inFunction, inMethod); + ret = member(ret, registerVars, inFunction, inMethod, variables); break; case PARENT_OPEN: if (ret instanceof GetMemberActionItem) { GetMemberActionItem mem = (GetMemberActionItem) ret; - ret = new CallMethodActionItem(null, mem.object, mem.memberName, call(registerVars, inFunction, inMethod)); - } else if (ret instanceof GetVariableActionItem) { - GetVariableActionItem var = (GetVariableActionItem) ret; - ret = new CallFunctionActionItem(null, var.name, call(registerVars, inFunction, inMethod)); + ret = new CallMethodActionItem(null, mem.object, mem.memberName, call(registerVars, inFunction, inMethod, variables)); + } else if (ret instanceof VariableActionItem) { + VariableActionItem var = (VariableActionItem) ret; + ret = new CallFunctionActionItem(null, var, call(registerVars, inFunction, inMethod, variables)); } else { - ret = new CallFunctionActionItem(null, ret, call(registerVars, inFunction, inMethod)); + ret = new CallFunctionActionItem(null, ret, call(registerVars, inFunction, inMethod, variables)); } break; } @@ -224,12 +225,12 @@ public class ActionScriptParser { return ret; } - private GraphTargetItem member(GraphTargetItem obj, HashMap registerVars, boolean inFunction, boolean inMethod) throws IOException, ParseException { + 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, SymbolType.BRACKET_OPEN)) { if (s.type == SymbolType.BRACKET_OPEN) { - ret = new GetMemberActionItem(null, ret, expression(registerVars, inFunction, inMethod, true)); + ret = new GetMemberActionItem(null, ret, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.BRACKET_CLOSE); s = lex(); continue; @@ -249,27 +250,13 @@ public class ActionScriptParser { return ret; } - private GraphTargetItem variable(HashMap registerVars, boolean inFunction, boolean inMethod) throws IOException, ParseException { + private GraphTargetItem variable(HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, ParseException { GraphTargetItem ret = null; ParsedSymbol s = lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.THIS, SymbolType.SUPER); - if (registerVars.containsKey(s.value.toString())) { - ret = new DirectValueActionItem(null, 0, new RegisterNumber(registerVars.get(s.value.toString())), new ArrayList()); - } else { - if (inMethod) { - ret = new DirectValueActionItem(null, 0, new RegisterNumber(REGISTER_THIS), new ArrayList()); - //TODO: Handle properties (?) - if (false) { //GraphTargetItem.propertyNamesList.contains(s.value.toString())) { - //ret.add(new ActionPush((Long) (long) (int) GraphTargetItem.propertyNamesList.indexOf(s.value.toString()))); - //ret.add(new ActionGetProperty()); - } else { - ret = new GetMemberActionItem(null, ret, pushConst(s.value.toString())); - } - } else { - ret = new GetVariableActionItem(null, pushConst(s.value.toString())); - } - } - ret = (member(ret, registerVars, inFunction, inMethod)); + ret = new VariableActionItem(s.value.toString(), null, false); + variables.add((VariableActionItem) ret); + ret = (member(ret, registerVars, inFunction, inMethod, variables)); return ret; } @@ -311,7 +298,7 @@ public class ActionScriptParser { return ret; } - private List call(HashMap registerVars, boolean inFunction, boolean inMethod) throws IOException, ParseException { + 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(); @@ -319,14 +306,14 @@ public class ActionScriptParser { if (s.type != SymbolType.COMMA) { lexer.pushback(s); } - ret.add(expression(registerVars, inFunction, inMethod, true)); + ret.add(expression(registerVars, inFunction, inMethod, true, variables)); s = lex(); expected(s, lexer.yyline(), SymbolType.COMMA, SymbolType.PARENT_CLOSE); } return ret; } - private FunctionActionItem function(boolean withBody, String functionName, boolean isMethod) throws IOException, ParseException { + private FunctionActionItem function(boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { GraphTargetItem ret = null; ParsedSymbol s = null; expectedType(SymbolType.PARENT_OPEN); @@ -342,7 +329,7 @@ public class ActionScriptParser { paramNames.add(s.value.toString()); s = lex(); if (s.type == SymbolType.COLON) { - type(); + type(variables); s = lex(); } @@ -361,16 +348,18 @@ public class ActionScriptParser { registerVars.put(paramNames.get(i), (7 + i)); //(paramNames.size() - i))); } List body = null; + List subvariables = new ArrayList<>(); if (withBody) { expectedType(SymbolType.CURLY_OPEN); - body = commands(registerVars, true, isMethod, 0); + + body = commands(registerVars, true, isMethod, 0, subvariables); expectedType(SymbolType.CURLY_CLOSE); } - return new FunctionActionItem(null, functionName, paramNames, body, constantPool, -1); + return new FunctionActionItem(null, functionName, paramNames, body, constantPool, -1, subvariables); } - private GraphTargetItem traits(boolean isInterface, GraphTargetItem nameStr, GraphTargetItem extendsStr, List implementsStr) throws IOException, ParseException { + private GraphTargetItem traits(boolean isInterface, GraphTargetItem nameStr, GraphTargetItem extendsStr, List implementsStr, List variables) throws IOException, ParseException { GraphTargetItem ret = null; /*for (int i = 0; i < nameStr.size() - 1; i++) { @@ -410,11 +399,9 @@ public class ActionScriptParser { if (mem.memberName instanceof DirectValueActionItem) { classNameStr = ((DirectValueActionItem) mem.memberName).toStringNoQuotes(LocalData.create(new ConstantPool(constantPool))); } - } else if (nameStr instanceof GetVariableActionItem) { - GetVariableActionItem var = (GetVariableActionItem) nameStr; - if (var.name instanceof DirectValueActionItem) { - classNameStr = ((DirectValueActionItem) var.name).toStringNoQuotes(LocalData.create(new ConstantPool(constantPool))); - } + } else if (nameStr instanceof VariableActionItem) { + VariableActionItem var = (VariableActionItem) nameStr; + classNameStr = var.getVariableName(); } looptrait: @@ -433,15 +420,15 @@ public class ActionScriptParser { expected(s, lexer.yyline(), SymbolType.IDENTIFIER); String fname = s.value.toString(); if (fname.equals(classNameStr)) { //constructor - constr = (function(!isInterface, "", true)); + constr = (function(!isInterface, "", true, variables)); } else { if (!isInterface) { if (isStatic) { - FunctionActionItem ft = function(!isInterface, "", true); + FunctionActionItem ft = function(!isInterface, "", true, variables); ft.calculatedFunctionName = pushConst(fname); staticFunctions.add(ft); } else { - FunctionActionItem ft = function(!isInterface, "", true); + FunctionActionItem ft = function(!isInterface, "", true, variables); ft.calculatedFunctionName = pushConst(fname); functions.add(ft); } @@ -454,14 +441,14 @@ public class ActionScriptParser { String ident = s.value.toString(); s = lex(); if (s.type == SymbolType.COLON) { - type(); + type(variables); s = lex(); } if (s.type == SymbolType.ASSIGN) { if (isStatic) { - staticVars.add(new MyEntry(pushConst(ident), expression(new HashMap(), false, false, true))); + staticVars.add(new MyEntry(pushConst(ident), expression(new HashMap(), false, false, true, variables))); } else { - vars.add(new MyEntry(pushConst(ident), expression(new HashMap(), false, false, true))); + vars.add(new MyEntry(pushConst(ident), expression(new HashMap(), false, false, true, variables))); } s = lex(); } @@ -483,7 +470,7 @@ public class ActionScriptParser { } } - private GraphTargetItem expressionCommands(ParsedSymbol s, HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel) throws IOException, ParseException { + 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 GETVERSION: @@ -493,52 +480,52 @@ public class ActionScriptParser { break; case MBORD: expectedType(SymbolType.PARENT_OPEN); - ret = new MBCharToAsciiActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new MBCharToAsciiActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); break; case MBCHR: expectedType(SymbolType.PARENT_OPEN); - ret = new MBAsciiToCharActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new MBAsciiToCharActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); break; case MBLENGTH: expectedType(SymbolType.PARENT_OPEN); - ret = new MBStringLengthActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new MBStringLengthActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); break; case MBSUBSTRING: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem val1 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem val1 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COMMA); - GraphTargetItem index1 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem index1 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COMMA); - GraphTargetItem len1 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem len1 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); ret = new MBStringExtractActionItem(null, val1, index1, len1); break; case SUBSTR: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem val2 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem val2 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COMMA); - GraphTargetItem index2 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem index2 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COMMA); - GraphTargetItem len2 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem len2 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); ret = new StringExtractActionItem(null, val2, index2, len2); break; case LENGTH: expectedType(SymbolType.PARENT_OPEN); - ret = new StringLengthActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new StringLengthActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); break; case RANDOM: expectedType(SymbolType.PARENT_OPEN); - ret = new RandomNumberActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new RandomNumberActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); break; case INT: expectedType(SymbolType.PARENT_OPEN); - ret = new ToIntegerActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new ToIntegerActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); break; @@ -551,10 +538,12 @@ public class ActionScriptParser { case NUMBER_OP: s = lex(); if (s.type == SymbolType.DOT) { - ret = memberOrCall(new GetVariableActionItem(null, new DirectValueActionItem(null, 0, s.value, new ArrayList())), registerVars, inFunction, inMethod); + VariableActionItem vi = new VariableActionItem(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 ToNumberActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new ToNumberActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); } break; @@ -563,31 +552,33 @@ public class ActionScriptParser { s = lex(); if (s.type == SymbolType.DOT) { lexer.pushback(s); - ret = memberOrCall(new GetVariableActionItem(null, new DirectValueActionItem(null, 0, sop.value, new ArrayList())), registerVars, inFunction, inMethod); + VariableActionItem vi2 = new VariableActionItem(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 ToStringActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new ToStringActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); - ret = memberOrCall(ret, registerVars, inFunction, inMethod); + ret = memberOrCall(ret, registerVars, inFunction, inMethod, variables); } break; case ORD: expectedType(SymbolType.PARENT_OPEN); - ret = new CharToAsciiActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new CharToAsciiActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); break; case CHR: expectedType(SymbolType.PARENT_OPEN); - ret = new AsciiToCharActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new AsciiToCharActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); break; case DUPLICATEMOVIECLIP: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem src3 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem src3 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COMMA); - GraphTargetItem tar3 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem tar3 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COMMA); - GraphTargetItem dep3 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem dep3 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); ret = new CloneSpriteActionItem(null, src3, tar3, dep3); break; @@ -602,7 +593,7 @@ public class ActionScriptParser { return ret; } - private GraphTargetItem command(HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel, boolean mustBeCommand) throws IOException, ParseException { + private GraphTargetItem command(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; @@ -616,38 +607,38 @@ public class ActionScriptParser { switch (s.type) { case CALL: expectedType(SymbolType.PARENT_OPEN); - ret = new CallActionItem(null, (expression(registerVars, inFunction, inMethod, true))); + ret = new CallActionItem(null, (expression(registerVars, inFunction, inMethod, true, variables))); expectedType(SymbolType.PARENT_CLOSE); break; case LENGTH: expectedType(SymbolType.PARENT_OPEN); - ret = new StringLengthActionItem(null, (expression(registerVars, inFunction, inMethod, true))); + ret = new StringLengthActionItem(null, (expression(registerVars, inFunction, inMethod, true, variables))); expectedType(SymbolType.PARENT_CLOSE); break; case MBLENGTH: expectedType(SymbolType.PARENT_OPEN); - ret = new MBStringLengthActionItem(null, (expression(registerVars, inFunction, inMethod, true))); + ret = new MBStringLengthActionItem(null, (expression(registerVars, inFunction, inMethod, true, variables))); expectedType(SymbolType.PARENT_CLOSE); break; case SET: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem name1 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem name1 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COMMA); - GraphTargetItem value1 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem value1 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); ret = new SetVariableActionItem(null, name1, value1); break; case WITH: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem wvar = (variable(registerVars, inFunction, inMethod)); + GraphTargetItem wvar = (variable(registerVars, inFunction, inMethod, variables)); expectedType(SymbolType.PARENT_CLOSE); expectedType(SymbolType.CURLY_OPEN); - List wcmd = commands(registerVars, inFunction, inMethod, forinlevel); + List wcmd = commands(registerVars, inFunction, inMethod, forinlevel, variables); expectedType(SymbolType.CURLY_CLOSE); ret = new WithActionItem(null, wvar, wcmd); break; case DELETE: - GraphTargetItem varDel = variable(registerVars, inFunction, inMethod); + GraphTargetItem varDel = variable(registerVars, inFunction, inMethod, variables); if (varDel instanceof GetMemberActionItem) { GetMemberActionItem gm = (GetMemberActionItem) varDel; ret = new DeleteActionItem(null, gm.object, gm.memberName); @@ -657,19 +648,19 @@ public class ActionScriptParser { break; case TRACE: expectedType(SymbolType.PARENT_OPEN); - ret = new TraceActionItem(null, (expression(registerVars, inFunction, inMethod, true))); + ret = new TraceActionItem(null, (expression(registerVars, inFunction, inMethod, true, variables))); expectedType(SymbolType.PARENT_CLOSE); break; case GETURL: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem url = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem url = (expression(registerVars, inFunction, inMethod, true, variables)); s = lex(); expected(s, lexer.yyline(), SymbolType.PARENT_CLOSE, SymbolType.COMMA); int getuMethod = 1; GraphTargetItem target = null; if (s.type == SymbolType.COMMA) { - target = (expression(registerVars, inFunction, inMethod, true)); + target = (expression(registerVars, inFunction, inMethod, true, variables)); s = lex(); if (s.type == SymbolType.COMMA) { s = lex(); @@ -693,11 +684,11 @@ public class ActionScriptParser { break; case GOTOANDSTOP: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem gtsFrame = expression(registerVars, inFunction, inMethod, true); + GraphTargetItem gtsFrame = expression(registerVars, inFunction, inMethod, true, variables); s = lex(); if (s.type == SymbolType.COMMA) { //Handle scene? s = lex(); - gtsFrame = expression(registerVars, inFunction, inMethod, true); + gtsFrame = expression(registerVars, inFunction, inMethod, true, variables); } else { lexer.pushback(s); } @@ -721,10 +712,10 @@ public class ActionScriptParser { break; case TELLTARGET: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem tellTarget = expression(registerVars, inFunction, inMethod, true); + GraphTargetItem tellTarget = expression(registerVars, inFunction, inMethod, true, variables); expectedType(SymbolType.PARENT_CLOSE); expectedType(SymbolType.CURLY_OPEN); - List tellcmds = commands(registerVars, inFunction, inMethod, forinlevel); + List tellcmds = commands(registerVars, inFunction, inMethod, forinlevel, variables); expectedType(SymbolType.CURLY_CLOSE); ret = new TellTargetActionItem(null, tellTarget, tellcmds); break; @@ -754,7 +745,7 @@ public class ActionScriptParser { case UNLOADMOVIENUM: SymbolType unloadType = s.type; expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem unTargetOrNum = expression(registerVars, inFunction, inMethod, true); + GraphTargetItem unTargetOrNum = expression(registerVars, inFunction, inMethod, true, variables); expectedType(SymbolType.PARENT_CLOSE); if (unloadType == SymbolType.UNLOADMOVIE) { ret = new UnLoadMovieActionItem(null, unTargetOrNum); @@ -769,9 +760,9 @@ public class ActionScriptParser { case PRINTNUM: SymbolType printType = s.type; expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem printTarget = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem printTarget = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COMMA); - GraphTargetItem printBBox = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem printBBox = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); switch (printType) { @@ -795,9 +786,9 @@ public class ActionScriptParser { case LOADMOVIENUM: SymbolType loadType = s.type; expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem url2 = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem url2 = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COMMA); - GraphTargetItem targetOrNum = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem targetOrNum = (expression(registerVars, inFunction, inMethod, true, variables)); s = lex(); expected(s, lexer.yyline(), SymbolType.PARENT_CLOSE, SymbolType.COMMA); @@ -833,11 +824,11 @@ public class ActionScriptParser { break; case GOTOANDPLAY: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem gtpFrame = expression(registerVars, inFunction, inMethod, true); + GraphTargetItem gtpFrame = expression(registerVars, inFunction, inMethod, true, variables); s = lex(); if (s.type == SymbolType.COMMA) { //Handle scene? s = lex(); - gtpFrame = expression(registerVars, inFunction, inMethod, true); + gtpFrame = expression(registerVars, inFunction, inMethod, true, variables); } else { lexer.pushback(s); } @@ -847,12 +838,12 @@ public class ActionScriptParser { case REMOVEMOVIECLIP: expectedType(SymbolType.PARENT_OPEN); - ret = new RemoveSpriteActionItem(null, (expression(registerVars, inFunction, inMethod, true))); + ret = new RemoveSpriteActionItem(null, (expression(registerVars, inFunction, inMethod, true, variables))); expectedType(SymbolType.PARENT_CLOSE); break; case STARTDRAG: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem dragTarget = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem dragTarget = (expression(registerVars, inFunction, inMethod, true, variables)); GraphTargetItem lockCenter = null; GraphTargetItem constrain = null; GraphTargetItem x1 = null; @@ -861,20 +852,20 @@ public class ActionScriptParser { GraphTargetItem y2 = null; s = lex(); if (s.type == SymbolType.COMMA) { - lockCenter = (expression(registerVars, inFunction, inMethod, true)); + lockCenter = (expression(registerVars, inFunction, inMethod, true, variables)); s = lex(); if (s.type == SymbolType.COMMA) { constrain = new DirectValueActionItem(null, 0, Boolean.TRUE, new ArrayList()); - x1 = (expression(registerVars, inFunction, inMethod, true)); + x1 = (expression(registerVars, inFunction, inMethod, true, variables)); s = lex(); if (s.type == SymbolType.COMMA) { - y1 = (expression(registerVars, inFunction, inMethod, true)); + y1 = (expression(registerVars, inFunction, inMethod, true, variables)); s = lex(); if (s.type == SymbolType.COMMA) { - x2 = (expression(registerVars, inFunction, inMethod, true)); + x2 = (expression(registerVars, inFunction, inMethod, true, variables)); s = lex(); if (s.type == SymbolType.COMMA) { - y2 = (expression(registerVars, inFunction, inMethod, true)); + y2 = (expression(registerVars, inFunction, inMethod, true, variables)); } else { lexer.pushback(s); y2 = new DirectValueActionItem(null, 0, (Long) 0L, new ArrayList()); @@ -907,65 +898,65 @@ public class ActionScriptParser { case IFFRAMELOADED: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem iflExpr = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem iflExpr = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); expectedType(SymbolType.CURLY_OPEN); - List iflComs = commands(registerVars, inFunction, inMethod, forinlevel); + List iflComs = commands(registerVars, inFunction, inMethod, forinlevel, variables); expectedType(SymbolType.CURLY_CLOSE); ret = new IfFrameLoadedActionItem(iflExpr, iflComs, null); break; case CLASS: - GraphTargetItem classTypeStr = type(); + GraphTargetItem classTypeStr = type(variables); s = lex(); GraphTargetItem extendsTypeStr = null; if (s.type == SymbolType.EXTENDS) { - extendsTypeStr = type(); + extendsTypeStr = type(variables); s = lex(); } List implementsTypeStrs = new ArrayList<>(); if (s.type == SymbolType.IMPLEMENTS) { do { - GraphTargetItem implementsTypeStr = type(); + 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)); + ret = (traits(false, classTypeStr, extendsTypeStr, implementsTypeStrs, variables)); expectedType(SymbolType.CURLY_CLOSE); break; case INTERFACE: - GraphTargetItem interfaceTypeStr = type(); + GraphTargetItem interfaceTypeStr = type(variables); s = lex(); List intExtendsTypeStrs = new ArrayList<>(); if (s.type == SymbolType.EXTENDS) { do { - GraphTargetItem intExtendsTypeStr = type(); + 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)); + 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)); + ret = (function(true, s.value.toString(), false, variables)); break; case NEW: - GraphTargetItem type = type(); + GraphTargetItem type = type(variables); expectedType(SymbolType.PARENT_OPEN); if (type instanceof GetMemberActionItem) { GetMemberActionItem mem = (GetMemberActionItem) type; - ret = new NewMethodActionItem(null, mem.object, mem.memberName, call(registerVars, inFunction, inMethod)); - } else if (type instanceof GetVariableActionItem) { - GetVariableActionItem var = (GetVariableActionItem) type; - ret = new NewObjectActionItem(null, var.name, call(registerVars, inFunction, inMethod)); + ret = new NewMethodActionItem(null, mem.object, mem.memberName, call(registerVars, inFunction, inMethod, variables)); + } else if (type instanceof VariableActionItem) { + VariableActionItem var = (VariableActionItem) type; + ret = new NewObjectActionItem(null, var, call(registerVars, inFunction, inMethod, variables)); } else { - ret = new NewObjectActionItem(null, ret, call(registerVars, inFunction, inMethod)); + ret = new NewObjectActionItem(null, ret, call(registerVars, inFunction, inMethod, variables)); } break; case VAR: @@ -974,7 +965,7 @@ public class ActionScriptParser { String varIdentifier = s.value.toString(); s = lex(); if (s.type == SymbolType.COLON) { - type(); + type(variables); s = lex(); //TODO: handle value type } @@ -984,40 +975,44 @@ public class ActionScriptParser { if (!inFunction) { //ret.add(pushConst(varIdentifier)); } - GraphTargetItem varval = (expression(registerVars, inFunction, inMethod, true)); - if (inFunction) { - for (int i = 1; i < 256; i++) { - if (!registerVars.containsValue(i)) { - registerVars.put(varIdentifier, i); - ret = new StoreRegisterActionItem(null, new RegisterNumber(i), varval, true); - break; - } - } - } else { - ret = new DefineLocalActionItem(null, pushConst(varIdentifier), varval); - } + GraphTargetItem varval = (expression(registerVars, inFunction, inMethod, true, variables)); + ret = new VariableActionItem(varIdentifier, varval, true); + variables.add((VariableActionItem) ret); + /*if (inFunction) { + for (int i = 1; i < 256; i++) { + if (!registerVars.containsValue(i)) { + registerVars.put(varIdentifier, i); + ret = new StoreRegisterActionItem(null, new RegisterNumber(i), varval, true); + break; + } + } + } else { + ret = new DefineLocalActionItem(null, pushConst(varIdentifier), varval); + }*/ } else { - if (inFunction) { - for (int i = 1; i < 256; i++) { - if (!registerVars.containsValue(i)) { - registerVars.put(varIdentifier, i); - ret = new DefineRegisterActionItem(varIdentifier, i); - break; - } - } - } else { - ret = new DefineLocalActionItem(null, pushConst(varIdentifier), null); - } + /*if (inFunction) { + for (int i = 1; i < 256; i++) { + if (!registerVars.containsValue(i)) { + registerVars.put(varIdentifier, i); + ret = new DefineRegisterActionItem(varIdentifier, i); + break; + } + } + } else { + ret = new DefineLocalActionItem(null, pushConst(varIdentifier), null); + }*/ + ret = new VariableActionItem(varIdentifier, null, true); + variables.add((VariableActionItem) ret); lexer.pushback(s); } break; case CURLY_OPEN: - ret = new BlockItem(null, commands(registerVars, inFunction, inMethod, forinlevel)); + ret = new BlockItem(null, commands(registerVars, inFunction, inMethod, forinlevel, variables)); expectedType(SymbolType.CURLY_CLOSE); break; case INCREMENT: //preincrement case DECREMENT: //predecrement - GraphTargetItem varincdec = variable(registerVars, inFunction, inMethod); + GraphTargetItem varincdec = variable(registerVars, inFunction, inMethod, variables); if (s.type == SymbolType.INCREMENT) { ret = new PreIncrementActionItem(null, varincdec); } else if (s.type == SymbolType.DECREMENT) { @@ -1033,25 +1028,25 @@ public class ActionScriptParser { boolean isEval = false; GraphTargetItem var; if (s.type == SymbolType.PARENT_OPEN) { - var = expression(registerVars, inFunction, inMethod, true); + var = expression(registerVars, inFunction, inMethod, true, variables); expectedType(SymbolType.PARENT_CLOSE); - memberOrCall(var, registerVars, inFunction, inMethod); + memberOrCall(var, registerVars, inFunction, inMethod, variables); } else if (s.type == SymbolType.EVAL) { expectedType(SymbolType.PARENT_OPEN); - var = expression(registerVars, inFunction, inMethod, true); + var = expression(registerVars, inFunction, inMethod, true, variables); var = new EvalActionItem(null, var); expectedType(SymbolType.PARENT_CLOSE); - var = memberOrCall(var, registerVars, inFunction, inMethod); + var = memberOrCall(var, registerVars, inFunction, inMethod, variables); isEval = true; } else { lexer.pushback(s); - var = variable(registerVars, inFunction, inMethod); + var = variable(registerVars, inFunction, inMethod, variables); } s = lex(); switch (s.type) { case ASSIGN: ret = var; - ret = Action.gettoset(ret, expression(registerVars, inFunction, inMethod, true)); + ret = Action.gettoset(ret, expression(registerVars, inFunction, inMethod, true, variables), variables); break; case ASSIGN_BITAND: case ASSIGN_BITOR: @@ -1064,29 +1059,29 @@ public class ActionScriptParser { case ASSIGN_SHIFT_RIGHT: case ASSIGN_USHIFT_RIGHT: case ASSIGN_XOR: - GraphTargetItem valtoappend = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem valtoappend = (expression(registerVars, inFunction, inMethod, true, variables)); switch (s.type) { case ASSIGN_BITAND: - ret = Action.gettoset(var, new BitAndActionItem(null, var, valtoappend)); + ret = Action.gettoset(var, new BitAndActionItem(null, var, valtoappend), variables); break; case ASSIGN_BITOR: - ret = Action.gettoset(var, new BitOrActionItem(null, var, valtoappend)); + ret = Action.gettoset(var, new BitOrActionItem(null, var, valtoappend), variables); break; case ASSIGN_DIVIDE: - ret = Action.gettoset(var, new DivideActionItem(null, var, valtoappend)); + ret = Action.gettoset(var, new DivideActionItem(null, var, valtoappend), variables); break; case ASSIGN_MINUS: - ret = Action.gettoset(var, new SubtractActionItem(null, var, valtoappend)); + ret = Action.gettoset(var, new SubtractActionItem(null, var, valtoappend), variables); break; case ASSIGN_MODULO: - ret = Action.gettoset(var, new ModuloActionItem(null, var, valtoappend)); + ret = Action.gettoset(var, new ModuloActionItem(null, var, valtoappend), variables); break; case ASSIGN_MULTIPLY: - ret = Action.gettoset(var, new MultiplyActionItem(null, var, valtoappend)); + ret = Action.gettoset(var, new MultiplyActionItem(null, var, valtoappend), variables); break; case ASSIGN_PLUS: - ret = Action.gettoset(var, new AddActionItem(null, var, valtoappend, true)); + ret = Action.gettoset(var, new AddActionItem(null, var, valtoappend, true), variables); break; } break; @@ -1099,11 +1094,11 @@ public class ActionScriptParser { case PARENT_OPEN: //function call ret = var; if (varS.type == SymbolType.SUPER || varS.type == SymbolType.THIS) { - List args = call(registerVars, inFunction, inMethod); + List args = call(registerVars, inFunction, inMethod, variables); ret = new CallMethodActionItem(null, ret, new DirectValueActionItem(null, 0, new Undefined(), constantPool), args); } else { lexer.pushback(s); - ret = memberOrCall(ret, registerVars, inFunction, inMethod); + ret = memberOrCall(ret, registerVars, inFunction, inMethod, variables); } break; default: @@ -1118,16 +1113,16 @@ public class ActionScriptParser { break; case IF: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem ifExpr = (expression(registerVars, inFunction, inMethod, true)); + GraphTargetItem ifExpr = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); - GraphTargetItem onTrue = command(registerVars, inFunction, inMethod, forinlevel, true); + GraphTargetItem onTrue = command(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(registerVars, inFunction, inMethod, forinlevel, true)); + onFalseList.add(command(registerVars, inFunction, inMethod, forinlevel, true, variables)); } else { lexer.pushback(s); } @@ -1136,19 +1131,19 @@ public class ActionScriptParser { case WHILE: expectedType(SymbolType.PARENT_OPEN); List whileExpr = new ArrayList<>(); - whileExpr.add(commaExpression(registerVars, inFunction, inMethod, forinlevel)); + whileExpr.add(commaExpression(registerVars, inFunction, inMethod, forinlevel, variables)); expectedType(SymbolType.PARENT_CLOSE); List whileBody = new ArrayList<>(); - whileBody.add(command(registerVars, inFunction, inMethod, forinlevel, true)); + whileBody.add(command(registerVars, inFunction, inMethod, forinlevel, true, variables)); ret = new WhileItem(null, null, whileExpr, whileBody); break; case DO: List doBody = new ArrayList<>(); - doBody.add(command(registerVars, inFunction, inMethod, forinlevel, true)); + doBody.add(command(registerVars, inFunction, inMethod, forinlevel, true, variables)); expectedType(SymbolType.WHILE); expectedType(SymbolType.PARENT_OPEN); List doExpr = new ArrayList<>(); - doExpr.add(commaExpression(registerVars, inFunction, inMethod, forinlevel)); + doExpr.add(commaExpression(registerVars, inFunction, inMethod, forinlevel, variables)); expectedType(SymbolType.PARENT_CLOSE); ret = new DoWhileItem(null, null, doBody, doExpr); break; @@ -1181,7 +1176,7 @@ public class ActionScriptParser { } } } - collection = expression(registerVars, inFunction, inMethod, true); + collection = expression(registerVars, inFunction, inMethod, true, variables); forin = true; } else { lexer.pushback(s3); @@ -1203,14 +1198,14 @@ public class ActionScriptParser { GraphTargetItem forExpr = null; List forFirstCommands = new ArrayList<>(); if (!forin) { - forFirstCommands.add((command(registerVars, inFunction, inMethod, forinlevel, true))); - forExpr = (expression(registerVars, inFunction, inMethod, true)); + forFirstCommands.add((command(registerVars, inFunction, inMethod, forinlevel, true, variables))); + forExpr = (expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.SEMICOLON); - forFinalCommands.add(command(registerVars, inFunction, inMethod, forinlevel, true)); + forFinalCommands.add(command(registerVars, inFunction, inMethod, forinlevel, true, variables)); } expectedType(SymbolType.PARENT_CLOSE); List forBody = new ArrayList<>(); - forBody.add(command(registerVars, inFunction, inMethod, forin ? forinlevel + 1 : forinlevel, true)); + forBody.add(command(registerVars, inFunction, inMethod, forin ? forinlevel + 1 : forinlevel, true, variables)); if (forin) { ret = new ForInActionItem(null, null, pushConst(objIdent), collection, forBody); } else { @@ -1219,7 +1214,7 @@ public class ActionScriptParser { break; case SWITCH: expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem switchExpr = expression(registerVars, inFunction, inMethod, true); + GraphTargetItem switchExpr = expression(registerVars, inFunction, inMethod, true, variables); expectedType(SymbolType.PARENT_CLOSE); expectedType(SymbolType.CURLY_OPEN); s = lex(); @@ -1240,7 +1235,7 @@ public class ActionScriptParser { while (s.type == SymbolType.CASE) { List caseExprs = new ArrayList<>(); while (s.type == SymbolType.CASE) { - GraphTargetItem curCaseExpr = expression(registerVars, inFunction, inMethod, true); + GraphTargetItem curCaseExpr = expression(registerVars, inFunction, inMethod, true, variables); caseExprs.add(curCaseExpr); expectedType(SymbolType.COLON); s = lex(); @@ -1249,14 +1244,14 @@ public class ActionScriptParser { } pos++; lexer.pushback(s); - List caseCmd = commands(registerVars, inFunction, inMethod, forinlevel); + List caseCmd = commands(registerVars, inFunction, inMethod, forinlevel, variables); caseCmds.add(caseCmd); s = lex(); } List defCmd = new ArrayList<>(); if (s.type == SymbolType.DEFAULT) { expectedType(SymbolType.COLON); - defCmd = commands(registerVars, inFunction, inMethod, forinlevel); + defCmd = commands(registerVars, inFunction, inMethod, forinlevel, variables); s = lexer.lex(); } expected(s, lexer.yyline(), SymbolType.CURLY_CLOSE); @@ -1269,7 +1264,7 @@ public class ActionScriptParser { ret = new ContinueItem(null, 0); //? There is no more than 1 level continue/break in AS1/2 break; case RETURN: - GraphTargetItem retexpr = expression(true, registerVars, inFunction, inMethod, true); + GraphTargetItem retexpr = expression(true, registerVars, inFunction, inMethod, true, variables); if (retexpr == null) { retexpr = new DirectValueActionItem(null, 0, new Undefined(), new ArrayList()); } @@ -1277,7 +1272,7 @@ public class ActionScriptParser { break; case TRY: List tryCommands = new ArrayList<>(); - tryCommands.add(command(registerVars, inFunction, inMethod, forinlevel, true)); + tryCommands.add(command(registerVars, inFunction, inMethod, forinlevel, true, variables)); s = lex(); boolean found = false; List> catchCommands = null; @@ -1290,7 +1285,7 @@ public class ActionScriptParser { expectedType(SymbolType.PARENT_CLOSE); catchCommands = new ArrayList<>(); List cc = new ArrayList<>(); - cc.add(command(registerVars, inFunction, inMethod, forinlevel, true)); + cc.add(command(registerVars, inFunction, inMethod, forinlevel, true, variables)); catchCommands.add(cc); s = lex(); found = true; @@ -1298,7 +1293,7 @@ public class ActionScriptParser { List finallyCommands = null; if (s.type == SymbolType.FINALLY) { finallyCommands = new ArrayList<>(); - finallyCommands.add(command(registerVars, inFunction, inMethod, forinlevel, true)); + finallyCommands.add(command(registerVars, inFunction, inMethod, forinlevel, true, variables)); found = true; s = lex(); } @@ -1309,10 +1304,10 @@ public class ActionScriptParser { ret = new TryActionItem(tryCommands, catchExceptions, catchCommands, finallyCommands); break; case THROW: - ret = new ThrowActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new ThrowActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); break; default: - GraphTargetItem valcmd = expressionCommands(s, registerVars, inFunction, inMethod, forinlevel); + GraphTargetItem valcmd = expressionCommands(s, registerVars, inFunction, inMethod, forinlevel, variables); if (valcmd != null) { ret = valcmd; break; @@ -1340,8 +1335,8 @@ public class ActionScriptParser { } - private GraphTargetItem expression(HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder) throws IOException, ParseException { - return expression(false, registerVars, inFunction, inMethod, allowRemainder); + 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 List expressionRemainder(GraphTargetItem expr, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder) throws IOException, ParseException { @@ -1365,75 +1360,75 @@ public class ActionScriptParser { return ret; } - private GraphTargetItem expressionRemainder(GraphTargetItem expr, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder) throws IOException, ParseException { + 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, false); + GraphTargetItem terOnTrue = expression(registerVars, inFunction, inMethod, false, variables); expectedType(SymbolType.COLON); - GraphTargetItem terOnFalse = expression(registerVars, inFunction, inMethod, false); + GraphTargetItem terOnFalse = expression(registerVars, inFunction, inMethod, false, variables); ret = new TernarOpItem(null, expr, terOnTrue, terOnFalse); break; case BITAND: - ret = new BitAndActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new BitAndActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case BITOR: - ret = new BitOrActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new BitOrActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case DIVIDE: - ret = new DivideActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new DivideActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case MODULO: - ret = new ModuloActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new ModuloActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case EQUALS: - ret = new EqActionItem(null, expr, expression(registerVars, inFunction, inMethod, false), true/*FIXME SWF version?*/); + ret = new EqActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables), true/*FIXME SWF version?*/); break; case STRICT_EQUALS: - ret = new StrictEqActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new StrictEqActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case NOT_EQUAL: - ret = new NeqActionItem(null, expr, expression(registerVars, inFunction, inMethod, false), true/*FIXME SWF version?*/); + ret = new NeqActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables), true/*FIXME SWF version?*/); break; case STRICT_NOT_EQUAL: - ret = new StrictNeqActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new StrictNeqActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case LOWER_THAN: - ret = new LtActionItem(null, expr, expression(registerVars, inFunction, inMethod, false), true/*FIXME SWF version?*/); + ret = new LtActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables), true/*FIXME SWF version?*/); break; case LOWER_EQUAL: - ret = new LeActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new LeActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case GREATER_THAN: - ret = new GtActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new GtActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case GREATER_EQUAL: - ret = new GeActionItem(null, expr, expression(registerVars, inFunction, inMethod, false), true/*FIXME SWF version?*/); + ret = new GeActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables), true/*FIXME SWF version?*/); break; case AND: - ret = new AndItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new AndItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case OR: - ret = new OrItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new OrItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case MINUS: - ret = new SubtractActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new SubtractActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case MULTIPLY: - ret = new MultiplyActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new MultiplyActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case PLUS: - ret = new AddActionItem(null, expr, expression(registerVars, inFunction, inMethod, false), true); + ret = new AddActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables), true); break; case XOR: - ret = new BitXorActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new BitXorActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case AS: break; case INSTANCEOF: - ret = new InstanceOfActionItem(null, expr, expression(registerVars, inFunction, inMethod, false)); + ret = new InstanceOfActionItem(null, expr, expression(registerVars, inFunction, inMethod, false, variables)); break; case IS: @@ -1445,7 +1440,7 @@ public class ActionScriptParser { return ret; } - private int brackets(List ret, HashMap registerVars, boolean inFunction, boolean inMethod) throws IOException, ParseException { + 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) { @@ -1456,7 +1451,7 @@ public class ActionScriptParser { lexer.pushback(s); } arrCnt++; - ret.add(expression(registerVars, inFunction, inMethod, true)); + 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); @@ -1469,12 +1464,12 @@ public class ActionScriptParser { return arrCnt; } - private GraphTargetItem commaExpression(HashMap registerVars, boolean inFunction, boolean inMethod, int forInLevel) throws IOException, ParseException { + private GraphTargetItem commaExpression(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(registerVars, inFunction, inMethod, forInLevel, false); + cmd = command(registerVars, inFunction, inMethod, forInLevel, false, variables); if (cmd != null) { expr.add(cmd); } @@ -1482,7 +1477,7 @@ public class ActionScriptParser { } while (s.type == SymbolType.COMMA && cmd != null); lexer.pushback(s); if (cmd == null) { - expr.add(expression(registerVars, inFunction, inMethod, true)); + expr.add(expression(registerVars, inFunction, inMethod, true, variables)); } else { if (!cmd.hasReturnValue()) { throw new ParseException("Expression expected", lexer.yyline()); @@ -1491,7 +1486,7 @@ public class ActionScriptParser { return new CommaExpressionItem(null, expr); } - private GraphTargetItem expression(boolean allowEmpty, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder) throws IOException, ParseException { + private GraphTargetItem expression(boolean allowEmpty, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, ParseException { if (debugMode) { System.out.println("expression:"); } @@ -1501,7 +1496,7 @@ public class ActionScriptParser { boolean assocRight = false; switch (s.type) { case MINUS: - GraphTargetItem num = expression(registerVars, inFunction, inMethod, true); + GraphTargetItem num = expression(registerVars, inFunction, inMethod, true, variables); if ((num instanceof DirectValueActionItem) && (((DirectValueActionItem) num).value instanceof Long)) { ((DirectValueActionItem) num).value = -(Long) ((DirectValueActionItem) num).value; @@ -1525,7 +1520,7 @@ public class ActionScriptParser { break; case TYPEOF: expectedType(SymbolType.PARENT_OPEN); - ret = new TypeOfActionItem(null, expression(registerVars, inFunction, inMethod, true)); + ret = new TypeOfActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); existsRemainder = true; break; @@ -1552,9 +1547,9 @@ public class ActionScriptParser { if (s.type != SymbolType.COMMA) { lexer.pushback(s); } - objectNames.add(expression(registerVars, inFunction, inMethod, true)); + objectNames.add(expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.COLON); - objectValues.add(expression(registerVars, inFunction, inMethod, true)); + objectValues.add(expression(registerVars, inFunction, inMethod, true, variables)); s = lex(); if (!s.isType(SymbolType.COMMA, SymbolType.CURLY_CLOSE)) { expected(s, lexer.yyline(), SymbolType.COMMA, SymbolType.CURLY_CLOSE); @@ -1565,7 +1560,7 @@ public class ActionScriptParser { case BRACKET_OPEN: //Array literal or just brackets lexer.pushback(s); List inBrackets = new ArrayList<>(); - int arrCnt = brackets(inBrackets, registerVars, inFunction, inMethod); + int arrCnt = brackets(inBrackets, registerVars, inFunction, inMethod, variables); ret = new InitArrayActionItem(null, inBrackets); break; case FUNCTION: @@ -1576,11 +1571,11 @@ public class ActionScriptParser { } else { lexer.pushback(s); } - ret = function(true, fname, false); + ret = function(true, fname, false, variables); break; case STRING: ret = pushConst(s.value.toString()); - ret = memberOrCall(ret, registerVars, inFunction, inMethod); + ret = memberOrCall(ret, registerVars, inFunction, inMethod, variables); existsRemainder = true; break; case NEWLINE: @@ -1601,7 +1596,7 @@ public class ActionScriptParser { existsRemainder = true; break; case DELETE: - GraphTargetItem varDel = variable(registerVars, inFunction, inMethod); + GraphTargetItem varDel = variable(registerVars, inFunction, inMethod, variables); if (varDel instanceof GetMemberActionItem) { GetMemberActionItem gm = (GetMemberActionItem) varDel; ret = new DeleteActionItem(null, gm.object, gm.memberName); @@ -1611,7 +1606,7 @@ public class ActionScriptParser { break; case INCREMENT: case DECREMENT: //preincrement - GraphTargetItem prevar = variable(registerVars, inFunction, inMethod); + GraphTargetItem prevar = variable(registerVars, inFunction, inMethod, variables); if (s.type == SymbolType.INCREMENT) { ret = new PreIncrementActionItem(null, prevar); } @@ -1621,24 +1616,24 @@ public class ActionScriptParser { existsRemainder = true; break; case NOT: - ret = new NotItem(null, expression(registerVars, inFunction, inMethod, true)); + 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)); + ret = new ParenthesisItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); - ret = memberOrCall(ret, registerVars, inFunction, inMethod); + ret = memberOrCall(ret, registerVars, inFunction, inMethod, variables); existsRemainder = true; break; case NEW: - GraphTargetItem newvar = variable(registerVars, inFunction, inMethod); + GraphTargetItem newvar = variable(registerVars, inFunction, inMethod, variables); expectedType(SymbolType.PARENT_OPEN); if (newvar instanceof GetMemberActionItem) { GetMemberActionItem mem = (GetMemberActionItem) newvar; - ret = new NewMethodActionItem(null, mem.object, mem.memberName, call(registerVars, inFunction, inMethod)); - } else if (newvar instanceof GetVariableActionItem) { - GetVariableActionItem gv = (GetVariableActionItem) newvar; - ret = new NewObjectActionItem(null, gv.name, call(registerVars, inFunction, inMethod)); + ret = new NewMethodActionItem(null, mem.object, mem.memberName, call(registerVars, inFunction, inMethod, variables)); + } else if (newvar instanceof VariableActionItem) { + //VariableActionItem gv = (VariableActionItem) newvar; + ret = new NewObjectActionItem(null, newvar, call(registerVars, inFunction, inMethod, variables)); } else { throw new ParseException("Invalid new item", lexer.yyline()); } @@ -1649,39 +1644,40 @@ public class ActionScriptParser { GraphTargetItem var; if (s.type == SymbolType.EVAL) { expectedType(SymbolType.PARENT_OPEN); - var = new EvalActionItem(null, expression(registerVars, inFunction, inMethod, true)); + var = new EvalActionItem(null, expression(registerVars, inFunction, inMethod, true, variables)); expectedType(SymbolType.PARENT_CLOSE); - var = memberOrCall(var, registerVars, inFunction, inMethod); + var = memberOrCall(var, registerVars, inFunction, inMethod, variables); } else { lexer.pushback(s); - var = variable(registerVars, inFunction, inMethod); + var = variable(registerVars, inFunction, inMethod, variables); } - GetVariableActionItem gva = null; + VariableActionItem gva = null; GetMemberActionItem gmb = null; RegisterNumber reg = null; - if (var instanceof GetVariableActionItem) { - gva = (GetVariableActionItem) var; + if (var instanceof VariableActionItem) { + gva = (VariableActionItem) var; } else if (var instanceof GetMemberActionItem) { gmb = (GetMemberActionItem) var; - } else if (var instanceof DirectValueActionItem) { - if (((DirectValueActionItem) var).value instanceof RegisterNumber) { - reg = (RegisterNumber) ((DirectValueActionItem) var).value; - } - } + } /*else if (var instanceof DirectValueActionItem) { + if (((DirectValueActionItem) var).value instanceof RegisterNumber) { + reg = (RegisterNumber) ((DirectValueActionItem) var).value; + } + }*/ s = lex(); switch (s.type) { case ASSIGN: - GraphTargetItem varval = expression(registerVars, inFunction, inMethod, true); + GraphTargetItem varval = expression(registerVars, inFunction, inMethod, true, variables); if (gva != null) { - ret = new SetVariableActionItem(null, gva.name, varval); + ret = new VariableActionItem(gva.getVariableName(), varval, false); + variables.add((VariableActionItem) ret); } else if (gmb != null) { ret = new SetMemberActionItem(null, gmb.object, gmb.memberName, varval); - } else if (reg != null) { - ret = new StoreRegisterActionItem(null, reg, varval, false); - } else { + } /*else if (reg != null) { + ret = new VariableActionItem(fname, varval, inFunction)StoreRegisterActionItem(null, reg, varval, false); + } */ else { throw new ParseException("Invalid assignment", lexer.yyline()); } existsRemainder = true; @@ -1700,54 +1696,61 @@ public class ActionScriptParser { if (gva == null && gmb == null) { throw new ParseException("Invalid assignment", lexer.yyline()); } - GraphTargetItem varval2 = expression(registerVars, inFunction, inMethod, true); + GraphTargetItem varval2 = expression(registerVars, inFunction, inMethod, true, variables); switch (s.type) { case ASSIGN_BITAND: if (gva != null) { - ret = new SetVariableActionItem(null, gva.name, new BitAndActionItem(null, gva, varval2)); + ret = new VariableActionItem(gva.getVariableName(), new BitAndActionItem(null, gva, varval2), false); + variables.add((VariableActionItem) ret); } else { ret = new SetMemberActionItem(null, gmb.object, gmb.memberName, new BitAndActionItem(null, gmb, varval2)); } break; case ASSIGN_BITOR: if (gva != null) { - ret = new SetVariableActionItem(null, gva.name, new BitOrActionItem(null, gva, varval2)); + ret = new VariableActionItem(gva.getVariableName(), new BitOrActionItem(null, gva, varval2), false); + variables.add((VariableActionItem) ret); } else { ret = new SetMemberActionItem(null, gmb.object, gmb.memberName, new BitOrActionItem(null, gmb, varval2)); } break; case ASSIGN_DIVIDE: if (gva != null) { - ret = new SetVariableActionItem(null, gva.name, new DivideActionItem(null, gva, varval2)); + ret = new VariableActionItem(gva.getVariableName(), new DivideActionItem(null, gva, varval2), false); + variables.add((VariableActionItem) ret); } else { ret = new SetMemberActionItem(null, gmb.object, gmb.memberName, new DivideActionItem(null, gmb, varval2)); } break; case ASSIGN_MINUS: if (gva != null) { - ret = new SetVariableActionItem(null, gva.name, new SubtractActionItem(null, gva, varval2)); + ret = new VariableActionItem(gva.getVariableName(), new SubtractActionItem(null, gva, varval2), false); + variables.add((VariableActionItem) ret); } else { ret = new SetMemberActionItem(null, gmb.object, gmb.memberName, new SubtractActionItem(null, gmb, varval2)); } break; case ASSIGN_MODULO: if (gva != null) { - ret = new SetVariableActionItem(null, gva.name, new ModuloActionItem(null, gva, varval2)); + ret = new VariableActionItem(gva.getVariableName(), new ModuloActionItem(null, gva, varval2), false); + variables.add((VariableActionItem) ret); } else { ret = new SetMemberActionItem(null, gmb.object, gmb.memberName, new ModuloActionItem(null, gmb, varval2)); } break; case ASSIGN_MULTIPLY: if (gva != null) { - ret = new SetVariableActionItem(null, gva.name, new MultiplyActionItem(null, gva, varval2)); + ret = new VariableActionItem(gva.getVariableName(), new MultiplyActionItem(null, gva, varval2), false); + variables.add((VariableActionItem) ret); } else { ret = new SetMemberActionItem(null, gmb.object, gmb.memberName, new MultiplyActionItem(null, gmb, varval2)); } break; case ASSIGN_PLUS: if (gva != null) { - ret = new SetVariableActionItem(null, gva.name, new AddActionItem(null, gva, varval2, true/*TODO:SWF version?*/)); + ret = new VariableActionItem(gva.getVariableName(), new AddActionItem(null, gva, varval2, true/*TODO:SWF version?*/), false); + variables.add((VariableActionItem) ret); } else { ret = new SetMemberActionItem(null, gmb.object, gmb.memberName, new AddActionItem(null, gmb, varval2, true/*TODO:SWF version?*/)); } @@ -1770,7 +1773,7 @@ public class ActionScriptParser { break; case PARENT_OPEN: //function call lexer.pushback(s); - ret = memberOrCall(var, registerVars, inFunction, inMethod); + ret = memberOrCall(var, registerVars, inFunction, inMethod, variables); existsRemainder = true; break; default: @@ -1781,7 +1784,7 @@ public class ActionScriptParser { } break; default: - GraphTargetItem excmd = expressionCommands(s, registerVars, inFunction, inMethod, -1); + GraphTargetItem excmd = expressionCommands(s, registerVars, inFunction, inMethod, -1, variables); if (excmd != null) { existsRemainder = true; //? ret = excmd; @@ -1792,7 +1795,7 @@ public class ActionScriptParser { if (allowRemainder && existsRemainder) { GraphTargetItem rem = ret; do { - rem = expressionRemainder(rem, registerVars, inFunction, inMethod, assocRight); + rem = expressionRemainder(rem, registerVars, inFunction, inMethod, assocRight, variables); if (rem != null) { ret = rem; } @@ -1819,7 +1822,22 @@ public class ActionScriptParser { List retTree = new ArrayList<>(); this.constantPool = constantPool; lexer = new ActionScriptLexer(new StringReader(str)); - retTree.addAll(commands(new HashMap(), false, false, 0)); + + List vars = new ArrayList<>(); + retTree.addAll(commands(new HashMap(), false, false, 0, vars)); + for (VariableActionItem v : vars) { + String varName = v.getVariableName(); + GraphTargetItem stored = v.getStoreValue(); + if (v.isDefinition()) { + v.setBoxedValue(new DefineLocalActionItem(null, pushConst(varName), stored)); + } else { + if (stored != null) { + v.setBoxedValue(new SetVariableActionItem(null, pushConst(varName), stored)); + } else { + v.setBoxedValue(new GetVariableActionItem(null, pushConst(varName))); + } + } + } if (lexer.lex().type != SymbolType.EOF) { throw new ParseException("Parsing finisned before end of the file", lexer.yyline()); } @@ -1830,7 +1848,7 @@ public class ActionScriptParser { ActionSourceGenerator gen = new ActionSourceGenerator(constantPool); List ret = new ArrayList<>(); SourceGeneratorLocalData localData = new SourceGeneratorLocalData( - new HashMap(), Boolean.FALSE, Boolean.FALSE, 0); + new HashMap(), 0, Boolean.FALSE, 0); List srcList = gen.generate(localData, tree); for (GraphSourceItem s : srcList) { if (s instanceof Action) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java index 21d833bb8..344f2383b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java @@ -455,11 +455,11 @@ public class ActionSourceGenerator implements SourceGenerator { localData.registerVars = value; } - public void setInFunction(SourceGeneratorLocalData localData, boolean value) { + public void setInFunction(SourceGeneratorLocalData localData, int value) { localData.inFunction = value; } - public boolean isInFunction(SourceGeneratorLocalData localData) { + public int isInFunction(SourceGeneratorLocalData localData) { return localData.inFunction; } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/parser/script/VariableActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/VariableActionItem.java new file mode 100644 index 000000000..379a092a3 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/VariableActionItem.java @@ -0,0 +1,130 @@ +/* + * 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.action.parser.script; + +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; +import com.jpexs.decompiler.flash.action.model.ActionItem; +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 VariableActionItem extends ActionItem { + + private ActionItem it; + + private String variableName; + private GraphTargetItem storeValue; + private boolean definition; + + public void setStoreValue(GraphTargetItem storeValue) { + this.storeValue = storeValue; + } + + + + public String getVariableName(){ + return variableName; + } + + + public VariableActionItem(String variableName, GraphTargetItem storeValue, boolean definition){ + this.variableName = variableName; + this.storeValue = storeValue; + this.definition = definition; + } + + public boolean isDefinition() { + return definition; + } + + + + public void setBoxedValue(ActionItem it) { + this.it = it; + } + + public ActionItem 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(it==null){ + return false; + }else{ + return it.hasReturnValue(); + } + } + + @Override + public boolean needsSemicolon() { + if(it==null){ + return super.needsSemicolon(); + } + return it.needsSemicolon(); + } + + + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf4/RegisterNumber.java b/trunk/src/com/jpexs/decompiler/flash/action/swf4/RegisterNumber.java index ebe25e845..8d8a58e81 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf4/RegisterNumber.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf4/RegisterNumber.java @@ -46,8 +46,12 @@ public class RegisterNumber implements Serializable { return true; } - public RegisterNumber(int number) { + public RegisterNumber(int number,String name) { this.number = number; + this.name = name; + } + public RegisterNumber(int number) { + this(number,null); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java b/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java index bc30d06a8..2bf06a2d3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.FunctionActionItem; import com.jpexs.decompiler.flash.action.parser.ParseException; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; +import com.jpexs.decompiler.flash.action.parser.script.VariableActionItem; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.ExportMode; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -202,7 +203,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta @Override public void translateContainer(List> content, Stack stack, List output, HashMap regNames, HashMap variables, HashMap functions) { - FunctionActionItem fti = new FunctionActionItem(this, functionName, paramNames, content.get(0), constantPool, 1); + FunctionActionItem fti = new FunctionActionItem(this, functionName, paramNames, content.get(0), constantPool, 1,new ArrayList()); //ActionGraph.translateViaGraph(regNames, variables, functions, code, version) stack.push(fti); functions.put(functionName, fti); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java b/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java index c9d24a9e4..dda52888f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.FunctionActionItem; import com.jpexs.decompiler.flash.action.parser.ParseException; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; +import com.jpexs.decompiler.flash.action.parser.script.VariableActionItem; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.ExportMode; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -341,7 +342,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont @Override public void translateContainer(List> content, Stack stack, List output, HashMap regNames, HashMap variables, HashMap functions) { - FunctionActionItem fti = new FunctionActionItem(this, functionName, paramNames, content.get(0), constantPool, getFirstRegister()); + FunctionActionItem fti = new FunctionActionItem(this, functionName, paramNames, content.get(0), constantPool, getFirstRegister(),new ArrayList()); functions.put(functionName, fti); stack.push(fti); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index f38d425d6..48aed6bbc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -19,19 +19,25 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.exporters.Matrix; +import com.jpexs.decompiler.flash.exporters.Point; import com.jpexs.decompiler.flash.tags.base.CharacterTag; +import com.jpexs.decompiler.flash.tags.base.DrawableTag; +import com.jpexs.decompiler.flash.tags.base.FontTag; import com.jpexs.decompiler.flash.tags.base.MissingCharacterHandler; import com.jpexs.decompiler.flash.tags.base.TextTag; import com.jpexs.decompiler.flash.tags.text.ParseException; import com.jpexs.decompiler.flash.tags.text.ParsedSymbol; import com.jpexs.decompiler.flash.tags.text.TextLexer; import com.jpexs.decompiler.flash.types.BasicType; +import com.jpexs.decompiler.flash.types.GLYPHENTRY; import com.jpexs.decompiler.flash.types.MATRIX; import com.jpexs.decompiler.flash.types.RECT; import com.jpexs.decompiler.flash.types.RGBA; +import com.jpexs.decompiler.flash.types.TEXTRECORD; import com.jpexs.decompiler.flash.types.annotations.Conditional; import com.jpexs.decompiler.flash.types.annotations.SWFType; -import java.awt.geom.GeneralPath; +import com.jpexs.helpers.SerializableImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -53,7 +59,7 @@ import java.util.regex.Pattern; * * @author JPEXS */ -public class DefineEditTextTag extends TextTag { +public class DefineEditTextTag extends TextTag implements DrawableTag { @SWFType(BasicType.UI16) public int characterID; @@ -609,8 +615,86 @@ public class DefineEditTextTag extends TextTag { return needed; } - //@Override - public List getPaths(List tags) { - return null; //FIXME + @Override + public SerializableImage toImage(int frame, List tags, Map characters, Stack visited, Matrix transformation) { + throw new Error("this overload of toImage call is not supported on BoundedTag"); + } + + @Override + public void toImage(int frame, List tags, Map characters, Stack visited, SerializableImage image, Matrix transformation) { + FontTag font = null; + for (Tag tag : tags) { + if (tag instanceof FontTag) { + if (((FontTag) tag).getFontId() == fontId) { + font = (FontTag) tag; + } + } + } + if (hasText) { + List textRecords = new ArrayList<>(); + TEXTRECORD tr = new TEXTRECORD(); + tr.styleFlagsHasFont = true; + tr.fontId = fontId; + tr.textHeight = fontHeight; + tr.styleFlagsHasYOffset = true; + tr.yOffset = fontHeight; + String txt; + if (html) { + txt = getInnerText(initialText); + } else { + txt = initialText; + } + tr.glyphEntries = new GLYPHENTRY[txt.length()]; + for (int i = 0; i < txt.length(); i++) { + char c = txt.charAt(i); + Character nextChar = null; + if (i + 1 < txt.length()) { + nextChar = txt.charAt(i + 1); + } + int advance; + tr.glyphEntries[i] = new GLYPHENTRY(); + tr.glyphEntries[i].glyphIndex = font.charToGlyph(tags, c); + if (font.hasLayout()) { + int kerningAdjustment = 0; + if (nextChar != null) { + kerningAdjustment = font.getGlyphKerningAdjustment(tags, tr.glyphEntries[i].glyphIndex, font.charToGlyph(tags, nextChar)); + kerningAdjustment /= font.getDivider(); + } + advance = (int) Math.round(font.getDivider() * Math.round((double) fontHeight * (font.getGlyphAdvance(tr.glyphEntries[i].glyphIndex) + kerningAdjustment) / (font.getDivider() * 1024.0))); + } else { + String fontName = FontTag.defaultFontName; + advance = (int) Math.round(SWF.unitDivisor * FontTag.getSystemFontAdvance(fontName, font.getFontStyle(), (int) (fontHeight / SWF.unitDivisor), c, nextChar)); + } + tr.glyphEntries[i].glyphAdvance = advance; + } + textRecords.add(tr); + staticTextToImage(swf, characters, textRecords, bounds, 1, image, transformation); + } + } + + private String getInnerText(String html) { + String result = ""; + boolean inTag = false; + for (int i = 0; i < html.length(); i++) { + char c = html.charAt(i); + if (c == '<') { + inTag = true; + } else if (inTag && c == '>') { + inTag = false; + } else if (!inTag) { + result += c; + } + } + return result; + } + + @Override + public Point getImagePos(int frame, Map characters, Stack visited) { + return new Point(bounds.Xmin / SWF.unitDivisor, bounds.Ymin / SWF.unitDivisor); + } + + @Override + public int getNumFrames() { + return 1; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/BoundedTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/BoundedTag.java index 81597d6bc..f93990700 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/BoundedTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/BoundedTag.java @@ -27,5 +27,4 @@ import java.util.Stack; public interface BoundedTag { public RECT getRect(Map characters, Stack visited); - //public List getPaths(List tags); } diff --git a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java index 0389b8ae4..979cc4b8d 100644 --- a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -113,7 +113,7 @@ public abstract class GraphTargetItem implements Serializable { return writer; } - protected abstract GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException; + public abstract GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException; public String toString(LocalData localData) throws InterruptedException { HilightedTextWriter writer = new HilightedTextWriter(false); @@ -165,7 +165,7 @@ public abstract class GraphTargetItem implements Serializable { return writer; } - protected GraphTextWriter appendToNoQuotes(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendToNoQuotes(GraphTextWriter writer, LocalData localData) throws InterruptedException { return toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/graph/MarkItem.java b/trunk/src/com/jpexs/decompiler/graph/MarkItem.java index 994b95280..a40be3409 100644 --- a/trunk/src/com/jpexs/decompiler/graph/MarkItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/MarkItem.java @@ -34,7 +34,7 @@ public class MarkItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("//" + AppStrings.translate("decompilerMark") + ":" + mark); } diff --git a/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java b/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java index 86f6f346d..7f28819d0 100644 --- a/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java @@ -47,7 +47,7 @@ public class NotCompileTimeItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return object.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java index 08500802f..5ceaca95b 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java @@ -48,7 +48,7 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (leftSide.getPrecedence() > precedence) { writer.append("("); leftSide.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java index 01ff73a89..9a3c625c0 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java @@ -38,7 +38,7 @@ public class BlockItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("{").newLine(); writer.indent(); Graph.graphToString(commands, writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java index bf5a14125..f7a3b50b7 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java @@ -39,7 +39,7 @@ public class BreakItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("break"); if (writer instanceof NulWriter) { NulWriter nulWriter = (NulWriter) writer; diff --git a/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java b/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java index 301950bdf..bf27245f1 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java @@ -37,7 +37,7 @@ public class CommaExpressionItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean first = true; for (GraphTargetItem t : commands) { if (!first) { diff --git a/trunk/src/com/jpexs/decompiler/graph/model/CommentItem.java b/trunk/src/com/jpexs/decompiler/graph/model/CommentItem.java index 6499b147e..5749b3e38 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/CommentItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/CommentItem.java @@ -38,7 +38,7 @@ public class CommentItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("/* "); for (int i = 0; i < commentLines.length; i++) { writer.append(commentLines[i]); diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java index 3e9404880..f5fd5ba12 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java @@ -39,7 +39,7 @@ public class ContinueItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("continue"); if (writer instanceof NulWriter) { NulWriter nulWriter = (NulWriter) writer; diff --git a/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java b/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java index 9512940e0..1e1d30fb3 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java @@ -53,7 +53,7 @@ public class DoWhileItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java b/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java index e7afc6f98..f065bbc7e 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java @@ -41,7 +41,7 @@ public class DuplicateItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java index abc539382..b3f71b05b 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java @@ -54,7 +54,7 @@ public class ForItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java b/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java index 180b53c37..4ab699a92 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java @@ -57,7 +57,7 @@ public class IfItem extends GraphTargetItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { GraphTargetItem expr = expression; List ifBranch = onTrue; List elseBranch = onFalse; diff --git a/trunk/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java b/trunk/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java index 7d70d019b..263c2d3cb 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java @@ -35,7 +35,7 @@ public class IntegerValueItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("" + intValue); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java index 6b043e705..acd9aca8a 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java @@ -35,7 +35,7 @@ public class ParenthesisItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ScriptEndItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ScriptEndItem.java index 7c9f509ad..7d05aca4a 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ScriptEndItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ScriptEndItem.java @@ -30,7 +30,7 @@ public class ScriptEndItem extends GraphTargetItem implements ExitItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer; } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java b/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java index 2fd9d5b6c..8f16cfebe 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java @@ -60,7 +60,7 @@ public class SwitchItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_SWITCH); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java index 02c0c4b49..31b96a384 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java @@ -37,7 +37,7 @@ public class TernarOpItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { expression.toString(writer, localData); writer.append("?"); onTrue.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/graph/model/TrueItem.java b/trunk/src/com/jpexs/decompiler/graph/model/TrueItem.java index 9c10fa180..32dbc38e3 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/TrueItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/TrueItem.java @@ -31,7 +31,7 @@ public class TrueItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { return writer.append("true"); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java index 683e49d33..edc825d92 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java @@ -35,7 +35,7 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append(operator); if (value != null) { if (value.getPrecedence() > precedence) { diff --git a/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java b/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java index aca9985f6..378718ffe 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java @@ -45,7 +45,7 @@ public class UniversalLoopItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java b/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java index 04526a834..f0044923d 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java @@ -48,7 +48,7 @@ public class WhileItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); }