mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 12:51:21 +00:00
Fixed code style
This commit is contained in:
@@ -330,10 +330,10 @@ public abstract class Action implements GraphSourceItem {
|
||||
ASMParsedSymbol symb = lex.lex();
|
||||
if (symb.type != ASMParsedSymbol.TYPE_BOOLEAN) {
|
||||
throw new ActionParseException("Boolean expected", lex.yyline());
|
||||
}
|
||||
}
|
||||
return (Boolean) symb.value;
|
||||
}
|
||||
|
||||
|
||||
protected void lexOptionalComma(FlasmLexer lex) throws IOException, ActionParseException {
|
||||
ASMParsedSymbol symb = lex.lex();
|
||||
if (symb.type != ASMParsedSymbol.TYPE_COMMA) {
|
||||
|
||||
@@ -364,7 +364,7 @@ public class ActionGraph extends Graph {
|
||||
checkedLoop = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EnumerateActionItem enumerateItem = null;
|
||||
BinaryOpItem comparisonOp = null;
|
||||
//for..in inside switch before break
|
||||
@@ -379,7 +379,7 @@ public class ActionGraph extends Graph {
|
||||
EqActionItem eq = (EqActionItem) checkedCondition;
|
||||
if (eq.rightSide instanceof DirectValueActionItem) {
|
||||
DirectValueActionItem dv = (DirectValueActionItem) eq.rightSide;
|
||||
if (dv.value == Null.INSTANCE) {
|
||||
if (dv.value == Null.INSTANCE) {
|
||||
GraphTargetItem en = list.get(t - 1);
|
||||
if (en instanceof EnumerateActionItem) {
|
||||
enumerateItem = (EnumerateActionItem) en;
|
||||
@@ -406,13 +406,13 @@ public class ActionGraph extends Graph {
|
||||
enumerateItem = (EnumerateActionItem) en;
|
||||
if (ne.leftSide instanceof StoreRegisterActionItem) {
|
||||
comparisonOp = ne;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (comparisonOp != null) {
|
||||
|
||||
|
||||
if (checkedBody != null && (!checkedBody.isEmpty()) && (checkedBody.get(0) instanceof SetTypeActionItem)) {
|
||||
SetTypeActionItem sti = (SetTypeActionItem) checkedBody.get(0);
|
||||
|
||||
|
||||
+4
-4
@@ -622,7 +622,7 @@ public class ActionScript2ClassDetector {
|
||||
func.isSetter = true;
|
||||
|
||||
if (FunctionActionItem.DECOMPILE_GET_SET) {
|
||||
|
||||
|
||||
AbstractGraphTargetVisitor visitor = new AbstractGraphTargetVisitor() {
|
||||
@Override
|
||||
public void visit(GraphTargetItem item) {
|
||||
@@ -640,7 +640,7 @@ public class ActionScript2ClassDetector {
|
||||
for (GraphTargetItem ti : func.actions) {
|
||||
ti.visitRecursively(visitor);
|
||||
}
|
||||
|
||||
|
||||
//There is return getter added at the end of every setter, gotta remove it, since it won't compile
|
||||
//as setter must not return a value
|
||||
if (!func.actions.isEmpty()) {
|
||||
@@ -734,7 +734,7 @@ public class ActionScript2ClassDetector {
|
||||
DirectValueActionItem classBaseName = new DirectValueActionItem(classNamePath.get(classNamePath.size() - 1));
|
||||
((FunctionActionItem) constructor).calculatedFunctionName = classBaseName;
|
||||
traits.add(0, new MyEntry<>(classBaseName, constructor));
|
||||
|
||||
|
||||
AbstractGraphTargetVisitor visitor = new AbstractGraphTargetVisitor() {
|
||||
@Override
|
||||
public void visit(GraphTargetItem item) {
|
||||
@@ -751,7 +751,7 @@ public class ActionScript2ClassDetector {
|
||||
};
|
||||
for (GraphTargetItem ti : ((FunctionActionItem) constructor).actions) {
|
||||
ti.visitRecursively(visitor);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//throw new AssertException("No constructor found");
|
||||
}
|
||||
|
||||
+2
-3
@@ -322,8 +322,7 @@ public class UninitializedClassFieldsDetector {
|
||||
|| (item instanceof CallMethodActionItem)
|
||||
|| (item instanceof NewMethodActionItem)
|
||||
|| (item instanceof DeleteActionItem)
|
||||
|| (item instanceof GetMemberActionItem)
|
||||
) {
|
||||
|| (item instanceof GetMemberActionItem)) {
|
||||
List<String> path = getFullPath(item);
|
||||
if (path != null) {
|
||||
List<String> parent = new ArrayList<>(path);
|
||||
@@ -336,7 +335,7 @@ public class UninitializedClassFieldsDetector {
|
||||
if (!containsTrait(classTraits, classInheritance, className, name) && (!result.containsKey(className) || !result.get(className).containsKey(name))) {
|
||||
if (!result.containsKey(className)) {
|
||||
result.put(className, new LinkedHashMap<>());
|
||||
}
|
||||
}
|
||||
Variable v = new Variable(true, name, null, className);
|
||||
result.get(className).put(name, v);
|
||||
}
|
||||
|
||||
+3
-3
@@ -63,13 +63,13 @@ public class FastActionList implements Collection<ActionItem> {
|
||||
|
||||
public String getCharset() {
|
||||
return charset;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final ActionItem insertItemBefore(ActionItem item, Action action) {
|
||||
ActionItem newItem = new ActionItem(action);
|
||||
return insertItemBefore(item, newItem);
|
||||
}
|
||||
|
||||
|
||||
public final ActionItem insertItemBefore(ActionItem item, ActionItem newItem) {
|
||||
insertItemAfter(item.prev, newItem);
|
||||
if (item == firstItem) {
|
||||
|
||||
+2
-4
@@ -126,10 +126,8 @@ public class CallMethodActionItem extends ActionItem {
|
||||
} else {
|
||||
scriptObject.toString(writer, localData);
|
||||
}
|
||||
if (
|
||||
!(((DirectValueActionItem) methodName).value instanceof RegisterNumber)
|
||||
&& IdentifiersDeobfuscation.isValidName(false, methodName.toStringNoQuotes(localData))
|
||||
) {
|
||||
if (!(((DirectValueActionItem) methodName).value instanceof RegisterNumber)
|
||||
&& IdentifiersDeobfuscation.isValidName(false, methodName.toStringNoQuotes(localData))) {
|
||||
writer.append(".");
|
||||
methodName.toStringNoQuotes(writer, localData);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class FSCommandActionItem extends ActionItem {
|
||||
writer.append("(");
|
||||
command.appendTry(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
|
||||
@@ -83,12 +83,12 @@ public class GetURL2ActionItem extends ActionItem {
|
||||
ret.addAll(targetString.getNeededSources());
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -84,13 +84,13 @@ public class GotoFrame2ActionItem extends ActionItem {
|
||||
List<GraphSourceItemPos> ret = super.getNeededSources();
|
||||
ret.addAll(frame.getNeededSources());
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -72,13 +72,13 @@ public class LoadMovieActionItem extends ActionItem {
|
||||
writer.append(",");
|
||||
targetString.toString(writer, localData);
|
||||
return writer.append(methodStr).append(")");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@ public class LoadMovieNumActionItem extends ActionItem {
|
||||
writer.append(",");
|
||||
num.toString(writer, localData);
|
||||
return writer.append(methodStr).append(")");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
@@ -84,7 +84,7 @@ public class LoadMovieNumActionItem extends ActionItem {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
}
|
||||
|
||||
|
||||
private List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator, boolean needsReturn) throws CompilationException {
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
String charset = asGenerator.getCharset();
|
||||
|
||||
+2
-2
@@ -72,7 +72,7 @@ public class LoadVariablesActionItem extends ActionItem {
|
||||
writer.append(",");
|
||||
targetString.toString(writer, localData);
|
||||
return writer.append(methodStr).append(")");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
@@ -83,7 +83,7 @@ public class LoadVariablesActionItem extends ActionItem {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
}
|
||||
|
||||
|
||||
private List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator, boolean needsReturn) throws CompilationException {
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
String charset = asGenerator.getCharset();
|
||||
|
||||
+2
-2
@@ -73,13 +73,13 @@ public class LoadVariablesNumActionItem extends ActionItem {
|
||||
writer.append(",");
|
||||
num.toString(writer, localData);
|
||||
return writer.append(methodStr).append(")");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -43,13 +43,13 @@ public class NextFrameActionItem extends ActionItem {
|
||||
|
||||
public NextFrameActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns) {
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
@@ -43,13 +43,13 @@ public class PlayActionItem extends ActionItem {
|
||||
|
||||
public PlayActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns) {
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -43,13 +43,13 @@ public class PrevFrameActionItem extends ActionItem {
|
||||
|
||||
public PrevFrameActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns) {
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
@@ -64,12 +64,12 @@ public class PrintActionItem extends ActionItem {
|
||||
boundingBox.toString(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -63,13 +63,13 @@ public class PrintAsBitmapActionItem extends ActionItem {
|
||||
writer.append(",");
|
||||
boundingBox.toString(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -63,13 +63,13 @@ public class PrintAsBitmapNumActionItem extends ActionItem {
|
||||
writer.append(",");
|
||||
boundingBox.toString(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -63,7 +63,7 @@ public class PrintNumActionItem extends ActionItem {
|
||||
writer.append(",");
|
||||
boundingBox.toString(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
@@ -74,7 +74,7 @@ public class PrintNumActionItem extends ActionItem {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
}
|
||||
|
||||
|
||||
private List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator, boolean needsReturn) throws CompilationException {
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
String charset = asGenerator.getCharset();
|
||||
|
||||
+2
-2
@@ -55,13 +55,13 @@ public class RemoveSpriteActionItem extends ActionItem {
|
||||
List<GraphSourceItemPos> ret = super.getNeededSources();
|
||||
ret.addAll(value.getNeededSources());
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -101,13 +101,13 @@ public class StartDragActionItem extends ActionItem {
|
||||
ret.addAll(y1.getNeededSources());
|
||||
ret.addAll(y2.getNeededSources());
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
@@ -44,12 +44,12 @@ public class StopActionItem extends ActionItem {
|
||||
public StopActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns) {
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+2
-2
@@ -43,13 +43,13 @@ public class StopAllSoundsActionItem extends ActionItem {
|
||||
|
||||
public StopAllSoundsActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns) {
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class StopDragActionItem extends ActionItem {
|
||||
|
||||
public StopDragActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns) {
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
|
||||
+2
-2
@@ -48,13 +48,13 @@ public class ToggleHighQualityActionItem extends ActionItem {
|
||||
@Override
|
||||
public boolean hasReturnValue() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
@@ -55,13 +55,13 @@ public class TraceActionItem extends ActionItem {
|
||||
List<GraphSourceItemPos> ret = super.getNeededSources();
|
||||
ret.addAll(value.getNeededSources());
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public class UnLoadMovieActionItem extends ActionItem {
|
||||
targetString.toString(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class UnLoadMovieNumActionItem extends ActionItem {
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return toSource(localData, generator, true);
|
||||
|
||||
+3
-3
@@ -23,7 +23,7 @@ package com.jpexs.decompiler.flash.action.parser.pcode;
|
||||
public class ASMParsedSymbol {
|
||||
|
||||
public int pos;
|
||||
|
||||
|
||||
public int type;
|
||||
|
||||
public Object value;
|
||||
@@ -61,7 +61,7 @@ public class ASMParsedSymbol {
|
||||
public static final int TYPE_EOL = 16;
|
||||
|
||||
public static final int TYPE_CONSTANT_LITERAL = 17;
|
||||
|
||||
|
||||
public static final int TYPE_COMMA = 18;
|
||||
|
||||
public ASMParsedSymbol(int pos, int type, Object value) {
|
||||
@@ -78,5 +78,5 @@ public class ASMParsedSymbol {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "symbol[type=" + type + ", value=" + value + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class ASMParser {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ASMParser.class.getName());
|
||||
private static final Logger logger = Logger.getLogger(ASMParser.class.getName());
|
||||
|
||||
private static Action parseAction(String instructionName, FlasmLexer lexer, List<String> constantPool, int version, String charset) throws IOException, ActionParseException {
|
||||
Action a = null;
|
||||
|
||||
+1155
-1049
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -175,8 +175,8 @@ import java.util.Map;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class ActionScript2Parser {
|
||||
|
||||
public class ActionScript2Parser {
|
||||
|
||||
public static final List<String> BUILTIN_CASTS = Arrays.asList(new String[]{
|
||||
"flash.display.BitmapData",
|
||||
"flash.external.ExternalInterface",
|
||||
|
||||
+8
-16
@@ -89,10 +89,8 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
|
||||
private String charset;
|
||||
|
||||
|
||||
private long uniqLast = 0;
|
||||
|
||||
|
||||
public ActionSourceGenerator(int swfVersion, List<String> constantPool, String charset) {
|
||||
this.constantPool = constantPool;
|
||||
this.swfVersion = swfVersion;
|
||||
@@ -103,13 +101,11 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
uniqLast++;
|
||||
return "" + uniqLast;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getCharset() {
|
||||
return charset;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private List<Action> generateToActionList(SourceGeneratorLocalData localData, List<GraphTargetItem> commands) throws CompilationException {
|
||||
return toActionList(generate(localData, commands));
|
||||
}
|
||||
@@ -117,7 +113,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
private List<Action> generateToActionList(SourceGeneratorLocalData localData, GraphTargetItem command) throws CompilationException {
|
||||
return toActionList(command.toSource(localData, this));
|
||||
}
|
||||
|
||||
|
||||
public List<Action> toActionList(List<GraphSourceItem> items) {
|
||||
List<Action> ret = new ArrayList<>();
|
||||
for (GraphSourceItem s : items) {
|
||||
@@ -185,8 +181,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void fixLoop(List<Action> code, int breakOffset) {
|
||||
fixLoop(code, breakOffset, Integer.MAX_VALUE);
|
||||
}
|
||||
@@ -208,8 +203,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public HashMap<String, Integer> getRegisterVars(SourceGeneratorLocalData localData) {
|
||||
return localData.registerVars;
|
||||
}
|
||||
@@ -363,7 +357,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
|
||||
public int getSwfVersion() {
|
||||
return swfVersion;
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getConstantPool() {
|
||||
return constantPool;
|
||||
@@ -386,8 +380,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
}
|
||||
return new ActionPush(new ConstantIndex(index), charset);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> generateDiscardValue(SourceGeneratorLocalData localData, GraphTargetItem item) throws CompilationException {
|
||||
List<GraphSourceItem> ret = item.toSource(localData, this);
|
||||
@@ -605,7 +598,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
ret.add(new ActionPop());
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> generate(SourceGeneratorLocalData localData, FalseItem item) throws CompilationException {
|
||||
return GraphTargetItem.toSourceMerge(localData, this, new ActionPush(Boolean.FALSE, charset));
|
||||
@@ -889,7 +882,6 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> generate(SourceGeneratorLocalData localData, List<GraphTargetItem> commands) throws CompilationException {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
|
||||
@@ -100,8 +100,8 @@ public class ActionWaitForFrame extends Action implements ActionStore {
|
||||
public ActionWaitForFrame(FlasmLexer lexer, String charset) throws IOException, ActionParseException {
|
||||
super(0x8A, -1, charset);
|
||||
frame = (int) lexLong(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
skipCount = (int) lexLong(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
skipCount = (int) lexLong(lexer);
|
||||
skipped = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
@@ -110,24 +110,24 @@ public class ActionGetURL2 extends Action {
|
||||
|
||||
public ActionGetURL2(FlasmLexer lexer, String charset) throws IOException, ActionParseException {
|
||||
super(0x9A, -1, charset);
|
||||
|
||||
|
||||
ASMParsedSymbol symb = lexer.lex();
|
||||
boolean sendVarsMethodLast = false;
|
||||
if (symb.type == ASMParsedSymbol.TYPE_BOOLEAN) { //backwards compatibility. In 19.1.0 up to 20.0.0 sendVarsMethod is first
|
||||
sendVarsMethodLast = true;
|
||||
sendVarsMethodLast = true;
|
||||
}
|
||||
lexer.pushback(symb);
|
||||
if (!sendVarsMethodLast) {
|
||||
sendVarsMethod = (int) lexLong(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
}
|
||||
loadVariablesFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
loadTargetFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
loadTargetFlag = lexBoolean(lexer);
|
||||
if (sendVarsMethodLast) {
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
sendVarsMethod = (int) lexLong(lexer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -104,10 +104,10 @@ public class ActionGotoFrame2 extends Action {
|
||||
public ActionGotoFrame2(FlasmLexer lexer, String charset) throws IOException, ActionParseException {
|
||||
super(0x9F, -1, charset);
|
||||
sceneBiasFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
playFlag = lexBoolean(lexer);
|
||||
if (sceneBiasFlag) {
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
sceneBias = (int) lexLong(lexer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ public class ActionPush extends Action {
|
||||
super(0x96, 0, charset);
|
||||
this.constantPool = constantPool;
|
||||
values = new ArrayList<>();
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
loop:
|
||||
while (true) {
|
||||
boolean valueExpected = false;
|
||||
@@ -346,14 +346,14 @@ public class ActionPush extends Action {
|
||||
ret = value.toString();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public GraphTextWriter paramsToString(GraphTextWriter writer) {
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
if (i > 0) {
|
||||
writer.appendNoHilight(", ");
|
||||
}
|
||||
writer.append(toString(i), getAddress() + i + 1, getFileOffset());
|
||||
writer.append(toString(i), getAddress() + i + 1, getFileOffset());
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
@@ -374,10 +374,10 @@ public class ActionPush extends Action {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
toString(writer);
|
||||
writer.finishHilights();
|
||||
return writer.toString();
|
||||
|
||||
@@ -64,7 +64,7 @@ public class ActionConstantPool extends Action {
|
||||
super(0x88, 0, charset);
|
||||
boolean first = true;
|
||||
while (true) {
|
||||
boolean valueRequired = false;
|
||||
boolean valueRequired = false;
|
||||
ASMParsedSymbol symb = lexer.lex();
|
||||
if (!first && symb.type == ASMParsedSymbol.TYPE_COMMA) {
|
||||
symb = lexer.lex();
|
||||
@@ -78,7 +78,7 @@ public class ActionConstantPool extends Action {
|
||||
}
|
||||
lexer.pushback(symb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta
|
||||
lexOptionalComma(lexer);
|
||||
int numParams = (int) lexLong(lexer);
|
||||
for (int i = 0; i < numParams; i++) {
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
paramNames.add(lexString(lexer));
|
||||
}
|
||||
lexBlockOpen(lexer);
|
||||
|
||||
+13
-13
@@ -145,32 +145,32 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont
|
||||
public ActionDefineFunction2(FlasmLexer lexer, String charset) throws IOException, ActionParseException {
|
||||
super(0x8E, -1, charset);
|
||||
functionName = lexString(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
int numParams = (int) lexLong(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
registerCount = (int) lexLong(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
preloadParentFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
preloadRootFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
suppressSuperFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
preloadSuperFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
suppressArgumentsFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
preloadArgumentsFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
suppressThisFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
preloadThisFlag = lexBoolean(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
preloadGlobalFlag = lexBoolean(lexer);
|
||||
for (int i = 0; i < numParams; i++) {
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
paramRegisters.add((int) lexLong(lexer));
|
||||
lexOptionalComma(lexer);
|
||||
lexOptionalComma(lexer);
|
||||
paramNames.add(lexString(lexer));
|
||||
}
|
||||
lexBlockOpen(lexer);
|
||||
|
||||
Reference in New Issue
Block a user