mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-22 01:46:10 +00:00
Instead of walking code structures to get loops, the loops are populated by new faster algorithm. Also, we do not join adjacent GraphParts anymore in non-obfuscated code. For proper switch handling, the code is decompiled in two passes everytime (Previously, the second pass was used only sometimes). In first pass we do not process ifs as it may break switch detection. Second pass is executed after we know the switches position. Fixes #2542
38 lines
1.1 KiB
Java
38 lines
1.1 KiB
Java
/*
|
|
* Copyright (C) 2018 JPEXS, All rights reserved.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 3.0 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library.
|
|
*/
|
|
package com.jpexs.decompiler.graph;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* Basic Prev-Next walker which uses only nextParts+refs.
|
|
* @author JPEXS
|
|
*/
|
|
public class BasicPrevNextWalker implements PrevNextWalker {
|
|
|
|
@Override
|
|
public List<? extends GraphPart> getPrev(GraphPart node) {
|
|
return node.refs;
|
|
}
|
|
|
|
@Override
|
|
public List<? extends GraphPart> getNext(GraphPart node) {
|
|
return node.nextParts;
|
|
}
|
|
|
|
}
|