From d1a0c1d4638cb84c63fbfa14809071311c736b49 Mon Sep 17 00:00:00 2001 From: Honfika Date: Sun, 25 Aug 2013 15:17:58 +0200 Subject: [PATCH] highlight parameter added --- .../decompiler/flash/SWFInputStream.java | 2 +- .../com/jpexs/decompiler/flash/TagNode.java | 4 +-- .../decompiler/flash/abc/avm2/AVM2Code.java | 24 +++++++-------- .../decompiler/flash/abc/avm2/CodeStats.java | 4 +-- .../avm2/instructions/AVM2Instruction.java | 2 +- .../construction/NewClassIns.java | 2 +- .../avm2/instructions/other/SetSuperIns.java | 2 +- .../flash/abc/avm2/model/AVM2Item.java | 24 +++++++-------- .../abc/avm2/model/AlchemyLoadAVM2Item.java | 4 +-- .../avm2/model/AlchemySignExtendAVM2Item.java | 4 +-- .../abc/avm2/model/AlchemyStoreAVM2Item.java | 4 +-- .../abc/avm2/model/ApplyTypeAVM2Item.java | 10 +++---- .../flash/abc/avm2/model/BooleanAVM2Item.java | 4 +-- .../flash/abc/avm2/model/CallAVM2Item.java | 10 +++---- .../abc/avm2/model/CallMethodAVM2Item.java | 6 ++-- .../abc/avm2/model/CallPropertyAVM2Item.java | 8 ++--- .../abc/avm2/model/CallStaticAVM2Item.java | 6 ++-- .../abc/avm2/model/CallSuperAVM2Item.java | 8 ++--- .../flash/abc/avm2/model/ClassAVM2Item.java | 2 +- .../flash/abc/avm2/model/CoerceAVM2Item.java | 6 ++-- .../abc/avm2/model/ConstructAVM2Item.java | 10 +++---- .../abc/avm2/model/ConstructPropAVM2Item.java | 8 ++--- .../avm2/model/ConstructSuperAVM2Item.java | 8 ++--- .../flash/abc/avm2/model/ConvertAVM2Item.java | 4 +-- .../abc/avm2/model/DecLocalAVM2Item.java | 4 +-- .../abc/avm2/model/DecrementAVM2Item.java | 4 +-- .../abc/avm2/model/DefaultXMLNamespace.java | 4 +-- .../abc/avm2/model/EscapeXAttrAVM2Item.java | 4 +-- .../abc/avm2/model/EscapeXElemAVM2Item.java | 4 +-- .../abc/avm2/model/FilteredCheckAVM2Item.java | 4 +-- .../abc/avm2/model/FindPropertyAVM2Item.java | 2 +- .../abc/avm2/model/FloatValueAVM2Item.java | 4 +-- .../abc/avm2/model/FullMultinameAVM2Item.java | 12 ++++---- .../avm2/model/GetDescendantsAVM2Item.java | 4 +-- .../flash/abc/avm2/model/GetLexAVM2Item.java | 4 +-- .../abc/avm2/model/GetPropertyAVM2Item.java | 4 +-- .../flash/abc/avm2/model/GetSlotAVM2Item.java | 6 ++-- .../abc/avm2/model/GetSuperAVM2Item.java | 6 ++-- .../flash/abc/avm2/model/HasNextAVM2Item.java | 4 +-- .../flash/abc/avm2/model/InAVM2Item.java | 4 +-- .../abc/avm2/model/IncLocalAVM2Item.java | 4 +-- .../abc/avm2/model/IncrementAVM2Item.java | 4 +-- .../abc/avm2/model/InitPropertyAVM2Item.java | 4 +-- .../abc/avm2/model/IntegerValueAVM2Item.java | 4 +-- .../abc/avm2/model/LocalRegAVM2Item.java | 6 ++-- .../abc/avm2/model/NameSpaceAVM2Item.java | 4 +-- .../flash/abc/avm2/model/NameValuePair.java | 6 ++-- .../flash/abc/avm2/model/NanAVM2Item.java | 4 +-- .../abc/avm2/model/NewActivationAVM2Item.java | 4 +-- .../abc/avm2/model/NewArrayAVM2Item.java | 6 ++-- .../abc/avm2/model/NewFunctionAVM2Item.java | 4 +-- .../abc/avm2/model/NewObjectAVM2Item.java | 8 ++--- .../abc/avm2/model/NextNameAVM2Item.java | 4 +-- .../abc/avm2/model/NextValueAVM2Item.java | 4 +-- .../flash/abc/avm2/model/NullAVM2Item.java | 4 +-- .../abc/avm2/model/PostDecrementAVM2Item.java | 4 +-- .../abc/avm2/model/PostIncrementAVM2Item.java | 4 +-- .../abc/avm2/model/ReturnValueAVM2Item.java | 6 ++-- .../abc/avm2/model/ReturnVoidAVM2Item.java | 4 +-- .../flash/abc/avm2/model/ScriptAVM2Item.java | 2 +- .../abc/avm2/model/SetGlobalSlotAVM2Item.java | 4 +-- .../abc/avm2/model/SetLocalAVM2Item.java | 4 +-- .../abc/avm2/model/SetPropertyAVM2Item.java | 4 +-- .../flash/abc/avm2/model/SetSlotAVM2Item.java | 8 ++--- .../abc/avm2/model/SetSuperAVM2Item.java | 6 ++-- .../flash/abc/avm2/model/StringAVM2Item.java | 4 +-- .../flash/abc/avm2/model/ThisAVM2Item.java | 2 +- .../flash/abc/avm2/model/ThrowAVM2Item.java | 4 +-- .../abc/avm2/model/UndefinedAVM2Item.java | 4 +-- .../abc/avm2/model/UnparsedAVM2Item.java | 2 +- .../flash/abc/avm2/model/WithAVM2Item.java | 6 ++-- .../flash/abc/avm2/model/WithEndAVM2Item.java | 4 +-- .../abc/avm2/model/WithObjectAVM2Item.java | 2 +- .../flash/abc/avm2/model/XMLAVM2Item.java | 4 +-- .../model/clauses/DeclarationAVM2Item.java | 8 ++--- .../avm2/model/clauses/ExceptionAVM2Item.java | 2 +- .../avm2/model/clauses/FilterAVM2Item.java | 4 +-- .../avm2/model/clauses/ForEachInAVM2Item.java | 8 ++--- .../abc/avm2/model/clauses/ForInAVM2Item.java | 8 ++--- .../abc/avm2/model/clauses/TryAVM2Item.java | 8 ++--- .../avm2/model/operations/AddAVM2Item.java | 12 ++++---- .../operations/DeletePropertyAVM2Item.java | 4 +-- .../model/operations/SubtractAVM2Item.java | 12 ++++---- .../flash/abc/types/MethodBody.java | 2 +- .../abc/types/traits/TraitSlotConst.java | 2 +- .../jpexs/decompiler/flash/action/Action.java | 22 +++++++------- .../flash/action/model/ActionItem.java | 19 ++++++------ .../action/model/AsciiToCharActionItem.java | 4 +-- .../flash/action/model/CallActionItem.java | 4 +-- .../action/model/CallFunctionActionItem.java | 8 ++--- .../action/model/CallMethodActionItem.java | 12 ++++---- .../flash/action/model/CastOpActionItem.java | 4 +-- .../action/model/CharToAsciiActionItem.java | 4 +-- .../action/model/CloneSpriteActionItem.java | 4 +-- .../action/model/DecrementActionItem.java | 4 +-- .../action/model/DefineLocalActionItem.java | 6 ++-- .../model/DefineRegisterActionItem.java | 2 +- .../flash/action/model/DeleteActionItem.java | 6 ++-- .../action/model/DirectValueActionItem.java | 26 ++++++++-------- .../action/model/EnumerateActionItem.java | 4 +-- .../flash/action/model/EvalActionItem.java | 4 +-- .../flash/action/model/ExtendsActionItem.java | 4 +-- .../action/model/FSCommand2ActionItem.java | 6 ++-- .../action/model/FSCommandActionItem.java | 4 +-- .../action/model/FunctionActionItem.java | 14 ++++----- .../action/model/GetMemberActionItem.java | 6 ++-- .../action/model/GetPropertyActionItem.java | 6 ++-- .../flash/action/model/GetTimeActionItem.java | 4 +-- .../flash/action/model/GetURL2ActionItem.java | 4 +-- .../flash/action/model/GetURLActionItem.java | 4 +-- .../action/model/GetVariableActionItem.java | 4 +-- .../action/model/GetVersionActionItem.java | 4 +-- .../action/model/GotoFrame2ActionItem.java | 4 +-- .../action/model/GotoFrameActionItem.java | 4 +-- .../action/model/GotoLabelActionItem.java | 4 +-- .../action/model/ImplementsOpActionItem.java | 6 ++-- .../action/model/IncrementActionItem.java | 4 +-- .../action/model/InitArrayActionItem.java | 8 ++--- .../action/model/InitObjectActionItem.java | 10 +++---- .../action/model/LoadMovieActionItem.java | 4 +-- .../action/model/LoadMovieNumActionItem.java | 4 +-- .../action/model/LoadVariablesActionItem.java | 4 +-- .../model/LoadVariablesNumActionItem.java | 4 +-- .../action/model/MBAsciiToCharActionItem.java | 4 +-- .../action/model/MBCharToAsciiActionItem.java | 4 +-- .../model/MBStringExtractActionItem.java | 4 +-- .../model/MBStringLengthActionItem.java | 6 ++-- .../action/model/NewMethodActionItem.java | 14 ++++----- .../action/model/NewObjectActionItem.java | 6 ++-- .../action/model/NextFrameActionItem.java | 4 +-- .../flash/action/model/PlayActionItem.java | 4 +-- .../flash/action/model/PopActionItem.java | 2 +- .../action/model/PostDecrementActionItem.java | 4 +-- .../action/model/PostIncrementActionItem.java | 4 +-- .../action/model/PrevFrameActionItem.java | 4 +-- .../flash/action/model/PrintActionItem.java | 4 +-- .../action/model/PrintAsBitmapActionItem.java | 4 +-- .../model/PrintAsBitmapNumActionItem.java | 4 +-- .../action/model/PrintNumActionItem.java | 4 +-- .../action/model/RandomNumberActionItem.java | 4 +-- .../action/model/RemoveSpriteActionItem.java | 4 +-- .../flash/action/model/ReturnActionItem.java | 4 +-- .../action/model/SetMemberActionItem.java | 6 ++-- .../action/model/SetPropertyActionItem.java | 6 ++-- .../action/model/SetTarget2ActionItem.java | 4 +-- .../action/model/SetTargetActionItem.java | 4 +-- .../action/model/SetVariableActionItem.java | 6 ++-- .../action/model/StartDragActionItem.java | 4 +-- .../flash/action/model/StopActionItem.java | 4 +-- .../action/model/StopAllSoundsActionItem.java | 4 +-- .../action/model/StopDragActionItem.java | 4 +-- .../action/model/StoreRegisterActionItem.java | 4 +-- .../action/model/StrictModeActionItem.java | 2 +- .../action/model/StringExtractActionItem.java | 4 +-- .../action/model/StringLengthActionItem.java | 4 +-- .../action/model/TargetPathActionItem.java | 4 +-- .../flash/action/model/TemporaryRegister.java | 4 +-- .../flash/action/model/ThrowActionItem.java | 4 +-- .../action/model/ToIntegerActionItem.java | 4 +-- .../action/model/ToNumberActionItem.java | 4 +-- .../action/model/ToStringActionItem.java | 4 +-- .../model/ToggleHighQualityActionItem.java | 4 +-- .../flash/action/model/TraceActionItem.java | 4 +-- .../flash/action/model/TypeOfActionItem.java | 4 +-- .../action/model/UnLoadMovieActionItem.java | 4 +-- .../model/UnLoadMovieNumActionItem.java | 4 +-- .../action/model/UnsupportedActionItem.java | 2 +- .../action/model/clauses/ClassActionItem.java | 24 +++++++-------- .../action/model/clauses/ForInActionItem.java | 8 ++--- .../clauses/IfFrameLoadedActionItem.java | 4 +-- .../model/clauses/InterfaceActionItem.java | 6 ++-- .../model/clauses/TellTargetActionItem.java | 8 ++--- .../action/model/clauses/TryActionItem.java | 12 ++++---- .../action/model/clauses/WithActionItem.java | 8 ++--- .../model/operations/AddActionItem.java | 12 ++++---- .../model/operations/SubtractActionItem.java | 12 ++++---- .../parser/script/ActionScriptParser.java | 4 +-- .../flash/action/swf4/ActionGetVariable.java | 2 +- .../flash/action/swf4/ActionPush.java | 22 ++++++++------ .../flash/action/swf4/ActionSetVariable.java | 4 +-- .../flash/action/swf5/ActionCallFunction.java | 2 +- .../action/swf5/ActionDefineFunction.java | 2 +- .../flash/action/swf5/ActionDefineLocal.java | 2 +- .../action/swf7/ActionDefineFunction2.java | 2 +- .../flash/gui/abc/ASMSourceEditorPane.java | 2 +- .../flash/gui/action/ActionPanel.java | 4 +-- .../flash/helpers/Highlighting.java | 8 ++--- .../flash/tags/DefineButtonTag.java | 4 +-- .../decompiler/flash/tags/DoActionTag.java | 4 +-- .../flash/tags/DoInitActionTag.java | 4 +-- .../decompiler/flash/tags/base/ASMSource.java | 2 +- .../flash/types/BUTTONCONDACTION.java | 4 +-- .../flash/types/CLIPACTIONRECORD.java | 4 +-- .../decompiler/flash/xfl/XFLConverter.java | 4 +-- .../src/com/jpexs/decompiler/graph/Graph.java | 4 +-- .../decompiler/graph/GraphTargetItem.java | 30 +++++++++---------- .../com/jpexs/decompiler/graph/MarkItem.java | 2 +- .../decompiler/graph/NotCompileTimeItem.java | 4 +-- .../decompiler/graph/model/BinaryOpItem.java | 12 ++++---- .../decompiler/graph/model/BlockItem.java | 4 +-- .../decompiler/graph/model/BreakItem.java | 4 +-- .../graph/model/CommaExpressionItem.java | 4 +-- .../decompiler/graph/model/CommentItem.java | 2 +- .../decompiler/graph/model/ContinueItem.java | 4 +-- .../decompiler/graph/model/DoWhileItem.java | 10 +++---- .../decompiler/graph/model/DuplicateItem.java | 4 +-- .../jpexs/decompiler/graph/model/ForItem.java | 16 +++++----- .../jpexs/decompiler/graph/model/IfItem.java | 14 ++++----- .../graph/model/IntegerValueItem.java | 4 +-- .../graph/model/ParenthesisItem.java | 4 +-- .../decompiler/graph/model/ScriptEndItem.java | 2 +- .../decompiler/graph/model/SwitchItem.java | 14 ++++----- .../decompiler/graph/model/TernarOpItem.java | 4 +-- .../decompiler/graph/model/TrueItem.java | 2 +- .../decompiler/graph/model/UnaryOpItem.java | 6 ++-- .../graph/model/UniversalLoopItem.java | 8 ++--- .../decompiler/graph/model/WhileItem.java | 10 +++---- trunk/src/com/jpexs/helpers/Helper.java | 4 +-- 218 files changed, 622 insertions(+), 621 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 0b8add2bd..cbb344a8a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -884,7 +884,7 @@ public class SWFInputStream extends InputStream { HashMap vars = (HashMap) localData.get(1); System.err.print("variables: "); for (Entry v : vars.entrySet()) { - System.err.print("'" + v + "' = " + Highlighting.stripHilights(v.getValue().toString(cpool)) + ", "); + System.err.print("'" + v + "' = " + v.getValue().toString(false, cpool) + ", "); } System.err.println(); String add = ""; diff --git a/trunk/src/com/jpexs/decompiler/flash/TagNode.java b/trunk/src/com/jpexs/decompiler/flash/TagNode.java index 9ccec497b..236f108ea 100644 --- a/trunk/src/com/jpexs/decompiler/flash/TagNode.java +++ b/trunk/src/com/jpexs/decompiler/flash/TagNode.java @@ -298,11 +298,11 @@ public class TagNode { String res; ASMSource asm = ((ASMSource) node.tag); if (isPcode) { - res = asm.getActionSourcePrefix() + Helper.indentRows(asm.getActionSourceIndent(), Highlighting.stripHilights(asm.getASMSource(SWF.DEFAULT_VERSION, false)), Graph.INDENT_STRING) + asm.getActionSourceSuffix(); + res = asm.getActionSourcePrefix() + Helper.indentRows(asm.getActionSourceIndent(), asm.getASMSource(SWF.DEFAULT_VERSION, false, false), Graph.INDENT_STRING) + asm.getActionSourceSuffix(); } else { List as = asm.getActions(SWF.DEFAULT_VERSION); Action.setActionsAddresses(as, 0, SWF.DEFAULT_VERSION); - res = asm.getActionSourcePrefix() + Helper.indentRows(asm.getActionSourceIndent(), Highlighting.stripHilights(Action.actionsToSource(as, SWF.DEFAULT_VERSION, ""/*FIXME*/)), Graph.INDENT_STRING) + asm.getActionSourceSuffix(); + res = asm.getActionSourcePrefix() + Helper.indentRows(asm.getActionSourceIndent(), Action.actionsToSource(as, SWF.DEFAULT_VERSION, ""/*FIXME*/, false), Graph.INDENT_STRING) + asm.getActionSourceSuffix(); } try (FileOutputStream fos = new FileOutputStream(f)) { fos.write(res.getBytes("utf-8")); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 9d3bd5181..e554d1290 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -702,24 +702,24 @@ public class AVM2Code implements Serializable { return s.toString(); } - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { StringBuilder s = new StringBuilder(); int i = 0; for (AVM2Instruction instruction : code) { s.append(Helper.formatAddress(i)); s.append(" "); - s.append(instruction.toString(constants, new ArrayList())); + s.append(instruction.toString(highlight, constants, new ArrayList())); s.append("\r\n"); i++; } return s.toString(); } - public String toASMSource(ConstantPool constants, MethodBody body, boolean hex) { - return toASMSource(constants, body, new ArrayList(), hex); + public String toASMSource(ConstantPool constants, MethodBody body, boolean hex, boolean highlight) { + return toASMSource(constants, body, new ArrayList(), hex, highlight); } - public String toASMSource(ConstantPool constants, MethodBody body, List outputMap, boolean hex) { + public String toASMSource(ConstantPool constants, MethodBody body, List outputMap, boolean hex, boolean highlight) { invalidateCache(); StringBuffer ret = new StringBuffer(); String t = ""; @@ -776,7 +776,8 @@ public class AVM2Code implements Serializable { if (ins2.isIgnored()) { continue; } - t = Highlighting.hilighOffset("", ins2.mappedOffset > -1 ? ins2.mappedOffset : ofs) + ins2.toStringNoAddress(constants, new ArrayList()) + " ;copy from " + Helper.formatAddress(pos2adr((Integer) o)) + "\n"; + t = highlight ? Highlighting.hilighOffset("", ins2.mappedOffset > -1 ? ins2.mappedOffset : ofs) : ""; + t += ins2.toStringNoAddress(constants, new ArrayList()) + " ;copy from " + Helper.formatAddress(pos2adr((Integer) o)) + "\n"; ret.append(t); outputMap.add((Integer) o); } else if (o instanceof ControlFlowTag) { @@ -814,7 +815,7 @@ public class AVM2Code implements Serializable { } } if (markOffsets) { - t = Highlighting.hilighOffset("", ins.mappedOffset > -1 ? ins.mappedOffset : ofs) + t + "\n"; + t = (highlight ? Highlighting.hilighOffset("", ins.mappedOffset > -1 ? ins.mappedOffset : ofs) : "") + t + "\n"; } else { t = t + "\n"; } @@ -1374,10 +1375,7 @@ public class AVM2Code implements Serializable { list.remove(lastPos); } - s = Graph.graphToString(list, constants, localRegNames, fullyQualifiedNames); - if (!hilighted) { - return Highlighting.stripHilights(s); - } + s = Graph.graphToString(list, hilighted, constants, localRegNames, fullyQualifiedNames); return s; } @@ -1958,7 +1956,7 @@ public class AVM2Code implements Serializable { invalidateCache(); try { List outputMap = new ArrayList<>(); - String src = Highlighting.stripHilights(toASMSource(constants, body, outputMap, false)); + String src = toASMSource(constants, body, outputMap, false, false); AVM2Code acode = ASM3Parser.parse(new ByteArrayInputStream(src.getBytes("UTF-8")), constants, null, body); for (int i = 0; i < acode.code.size(); i++) { @@ -1998,7 +1996,7 @@ public class AVM2Code implements Serializable { public void removeIgnored(ConstantPool constants, MethodBody body) { try { List outputMap = new ArrayList<>(); - String src = toASMSource(constants, body, outputMap, false); + String src = toASMSource(constants, body, outputMap, false, false); AVM2Code acode = ASM3Parser.parse(new ByteArrayInputStream(src.getBytes("UTF-8")), constants, body); for (int i = 0; i < acode.code.size(); i++) { if (outputMap.size() > i) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/CodeStats.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/CodeStats.java index 121656abb..7ae63b260 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/CodeStats.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/CodeStats.java @@ -32,7 +32,7 @@ public class CodeStats { public boolean has_activation = false; public InstructionStats instructionStats[]; - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(boolean highlight, ABC abc, List fullyQualifiedNames) { String ret = "Stats: maxstack=" + maxstack + ", maxscope=" + maxscope + ", maxlocal=" + maxlocal + "\r\n"; int i = 0; int ms = 0; @@ -41,7 +41,7 @@ public class CodeStats { if (stats.stackpos > ms) { ms = stats.stackpos; } - ret += "" + i + ":" + stats.stackpos + (deltastack >= 0 ? "+" + deltastack : deltastack) + "," + stats.scopepos + " " + stats.ins.toString(abc.constants, fullyQualifiedNames) + "\r\n"; + ret += "" + i + ":" + stats.stackpos + (deltastack >= 0 ? "+" + deltastack : deltastack) + "," + stats.scopepos + " " + stats.ins.toString(highlight, abc.constants, fullyQualifiedNames) + "\r\n"; i++; } return ret; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java index 99a718cc1..1fe6919fd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java @@ -241,7 +241,7 @@ public class AVM2Instruction implements Serializable, GraphSourceItem { return ignored; } - public String toString(ConstantPool constants, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, List fullyQualifiedNames) { String s = Helper.formatAddress(offset) + " " + Helper.padSpaceRight(Helper.byteArrToString(getBytes()), 30) + definition.instructionName; s += getParams(constants, fullyQualifiedNames) + getComment(); return s; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java index c32de811c..7a718063d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java @@ -38,7 +38,7 @@ public class NewClassIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int clsIndex = ins.operands[0]; - String baseType = stack.pop().toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + String baseType = stack.pop().toString(false, Helper.toList(constants, localRegNames, fullyQualifiedNames)); stack.push(new UnparsedAVM2Item(ins, "new " + abc.constants.constant_multiname[abc.instance_info[clsIndex].name_index].getName(constants, fullyQualifiedNames) + ".class extends " + baseType)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java index 585778eec..1490f7be9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java @@ -51,7 +51,7 @@ public class SetSuperIns extends InstructionDefinition implements SetTypeIns { public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; String multiname = resolveMultinameNoPop(1, stack, abc.constants, multinameIndex, ins, fullyQualifiedNames); - String obj = stack.get(1 + resolvedCount(abc.constants, multinameIndex)).toString(abc.constants, localRegNames, fullyQualifiedNames); + String obj = stack.get(1 + resolvedCount(abc.constants, multinameIndex)).toString(false, abc.constants, localRegNames, fullyQualifiedNames); return obj + ".super." + multiname; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java index 24aca5300..efa7a8527 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java @@ -36,18 +36,18 @@ public abstract class AVM2Item extends GraphTargetItem { @Override @SuppressWarnings("unchecked") - public String toString(List localData) { - return toString((ConstantPool) localData.get(0), (HashMap) localData.get(1), (List) localData.get(2)); + public String toString(boolean highlight, List localData) { + return toString(highlight, (ConstantPool) localData.get(0), (HashMap) localData.get(1), (List) localData.get(2)); } - public abstract String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames); + public abstract String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames); public String toStringNoH(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return Highlighting.stripHilights(toString(constants, localRegNames, fullyQualifiedNames)); + return toString(false, constants, localRegNames, fullyQualifiedNames); } - public String toStringSemicoloned(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return toString(constants, localRegNames, fullyQualifiedNames) + (needsSemicolon() ? ";" : ""); + public String toStringSemicoloned(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return toString(highlight, constants, localRegNames, fullyQualifiedNames) + (needsSemicolon() ? ";" : ""); } @Override @@ -55,8 +55,8 @@ public abstract class AVM2Item extends GraphTargetItem { return true; } - protected String formatProperty(ConstantPool constants, GraphTargetItem object, GraphTargetItem propertyName, HashMap localRegNames, List fullyQualifiedNames) { - String obStr = object.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + protected String formatProperty(boolean highlight, ConstantPool constants, GraphTargetItem object, GraphTargetItem propertyName, HashMap localRegNames, List fullyQualifiedNames) { + String obStr = object.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)); if (object.precedence > PRECEDENCE_PRIMARY) { obStr = "(" + obStr + ")"; } @@ -68,16 +68,16 @@ public abstract class AVM2Item extends GraphTargetItem { } } if (obStr.equals("")) { - return propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + return propertyName.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)); } if (propertyName instanceof FullMultinameAVM2Item) { if (((FullMultinameAVM2Item) propertyName).name != null) { - return obStr + propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + return obStr + propertyName.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)); } else { - return obStr + "." + propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + return obStr + "." + propertyName.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)); } } else { - return obStr + "[" + propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "]"; + return obStr + "[" + propertyName.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "]"; } } 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 78b4d0278..827700253 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 @@ -38,7 +38,7 @@ public class AlchemyLoadAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("op_" + name + "(") + ofs.toString(constants, localRegNames, fullyQualifiedNames) + hilight(") /*Alchemy*/"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("op_" + name + "(", highlight) + ofs.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(") /*Alchemy*/", highlight); } } 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 4a1e7274c..1ab29ec33 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 @@ -37,7 +37,7 @@ public class AlchemySignExtendAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("op_" + name + "(") + value.toString(constants, localRegNames, fullyQualifiedNames) + hilight(") /*Alchemy*/"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("op_" + name + "(", highlight) + value.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(") /*Alchemy*/", highlight); } } 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 ba4b4d5c9..bd64d0821 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 @@ -39,7 +39,7 @@ public class AlchemyStoreAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("op_" + name + "(") + ofs.toString(constants, localRegNames, fullyQualifiedNames) + hilight(",") + value.toString(constants, localRegNames, fullyQualifiedNames) + hilight(") /*Alchemy*/"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("op_" + name + "(", highlight) + ofs.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(",", highlight) + value.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(") /*Alchemy*/", highlight); } } 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 1d6ddda56..222b95c60 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 @@ -35,20 +35,20 @@ public class ApplyTypeAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { StringBuilder ret = new StringBuilder(); - ret.append(object.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames))); + ret.append(object.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames))); if (!params.isEmpty()) { - ret.append(hilight(".<")); + ret.append(hilight(".<", highlight)); for (int i = 0; i < params.size(); i++) { if (i > 0) { - ret.append(hilight(",")); + ret.append(hilight(",", highlight)); } GraphTargetItem p = params.get(i); if (p instanceof NullAVM2Item) { ret.append("*"); } else { - ret.append(p.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames))); + ret.append(p.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames))); } } ret.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 ef16aff93..dd9ec7366 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 @@ -31,8 +31,8 @@ public class BooleanAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return value.toString(); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return value.toString(highlight); } @Override 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 df5db8f4a..e348401c9 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,25 +36,25 @@ public class CallAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String args = ""; for (int a = 0; a < arguments.size(); a++) { if (a > 0) { args = args + ","; } - args = args + arguments.get(a).toString(constants, localRegNames, fullyQualifiedNames); + args = args + arguments.get(a).toString(highlight, constants, localRegNames, fullyQualifiedNames); } - /*String recPart = ""; receiver.toString(constants, localRegNames) + hilight("."); + /*String recPart = ""; receiver.toString(constants, localRegNames) + hilight(".", highlight); if (receiver instanceof NewActivationAVM2Item) { recPart = ""; } if (receiver instanceof ThisAVM2Item) { recPart = ""; }*/ - String fstr = function.toString(constants, localRegNames, fullyQualifiedNames); + String fstr = function.toString(highlight, constants, localRegNames, fullyQualifiedNames); if (function.precedence > precedence) { fstr = "(" + fstr + ")"; } - return fstr + hilight("(") + args + hilight(")"); + return fstr + hilight("(", highlight) + args + hilight(")", highlight); } } 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 f579e5d50..16ff0b690 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 @@ -37,14 +37,14 @@ public class CallMethodAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String args = ""; for (int a = 0; a < arguments.size(); a++) { if (a > 0) { args = args + ","; } - args = args + arguments.get(a).toString(constants, localRegNames, fullyQualifiedNames); + args = args + arguments.get(a).toString(highlight, constants, localRegNames, fullyQualifiedNames); } - return receiver.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight(".") + methodName + hilight("(") + args + hilight(")"); + return receiver.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight(".", highlight) + methodName + hilight("(", highlight) + args + hilight(")", highlight); } } 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 68f774cbe..5bef793ad 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,14 +38,14 @@ public class CallPropertyAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String args = ""; for (int a = 0; a < arguments.size(); a++) { if (a > 0) { - args = args + hilight(","); + args = args + hilight(",", highlight); } - args = args + arguments.get(a).toString(constants, localRegNames, fullyQualifiedNames); + args = args + arguments.get(a).toString(highlight, constants, localRegNames, fullyQualifiedNames); } - return formatProperty(constants, receiver, propertyName, localRegNames, fullyQualifiedNames) + hilight("(") + args + hilight(")"); + return formatProperty(highlight, constants, receiver, propertyName, localRegNames, fullyQualifiedNames) + hilight("(", highlight) + args + hilight(")", highlight); } } 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 7269077e5..78264b12f 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 @@ -37,14 +37,14 @@ public class CallStaticAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String args = ""; for (int a = 0; a < arguments.size(); a++) { if (a > 0) { args = args + ","; } - args = args + arguments.get(a).toString(constants, localRegNames, fullyQualifiedNames); + args = args + arguments.get(a).toString(highlight, constants, localRegNames, fullyQualifiedNames); } - return receiver.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight(".") + methodName + hilight("(") + args + hilight(")"); + return receiver.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight(".", highlight) + methodName + hilight("(", highlight) + args + hilight(")", highlight); } } 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 6ee157d51..c967f0b9d 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 @@ -39,18 +39,18 @@ public class CallSuperAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String args = ""; for (int a = 0; a < arguments.size(); a++) { if (a > 0) { args = args + ","; } - args = args + arguments.get(a).toString(constants, localRegNames, fullyQualifiedNames); + args = args + arguments.get(a).toString(highlight, constants, localRegNames, fullyQualifiedNames, highlight); } - String calee = receiver.toString(constants, localRegNames, fullyQualifiedNames) + "."; + String calee = receiver.toString(highlight, constants, localRegNames, fullyQualifiedNames, highlight) + "."; if (Highlighting.stripHilights(calee).equals("this.")) { calee = ""; } - return calee + hilight("super.") + multiname.toString(constants, localRegNames, fullyQualifiedNames) + hilight("(") + args + hilight(")"); + return calee + hilight("super.", highlight) + multiname.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight("(", highlight) + args + hilight(")", highlight); } } 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 b5849dfa1..cebf52dc7 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 @@ -31,7 +31,7 @@ public class ClassAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { return className.getName(constants, 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 3ffcd2bbc..b63981bee 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,9 +36,9 @@ public class CoerceAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - //return hilight("("+type+")")+ - return value.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + //return hilight("("+type+")", highlight)+ + return value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } @Override 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 76d970aba..124edda6b 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,19 +34,19 @@ public class ConstructAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String argStr = ""; for (int a = 0; a < args.size(); a++) { if (a > 0) { argStr = argStr + ","; } - argStr = argStr + args.get(a).toString(constants, localRegNames, fullyQualifiedNames); + argStr = argStr + args.get(a).toString(highlight, constants, localRegNames, fullyQualifiedNames); } if (object instanceof NewFunctionAVM2Item) { - return hilight("new ") + object.toString(constants, localRegNames, fullyQualifiedNames); + return hilight("new ", highlight) + object.toString(highlight, constants, localRegNames, fullyQualifiedNames); } - String obStr = object.toString(constants, localRegNames, fullyQualifiedNames); - return hilight("new ") + obStr + hilight("(") + argStr + hilight(")"); + String obStr = object.toString(highlight, constants, localRegNames, fullyQualifiedNames); + return hilight("new ", highlight) + obStr + hilight("(", highlight) + argStr + hilight(")", highlight); } } 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 fd362d6bb..aeff1406e 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,19 +36,19 @@ public class ConstructPropAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String argStr = ""; for (int a = 0; a < args.size(); a++) { if (a > 0) { argStr = argStr + ","; } - argStr = argStr + args.get(a).toString(constants, localRegNames, fullyQualifiedNames); + argStr = argStr + args.get(a).toString(highlight, constants, localRegNames, fullyQualifiedNames); } - String objstr = object.toString(constants, localRegNames, fullyQualifiedNames); + String objstr = object.toString(highlight, constants, localRegNames, fullyQualifiedNames); if (!objstr.equals("")) { objstr += "."; } - return hilight("new ") + objstr + propertyName.toString(constants, localRegNames, fullyQualifiedNames) + hilight("(") + argStr + hilight(")"); + return hilight("new ", highlight) + objstr + propertyName.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight("(", highlight) + argStr + hilight(")", highlight); } } 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 e1d9c30e3..d0da2dea4 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 @@ -35,19 +35,19 @@ public class ConstructSuperAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String argStr = ""; for (int a = 0; a < args.size(); a++) { if (a > 0) { argStr = argStr + ","; } - argStr = argStr + args.get(a).toString(constants, localRegNames, fullyQualifiedNames); + argStr = argStr + args.get(a).toString(highlight, constants, localRegNames, fullyQualifiedNames); } - String calee = object.toString(constants, localRegNames, fullyQualifiedNames) + "."; + String calee = object.toString(highlight, constants, localRegNames, fullyQualifiedNames) + "."; if (Highlighting.stripHilights(calee).equals("this.")) { calee = ""; } - return calee + hilight("super(") + argStr + hilight(")"); + return calee + hilight("super(", highlight) + argStr + hilight(")", highlight); } } 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 0e111d96d..9dab37cc2 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,8 +35,8 @@ public class ConvertAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return value.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } @Override 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 340ff3754..da9400749 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 @@ -31,7 +31,7 @@ public class DecLocalAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return localRegName(localRegNames, regIndex) + hilight("--"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return localRegName(localRegNames, regIndex) + hilight("--", highlight); } } 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 d52122ba3..4ba56ffd0 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,8 +31,8 @@ public class DecrementAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return value.toString(constants, localRegNames, fullyQualifiedNames) + hilight("-1"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return value.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight("-1", highlight); } @Override 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 b95a3eb2c..84d90bf55 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 @@ -37,7 +37,7 @@ public class DefaultXMLNamespace extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("default xml namespace = ") + ns.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("default xml namespace = ", highlight) + ns.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)); } } 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 a8d81f292..c2c533238 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 @@ -35,7 +35,7 @@ public class EscapeXAttrAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("{") + value.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight("}"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("{", highlight) + value.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight("}", highlight); } } 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 9b64cfbe9..70946944f 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 @@ -37,7 +37,7 @@ public class EscapeXElemAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("{") + expression.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight("}"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("{", highlight) + expression.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight("}", highlight); } } 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 c03cc9069..ee0954b52 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 @@ -37,7 +37,7 @@ public class FilteredCheckAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return object.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return object.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)); } } 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 5c5e6e0bb..621cfb1b1 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 @@ -31,7 +31,7 @@ public class FindPropertyAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { return ""; } } 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 05d4667dc..e19d9c1fd 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 @@ -31,8 +31,8 @@ public class FloatValueAVM2Item extends NumberValueAVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("" + value); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("" + value, highlight); } @Override 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 52fccb67d..3efa90de9 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 @@ -57,13 +57,13 @@ public class FullMultinameAVM2Item extends AVM2Item { public boolean isXML(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String cname; if (name != null) { - cname = name.toString(constants, localRegNames, fullyQualifiedNames); + cname = name.toString(false, constants, localRegNames, fullyQualifiedNames); } else { cname = (constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames)); } String cns = ""; if (namespace != null) { - cns = namespace.toString(constants, localRegNames, fullyQualifiedNames); + cns = namespace.toString(false, constants, localRegNames, fullyQualifiedNames); } else { Namespace ns = constants.constant_multiname[multinameIndex].getNamespace(constants); if ((ns != null) && (ns.name_index != 0)) { @@ -74,15 +74,15 @@ public class FullMultinameAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String ret = ""; if (name != null) { - ret = "[" + name.toString(constants, localRegNames, fullyQualifiedNames) + "]"; + ret = "[" + name.toString(highlight, constants, localRegNames, fullyQualifiedNames) + "]"; } else { - ret = hilight(constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames)); + ret = hilight(constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames), highlight); } if (namespace != null) { - ret = namespace.toString(constants, localRegNames, fullyQualifiedNames) + "::" + ret; + ret = namespace.toString(highlight, constants, localRegNames, fullyQualifiedNames) + "::" + ret; } else { /*Namespace ns = constants.constant_multiname[multinameIndex].getNamespace(constants); if ((ns != null)&&(ns.name_index!=0)) { 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 1f8018ad4..dd02e3cc9 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 @@ -34,7 +34,7 @@ public class GetDescendantsAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return object.toString(constants, localRegNames, fullyQualifiedNames) + hilight("..") + multiname.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return object.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight("..", highlight) + multiname.toString(highlight, constants, localRegNames, fullyQualifiedNames); } } 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 62a79c68d..91136d1d4 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 @@ -32,7 +32,7 @@ public class GetLexAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight(propertyName.getName(constants, fullyQualifiedNames)); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight(propertyName.getName(constants, fullyQualifiedNames), highlight); } } 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 6d22e4e1e..b145bb21b 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 @@ -34,7 +34,7 @@ public class GetPropertyAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return formatProperty(constants, object, propertyName, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return formatProperty(highlight, constants, object, propertyName, localRegNames, fullyQualifiedNames); } } 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 61555c222..f241033f8 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 @@ -35,10 +35,10 @@ public class GetSlotAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { if (slotName == null) { - return hilight("/*UnknownSlot*/"); + return hilight("/*UnknownSlot*/", highlight); } - return hilight(slotName.getName(constants, fullyQualifiedNames)); + return hilight(slotName.getName(constants, fullyQualifiedNames), highlight); } } 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 c2c7330a3..a4d5cd0f2 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 @@ -35,11 +35,11 @@ public class GetSuperAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - String calee = object.toString(constants, localRegNames, fullyQualifiedNames) + "."; + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + String calee = object.toString(highlight, constants, localRegNames, fullyQualifiedNames) + "."; if (Highlighting.stripHilights(calee).equals("this.")) { calee = ""; } - return calee + hilight("super.") + propertyName.toString(constants, localRegNames, fullyQualifiedNames); + return calee + hilight("super.", highlight) + propertyName.toString(highlight, constants, localRegNames, fullyQualifiedNames); } } 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 c3c79c268..fa8e09d3c 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 @@ -39,7 +39,7 @@ public class HasNextAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return collection.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + " hasNext " + object.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return collection.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + " hasNext " + object.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)); } } 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 21a434934..a8e0ba1e7 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 @@ -34,7 +34,7 @@ public class InAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return object.toString(constants, localRegNames, fullyQualifiedNames) + hilight(" in ") + collection.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return object.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(" in ", highlight) + collection.toString(highlight, constants, localRegNames, fullyQualifiedNames); } } 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 12e746c21..fc3a6ae33 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 @@ -31,7 +31,7 @@ public class IncLocalAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return localRegName(localRegNames, regIndex) + hilight("++"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return localRegName(localRegNames, regIndex) + hilight("++", highlight); } } 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 f292151d8..e9b81d42c 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,8 +31,8 @@ public class IncrementAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return value.toString(constants, localRegNames, fullyQualifiedNames) + hilight("+1"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return value.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight("+1", highlight); } @Override 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 b8276691f..6665ec564 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 @@ -37,8 +37,8 @@ public class InitPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, A } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return formatProperty(constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight(" = ") + value.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return formatProperty(highlight, constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight(" = ", highlight) + value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } @Override 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 ce87cb3a9..4165147df 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 @@ -31,8 +31,8 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("" + value); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("" + value, highlight); } @Override 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 065e81d78..8b682048d 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 @@ -49,11 +49,11 @@ public class LocalRegAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { if (computedValue instanceof FilterAVM2Item) { - return computedValue.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + return computedValue.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)); } - return hilight(localRegName(localRegNames, regIndex)); + return hilight(localRegName(localRegNames, regIndex), highlight); } @Override 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 5b016c85b..8f36bc6f3 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,10 +31,10 @@ public class NameSpaceAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { if (namespaceIndex == 0) { return "*"; } - return hilight(constants.constant_namespace[namespaceIndex].toString(constants)); + return hilight(constants.constant_namespace[namespaceIndex].toString(constants), highlight); } } 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 1d29778be..6baba1f78 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 @@ -34,11 +34,11 @@ public class NameValuePair extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - String valueStr = value.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + String valueStr = value.toString(highlight, constants, localRegNames, fullyQualifiedNames); if (value instanceof TernarOpItem) { //Ternar operator contains ":" valueStr = "(" + valueStr + ")"; } - return name.toString(constants, localRegNames, fullyQualifiedNames) + ":" + valueStr; + return name.toString(highlight, constants, localRegNames, fullyQualifiedNames) + ":" + valueStr; } } 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 d663726df..5221d6510 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 @@ -28,7 +28,7 @@ public class NanAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("NaN"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("NaN", highlight); } } 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 6c172f21b..90340490d 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 - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("newactivation()"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("newactivation()", highlight); } } 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 4c0d00a45..bd02d7a65 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,14 +32,14 @@ public class NewArrayAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String args = ""; for (int a = 0; a < values.size(); a++) { if (a > 0) { args = args + ","; } - args = args + values.get(a).toString(constants, localRegNames, fullyQualifiedNames); + args = args + values.get(a).toString(highlight, constants, localRegNames, fullyQualifiedNames); } - return hilight("[") + args + hilight("]"); + return hilight("[", highlight) + args + hilight("]", highlight); } } 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 4b5047bff..ac03b3d15 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 @@ -37,7 +37,7 @@ public class NewFunctionAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("function" + (!functionName.equals("") ? " " + functionName : "") + "(" + paramStr + "):" + returnStr + "\r\n{\r\n") + functionBody + "\r\n" + hilight("}"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("function" + (!functionName.equals("") ? " " + functionName : "") + "(" + paramStr + "):" + returnStr + "\r\n{\r\n", highlight) + functionBody + "\r\n" + hilight("}", highlight); } } 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 ce4f3df32..14832b255 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 @@ -32,17 +32,17 @@ public class NewObjectAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String params = ""; for (int n = 0; n < pairs.size(); n++) { if (n > 0) { params += ",\r\n"; } - params += pairs.get(n).toString(constants, localRegNames, fullyQualifiedNames); + params += pairs.get(n).toString(highlight, constants, localRegNames, fullyQualifiedNames); } if (pairs.size() < 2) { - return hilight("{") + params + hilight("}"); + return hilight("{", highlight) + params + hilight("}", highlight); } - return "\r\n" + Graph.INDENTOPEN + "\r\n" + hilight("{") + "\r\n" + params + "\r\n" + hilight("}") + "\r\n" + Graph.INDENTCLOSE + "\r\n"; + return "\r\n" + Graph.INDENTOPEN + "\r\n" + hilight("{", highlight) + "\r\n" + params + "\r\n" + hilight("}", highlight) + "\r\n" + Graph.INDENTCLOSE + "\r\n"; } } 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 6140053d7..469fbaf21 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 @@ -39,7 +39,7 @@ public class NextNameAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return "nextName(" + index.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "," + obj.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + ")"; + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return "nextName(" + index.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "," + obj.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + ")"; } } 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 7469f0341..1931419f9 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 @@ -39,7 +39,7 @@ public class NextValueAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return "nextValue(" + index.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "," + obj.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + ")"; + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return "nextValue(" + index.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "," + obj.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + ")"; } } 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 3b9cb3108..18baf5410 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 @@ -29,8 +29,8 @@ public class NullAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("null"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("null", highlight); } @Override 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 bb126fc34..08ecbb9bd 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 @@ -34,8 +34,8 @@ public class PostDecrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return object.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight("--"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return object.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight("--", highlight); } @Override 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 601e2503d..1c88d3bc8 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 @@ -34,8 +34,8 @@ public class PostIncrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return object.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight("++"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return object.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight("++", highlight); } @Override 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 512969ee2..e70cce747 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 @@ -33,12 +33,12 @@ public class ReturnValueAVM2Item extends AVM2Item implements ExitItem { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - String vaStr = value.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + String vaStr = value.toString(highlight, constants, localRegNames, fullyQualifiedNames); String prefix = "\r\n" + Graph.INDENTOPEN + "\r\n"; if (vaStr.startsWith(prefix)) { //NewObjectAVM2Item vaStr = vaStr.substring(prefix.length()); } - return hilight("return ") + vaStr; + return hilight("return ", highlight) + vaStr; } } 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 fe075cb58..16e002fae 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 @@ -29,7 +29,7 @@ public class ReturnVoidAVM2Item extends AVM2Item implements ExitItem { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("return"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("return", highlight); } } 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 4a76ef878..056fa6f5b 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 @@ -34,7 +34,7 @@ public class ScriptAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { return "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 bd08895eb..46cb8d3e1 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 @@ -40,8 +40,8 @@ public class SetGlobalSlotAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("setglobalslot(" + slotId + ",") + value.toString(constants, localRegNames, fullyQualifiedNames) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("setglobalslot(" + slotId + ",", highlight) + value.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(")", highlight); } @Override 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 57ad8a23b..0e7495e65 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 @@ -35,8 +35,8 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight(localRegName(localRegNames, regIndex) + " = ") + value.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight(localRegName(localRegNames, regIndex) + " = ", highlight) + value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } @Override 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 5c7b11e1a..833130922 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 @@ -43,8 +43,8 @@ public class SetPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, As } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return formatProperty(constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight(" = ") + value.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return formatProperty(highlight, constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight(" = ", highlight) + value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } @Override 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 e7e4c0c52..416550a68 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 @@ -44,12 +44,12 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return getName(constants, localRegNames, fullyQualifiedNames) + hilight(" = ") + value.toString(constants, localRegNames, fullyQualifiedNames); + return getName(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(" = ", highlight) + value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } - public String getName(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String getName(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String ret = ""; /*ret = scope.toString(constants, localRegNames) + "."; @@ -66,7 +66,7 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign if (slotName == null) { return ret + "/*UnknownSlot*/"; } - return ret + hilight(slotName.getName(constants, fullyQualifiedNames)); + return ret + hilight(slotName.getName(constants, fullyQualifiedNames), highlight); } @Override 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 5b0b197d6..ede7cc8cf 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 @@ -43,12 +43,12 @@ public class SetSuperAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - String calee = object.toString(constants, localRegNames, fullyQualifiedNames) + "."; + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + String calee = object.toString(highlight, constants, localRegNames, fullyQualifiedNames) + "."; if (Highlighting.stripHilights(calee).equals("this.")) { calee = ""; } - return calee + hilight("super.") + propertyName.toString(constants, localRegNames, fullyQualifiedNames) + hilight(" = ") + value.toString(constants, localRegNames, fullyQualifiedNames); + return calee + hilight("super.", highlight) + propertyName.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(" = ", highlight) + value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } @Override 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 5dce8d35e..67af5139c 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 @@ -32,8 +32,8 @@ public class StringAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("\"" + Helper.escapeString(value) + "\""); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("\"" + Helper.escapeString(value) + "\"", highlight); } @Override 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 f337d634d..c003380b3 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 @@ -31,7 +31,7 @@ public class ThisAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { return "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 82723da56..b2df717b8 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 @@ -31,7 +31,7 @@ public class ThrowAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("throw ") + value.toString(constants, localRegNames, fullyQualifiedNames); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("throw ", highlight) + value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } } 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 e3671e8d3..2ec21394b 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 @@ -29,8 +29,8 @@ public class UndefinedAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("undefined"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("undefined", highlight); } @Override 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 99882d437..0b1e24a4e 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 @@ -31,7 +31,7 @@ public class UnparsedAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { return 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 a308351a5..62ad061db 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,13 +41,13 @@ public class WithAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String ret; - ret = hilight("with(") + scope.toString(constants, localRegNames, fullyQualifiedNames) + hilight(")\r\n{\r\n"); + ret = hilight("with(", highlight) + scope.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(")\r\n{\r\n", highlight); /*for (GraphTargetItem ti : items) { ret += ti.toString(constants, localRegNames, fullyQualifiedNames) + "\r\n"; } - ret += hilight("}");*/ + ret += hilight("}", highlight);*/ return ret; } 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 e31c27e16..9f012a41e 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 @@ -32,8 +32,8 @@ public class WithEndAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("}"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("}", highlight); } @Override 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 1cb10ca11..0c4e242d8 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 @@ -32,7 +32,7 @@ public class WithObjectAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { return ""; } } 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 5ce709e5e..e3ba5326e 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,13 +36,13 @@ public class XMLAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String ret = ""; for (GraphTargetItem part : parts) { if (part instanceof StringAVM2Item) { ret += ((StringAVM2Item) part).value; } else { - ret += part.toString(constants, localRegNames, fullyQualifiedNames); + ret += part.toString(highlight, constants, localRegNames, fullyQualifiedNames); } } return ret; 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 1592210e1..afa898911 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 @@ -47,7 +47,7 @@ public class DeclarationAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { if (assignment instanceof SetLocalAVM2Item) { SetLocalAVM2Item lti = (SetLocalAVM2Item) assignment; String type = "*"; @@ -57,12 +57,12 @@ public class DeclarationAVM2Item extends AVM2Item { if (lti.value instanceof ConvertAVM2Item) { type = ((ConvertAVM2Item) lti.value).type; } - return "var " + hilight(localRegName(localRegNames, lti.regIndex) + ":" + type + " = ") + lti.value.toString(constants, localRegNames, fullyQualifiedNames); + return "var " + hilight(localRegName(localRegNames, lti.regIndex) + ":" + type + " = ", highlight) + lti.value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } if (assignment instanceof SetSlotAVM2Item) { SetSlotAVM2Item ssti = (SetSlotAVM2Item) assignment; - return "var " + ssti.getName(constants, localRegNames, fullyQualifiedNames) + ":" + type + hilight(" = ") + ssti.value.toString(constants, localRegNames, fullyQualifiedNames); + return "var " + ssti.getName(highlight, constants, localRegNames, fullyQualifiedNames) + ":" + type + hilight(" = ", highlight) + ssti.value.toString(highlight, constants, localRegNames, fullyQualifiedNames); } - return "var " + assignment.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); + return "var " + assignment.toString(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)); } } 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 288ffae70..5f07a4d71 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 @@ -32,7 +32,7 @@ public class ExceptionAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { return exception.getVarName(constants, 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 d6269edde..c6a16601c 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 @@ -39,7 +39,7 @@ public class FilterAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return collection.toString(constants, localRegNames, fullyQualifiedNames) + hilight(".(") + expression.toString(constants, localRegNames, fullyQualifiedNames) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return collection.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(".(", highlight) + expression.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(")", highlight); } } 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 dfe22df4e..659153f5a 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 @@ -67,16 +67,16 @@ public class ForEachInAVM2Item extends LoopItem implements Block { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret = ""; ret += "loop" + loop.id + ":\r\n"; - ret += hilight("for each (") + expression.toString(localData) + ")\r\n{\r\n"; + ret += hilight("for each (", highlight) + expression.toString(highlight, localData) + ")\r\n{\r\n"; for (GraphTargetItem ti : commands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } - ret += hilight("}") + "\r\n"; + ret += hilight("}", highlight) + "\r\n"; ret += ":loop" + loop.id; return ret; } 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 5c2b74577..2efea175e 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 @@ -67,16 +67,16 @@ public class ForInAVM2Item extends LoopItem implements Block { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret = ""; ret += "loop" + loop.id + ":\r\n"; - ret += hilight("for (") + expression.toString(localData) + hilight(")") + "\r\n{\r\n"; + ret += hilight("for (", highlight) + expression.toString(highlight, localData) + hilight(")", highlight) + "\r\n{\r\n"; for (GraphTargetItem ti : commands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } - ret += hilight("}") + "\r\n"; + ret += hilight("}", highlight) + "\r\n"; ret += ":loop" + loop.id; return ret; } 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 1d6f75ebe..87f1ea320 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 @@ -52,12 +52,12 @@ public class TryAVM2Item extends AVM2Item implements Block { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String ret = ""; ret += "try\r\n{\r\n"; for (GraphTargetItem ti : tryCommands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n"; } } ret += "}"; @@ -66,7 +66,7 @@ public class TryAVM2Item extends AVM2Item implements Block { List commands = catchCommands.get(e); for (GraphTargetItem ti : commands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n"; } } ret += "}"; @@ -75,7 +75,7 @@ public class TryAVM2Item extends AVM2Item implements Block { ret += "\r\nfinally\r\n{\r\n"; for (GraphTargetItem ti : finallyCommands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n"; } } ret += "}"; 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 8a94e9037..598e8b8a5 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 @@ -30,22 +30,22 @@ public class AddAVM2Item extends BinaryOpItem { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { if (rightSide.precedence >= precedence) { //string + vs number + String ret = ""; if (leftSide.precedence > precedence) { - ret += "(" + leftSide.toString(localData) + ")"; + ret += "(" + leftSide.toString(highlight, localData) + ")"; } else { - ret += leftSide.toString(localData); + ret += leftSide.toString(highlight, localData); } ret += " "; - ret += hilight(operator); + ret += hilight(operator, highlight); ret += " "; - ret += "(" + rightSide.toString(localData) + ")"; + ret += "(" + rightSide.toString(highlight, localData) + ")"; return ret; } else { - return super.toString(localData); + return super.toString(highlight, localData); } } 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 6216462fb..38da000e2 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 @@ -36,7 +36,7 @@ public class DeletePropertyAVM2Item extends AVM2Item { } @Override - public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return hilight("delete ") + object.toString(constants, localRegNames, fullyQualifiedNames) + "[" + propertyName.toString(constants, localRegNames, fullyQualifiedNames) + "]"; + public String toString(boolean highlight, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("delete ", highlight) + object.toString(highlight, constants, localRegNames, fullyQualifiedNames) + "[" + propertyName.toString(highlight, constants, localRegNames, fullyQualifiedNames) + "]"; } } 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 6809dc1bd..25b472715 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 @@ -34,22 +34,22 @@ public class SubtractAVM2Item extends BinaryOpItem { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { if (rightSide.precedence >= precedence) { // >= add or subtract too String ret = ""; if (leftSide.precedence > precedence) { - ret += "(" + leftSide.toString(localData) + ")"; + ret += "(" + leftSide.toString(highlight, localData) + ")"; } else { - ret += leftSide.toString(localData); + ret += leftSide.toString(highlight, localData); } ret += " "; - ret += hilight(operator); + ret += hilight(operator, highlight); ret += " "; - ret += "(" + rightSide.toString(localData) + ")"; + ret += "(" + rightSide.toString(highlight, localData) + ")"; return ret; } else { - return super.toString(localData); + return super.toString(highlight, localData); } } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index 52bb48453..d9d23592b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -114,7 +114,7 @@ public class MethodBody implements Cloneable, Serializable { } String s = ""; if (pcode) { - s += code.toASMSource(constants, this, false); + s += code.toASMSource(constants, this, false, hilight); } else { if (!Configuration.getConfig("decompile", true)) { s = "//Decompilation skipped"; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java index d25e6ad81..d062c74c7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java @@ -91,7 +91,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { } if (assignedValue != null) { - valueStr = Highlighting.stripHilights(assignedValue.toString(abc.constants, new HashMap(), fullyQualifiedNames)); + valueStr = assignedValue.toString(false, abc.constants, new HashMap(), fullyQualifiedNames); } return valueStr; } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index 2b56aec03..264b0df3c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -394,8 +394,8 @@ public class Action implements GraphSourceItem { * @param path * @return ASM source as String */ - public static String actionsToString(List listeners, long address, List list, List importantOffsets, int version, boolean hex, long swfPos, String path) { - return actionsToString(listeners, address, list, importantOffsets, new ArrayList(), version, hex, swfPos, path); + public static String actionsToString(List listeners, long address, List list, List importantOffsets, int version, boolean hex, boolean highlight, long swfPos, String path) { + return actionsToString(listeners, address, list, importantOffsets, new ArrayList(), version, hex, highlight, swfPos, path); } /** @@ -412,7 +412,7 @@ public class Action implements GraphSourceItem { * @param path * @return ASM source as String */ - private static String actionsToString(List listeners, long address, List list, List importantOffsets, List constantPool, int version, boolean hex, long swfPos, String path) { + private static String actionsToString(List listeners, long address, List list, List importantOffsets, List constantPool, int version, boolean hex, boolean highlight, long swfPos, String path) { long offset; if (importantOffsets == null) { //setActionsAddresses(list, 0, version); @@ -493,7 +493,7 @@ public class Action implements GraphSourceItem { ret.append("\r\n"); lastPush = false; } - ret.append(Highlighting.hilighOffset("", offset)); + ret.append(highlight ? Highlighting.hilighOffset("", offset) : ""); ret.append(a.replaceWith.getASMSource(list, importantOffsets, constantPool, version, hex)); ret.append("\r\n"); } else if (a.isIgnored()) { @@ -533,7 +533,7 @@ public class Action implements GraphSourceItem { add = ""; if ((a instanceof ActionPush) && lastPush) { ret.append(" "); - ret.append(((ActionPush) a).paramsToStringReplaced(list, importantOffsets, constantPool, version, hex)); + ret.append(((ActionPush) a).paramsToStringReplaced(list, importantOffsets, constantPool, version, hex, highlight)); } else { if (lastPush) { ret.append("\r\n"); @@ -541,7 +541,7 @@ public class Action implements GraphSourceItem { } - ret.append(Highlighting.hilighOffset("", offset)); + ret.append(highlight ? Highlighting.hilighOffset("", offset) : ""); if (a instanceof ActionIf) { ActionIf aif = (ActionIf) a; @@ -565,7 +565,7 @@ public class Action implements GraphSourceItem { } } } else { - ret.append(a.getASMSourceReplaced(list, importantOffsets, constantPool, version, hex)); + ret.append(a.getASMSourceReplaced(list, importantOffsets, constantPool, version, hex, highlight)); } ret.append(a.isIgnored() ? "; ignored" : ""); ret.append(add); @@ -715,7 +715,7 @@ public class Action implements GraphSourceItem { * @param path * @return String with Source code */ - public static String actionsToSource(final List actions, final int version, final String path) { + public static String actionsToSource(final List actions, final int version, final String path, final boolean highlight) { int timeout = Configuration.getConfig("decompilationTimeoutSingleMethod", 60); try { return Helper.timedCall(new Callable() { @@ -726,7 +726,7 @@ public class Action implements GraphSourceItem { List tree = actionsToTree(new HashMap(), new HashMap(), new HashMap(), actions, version, staticOperation, path); - return Graph.graphToString(tree); + return Graph.graphToString(tree, highlight); } }, timeout, TimeUnit.SECONDS); } catch (TimeoutException ex) { @@ -1198,7 +1198,7 @@ public class Action implements GraphSourceItem { } String s = null; try { - s = Highlighting.stripHilights(Action.actionsToString(new ArrayList(), address, ret, null, version, false, swfPos, path)); + s = Action.actionsToString(new ArrayList(), address, ret, null, version, false, false, swfPos, path); ret = ASMParser.parse(address, swfPos, true, new StringReader(s), SWF.DEFAULT_VERSION); } catch (Exception ex) { Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE, "parsing error", ex); @@ -1226,7 +1226,7 @@ public class Action implements GraphSourceItem { } } - public String getASMSourceReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex) { + public String getASMSourceReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex, boolean highlight) { return getASMSource(container, knownAddreses, constantPool, version, hex); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java index 9277f63fe..cddca0529 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java @@ -35,12 +35,11 @@ public abstract class ActionItem extends GraphTargetItem implements Serializable super(instruction, precedence); } - public abstract String toString(ConstantPool constants); + public abstract String toString(boolean highlight, ConstantPool constants); - @Override - public String toString() { + public String toString(boolean highlight) { ConstantPool c = null; - return toString(c); + return toString(highlight, c); } protected boolean isEmptyString(GraphTargetItem target) { @@ -55,26 +54,26 @@ public abstract class ActionItem extends GraphTargetItem implements Serializable return false; } - protected String stripQuotes(GraphTargetItem target, ConstantPool constants) { + protected String stripQuotes(GraphTargetItem target, ConstantPool constants, boolean highlight) { if (target instanceof DirectValueActionItem) { if (((DirectValueActionItem) target).value instanceof String) { - return (String) ((DirectValueActionItem) target).hilight((String) ((DirectValueActionItem) target).value); + return (String) ((DirectValueActionItem) target).hilight((String) ((DirectValueActionItem) target).value, highlight); } } if (target == null) { return ""; } else { - return target.toString(constants); + return target.toString(highlight, constants); } } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { if (localData.isEmpty()) { ConstantPool c = null; - return toString(c); + return toString(highlight, c); } - return toString((ConstantPool) localData.get(0)); + return toString(highlight, (ConstantPool) localData.get(0)); } protected List toSourceCall(List localData, SourceGenerator gen, List list) { 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 2d0f63740..d407810b1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java @@ -30,8 +30,8 @@ public class AsciiToCharActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("chr(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("chr(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 cd1f25982..9b363edbc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java @@ -30,8 +30,8 @@ public class CallActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("call(") + stripQuotes(value, constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("call(", highlight) + stripQuotes(value, constants, highlight) + hilight(")", highlight); } @Override 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 5228d7a80..7609b0286 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java @@ -40,15 +40,15 @@ public class CallFunctionActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String paramStr = ""; for (int t = 0; t < arguments.size(); t++) { if (t > 0) { - paramStr += hilight(","); + paramStr += hilight(",", highlight); } - paramStr += arguments.get(t).toStringNL(constants); + paramStr += arguments.get(t).toStringNL(highlight, constants); } - return stripQuotes(functionName, constants) + hilight("(") + paramStr + hilight(")"); + return stripQuotes(functionName, constants, highlight) + hilight("(", highlight) + paramStr + hilight(")", highlight); } @Override 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 10d1d246e..0562e9311 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java @@ -46,13 +46,13 @@ public class CallMethodActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String paramStr = ""; for (int t = 0; t < arguments.size(); t++) { if (t > 0) { - paramStr += hilight(","); + paramStr += hilight(",", highlight); } - paramStr += arguments.get(t).toStringNL(constants); + paramStr += arguments.get(t).toStringNL(highlight, constants); } boolean blankMethod = false; if (methodName instanceof DirectValueActionItem) { @@ -66,13 +66,13 @@ public class CallMethodActionItem extends ActionItem { } } if (blankMethod) { - return scriptObject.toString(constants) + hilight("(") + paramStr + hilight(")"); + return scriptObject.toString(highlight, constants) + hilight("(", highlight) + paramStr + hilight(")", highlight); } - String soStr = scriptObject.toString(constants); + String soStr = scriptObject.toString(highlight, constants); if (scriptObject.precedence > this.precedence) { soStr = "(" + soStr + ")"; } - return soStr + hilight(".") + stripQuotes(methodName, constants) + hilight("(") + paramStr + hilight(")"); + return soStr + hilight(".", highlight) + stripQuotes(methodName, constants, highlight) + hilight("(", highlight) + paramStr + hilight(")", highlight); } @Override 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 02b6d1a34..16201500b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java @@ -44,8 +44,8 @@ public class CastOpActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("(") + stripQuotes(constructor, constants) + hilight(")") + object.toString(Helper.toList(constants)); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("(", highlight) + stripQuotes(constructor, constants, highlight) + hilight(")", highlight) + object.toString(highlight, Helper.toList(constants)); } @Override 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 0037d3a67..1c4456796 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java @@ -30,8 +30,8 @@ public class CharToAsciiActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("ord(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("ord(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 590c26b0d..e2f330c01 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java @@ -46,8 +46,8 @@ public class CloneSpriteActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("duplicateMovieClip(") + target.toString(constants) + hilight(",") + source.toString(constants) + hilight(",") + depth.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("duplicateMovieClip(", highlight) + target.toString(highlight, constants) + hilight(",", highlight) + source.toString(highlight, constants) + hilight(",", highlight) + depth.toString(highlight, constants) + hilight(")", highlight); } @Override 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 25366e322..4620147bd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java @@ -41,8 +41,8 @@ public class DecrementActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return object.toString(constants) + hilight(" - 1"); + public String toString(boolean highlight, ConstantPool constants) { + return object.toString(highlight, constants) + hilight(" - 1", highlight); } @Override 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 ac4126b6f..da395a41d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java @@ -67,11 +67,11 @@ public class DefineLocalActionItem extends ActionItem implements SetTypeActionIt } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { if (value == null) { - return hilight("var ") + stripQuotes(name, constants); + return hilight("var ", highlight) + stripQuotes(name, constants, highlight); } - return hilight("var ") + stripQuotes(name, constants) + hilight(" = ") + value.toString(constants); + return hilight("var ", highlight) + stripQuotes(name, constants, highlight) + hilight(" = ", highlight) + value.toString(highlight, constants); } @Override 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 3b7c5db05..51623a1a6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineRegisterActionItem.java @@ -32,7 +32,7 @@ public class DefineRegisterActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { return "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 ce3d171d5..e5b0f8412 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java @@ -43,11 +43,11 @@ public class DeleteActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { if (object == null) { - return hilight("delete ") + propertyName.toString(constants); + return hilight("delete ", highlight) + propertyName.toString(highlight, constants); } - return hilight("delete ") + object.toString(constants) + "." + stripQuotes(propertyName, constants); + return hilight("delete ", highlight) + object.toString(highlight, constants) + "." + stripQuotes(propertyName, constants, highlight); } @Override 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 a389db03e..0f54ea510 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java @@ -85,24 +85,24 @@ public class DirectValueActionItem extends ActionItem { } @Override - public String toStringNoQuotes(List localData) { + public String toStringNoQuotes(boolean highlight, List localData) { if (value instanceof Double) { if (Double.compare((double) (Double) value, 0) == 0) { - return hilight("0"); + return hilight("0", highlight); } } if (value instanceof Float) { if (Float.compare((float) (Float) value, 0) == 0) { - return hilight("0"); + return hilight("0", highlight); } } if (value instanceof String) { - return hilight((String) value); + return hilight((String) value, highlight); } if (value instanceof ConstantIndex) { - return hilight(this.constants.get(((ConstantIndex) value).index)); + return hilight(this.constants.get(((ConstantIndex) value).index), highlight); } - return hilight(value.toString()); + return hilight(value.toString(), highlight); } public String toStringNoH(ConstantPool constants) { @@ -126,27 +126,27 @@ public class DirectValueActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { if (value instanceof Double) { if (Double.compare((double) (Double) value, 0) == 0) { - return hilight("0"); + return hilight("0", highlight); } } if (value instanceof Float) { if (Float.compare((float) (Float) value, 0) == 0) { - return hilight("0"); + return hilight("0", highlight); } } if (value instanceof String) { - return hilight("\"" + Helper.escapeString((String) value) + "\""); + return hilight("\"" + Helper.escapeString((String) value) + "\"", highlight); } if (value instanceof ConstantIndex) { - return hilight("\"" + Helper.escapeString(this.constants.get(((ConstantIndex) value).index)) + "\""); + return hilight("\"" + Helper.escapeString(this.constants.get(((ConstantIndex) value).index)) + "\"", highlight); } if (value instanceof RegisterNumber) { - return hilight(((RegisterNumber) value).translate()); + return hilight(((RegisterNumber) value).translate(), highlight); } - return hilight(value.toString()); + return hilight(value.toString(), highlight); } @Override 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 4b4fa9077..fc6842097 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java @@ -39,8 +39,8 @@ public class EnumerateActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return "enumerate " + object.toString(Helper.toList(constants)); + public String toString(boolean highlight, ConstantPool constants) { + return "enumerate " + object.toString(highlight, Helper.toList(constants)); } @Override 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 03d17ff03..e983da75d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java @@ -34,8 +34,8 @@ public class EvalActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("eval(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("eval(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 57f58c971..3f5284411 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java @@ -34,10 +34,10 @@ public class ExtendsActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { List localData = new ArrayList<>(); localData.add(constants); - return subclass.toString(localData) + hilight(" extends ") + stripQuotes(superclass, constants); + return subclass.toString(highlight, localData) + hilight(" extends ", highlight) + stripQuotes(superclass, constants, highlight); } @Override 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 4977ee9fd..c50f44167 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java @@ -45,13 +45,13 @@ public class FSCommand2ActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String paramStr = ""; for (int t = 0; t < arguments.size(); t++) { paramStr += ","; - paramStr += arguments.get(t).toString(constants); + paramStr += arguments.get(t).toString(highlight, constants); } - return hilight("FSCommand2(") + command.toString(constants) + paramStr + hilight(")"); + return hilight("FSCommand2(", highlight) + command.toString(highlight, constants) + paramStr + hilight(")", highlight); } @Override 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 d93f44d38..c70b70d80 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java @@ -36,8 +36,8 @@ public class FSCommandActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("fscommand(\"") + Helper.escapeString(command) + hilight("\")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("fscommand(\"", highlight) + Helper.escapeString(command) + hilight("\", highlight)", highlight); } @Override 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 f782c2027..82d48042d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java @@ -70,28 +70,28 @@ public class FunctionActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { if (true) { //return ""; } - String ret = hilight("function"); + String ret = hilight("function", highlight); if (calculatedFunctionName != null) { - ret += " " + calculatedFunctionName.toStringNoQuotes(constants); + ret += " " + calculatedFunctionName.toStringNoQuotes(highlight, constants); } else if (!functionName.equals("")) { ret += " " + functionName; } - ret += hilight("("); + ret += hilight("(", highlight); for (int p = 0; p < paramNames.size(); p++) { if (p > 0) { - ret += hilight(", "); + ret += hilight(", ", highlight); } String pname = paramNames.get(p); if (pname == null || pname.equals("")) { pname = new RegisterNumber(regStart + p).translate(); } - ret += hilight(pname); + ret += hilight(pname, highlight); } - ret += hilight(")") + "\r\n{\r\n" + Graph.graphToString(actions, constants) + "}"; + ret += hilight(")", highlight) + "\r\n{\r\n" + Graph.graphToString(actions, highlight, constants) + "}"; 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 bbc901f0c..409b4e1cd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java @@ -42,12 +42,12 @@ public class GetMemberActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { if (!((memberName instanceof DirectValueActionItem) && (((DirectValueActionItem) memberName).value instanceof String))) { //if(!(functionName instanceof GetVariableActionItem)) - return object.toString(constants) + "[" + stripQuotes(memberName, constants) + "]"; + return object.toString(highlight, constants) + "[" + stripQuotes(memberName, constants, highlight) + "]"; } - return object.toString(constants) + "." + stripQuotes(memberName, constants); + return object.toString(highlight, constants) + "." + stripQuotes(memberName, constants, highlight); } @Override 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 234aa24e6..5db12cec3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java @@ -44,11 +44,11 @@ public class GetPropertyActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { if (isEmptyString(target)) { - return hilight(Action.propertyNames[propertyIndex]); + return hilight(Action.propertyNames[propertyIndex], highlight); } - return target.toString(constants) + hilight("." + Action.propertyNames[propertyIndex]); + return target.toString(highlight, constants) + hilight("." + Action.propertyNames[propertyIndex], highlight); } @Override 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 4bb9a61f5..6334622dc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java @@ -29,8 +29,8 @@ public class GetTimeActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("getTimer()"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("getTimer()", highlight); } @Override 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 283b1a5ac..d0393ba23 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java @@ -38,7 +38,7 @@ public class GetURL2ActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String methodStr = ""; if (sendVarsMethod == 1) { methodStr = ",\"GET\""; @@ -47,7 +47,7 @@ public class GetURL2ActionItem extends ActionItem { methodStr = ",\"POST\""; } - return hilight("getURL(") + urlString.toString(constants) + hilight(",") + targetString.toString(constants) + hilight(methodStr + ")"); + return hilight("getURL(", highlight) + urlString.toString(highlight, constants) + hilight(",", highlight) + targetString.toString(highlight, constants) + hilight(methodStr + ")", highlight); } public GetURL2ActionItem(GraphSourceItem instruction, GraphTargetItem urlString, GraphTargetItem targetString, int method) { 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 91a931c51..852f4797a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java @@ -28,8 +28,8 @@ public class GetURLActionItem extends ActionItem { public String targetString; @Override - public String toString(ConstantPool constants) { - return hilight("getUrl(\"") + Helper.escapeString(urlString) + "\", \"" + Helper.escapeString(targetString) + hilight("\")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("getUrl(\"", highlight) + Helper.escapeString(urlString) + "\", \"" + Helper.escapeString(targetString) + hilight("\")", highlight); } public GetURLActionItem(GraphSourceItem instruction, String urlString, String targetString) { 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 a9bfaf0de..07ef12a4d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java @@ -45,8 +45,8 @@ public class GetVariableActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return stripQuotes(name, constants); + public String toString(boolean highlight, ConstantPool constants) { + return stripQuotes(name, constants, highlight); } @Override 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 7e006793c..194f68e95 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java @@ -33,8 +33,8 @@ public class GetVersionActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("getVersion()"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight(")", highlight); } @Override 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 292567bd3..82603afb5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java @@ -46,12 +46,12 @@ public class GotoFrame2ActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String prefix = "gotoAndStop"; if (playFlag) { prefix = "gotoAndPlay"; } - return hilight(prefix + "(") + frame.toString(constants) + (sceneBiasFlag ? "," + sceneBias : "") + hilight(")"); + return hilight(prefix + "(", highlight) + frame.toString(highlight, constants) + (sceneBiasFlag ? "," + sceneBias : "") + hilight(")", highlight); } @Override 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 8c7a48263..8bf8afd0c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java @@ -31,8 +31,8 @@ public class GotoFrameActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("gotoAndStop(") + (frame + 1) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("gotoAndStop(", highlight) + (frame + 1) + hilight(")", highlight); } @Override 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 924e44a5b..205a440ad 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java @@ -32,8 +32,8 @@ public class GotoLabelActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("gotoAndStop(\"") + Helper.escapeString(label) + hilight("\")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("gotoAndStop(\"", highlight) + Helper.escapeString(label) + hilight("\", highlight)", highlight); } @Override 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 e73cb435e..9851634df 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java @@ -33,15 +33,15 @@ public class ImplementsOpActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String impStr = ""; for (int i = 0; i < superclasses.size(); i++) { if (i > 0) { impStr += ","; } - impStr += superclasses.get(i).toString(Helper.toList(constants)); + impStr += superclasses.get(i).toString(highlight, Helper.toList(constants)); } - return subclass.toString(Helper.toList(constants)) + hilight(" implements ") + impStr; + return subclass.toString(highlight, Helper.toList(constants)) + hilight(" implements ", highlight) + impStr; } @Override 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 50b5f50c7..d71176dbb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java @@ -41,8 +41,8 @@ public class IncrementActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return object.toString(constants) + hilight(" + 1"); + public String toString(boolean highlight, ConstantPool constants) { + return object.toString(highlight, constants) + hilight(" + 1", highlight); } @Override 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 8bab7098c..dff75422f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java @@ -41,15 +41,15 @@ public class InitArrayActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String arrStr = ""; for (int i = 0; i < values.size(); i++) { if (i > 0) { - arrStr += hilight(","); + arrStr += hilight(",", highlight); } - arrStr += values.get(i).toString(constants); + arrStr += values.get(i).toString(highlight, constants); } - return hilight("[") + arrStr + hilight("]"); + return hilight("[", highlight) + arrStr + hilight("]", highlight); } @Override 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 6e25ea1c3..367ff9164 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java @@ -44,19 +44,19 @@ public class InitObjectActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String objStr = ""; for (int i = 0; i < values.size(); i++) { if (i > 0) { - objStr += hilight(","); + objStr += hilight(",", highlight); } - String valueStr = values.get(i).toString(constants); + String valueStr = values.get(i).toString(highlight, constants); if (values.get(i) instanceof TernarOpItem) { //Ternar operator contains ":" valueStr = "(" + valueStr + ")"; } - objStr += names.get(i).toStringNoQuotes(constants) + hilight(":") + valueStr; //AS1/2 do not allow quotes in name here + objStr += names.get(i).toStringNoQuotes(highlight, constants) + hilight(":", highlight) + valueStr; //AS1/2 do not allow quotes in name here } - return hilight("{") + objStr + hilight("}"); + return hilight("{", highlight) + objStr + hilight("}", highlight); } @Override 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 41bce1660..49b763205 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java @@ -49,7 +49,7 @@ public class LoadMovieActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; @@ -57,7 +57,7 @@ public class LoadMovieActionItem extends ActionItem { if (method == 2) { methodStr = ",\"POST\""; } - return hilight("loadMovie(") + urlString.toString(constants) + hilight(",") + targetString.toString(constants) + hilight(methodStr + ")"); + return hilight("loadMovie", highlight) + urlString.toString(highlight, constants) + hilight(",", highlight) + targetString.toString(highlight, constants) + hilight(methodStr + ")", highlight); } @Override 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 473680e68..b36cc6150 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java @@ -51,7 +51,7 @@ public class LoadMovieNumActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; @@ -59,7 +59,7 @@ public class LoadMovieNumActionItem extends ActionItem { if (method == 2) { methodStr = ",\"POST\""; } - return hilight("loadMovieNum(") + urlString.toString(constants) + hilight(",") + num + hilight(methodStr + ")"); + return hilight("loadMovieNum(", highlight) + urlString.toString(highlight, constants) + hilight(",", highlight) + num + hilight(methodStr + ")", highlight); } @Override 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 c33931356..02f89a322 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java @@ -49,7 +49,7 @@ public class LoadVariablesActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; @@ -57,7 +57,7 @@ public class LoadVariablesActionItem extends ActionItem { if (method == 2) { methodStr = ",\"POST\""; } - return hilight("loadVariables(") + urlString.toString(constants) + hilight(",") + targetString.toString(constants) + hilight(methodStr + ")"); + return hilight("loadVariables(", highlight) + urlString.toString(highlight, constants) + hilight(",", highlight) + targetString.toString(highlight, constants) + hilight(methodStr + ")", highlight); } @Override 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 20f828183..020c58a67 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java @@ -51,7 +51,7 @@ public class LoadVariablesNumActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; @@ -59,7 +59,7 @@ public class LoadVariablesNumActionItem extends ActionItem { if (method == 2) { methodStr = ",\"POST\""; } - return hilight("loadVariablesNum(") + urlString.toString(constants) + hilight(",") + num + hilight(methodStr + ")"); + return hilight("loadVariablesNum(", highlight) + urlString.toString(highlight, constants) + hilight(",", highlight) + num + hilight(methodStr + ")", highlight); } @Override 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 5b6d5ca39..e04122b90 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java @@ -30,8 +30,8 @@ public class MBAsciiToCharActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("mbchr(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("mbchr(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 588c8370e..2a1f3410f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java @@ -30,8 +30,8 @@ public class MBCharToAsciiActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("mbord(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("mbord(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 bfbbb302e..061a50b23 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java @@ -46,8 +46,8 @@ public class MBStringExtractActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("mbsubstring(") + value.toString(constants) + hilight(",") + index.toString(constants) + hilight(",") + count.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("mbsubstring(", highlight) + value.toString(highlight, constants) + hilight(",", highlight) + index.toString(highlight, constants) + hilight(",", highlight) + count.toString(highlight, constants) + hilight(")", highlight); } @Override 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 0d6cf0975..774b9633b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java @@ -31,12 +31,12 @@ public class MBStringLengthActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - String s = value.toString(constants); + public String toString(boolean highlight, ConstantPool constants) { + String s = value.toString(highlight, constants); if (value.precedence > precedence) { s = "(" + s + ")"; } - return hilight("mblength(") + s + ")"; + return hilight("mblength(", highlight) + s + ")"; } @Override 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 e37e5b5cd..bfbd8df95 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java @@ -46,13 +46,13 @@ public class NewMethodActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String paramStr = ""; for (int t = 0; t < arguments.size(); t++) { if (t > 0) { paramStr += ","; } - paramStr += arguments.get(t).toString(constants); + paramStr += arguments.get(t).toString(highlight, constants); } boolean blankMethod = false; String methodNameStr = ""; @@ -63,17 +63,17 @@ public class NewMethodActionItem extends ActionItem { if (((DirectValueActionItem) methodName).value.equals("")) { blankMethod = true; } - methodNameStr = ((DirectValueActionItem) methodName).toStringNoQuotes(constants); + methodNameStr = ((DirectValueActionItem) methodName).toStringNoQuotes(highlight, constants); } else { - methodNameStr = methodName.toString(constants); + methodNameStr = methodName.toString(highlight, constants); } } else { - methodNameStr = methodName.toString(constants); + methodNameStr = methodName.toString(highlight, constants); } if (blankMethod) { - return scriptObject.toString(constants) + "(" + paramStr + ")"; + return scriptObject.toString(highlight, constants) + "(" + paramStr + ")"; } - return hilight("new ") + scriptObject.toString(constants) + hilight(".") + methodNameStr + hilight("(") + paramStr + hilight(")"); + return hilight("new ", highlight) + scriptObject.toString(highlight, constants) + hilight(".", highlight) + methodNameStr + hilight("(", highlight) + paramStr + hilight(")", highlight); } @Override 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 36bd56f75..c02dba3b0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java @@ -43,15 +43,15 @@ public class NewObjectActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String paramStr = ""; for (int t = 0; t < arguments.size(); t++) { if (t > 0) { paramStr += ","; } - paramStr += arguments.get(t).toString(constants); + paramStr += arguments.get(t).toString(highlight, constants); } - return hilight("new ") + stripQuotes(objectName, constants) + hilight("(") + paramStr + hilight(")"); + return hilight("new ", highlight) + stripQuotes(objectName, constants, highlight) + hilight("(", highlight) + paramStr + hilight(")", highlight); } @Override 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 537c8d5ed..bee6d71f7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java @@ -24,8 +24,8 @@ import java.util.List; public class NextFrameActionItem extends ActionItem { @Override - public String toString(ConstantPool constants) { - return hilight("nextFrame()"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("nextFrame()", highlight); } public NextFrameActionItem(GraphSourceItem instruction) { 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 934e53ffc..0297ca993 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java @@ -24,8 +24,8 @@ import java.util.List; public class PlayActionItem extends ActionItem { @Override - public String toString(ConstantPool constants) { - return hilight("play()"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("play()", highlight); } public PlayActionItem(GraphSourceItem instruction) { 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 193081f3a..f2973eee6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java @@ -32,7 +32,7 @@ public class PopActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { return ""; } 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 f3c5b0476..2f5509ff6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java @@ -49,8 +49,8 @@ public class PostDecrementActionItem extends ActionItem implements SetTypeAction } @Override - public String toString(ConstantPool constants) { - return object.toString(constants) + hilight("--"); + public String toString(boolean highlight, ConstantPool constants) { + return object.toString(highlight, constants) + hilight("--", highlight); } @Override 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 e54d46441..60b1fd6d2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java @@ -49,8 +49,8 @@ public class PostIncrementActionItem extends ActionItem implements SetTypeAction } @Override - public String toString(ConstantPool constants) { - return object.toString(constants) + hilight("++"); + public String toString(boolean highlight, ConstantPool constants) { + return object.toString(highlight, constants) + hilight("++", highlight); } @Override 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 a085d2487..08d0b9adf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java @@ -24,8 +24,8 @@ import java.util.List; public class PrevFrameActionItem extends ActionItem { @Override - public String toString(ConstantPool constants) { - return hilight("prevFrame()"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("prevFrame()", highlight); } public PrevFrameActionItem(GraphSourceItem instruction) { 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 ddf1ac0e3..eb2ab13f6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java @@ -49,8 +49,8 @@ public class PrintActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("print(") + target.toString(constants) + hilight(",") + boundingBox.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("print(", highlight) + target.toString(highlight, constants) + hilight(",", highlight) + boundingBox.toString(highlight, constants) + hilight(")", highlight); } @Override 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 15ea46c19..1ebde4e7e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java @@ -49,8 +49,8 @@ public class PrintAsBitmapActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("printAsBitmap(") + target.toString(constants) + hilight(",") + boundingBox.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("printAsBitmap(", highlight) + target.toString(highlight, constants) + hilight(",", highlight) + boundingBox.toString(highlight, constants) + hilight(")", highlight); } @Override 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 8fb80ddce..04bf09104 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java @@ -49,8 +49,8 @@ public class PrintAsBitmapNumActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("printAsBitmapNum(") + num.toString(constants) + hilight(",") + boundingBox.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("printAsBitmapNum(", highlight) + num.toString(highlight, constants) + hilight(",", highlight) + boundingBox.toString(highlight, constants) + hilight(")", highlight); } @Override 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 2a946f23f..ed02a42ac 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java @@ -49,8 +49,8 @@ public class PrintNumActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("printNum(") + num.toString(constants) + hilight(",") + boundingBox.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("printNum(", highlight) + num.toString(highlight, constants) + hilight(",", highlight) + boundingBox.toString(highlight, constants) + hilight(")", highlight); } @Override 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 40a99e0db..9ce45145d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java @@ -30,8 +30,8 @@ public class RandomNumberActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("random(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("random(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 7abe3f095..be040fb17 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java @@ -30,8 +30,8 @@ public class RemoveSpriteActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("removeMovieClip(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("removeMovieClip(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 387f6c82a..6bab5f3a7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java @@ -42,8 +42,8 @@ public class ReturnActionItem extends ActionItem implements ExitItem { } @Override - public String toString(ConstantPool constants) { - return hilight("return ") + value.toString(constants); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("return ", highlight) + value.toString(highlight, constants); } @Override 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 d0f2212eb..780ab5e7f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java @@ -76,12 +76,12 @@ public class SetMemberActionItem extends ActionItem implements SetTypeActionItem } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { if (!((objectName instanceof DirectValueActionItem) && (((DirectValueActionItem) objectName).value instanceof String))) { //if(!(functionName instanceof GetVariableActionItem)) - return object.toString(constants) + "[" + stripQuotes(objectName, constants) + "]" + " = " + value.toString(constants); + return object.toString(highlight, constants) + "[" + stripQuotes(objectName, constants, highlight) + "]" + " = " + value.toString(highlight, constants); } - return object.toString(constants) + "." + stripQuotes(objectName, constants) + " = " + value.toString(constants); + return object.toString(highlight, constants) + "." + stripQuotes(objectName, constants, highlight) + " = " + value.toString(highlight, constants); } @Override 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 8155805aa..82a7a7fe7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java @@ -68,11 +68,11 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { if (isEmptyString(target)) { - return hilight(Action.propertyNames[propertyIndex] + " = ") + value.toString(constants); + return hilight(Action.propertyNames[propertyIndex] + " = ", highlight) + value.toString(highlight, constants); } - return target.toString(constants) + hilight("." + Action.propertyNames[propertyIndex] + " = ") + value.toString(constants); + return target.toString(highlight, constants) + hilight("." + Action.propertyNames[propertyIndex] + " = ", highlight) + value.toString(highlight, constants); } @Override 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 b3c360467..fa2726f7a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java @@ -31,8 +31,8 @@ public class SetTarget2ActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("tellTarget(") + target.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("tellTarget(", highlight) + target.toString(highlight, constants) + hilight(")", highlight); } @Override 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 6171d2c05..864c9fbec 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java @@ -31,8 +31,8 @@ public class SetTargetActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("tellTarget(\"") + Helper.escapeString(target) + hilight("\")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("tellTarget(\"", highlight) + Helper.escapeString(target) + hilight("\")", highlight); } @Override 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 424446faf..424d9ea75 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java @@ -65,11 +65,11 @@ public class SetVariableActionItem extends ActionItem implements SetTypeActionIt } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { if (name instanceof DirectValueActionItem || name instanceof GetVariableActionItem) { - return stripQuotes(name, constants) + hilight(" = ") + value.toString(constants); + return stripQuotes(name, constants, highlight) + hilight(" = ", highlight) + value.toString(highlight, constants); } else { - return hilight("set(") + name.toString(constants) + hilight(",") + value.toString(constants) + hilight(")"); + return hilight("set(", highlight) + name.toString(highlight, constants) + hilight(",", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } } 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 cdff653e2..6b9a66253 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java @@ -45,14 +45,14 @@ public class StartDragActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { boolean hasConstrains = true; if (constrain instanceof DirectValueActionItem) { if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) { hasConstrains = false; } } - return hilight("startDrag(") + target.toString(constants) + hilight(",") + lockCenter.toString(constants) + (hasConstrains ? hilight(",") + x1.toString(constants) + hilight(",") + y1.toString(constants) + hilight(",") + x2.toString(constants) + hilight(",") + y2.toString(constants) : "") + hilight(")"); + return hilight("startDrag(", highlight) + target.toString(highlight, constants) + hilight(",", highlight) + lockCenter.toString(highlight, constants) + (hasConstrains ? hilight(",", highlight) + x1.toString(highlight, constants) + hilight(",", highlight) + y1.toString(highlight, constants) + hilight(",", highlight) + x2.toString(highlight, constants) + hilight(",", highlight) + y2.toString(highlight, constants) : "") + hilight(")", highlight); } @Override 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 36c16bcb0..c157a4e66 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java @@ -24,8 +24,8 @@ import java.util.List; public class StopActionItem extends ActionItem { @Override - public String toString(ConstantPool constants) { - return hilight("stop()"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("stop()", highlight); } public StopActionItem(GraphSourceItem instruction) { 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 20b029dc2..f12e543fb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java @@ -24,8 +24,8 @@ import java.util.List; public class StopAllSoundsActionItem extends ActionItem { @Override - public String toString(ConstantPool constants) { - return hilight("stopAllSounds()"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("stopAllSounds()", highlight); } public StopAllSoundsActionItem(GraphSourceItem instruction) { 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 005c6e6b2..964ff91b4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java @@ -24,8 +24,8 @@ import java.util.List; public class StopDragActionItem extends ActionItem { @Override - public String toString(ConstantPool constants) { - return hilight("stopDrag()"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("stopDrag()", highlight); } public StopDragActionItem(GraphSourceItem instruction) { 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 82016106b..3ec7a00e4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java @@ -65,8 +65,8 @@ public class StoreRegisterActionItem extends ActionItem implements SetTypeAction } @Override - public String toString(ConstantPool constants) { - return temporary ? value.toString(constants) : ((define ? hilight("var ") : "") + hilight(register.translate() + " = ") + value.toString(constants)); + public String toString(boolean highlight, ConstantPool constants) { + return temporary ? value.toString(highlight, constants) : ((define ? hilight("var ", highlight) : "") + hilight(register.translate() + " = ", highlight) + value.toString(highlight, constants)); } @Override 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 f54d137f0..9f4dcb89b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StrictModeActionItem.java @@ -28,7 +28,7 @@ public class StrictModeActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { return "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 1d828b717..788c93e83 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java @@ -36,8 +36,8 @@ public class StringExtractActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return value.toString(constants) + ".substr(" + index.toString(constants) + "," + count.toString(constants) + ")"; + public String toString(boolean highlight, ConstantPool constants) { + return value.toString(highlight, constants) + ".substr(" + index.toString(highlight, constants) + "," + count.toString(highlight, constants) + ")"; } @Override 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 c3c08ce73..998dd1e13 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java @@ -31,8 +31,8 @@ public class StringLengthActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("length(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("length(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 9293f4f3a..4c23c3dde 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java @@ -30,8 +30,8 @@ public class TargetPathActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return "targetPath(" + value.toString(constants) + ")"; + public String toString(boolean highlight, ConstantPool constants) { + return "targetPath(" + value.toString(highlight, constants) + ")"; } @Override 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 a62773a91..0d5b86d4b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java @@ -44,8 +44,8 @@ public class TemporaryRegister extends GraphTargetItem { } @Override - public String toString(List localData) { - return value.toString(localData); + public String toString(boolean highlight, List localData) { + return value.toString(highlight, localData); } @Override 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 763d0e991..f8a405ffc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java @@ -32,8 +32,8 @@ public class ThrowActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("throw ") + value.toString(Helper.toList(constants)); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("throw ", highlight) + value.toString(highlight, Helper.toList(constants)); } @Override 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 b6246ffb2..53a8a0044 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java @@ -30,8 +30,8 @@ public class ToIntegerActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("int(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("int(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 c9582c3bb..c82ac2416 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java @@ -31,8 +31,8 @@ public class ToNumberActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("Number(") + value.toString(Helper.toList(constants)) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("Number(", highlight) + value.toString(highlight, Helper.toList(constants)) + hilight(")", highlight); } @Override 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 00b215ba3..128af2ba0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java @@ -31,8 +31,8 @@ public class ToStringActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("String(") + value.toString(Helper.toList(constants)) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("String(", highlight) + value.toString(highlight, Helper.toList(constants)) + hilight(")", highlight); } @Override 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 86bdf036a..1a623752b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java @@ -24,8 +24,8 @@ import java.util.List; public class ToggleHighQualityActionItem extends ActionItem { @Override - public String toString(ConstantPool constants) { - return hilight("toggleHighQuality()"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("toggleHighQuality()", highlight); } public ToggleHighQualityActionItem(GraphSourceItem instruction) { 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 bb865e4a8..bb304436c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java @@ -30,8 +30,8 @@ public class TraceActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("trace(") + value.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("trace(", highlight) + value.toString(highlight, constants) + hilight(")", highlight); } @Override 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 5bd593948..122a43824 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java @@ -33,8 +33,8 @@ public class TypeOfActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("typeof(") + value.toString(Helper.toList(constants)) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("typeof(", highlight) + value.toString(highlight, Helper.toList(constants)) + hilight(")", highlight); } @Override 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 59a3fd459..3b515d35c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java @@ -45,8 +45,8 @@ public class UnLoadMovieActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("unloadMovie(") + targetString.toString(constants) + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("unloadMovie(", highlight) + targetString.toString(highlight, constants) + hilight(")", highlight); } @Override 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 237085056..ab8c67f42 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java @@ -47,8 +47,8 @@ public class UnLoadMovieNumActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - return hilight("unloadMovieNum(") + num + hilight(")"); + public String toString(boolean highlight, ConstantPool constants) { + return hilight("unloadMovieNum(", highlight) + num + hilight(")", highlight); } @Override 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 e8329731c..f35710dee 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java @@ -28,7 +28,7 @@ public class UnsupportedActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { return "//Unsupported by decompiler:" + 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 6c799aff5..e4966597a 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 @@ -84,11 +84,11 @@ public class ClassActionItem extends ActionItem implements Block { } Set allMembers = new HashSet<>(); for (GraphTargetItem it : allUsages) { - allMembers.add(Highlighting.stripHilights(it.toStringNoQuotes(new ArrayList<>()))); + allMembers.add(it.toStringNoQuotes(false, new ArrayList<>())); } uninitializedVars.addAll(allMembers); for (MyEntry v : vars) { - String s = Highlighting.stripHilights(v.key.toStringNoQuotes(new ArrayList<>())); + String s = v.key.toStringNoQuotes(false, new ArrayList<>()); if (uninitializedVars.contains(s)) { uninitializedVars.remove(s); } @@ -155,45 +155,45 @@ public class ClassActionItem extends ActionItem implements Block { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String ret; - ret = hilight("class ") + className.toStringNoQuotes(Helper.toList(constants)); + ret = hilight("class ", highlight) + className.toStringNoQuotes(highlight, Helper.toList(constants)); if (extendsOp != null) { - ret += hilight(" extends ") + extendsOp.toStringNoQuotes(Helper.toList(constants)); + ret += hilight(" extends ", highlight) + extendsOp.toStringNoQuotes(highlight, Helper.toList(constants)); } if (!implementsOp.isEmpty()) { - ret += hilight(" implements "); + ret += hilight(" implements ", highlight); boolean first = true; for (GraphTargetItem t : implementsOp) { if (!first) { ret += ", "; } first = false; - ret += Action.getWithoutGlobal(t).toString(constants); + ret += Action.getWithoutGlobal(t).toString(highlight, constants); } } ret += "\r\n{\r\n"; if (constructor != null) { - ret += constructor.toString(constants) + "\r\n"; + ret += constructor.toString(highlight, constants) + "\r\n"; } for (MyEntry item : vars) { - ret += "var " + item.key.toStringNoQuotes(constants) + " = " + item.value.toString(constants) + ";\r\n"; + ret += "var " + item.key.toStringNoQuotes(highlight, constants) + " = " + item.value.toString(highlight, constants) + ";\r\n"; } for (String v : uninitializedVars) { ret += "var " + v + ";\r\n"; } for (MyEntry item : staticVars) { - ret += "static var " + item.key.toStringNoQuotes(constants) + " = " + item.value.toString(constants) + ";\r\n"; + ret += "static var " + item.key.toStringNoQuotes(highlight, constants) + " = " + item.value.toString(highlight, constants) + ";\r\n"; } for (GraphTargetItem f : functions) { - ret += f.toString(constants) + "\r\n"; + ret += f.toString(highlight, constants) + "\r\n"; } for (GraphTargetItem f : staticFunctions) { - ret += "static " + f.toString(constants) + "\r\n"; + ret += "static " + f.toString(highlight, constants) + "\r\n"; } ret += "}\r\n"; 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 1ae93ba0d..48df0332d 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 @@ -62,14 +62,14 @@ public class ForInActionItem extends LoopActionItem implements Block { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String ret = ""; ret += "loop" + loop.id + ":\r\n"; - ret += hilight("for(") + ((variableName instanceof DirectValueActionItem) && (((DirectValueActionItem) variableName).value instanceof RegisterNumber) ? "var " : "") + stripQuotes(variableName, constants) + " in " + enumVariable.toString(constants) + ")\r\n{\r\n"; + ret += hilight("for(", highlight) + ((variableName instanceof DirectValueActionItem) && (((DirectValueActionItem) variableName).value instanceof RegisterNumber) ? "var " : "") + stripQuotes(variableName, constants, highlight) + " in " + enumVariable.toString(highlight, constants) + ")\r\n{\r\n"; for (GraphTargetItem ti : commands) { - ret += ti.toStringSemicoloned(constants) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, constants) + "\r\n"; } - ret += hilight("}") + "\r\n"; + ret += hilight("}", highlight) + "\r\n"; ret += ":loop" + loop.id; return ret; } 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 c8ec154dd..83cc145c7 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 @@ -44,8 +44,8 @@ public class IfFrameLoadedActionItem extends ActionItem implements Block { } @Override - public String toString(ConstantPool constants) { - return hilight("ifFrameLoaded(") + frame.toString(constants) + hilight(")") + "\r\n" + hilight("{") + "\r\n" + Graph.graphToString(actions, constants) + "}"; + public String toString(boolean highlight, ConstantPool constants) { + return hilight("ifFrameLoaded(", highlight) + frame.toString(highlight, constants) + hilight(")", highlight) + "\r\n" + hilight("{", highlight) + "\r\n" + Graph.graphToString(actions, highlight, constants) + "}"; } @Override 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 e25eb8a90..2603e1ccd 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 @@ -42,9 +42,9 @@ public class InterfaceActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String ret = ""; - ret += "interface " + name.toStringNoQuotes(constants); + ret += "interface " + name.toStringNoQuotes(highlight, constants); boolean first = true; if (!superInterfaces.isEmpty()) { ret += " extends "; @@ -54,7 +54,7 @@ public class InterfaceActionItem extends ActionItem { ret += ", "; } first = false; - ret += Action.getWithoutGlobal(ti).toStringNoQuotes(constants); + ret += Action.getWithoutGlobal(ti).toStringNoQuotes(highlight, constants); } ret += "\r\n{\r\n}\r\n"; return ret; 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 191732ed5..4142d1b2d 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 @@ -38,12 +38,12 @@ public class TellTargetActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { - String ret = hilight("tellTarget(") + target.toString(constants) + hilight(")\r\n{\r\n"); + public String toString(boolean highlight, ConstantPool constants) { + String ret = hilight("tellTarget(", highlight) + target.toString(highlight, constants) + hilight(")\r\n{\r\n", highlight); for (GraphTargetItem ti : commands) { - ret += ti.toString(constants) + "\r\n"; + ret += ti.toString(highlight, constants) + "\r\n"; } - ret += hilight("}"); + ret += hilight("}", highlight); return ret; } 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 703e55a95..a84ff53f9 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 @@ -56,23 +56,23 @@ public class TryActionItem extends ActionItem implements Block { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String ret = ""; ret += "try\r\n{\r\n"; List localData = new ArrayList<>(); localData.add(constants); for (GraphTargetItem ti : tryCommands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } ret += "}"; for (int e = 0; e < catchExceptions.size(); e++) { - ret += "\r\ncatch(" + catchExceptions.get(e).toStringNoQuotes(localData) + ")\r\n{\r\n"; + ret += "\r\ncatch(" + catchExceptions.get(e).toStringNoQuotes(highlight, localData) + ")\r\n{\r\n"; List commands = catchCommands.get(e); for (GraphTargetItem ti : commands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } ret += "}"; @@ -81,7 +81,7 @@ public class TryActionItem extends ActionItem implements Block { ret += "\r\nfinally\r\n{\r\n"; for (GraphTargetItem ti : finallyCommands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } ret += "}"; @@ -138,7 +138,7 @@ public class TryActionItem extends ActionItem implements Block { String catchName = null; if (catchExceptions != null) { if (!catchExceptions.isEmpty()) { - catchName = catchExceptions.get(0).toStringNoQuotes(new ConstantPool(asGenerator.getConstantPool())); + catchName = catchExceptions.get(0).toStringNoQuotes(false, new ConstantPool(asGenerator.getConstantPool())); } } 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 dd764f4ee..7047f165f 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 @@ -45,15 +45,15 @@ public class WithActionItem extends ActionItem { } @Override - public String toString(ConstantPool constants) { + public String toString(boolean highlight, ConstantPool constants) { String ret; List localData = new ArrayList<>(); localData.add(constants); - ret = hilight("with(") + scope.toString(localData) + hilight(")\r\n{\r\n"); + ret = hilight("with(", highlight) + scope.toString(highlight, localData) + hilight(")\r\n{\r\n", highlight); for (GraphTargetItem ti : items) { - ret += ti.toString(localData) + "\r\n"; + ret += ti.toString(highlight, localData) + "\r\n"; } - ret += hilight("}"); + ret += hilight("}", highlight); return ret; } 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 a70974522..59b4fd14b 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 @@ -35,21 +35,21 @@ public class AddActionItem extends BinaryOpItem { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { if (rightSide.precedence >= precedence) { //string + vs number + String ret = ""; if (leftSide.precedence > precedence) { - ret += "(" + leftSide.toString(localData) + ")"; + ret += "(" + leftSide.toString(highlight, localData) + ")"; } else { - ret += leftSide.toString(localData); + ret += leftSide.toString(highlight, localData); } ret += " "; - ret += hilight(operator); + ret += hilight(operator, highlight); ret += " "; - ret += "(" + rightSide.toString(localData) + ")"; + ret += "(" + rightSide.toString(highlight, localData) + ")"; return ret; } else { - return super.toString(localData); + return super.toString(highlight, localData); } } 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 2505fbe0e..b559ddf8b 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 @@ -36,22 +36,22 @@ public class SubtractActionItem extends BinaryOpItem { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { if (rightSide.precedence >= precedence) { // >= add or subtract too String ret = ""; if (leftSide.precedence > precedence) { - ret += "(" + leftSide.toString(localData) + ")"; + ret += "(" + leftSide.toString(highlight, localData) + ")"; } else { - ret += leftSide.toString(localData); + ret += leftSide.toString(highlight, localData); } ret += " "; - ret += hilight(operator); + ret += hilight(operator, highlight); ret += " "; - ret += "(" + rightSide.toString(localData) + ")"; + ret += "(" + rightSide.toString(highlight, localData) + ")"; return ret; } else { - return super.toString(localData); + return super.toString(highlight, localData); } } 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 64165e443..82631f186 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 @@ -409,12 +409,12 @@ public class ActionScriptParser { if (nameStr instanceof GetMemberActionItem) { GetMemberActionItem mem = (GetMemberActionItem) nameStr; if (mem.memberName instanceof DirectValueActionItem) { - classNameStr = ((DirectValueActionItem) mem.memberName).toStringNoQuotes(new ConstantPool(constantPool)); + classNameStr = ((DirectValueActionItem) mem.memberName).toStringNoQuotes(false, new ConstantPool(constantPool)); } } else if (nameStr instanceof GetVariableActionItem) { GetVariableActionItem var = (GetVariableActionItem) nameStr; if (var.name instanceof DirectValueActionItem) { - classNameStr = ((DirectValueActionItem) var.name).toStringNoQuotes(new ConstantPool(constantPool)); + classNameStr = ((DirectValueActionItem) var.name).toStringNoQuotes(false, new ConstantPool(constantPool)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java index 5348f106f..c7ad465fd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java @@ -42,7 +42,7 @@ public class ActionGetVariable extends Action { @Override public void translate(Stack stack, List output, java.util.HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem name = stack.pop(); - GraphTargetItem computedVal = variables.get(Highlighting.stripHilights(name.toStringNoQuotes((ConstantPool) null))); + GraphTargetItem computedVal = variables.get(name.toStringNoQuotes(false, (ConstantPool) null)); if (name instanceof DirectValueActionItem && ((DirectValueActionItem) name).value.equals("/:$version")) { stack.push(new GetVersionActionItem(this)); } else if (!(name instanceof DirectValueActionItem) && !(name instanceof GetVariableActionItem)) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java index e2e925cba..f87bbd8c4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java @@ -230,24 +230,24 @@ public class ActionPush extends Action { } @Override - public String getASMSourceReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex) { + public String getASMSourceReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex, boolean highlight) { if (replacement == null || replacement.size() < values.size()) { - return toString(); + return toString(highlight); } List oldVal = values; values = replacement; - String ts = toString(); + String ts = toString(highlight); values = oldVal; return ts; } - public String paramsToStringReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex) { + public String paramsToStringReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex, boolean highlight) { if (replacement == null || replacement.size() < values.size()) { - return paramsToString(); + return paramsToString(highlight); } List oldVal = values; values = replacement; - String ts = paramsToString(); + String ts = paramsToString(highlight); values = oldVal; return ts; } @@ -282,7 +282,7 @@ public class ActionPush extends Action { return ret; } - public String paramsToString() { + public String paramsToString(boolean highlight) { String ret = ""; int pos = 0; for (int i = 0; i < values.size(); i++) { @@ -292,7 +292,7 @@ public class ActionPush extends Action { if (pos > 0) { ret += " "; } - ret += Highlighting.hilighOffset(toString(i), getAddress() + pos + 1); + ret += highlight ? Highlighting.hilighOffset(toString(i), getAddress() + pos + 1) : toString(i); pos++; } return ret; @@ -300,7 +300,11 @@ public class ActionPush extends Action { @Override public String toString() { - return "Push " + paramsToString(); + return "Push " + paramsToString(false); + } + + public String toString(boolean highlight) { + return "Push " + paramsToString(highlight); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java index 7ebf95753..6c56b266f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java @@ -50,7 +50,7 @@ public class ActionSetVariable extends Action implements StoreTypeAction { public void translate(Stack stack, List output, java.util.HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.pop().getThroughDuplicate(); GraphTargetItem name = stack.pop(); - variables.put(Highlighting.stripHilights(name.toStringNoQuotes((ConstantPool) null)), value); + variables.put(name.toStringNoQuotes(false, (ConstantPool) null), value); if (value instanceof IncrementActionItem) { GraphTargetItem obj = ((IncrementActionItem) value).object; if (!stack.isEmpty()) { @@ -126,6 +126,6 @@ public class ActionSetVariable extends Action implements StoreTypeAction { if (stack.size() < 2) { return null; } - return Highlighting.stripHilights(stack.get(stack.size() - 2).toStringNoQuotes(cpool)); + return stack.get(stack.size() - 2).toStringNoQuotes(false, cpool); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java b/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java index 21e07e7c3..41b06950f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java @@ -46,7 +46,7 @@ public class ActionCallFunction extends Action { args.add(stack.pop()); } CallFunctionActionItem cft = new CallFunctionActionItem(this, functionName, args); - cft.calculatedFunction = functions.get(Highlighting.stripHilights(functionName.toStringNoQuotes((ConstantPool) null))); + cft.calculatedFunction = functions.get(functionName.toStringNoQuotes(false, (ConstantPool) null)); stack.push(cft); } } 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 b80216bec..ae18f0cef 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -167,7 +167,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta } @Override - public String getASMSourceReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex) { + public String getASMSourceReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex, boolean highlight) { List oldParamNames = paramNames; if (replacedParamNames != null) { paramNames = replacedParamNames; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java b/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java index bf4bd6bcd..1fdcb56f6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java @@ -40,7 +40,7 @@ public class ActionDefineLocal extends Action { public void translate(Stack stack, List output, java.util.HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.pop(); GraphTargetItem name = stack.pop(); - variables.put(Highlighting.stripHilights(name.toStringNoQuotes((ConstantPool) null)), value); + variables.put(name.toStringNoQuotes(false, (ConstantPool) null), value); output.add(new DefineLocalActionItem(this, name, value)); } } 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 1a9c759e8..9373bc8a1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java @@ -234,7 +234,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont } @Override - public String getASMSourceReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex) { + public String getASMSourceReplaced(List container, List knownAddreses, List constantPool, int version, boolean hex, boolean highlight) { List oldParamNames = paramNames; if (replacedParamNames != null) { paramNames = replacedParamNames; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java index 1f2ff8601..a2aee303a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java @@ -109,7 +109,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi if (bodyIndex == -1) { return; } - String textWithHexTags = abc.bodies[bodyIndex].code.toASMSource(abc.constants, abc.bodies[bodyIndex], true); + String textWithHexTags = abc.bodies[bodyIndex].code.toASMSource(abc.constants, abc.bodies[bodyIndex], true, true); textWithHex = Helper.hexToComments(textWithHexTags); textNoHex = Helper.stripComments(textWithHexTags); setText(hex ? textWithHex : textNoHex); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index d0f3cab01..8b1a0554b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -168,7 +168,7 @@ public class ActionPanel extends JPanel implements ActionListener { private void cacheScript(ASMSource src) { if (!cache.contains(src)) { List as = src.getActions(SWF.DEFAULT_VERSION); - String s = Action.actionsToSource(as, SWF.DEFAULT_VERSION, src.toString()/*FIXME?*/); + String s = Action.actionsToSource(as, SWF.DEFAULT_VERSION, src.toString()/*FIXME?*/, true); List hilights = Highlighting.getInstrHighlights(s); String srcNoHex = Highlighting.stripHilights(s); cache.put(src, new CachedScript(srcNoHex, hilights)); @@ -305,7 +305,7 @@ public class ActionPanel extends JPanel implements ActionListener { } }; asm.addDisassemblyListener(listener); - lastDisasm = asm.getASMSource(SWF.DEFAULT_VERSION, true); + lastDisasm = asm.getASMSource(SWF.DEFAULT_VERSION, true, true); asm.removeDisassemblyListener(listener); srcWithHex = Helper.hexToComments(lastDisasm); srcNoHex = Helper.stripComments(lastDisasm); diff --git a/trunk/src/com/jpexs/decompiler/flash/helpers/Highlighting.java b/trunk/src/com/jpexs/decompiler/flash/helpers/Highlighting.java index 5781a3a98..6995836a0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/helpers/Highlighting.java +++ b/trunk/src/com/jpexs/decompiler/flash/helpers/Highlighting.java @@ -186,7 +186,7 @@ public class Highlighting implements Serializable { * @param text Text to strip instruction highlights in * @return Text with no instruction highlights */ - public static String stripInstrHilights(String text) { + private static String stripInstrHilights(String text) { return stripSpecificHilights(text, OFSOPEN, OFSCLOSE, OFSEND); } @@ -196,7 +196,7 @@ public class Highlighting implements Serializable { * @param text Text to strip method highlights in * @return Text with no method highlights */ - public static String stripMethodHilights(String text) { + private static String stripMethodHilights(String text) { return stripSpecificHilights(text, METHODOPEN, METHODCLOSE, METHODEND); } @@ -206,7 +206,7 @@ public class Highlighting implements Serializable { * @param text Text to strip trait highlights in * @return Text with no trait highlights */ - public static String stripTraitHilights(String text) { + private static String stripTraitHilights(String text) { return stripSpecificHilights(text, TRAITOPEN, TRAITCLOSE, TRAITEND); } @@ -216,7 +216,7 @@ public class Highlighting implements Serializable { * @param text Text to strip trait highlights in * @return Text with no class highlights */ - public static String stripClassHilights(String text) { + private static String stripClassHilights(String text) { return stripSpecificHilights(text, CLASSOPEN, CLASSCLOSE, CLASSEND); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index 0ad3fa951..9ba9e1b08 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -135,8 +135,8 @@ public class DefineButtonTag extends CharacterTag implements ASMSource, BoundedT * @return ASM source */ @Override - public String getASMSource(int version, boolean hex) { - return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, getPos() + hdrSize, toString()/*FIXME?*/); + public String getASMSource(int version, boolean hex, boolean highlight) { + return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, highlight, getPos() + hdrSize, toString()/*FIXME?*/); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index bb9e8b1f7..e5d762900 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -75,8 +75,8 @@ public class DoActionTag extends Tag implements ASMSource { * @return ASM source */ @Override - public String getASMSource(int version, boolean hex) { - return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, getPos(), toString()/*FIXME?*/); + public String getASMSource(int version, boolean hex, boolean highlight) { + return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, highlight, getPos(), toString()/*FIXME?*/); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 16fe1a7a6..2a16736b8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -101,8 +101,8 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource { * @return ASM source */ @Override - public String getASMSource(int version, boolean hex) { - return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, getPos() + 2, toString()/*FIXME?*/); + public String getASMSource(int version, boolean hex, boolean highlight) { + return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, highlight, getPos() + 2, toString()/*FIXME?*/); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java index de5d70416..d0e226f17 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java @@ -34,7 +34,7 @@ public interface ASMSource { * @param hex Add hexadecimal? * @return ASM source */ - public String getASMSource(int version, boolean hex); + public String getASMSource(int version, boolean hex, boolean highlight); /** * Whether or not this object contains ASM source diff --git a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index f4d181b4e..5c6167941 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -146,8 +146,8 @@ public class BUTTONCONDACTION implements ASMSource, Exportable { * @return ASM source */ @Override - public String getASMSource(int version, boolean hex) { - return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, getPos() + 4, toString()/*FIXME?*/); + public String getASMSource(int version, boolean hex, boolean highlight) { + return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, highlight, getPos() + 4, toString()/*FIXME?*/); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java index 23664e978..d4128c1f6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java @@ -150,8 +150,8 @@ public class CLIPACTIONRECORD implements ASMSource, Exportable { * @return ASM source */ @Override - public String getASMSource(int version, boolean hex) { - return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, getPos() + hdrPos, toString()/*FIXME?*/); + public String getASMSource(int version, boolean hex, boolean highlight) { + return Action.actionsToString(listeners, 0, getActions(version), null, version, hex, highlight, getPos() + hdrPos, toString()/*FIXME?*/); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index b56efe9a2..96b09ce6b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -1159,8 +1159,8 @@ public class XFLConverter { } private static String convertActionScript(ASMSource as) { - String decompiledASHilighted = Action.actionsToSource(as.getActions(SWF.DEFAULT_VERSION), SWF.DEFAULT_VERSION, as.toString()); - return as.getActionSourcePrefix() + Helper.indentRows(as.getActionSourceIndent(), Highlighting.stripHilights(decompiledASHilighted), Graph.INDENT_STRING) + as.getActionSourceSuffix(); + String decompiledAS = Action.actionsToSource(as.getActions(SWF.DEFAULT_VERSION), SWF.DEFAULT_VERSION, as.toString(), false); + return as.getActionSourcePrefix() + Helper.indentRows(as.getActionSourceIndent(), decompiledAS, Graph.INDENT_STRING) + as.getActionSourceSuffix(); } private static long getTimestamp() { diff --git a/trunk/src/com/jpexs/decompiler/graph/Graph.java b/trunk/src/com/jpexs/decompiler/graph/Graph.java index eff6c105e..f58b4c09d 100644 --- a/trunk/src/com/jpexs/decompiler/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/graph/Graph.java @@ -2155,12 +2155,12 @@ public class Graph { * @param localData * @return String */ - public static String graphToString(List tree, Object... localData) { + public static String graphToString(List tree, boolean highlight, Object... localData) { StringBuilder ret = new StringBuilder(); List localDataList = Arrays.asList(localData); for (GraphTargetItem ti : tree) { if (!ti.isEmpty()) { - ret.append(ti.toStringSemicoloned(localDataList)); + ret.append(ti.toStringSemicoloned(highlight, localDataList)); ret.append("\r\n"); } } diff --git a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java index 6415980bb..3ced8ebff 100644 --- a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -82,23 +82,23 @@ public abstract class GraphTargetItem implements Serializable { return ret; } - public String hilight(String str) { - if (src == null) { + public String hilight(String str, boolean highlight) { + if (src == null || !highlight) { return str; } return Highlighting.hilighOffset(str, src.getOffset() + pos + 1); } - public String toStringSemicoloned(List localData) { - return toString(localData) + (needsSemicolon() ? ";" : ""); + public String toStringSemicoloned(boolean highlight, List localData) { + return toString(highlight, localData) + (needsSemicolon() ? ";" : ""); } - public String toStringSemicoloned(Object... localData) { + public String toStringSemicoloned(boolean highlight, Object... localData) { List localData2 = new ArrayList<>(); for (Object o : localData) { localData2.add(o); } - return toStringSemicoloned(localData2); + return toStringSemicoloned(highlight, localData2); } public boolean needsSemicolon() { @@ -110,14 +110,14 @@ public abstract class GraphTargetItem implements Serializable { return this.getClass().getName(); } - public abstract String toString(List localData); + public abstract String toString(boolean highlight, List localData); - public String toString(Object... localData) { + public String toString(boolean highlight, Object... localData) { List localData2 = new ArrayList<>(); for (Object o : localData) { localData2.add(o); } - return toString(localData2); + return toString(highlight, localData2); } public int getPrecedence() { @@ -147,16 +147,16 @@ public abstract class GraphTargetItem implements Serializable { return null; } - public String toStringNoQuotes(List localData) { - return toString(localData); + public String toStringNoQuotes(boolean highlight, List localData) { + return toString(highlight, localData); } - public String toStringNoQuotes(Object... localData) { + public String toStringNoQuotes(boolean highlight, Object... localData) { List localData2 = new ArrayList<>(); for (Object o : localData) { localData2.add(o); } - return toStringNoQuotes(localData2); + return toStringNoQuotes(highlight, localData2); } public GraphTargetItem getNotCoerced() { @@ -171,12 +171,12 @@ public abstract class GraphTargetItem implements Serializable { return false; } - public String toStringNL(Object... localData) { + public String toStringNL(boolean highlight, Object... localData) { List localData2 = new ArrayList<>(); for (Object o : localData) { localData2.add(o); } - return toString(localData2) + (needsNewLine() ? "\r\n" : ""); + return toString(highlight, localData2) + (needsNewLine() ? "\r\n" : ""); } public boolean isEmpty() { diff --git a/trunk/src/com/jpexs/decompiler/graph/MarkItem.java b/trunk/src/com/jpexs/decompiler/graph/MarkItem.java index 1c93fd8f1..3bfb26831 100644 --- a/trunk/src/com/jpexs/decompiler/graph/MarkItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/MarkItem.java @@ -32,7 +32,7 @@ public class MarkItem extends GraphTargetItem { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { return "//decompiler mark:" + mark; } diff --git a/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java b/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java index ef3a6787f..e6d56167c 100644 --- a/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java @@ -45,8 +45,8 @@ public class NotCompileTimeItem extends GraphTargetItem { } @Override - public String toString(List localData) { - return object.toString(localData); + public String toString(boolean highlight, List localData) { + return object.toString(highlight, localData); } @Override diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java index 7a0adfbfc..10a19595a 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java @@ -46,22 +46,22 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret = ""; if (leftSide.getPrecedence() > precedence) { - ret += "(" + leftSide.toString(localData) + ")"; + ret += "(" + leftSide.toString(highlight, localData) + ")"; } else { - ret += leftSide.toString(localData); + ret += leftSide.toString(highlight, localData); } ret += " "; - ret += hilight(operator); + ret += hilight(operator, highlight); ret += " "; if (rightSide.getPrecedence() > precedence) { - ret += "(" + rightSide.toString(localData) + ")"; + ret += "(" + rightSide.toString(highlight, localData) + ")"; } else { - ret += rightSide.toString(localData); + ret += rightSide.toString(highlight, localData); } return ret; } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java index ef0b85cd0..a2125f051 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java @@ -36,8 +36,8 @@ public class BlockItem extends GraphTargetItem { } @Override - public String toString(List localData) { - return "{\r\n" + Graph.graphToString(commands, localData) + "\r\n}"; + public String toString(boolean highlight, List localData) { + return "{\r\n" + Graph.graphToString(commands, highlight, localData) + "\r\n}"; } @Override diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java index b4556739b..1f4bc70be 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java @@ -19,8 +19,8 @@ public class BreakItem extends GraphTargetItem { } @Override - public String toString(List localData) { - return hilight("break") + " " + "loop" + loopId; + public String toString(boolean highlight, List localData) { + return hilight("break", highlight) + " " + "loop" + loopId; } @Override diff --git a/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java b/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java index 4ac724334..c28d58158 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java @@ -35,14 +35,14 @@ public class CommaExpressionItem extends GraphTargetItem { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret = ""; boolean first = true; for (GraphTargetItem t : commands) { if (!first) { ret += ", "; } - ret += t.toString(localData); + ret += t.toString(highlight, localData); first = false; } return ret; diff --git a/trunk/src/com/jpexs/decompiler/graph/model/CommentItem.java b/trunk/src/com/jpexs/decompiler/graph/model/CommentItem.java index 24efe6b67..c88483ab1 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/CommentItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/CommentItem.java @@ -33,7 +33,7 @@ public class CommentItem extends GraphTargetItem { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { return "/* " + comment + " */"; } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java index 75ba01971..c4f1d3fcc 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java @@ -19,8 +19,8 @@ public class ContinueItem extends GraphTargetItem { } @Override - public String toString(List localData) { - return hilight("continue") + " " + "loop" + loopId; + public String toString(boolean highlight, List localData) { + return hilight("continue", highlight) + " " + "loop" + loopId; } @Override diff --git a/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java b/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java index b5aed1aca..acc33c6d5 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java @@ -48,13 +48,13 @@ public class DoWhileItem extends LoopItem implements Block { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret = ""; ret += "loop" + loop.id + ":\r\n"; - ret += hilight("do\r\n{") + "\r\n"; + ret += hilight("do\r\n{", highlight) + "\r\n"; for (GraphTargetItem ti : commands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } String expStr = ""; @@ -65,9 +65,9 @@ public class DoWhileItem extends LoopItem implements Block { if (!expStr.equals("")) { expStr += ", "; } - expStr += expression.get(i).toString(localData); + expStr += expression.get(i).toString(highlight, localData); } - ret += hilight("}\r\nwhile(") + expStr + hilight(");") + "\r\n"; + ret += hilight("}\r\nwhile(", highlight) + expStr + hilight(");", highlight) + "\r\n"; ret += ":loop" + loop.id; return ret; diff --git a/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java b/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java index 724105c2c..9e4e57348 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java @@ -38,8 +38,8 @@ public class DuplicateItem extends GraphTargetItem { } @Override - public String toString(List localData) { - return value.toString(localData); + public String toString(boolean highlight, List localData) { + return value.toString(highlight, localData); } @Override diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java index d82449dad..ed39016b1 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java @@ -56,10 +56,10 @@ public class ForItem extends LoopItem implements Block { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret = ""; ret += "loop" + loop.id + ":\r\n"; - ret += hilight("for("); + ret += hilight("for(", highlight); int p = 0; for (int i = 0; i < firstCommands.size(); i++) { if (firstCommands.get(i).isEmpty()) { @@ -69,11 +69,11 @@ public class ForItem extends LoopItem implements Block { if (p > 0) { ret += ","; } - ret += stripSemicolon(firstCommands.get(i).toString(localData)); + ret += stripSemicolon(firstCommands.get(i).toString(highlight, localData)); p++; } ret += ";"; - ret += expression.toString(localData); + ret += expression.toString(highlight, localData); ret += ";"; p = 0; for (int i = 0; i < finalCommands.size(); i++) { @@ -83,16 +83,16 @@ public class ForItem extends LoopItem implements Block { if (p > 0) { ret += ","; } - ret += stripSemicolon(finalCommands.get(i).toString(localData)); + ret += stripSemicolon(finalCommands.get(i).toString(highlight, localData)); p++; } - ret += hilight(")") + "\r\n{\r\n"; + ret += hilight(")", highlight) + "\r\n{\r\n"; for (GraphTargetItem ti : commands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } - ret += hilight("}") + "\r\n"; + ret += hilight("}", highlight) + "\r\n"; ret += ":loop" + loop.id; return ret; } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java b/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java index 1169c8882..8cdda2185 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java @@ -50,7 +50,7 @@ public class IfItem extends GraphTargetItem implements Block { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret; GraphTargetItem expr = expression; List ifBranch = onTrue; @@ -70,21 +70,21 @@ public class IfItem extends GraphTargetItem implements Block { elseBranch = onTrue; } } - ret = hilight("if(") + expr.toString(localData) + hilight(")") + "\r\n{\r\n"; + ret = hilight("if(", highlight) + expr.toString(highlight, localData) + hilight(")", highlight) + "\r\n{\r\n"; for (GraphTargetItem ti : ifBranch) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } - ret += hilight("}"); + ret += hilight("}", highlight); if (elseBranch.size() > 0) { - ret += "\r\n" + hilight("else") + "\r\n" + hilight("{") + "\r\n"; + ret += "\r\n" + hilight("else", highlight) + "\r\n" + hilight("{", highlight) + "\r\n"; for (GraphTargetItem ti : elseBranch) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } - ret += hilight("}"); + ret += hilight("}", highlight); } return ret; } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java b/trunk/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java index 2c754eeb1..6c8f58741 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/IntegerValueItem.java @@ -34,8 +34,8 @@ public class IntegerValueItem extends GraphTargetItem { } @Override - public String toString(List localData) { - return hilight("" + intValue); + public String toString(boolean highlight, List localData) { + return hilight("" + intValue, highlight); } @Override diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java index f8ba0f9c9..1b92b3de9 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java @@ -33,8 +33,8 @@ public class ParenthesisItem extends GraphTargetItem { } @Override - public String toString(List localData) { - return "(" + value.toString(localData) + ")"; + public String toString(boolean highlight, List localData) { + return "(" + value.toString(highlight, localData) + ")"; } @Override diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ScriptEndItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ScriptEndItem.java index 0acc1e67a..c59f7d72e 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 - public String toString(List localData) { + public String toString(boolean highlight, List localData) { return ""; } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java b/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java index 2af25106b..e82ca593a 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java @@ -51,37 +51,37 @@ public class SwitchItem extends LoopItem implements Block { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret = ""; ret += "loopswitch" + loop.id + ":\r\n"; - ret += hilight("switch(") + switchedObject.toString(localData) + hilight(")") + "\r\n{\r\n"; + ret += hilight("switch(", highlight) + switchedObject.toString(highlight, localData) + hilight(")", highlight) + "\r\n{\r\n"; for (int i = 0; i < caseCommands.size(); i++) { for (int k = 0; k < valuesMapping.size(); k++) { if (valuesMapping.get(k) == i) { - ret += "case " + caseValues.get(k).toString(localData) + ":\r\n"; + ret += "case " + caseValues.get(k).toString(highlight, localData) + ":\r\n"; } } ret += Graph.INDENTOPEN + "\r\n"; for (int j = 0; j < caseCommands.get(i).size(); j++) { if (!caseCommands.get(i).get(j).isEmpty()) { - ret += caseCommands.get(i).get(j).toStringSemicoloned(localData) + "\r\n"; + ret += caseCommands.get(i).get(j).toStringSemicoloned(highlight, localData) + "\r\n"; } } ret += Graph.INDENTCLOSE + "\r\n"; } if (defaultCommands != null) { if (defaultCommands.size() > 0) { - ret += hilight("default") + ":\r\n"; + ret += hilight("default", highlight) + ":\r\n"; ret += Graph.INDENTOPEN + "\r\n"; for (int j = 0; j < defaultCommands.size(); j++) { if (!defaultCommands.get(j).isEmpty()) { - ret += defaultCommands.get(j).toStringSemicoloned(localData) + "\r\n"; + ret += defaultCommands.get(j).toStringSemicoloned(highlight, localData) + "\r\n"; } } ret += Graph.INDENTCLOSE + "\r\n"; } } - ret += hilight("}") + "\r\n"; + ret += hilight("}", highlight) + "\r\n"; ret += ":loop" + loop.id; return ret; } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java index 8b7cce0f3..ae3637663 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java @@ -35,8 +35,8 @@ public class TernarOpItem extends GraphTargetItem { } @Override - public String toString(List localData) { - return expression.toString(localData) + hilight("?") + onTrue.toString(localData) + hilight(":") + onFalse.toString(localData); + public String toString(boolean highlight, List localData) { + return expression.toString(highlight, localData) + hilight("?", highlight) + onTrue.toString(highlight, localData) + hilight(":", highlight) + onFalse.toString(highlight, localData); } @Override diff --git a/trunk/src/com/jpexs/decompiler/graph/model/TrueItem.java b/trunk/src/com/jpexs/decompiler/graph/model/TrueItem.java index c6fe54b0b..283ccdfd7 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/TrueItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/TrueItem.java @@ -15,7 +15,7 @@ public class TrueItem extends GraphTargetItem { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { return "true"; } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java index 60825acc1..f95331eae 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java @@ -33,14 +33,14 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp { } @Override - public String toString(List localData) { - String s = (value == null ? "null" : value.toString(localData)); + public String toString(boolean highlight, List localData) { + String s = (value == null ? "null" : value.toString(highlight, localData)); if (value != null) { if (value.precedence > precedence) { s = "(" + s + ")"; } } - return hilight(operator) + s; + return hilight(operator, highlight) + s; } @Override diff --git a/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java b/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java index 87ce45ca5..c0d44d716 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java @@ -36,17 +36,17 @@ public class UniversalLoopItem extends LoopItem implements Block { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret = ""; ret += "loop" + loop.id + ":\r\n"; - ret += hilight("while(true)"); + ret += hilight("while(true)", highlight); ret += "\r\n{\r\n"; for (GraphTargetItem ti : commands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } - ret += hilight("}") + "\r\n"; + ret += hilight("}", highlight) + "\r\n"; ret += ":loop" + loop.id; return ret; } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java b/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java index c0707f9bf..18a244cba 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java @@ -43,7 +43,7 @@ public class WhileItem extends LoopItem implements Block { } @Override - public String toString(List localData) { + public String toString(boolean highlight, List localData) { String ret = ""; ret += "loop" + loop.id + ":\r\n"; String expStr = ""; @@ -54,15 +54,15 @@ public class WhileItem extends LoopItem implements Block { if (!expStr.equals("")) { expStr += ", "; } - expStr += expression.get(i).toString(localData); + expStr += expression.get(i).toString(highlight, localData); } - ret += hilight("while(") + expStr + hilight(")") + "\r\n{\r\n"; + ret += hilight("while(", highlight) + expStr + hilight(")", highlight) + "\r\n{\r\n"; for (GraphTargetItem ti : commands) { if (!ti.isEmpty()) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; + ret += ti.toStringSemicoloned(highlight, localData) + "\r\n"; } } - ret += hilight("}") + "\r\n"; + ret += hilight("}", highlight) + "\r\n"; ret += ":loop" + loop.id; return ret; } diff --git a/trunk/src/com/jpexs/helpers/Helper.java b/trunk/src/com/jpexs/helpers/Helper.java index 216759a96..ed6c8a20e 100644 --- a/trunk/src/com/jpexs/helpers/Helper.java +++ b/trunk/src/com/jpexs/helpers/Helper.java @@ -385,10 +385,10 @@ public class Helper { if (i < stack.size() - 1) { ret += ", "; } - ret += stack.get(i).toString(localData); + ret += stack.get(i).toString(false, localData); } ret += "]"; - return Highlighting.stripHilights(ret); + return ret; } public static File fixDialogFile(File f) {