- New AS2 class detector

- Reference helper class moved to helper package.
This commit is contained in:
Jindra Petřík
2018-01-22 22:06:40 +01:00
parent def79bd7a7
commit da586b105f
25 changed files with 763 additions and 308 deletions

View File

@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.graph;
import com.jpexs.decompiler.flash.BaseLocalData;
@@ -643,25 +644,25 @@ public class Graph {
System.err.println("</loopspre>");//*/
List<GraphTargetItem> ret = printGraph(new HashMap<>(), new HashMap<>(), localData, stack, allParts, null, heads.get(0), null, loops, staticOperation, path);
processIfs(ret);
processIfs(ret);
finalProcessStack(stack, ret);
finalProcessStack(stack, ret, path);
finalProcessAll(ret, 0, new FinalProcessLocalData(), path);
return ret;
}
public void finalProcessStack(TranslateStack stack, List<GraphTargetItem> output, String path) {
}
private void finalProcessAll(List<GraphTargetItem> list, int level, FinalProcessLocalData localData) throws InterruptedException {
private void finalProcessAll(List<GraphTargetItem> list, int level, FinalProcessLocalData localData, String path) throws InterruptedException {
finalProcess(list, level, localData, path);
for (GraphTargetItem item : list) {
if (item instanceof Block) {
List<List<GraphTargetItem>> subs = ((Block) item).getSubs();
for (List<GraphTargetItem> sub : subs) {
for (List<GraphTargetItem> sub : subs) {
finalProcessAll(sub, level + 1, localData, path);
}
}
}
}
finalProcessAfter(list, level, localData, path);
}
private boolean processSubBlk(Block b, GraphTargetItem replacement) {
@@ -703,7 +704,7 @@ public class Graph {
return allSubPush && atleastOne;
}
protected void finalProcessAfter(List<GraphTargetItem> list, int level, FinalProcessLocalData localData, String path) {
if (list.size() >= 2) {
if (list.get(list.size() - 1) instanceof ExitItem) {
ExitItem e = (ExitItem) list.get(list.size() - 1);
@@ -719,7 +720,7 @@ public class Graph {
}
}
protected void finalProcess(List<GraphTargetItem> list, int level, FinalProcessLocalData localData, String path) throws InterruptedException {
//For detection based on debug line information
boolean[] toDelete = new boolean[list.size()];