#349 AS3 - better handling of declarations

This commit is contained in:
Jindra Petřík
2021-02-04 21:36:09 +01:00
parent 6f19d50572
commit 43885a1a40
28 changed files with 397 additions and 105 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.SourceGeneratorLocalData;
@@ -534,12 +535,30 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
});
}
public final void visitRecursivelyNoBlock(GraphTargetVisitorInterface visitor) {
Set<GraphTargetItem> visitedItems = new HashSet<>();
visitNoBlock(new AbstractGraphTargetVisitor() {
@Override
public void visit(GraphTargetItem item) {
if (item != null && !visitedItems.contains(item)) {
visitedItems.add(item);
visitor.visit(item);
item.visitNoBlock(this);
}
}
});
}
public void visit(GraphTargetVisitorInterface visitor) {
if (value != null) {
visitor.visit(value);
}
}
public void visitNoBlock(GraphTargetVisitorInterface visitor) {
visit(visitor);
}
public abstract GraphTargetItem returnType();
@Override