AS3 parser: easier debugging

This commit is contained in:
Jindra Petk
2014-04-05 12:47:23 +02:00
parent b8a63c8d5a
commit 079f642e40
4 changed files with 6 additions and 9 deletions

View File

@@ -1883,14 +1883,9 @@ public class ActionScriptParser {
this.otherABCs = otherABCs;
}
public static void main(String[] args) {
if (args.length < 2) {
return;
}
Main.initLogging(false);
public static void compile(String src, String dst) {
System.err.println("WARNING: AS3 compiler is not finished yet. This is only used for debuggging!");
try {
String src = args[0];
String dst = args[1];
SWC swc = new SWC(new FileInputStream(Configuration.getPlayerSWC()));
SWF swf = new SWF(swc.getSWF("library.swf"), true);
List<ABC> playerABCs = new ArrayList<>();

View File

@@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.SWFBundle;
import com.jpexs.decompiler.flash.SWFSourceInfo;
import com.jpexs.decompiler.flash.SearchMode;
import com.jpexs.decompiler.flash.abc.RenameType;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.ActionScriptParser;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.configuration.ConfigurationItem;
import com.jpexs.decompiler.flash.exporters.modes.BinaryDataExportMode;
@@ -276,6 +277,8 @@ public class CommandLineArgumentParser {
parseRenameInvalidIdentifiers(args);
} else if (nextParam.equals("-dumpswf")) {
parseDumpSwf(args);
} else if (nextParam.equals("-as3compiler")) {
ActionScriptParser.compile(args.remove(),args.remove());
} else if (nextParam.equals("-help") || nextParam.equals("--help") || nextParam.equals("/?")) {
printHeader();
printCmdLineUsage();

View File

@@ -25,7 +25,6 @@ import com.jpexs.decompiler.flash.SWFSourceInfo;
import com.jpexs.decompiler.flash.SearchMode;
import com.jpexs.decompiler.flash.Version;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.ActionScriptParser;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.console.CommandLineArgumentParser;
import com.jpexs.decompiler.flash.console.ContextMenuTools;

View File

@@ -215,7 +215,7 @@ public abstract class GraphTargetItem implements Serializable {
return ret;
}
protected List<GraphSourceItem> toSourceMerge(SourceGeneratorLocalData localData, SourceGenerator gen, Object... tar) {
public static List<GraphSourceItem> toSourceMerge(SourceGeneratorLocalData localData, SourceGenerator gen, Object... tar) {
List<GraphSourceItem> ret = new ArrayList<>();
for (Object o : tar) {
if (o == null) {