Reformating to fix checkstyle.

This commit is contained in:
Jindra Petřík
2024-08-07 18:33:17 +02:00
parent a5d3ce4f9b
commit f3da12e032
2432 changed files with 39110 additions and 44808 deletions

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,12 +20,14 @@ import java.util.Collection;
/**
* Abstract graph target visitor.
*
* @author JPEXS
*/
public abstract class AbstractGraphTargetVisitor implements GraphTargetVisitorInterface {
/**
* Visits a graph target item.
*
* @param item Graph target item
*/
@Override
@@ -33,6 +35,7 @@ public abstract class AbstractGraphTargetVisitor implements GraphTargetVisitorIn
/**
* Visits all graph target items.
*
* @param items Collection of graph target items
*/
@Override

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,20 +20,23 @@ import com.jpexs.decompiler.graph.model.ContinueItem;
import java.util.List;
/**
* Block interface.
* For example, a block can be a loop, if statement, or a function.
* Block interface. For example, a block can be a loop, if statement, or a
* function.
*
* @author JPEXS
*/
public interface Block {
/**
* Gets all sub continues.
*
* @return List of continues
*/
public List<ContinueItem> getContinues();
/**
* Gets all sub blocks.
*
* @return List of blocks
*/
public List<List<GraphTargetItem>> getSubs();

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph;
/**
* Compilation exception.
*
* @author JPEXS
*/
public class CompilationException extends Exception {
@@ -34,6 +35,7 @@ public class CompilationException extends Exception {
/**
* Constructs a new compilation exception.
*
* @param message Error message
* @param line Line number
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -26,14 +26,13 @@ import java.util.List;
import java.util.Objects;
/**
* Dotted chain class.
* Represents a chain of names separated by dots.
* Dotted chain class. Represents a chain of names separated by dots.
*
* @author JPEXS
*/
public class DottedChain implements Serializable, Comparable<DottedChain> {
//Basic dotted chains
public static final DottedChain EMPTY = new DottedChain(true);
public static final DottedChain UNBOUNDED = new DottedChain(new String[]{"*"});
@@ -80,6 +79,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Get the namespace suffix of the part at the given index.
*
* @param index Index
* @return Namespace suffix
*/
@@ -89,6 +89,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Gets the last namespace suffix.
*
* @return Last namespace suffix
*/
public String getLastNamespaceSuffix() {
@@ -100,6 +101,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Parses a dotted chain from a string without suffix.
*
* @param name Name
* @return Dotted chain
*/
@@ -121,6 +123,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Parses a dotted chain from a string with suffix.
*
* @param name Name
* @return Dotted chain
*/
@@ -148,6 +151,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Constructs a new dotted chain.
*
* @param isNull Whether the chain is null
*/
private DottedChain(boolean isNull) {
@@ -157,6 +161,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Constructs a new dotted chain.
*
* @param src Source chain
*/
public DottedChain(DottedChain src) {
@@ -166,6 +171,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Constructs a new dotted chain.
*
* @param parts Parts
*/
public DottedChain(String[] parts) {
@@ -174,6 +180,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Constructs a new dotted chain.
*
* @param parts Parts
* @param isNull Whether the chain is null
*/
@@ -184,6 +191,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Constructs a new dotted chain.
*
* @param parts Parts
*/
public DottedChain(List<String> parts) {
@@ -196,6 +204,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Constructs a new dotted chain.
*
* @param parts Parts
* @param namespaceSuffixes Namespace suffixes
*/
@@ -205,6 +214,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Constructs a new dotted chain.
*
* @param attributes Attributes
* @param parts Parts
* @param namespaceSuffixes Namespace suffixes
@@ -220,6 +230,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Checks whether this chain is top-level.
*
* @return Whether this chain is top-level
*/
public boolean isTopLevel() {
@@ -228,6 +239,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Checks whether this chain is empty.
*
* @return Whether this chain is empty
*/
public boolean isEmpty() {
@@ -236,6 +248,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Gets the number of parts in this chain.
*
* @return Number of parts
*/
public int size() {
@@ -244,6 +257,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Gets the part at the given index.
*
* @param index Index
* @return Part
*/
@@ -257,6 +271,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Checks whether the part at the given index is an attribute.
*
* @param index Index
* @return Whether the part at the given index is an attribute
*/
@@ -269,6 +284,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Gets the sub-chain of specific length.
*
* @param count Length
* @return
*/
@@ -282,6 +298,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Gets last part.
*
* @return Last part
*/
public String getLast() {
@@ -297,6 +314,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Checks whether the last part is an attribute.
*
* @return Whether the last part is an attribute
*/
public boolean isLastAttribute() {
@@ -312,6 +330,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Gets the chain without the last part.
*
* @return Chain without the last part
*/
public DottedChain getWithoutLast() {
@@ -327,6 +346,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Adds a part to the chain with a suffix.
*
* @param name Name
* @return New chain
*/
@@ -342,6 +362,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Adds a part to the chain.
*
* @param name Name
* @param namespaceSuffix Namespace suffix
* @return New chain
@@ -352,6 +373,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Adds a part to the chain.
*
* @param attribute Whether the part is an attribute
* @param name Name
* @param namespaceSuffix Namespace suffix
@@ -368,6 +390,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Adds prefix to the chain.
*
* @param name Name
* @param namespaceSuffix Namespace suffix
* @return New chain
@@ -378,6 +401,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Adds prefix to the chain.
*
* @param attribute Whether the part is an attribute
* @param name Name
* @param namespaceSuffix Namespace suffix
@@ -394,6 +418,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* To string.
*
* @return String
*/
@Override
@@ -403,6 +428,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* To string.
*
* @param as3 Whether to print as AS3
* @param raw Whether to print raw (without deobfuscation)
* @param withSuffix Whether to print with suffix
@@ -437,6 +463,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* To file path.
*
* @return File path
*/
public String toFilePath() {
@@ -460,6 +487,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* To list.
*
* @return List
*/
public List<String> toList() {
@@ -472,6 +500,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* To printable string.
*
* @param as3 Whether to print as AS3
* @return Printable string
*/
@@ -481,6 +510,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* To raw string. (without deobfuscation)
*
* @return Raw string
*/
public String toRawString() { //Is SUFFIX correctly handled?
@@ -489,6 +519,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Hash code.
*
* @return Hash code
*/
@Override
@@ -501,6 +532,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Equals.
*
* @param obj Object
* @return Whether this object is equal to the given object
*/
@@ -524,8 +556,10 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Compare to.
*
* @param o the object to be compared.
* @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
* @return a negative integer, zero, or a positive integer as this object is
* less than, equal to, or greater than the specified object.
*/
@Override
public int compareTo(DottedChain o) {
@@ -554,6 +588,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Constructs a new path part.
*
* @param name Name
* @param attribute Whether this part is an attribute
* @param namespaceSuffix Namespace suffix
@@ -566,6 +601,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Hash code.
*
* @return
*/
@Override
@@ -579,6 +615,7 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
/**
* Equals.
*
* @param obj Object
* @return Whether this object is equal to the given object
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.graph.model.BinaryOp;
/**
* Equals type item.
*
* @author JPEXS
*/
public interface EqualsTypeItem extends BinaryOp {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -72,11 +72,11 @@ import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Graph class.
* This is the main class where decompilation process is done.
* It translates GraphSourceItems to GraphTargetItems.
*
* Graph class. This is the main class where decompilation process is done. It
* translates GraphSourceItems to GraphTargetItems.
* <p>
* Subclasses of Graph are used for different types of decompilation.
*
* @author JPEXS
*/
public class Graph {
@@ -98,6 +98,7 @@ public class Graph {
/**
* Constant not used anymore
*
* @deprecated not used.
*/
public static final int SOP_USE_STATIC = 0;
@@ -130,6 +131,7 @@ public class Graph {
/**
* Gets the graphSource
*
* @return GraphSource
*/
public GraphSource getGraphCode() {
@@ -138,6 +140,7 @@ public class Graph {
/**
* Gets sub-graphs
*
* @return
*/
public LinkedHashMap<String, Graph> getSubGraphs() {
@@ -146,6 +149,7 @@ public class Graph {
/**
* Constructs a new Graph.
*
* @param code Graph source
* @param exceptions Exceptions in the graph
*/
@@ -156,6 +160,7 @@ public class Graph {
/**
* Initializes the graph.
*
* @param localData Local data
* @throws InterruptedException
*/
@@ -177,7 +182,7 @@ public class Graph {
* Calculates time of closing the node. The node is closed when all its
* input edges are already visited (not counting back edges), then all its
* output edges are processed.
*
* <p>
* This time is useful when sorting nodes according their occurence in
* getMostCommonPart method - used for switch detection
*
@@ -243,6 +248,7 @@ public class Graph {
/**
* Constructs a new LevelMapEdge
*
* @param from Source part
* @param to Target part
*/
@@ -253,6 +259,7 @@ public class Graph {
/**
* Hash code
*
* @return Hash code
*/
@Override
@@ -265,6 +272,7 @@ public class Graph {
/**
* Equals
*
* @param obj Object
* @return True if equals
*/
@@ -291,6 +299,7 @@ public class Graph {
/**
* Gets graph exceptions.
*
* @return List of exceptions
*/
public List<GraphException> getExceptions() {
@@ -299,6 +308,7 @@ public class Graph {
/**
* Populates all parts available from the part.
*
* @param part Source part
* @param allParts Result
*/
@@ -314,6 +324,7 @@ public class Graph {
/**
* Deep copies GraphPart.
*
* @param part Source part
* @return Deep copy of the part
*/
@@ -323,6 +334,7 @@ public class Graph {
/**
* Deep copies GraphPart.
*
* @param part Source part
* @param copies Already copied parts
* @return Deep copy of the part
@@ -350,6 +362,7 @@ public class Graph {
/**
* Resets the graph.
*
* @param part Part to reset
* @param visited Visited parts
*/
@@ -372,6 +385,7 @@ public class Graph {
/**
* Gets reachable parts from the part.
*
* @param localData Local data
* @param part Source part
* @param ret Result
@@ -385,6 +399,7 @@ public class Graph {
/**
* Gets reachable parts from the part.
*
* @param localData Local data
* @param part Source part
* @param ret Result
@@ -494,6 +509,7 @@ public class Graph {
/**
* Gets common successor of the next parts of the part.
*
* @param localData Local data
* @param part Part
* @param loops Loops
@@ -507,8 +523,9 @@ public class Graph {
/**
* Gets common successor of the parts.
*
* <p>
* TODO: Make this faster!
*
* @param localData Local data
* @param prev Previous part
* @param parts Parts
@@ -578,7 +595,7 @@ public class Graph {
/**
* Gets common successor of most of the nextparts of the part.
*
* <p>
* This is used mostly in switch detection.
*
* @param localData Local data
@@ -789,6 +806,7 @@ public class Graph {
/**
* Constructs a new PartCommon
*
* @param part Part
* @param level Level
*/
@@ -799,6 +817,7 @@ public class Graph {
/**
* Compares to another PartCommon
*
* @param o Other PartCommon
* @return Comparison result
*/
@@ -817,6 +836,7 @@ public class Graph {
/**
* To string
*
* @return String representation
*/
@Override
@@ -826,6 +846,7 @@ public class Graph {
/**
* Hash code
*
* @return Hash code
*/
@Override
@@ -838,6 +859,7 @@ public class Graph {
/**
* Equals
*
* @param obj Object
* @return True if equals
*/
@@ -863,6 +885,7 @@ public class Graph {
/**
* Method called after populating all parts.
*
* @param allParts All parts
*/
protected void afterPopupateAllParts(Set<GraphPart> allParts) {
@@ -870,8 +893,8 @@ public class Graph {
}
/**
* Gets throw states.
* Override this method to get throw states.
* Gets throw states. Override this method to get throw states.
*
* @param localData Local data
* @param allParts All parts
* @return List of ThrowStates
@@ -882,6 +905,7 @@ public class Graph {
/**
* Translates the graph - decompiles.
*
* @param localData Local data
* @param staticOperation Unused
* @param path Path
@@ -989,9 +1013,9 @@ public class Graph {
}
/**
* Prepares second pass data.
* Can return null when no second pass will happen.
* Override this method to prepare second pass data.
* Prepares second pass data. Can return null when no second pass will
* happen. Override this method to prepare second pass data.
*
* @param list List of GraphTargetItems
* @return Second pass data or null
*/
@@ -1001,6 +1025,7 @@ public class Graph {
/**
* Process various items. Override this method to process items.
*
* @param list List of GraphTargetItems
* @param lastLoopId Last loop id
*/
@@ -1010,6 +1035,7 @@ public class Graph {
/**
* Process switches.
*
* @param list
*/
protected final void processSwitches(List<GraphTargetItem> list) {
@@ -1054,9 +1080,9 @@ public class Graph {
This will fix precontinue handler which detects multiple continues
*/
/**
* Process switches.
*
* @param list List of GraphTargetItems
* @param lastLoopId Last loop id
*/
@@ -1178,8 +1204,9 @@ public class Graph {
}
/**
* Gets data for final process.
* Override this method to provide data for final process.
* Gets data for final process. Override this method to provide data for
* final process.
*
* @param localData
* @param loops
* @param throwStates
@@ -1190,8 +1217,9 @@ public class Graph {
}
/**
* Method called before getting loops.
* Override this method to provide custom behavior.
* Method called before getting loops. Override this method to provide
* custom behavior.
*
* @param localData Local data
* @param path Path
* @param allParts All parts
@@ -1203,8 +1231,9 @@ public class Graph {
}
/**
* Method called after getting loops.
* Override this method to provide custom behavior.
* Method called after getting loops. Override this method to provide custom
* behavior.
*
* @param localData Local data
* @param path Path
* @param allParts All parts
@@ -1215,8 +1244,9 @@ public class Graph {
}
/**
* Checks whether part is empty.
* Override this method to provide custom behavior.
* Checks whether part is empty. Override this method to provide custom
* behavior.
*
* @param part Part
* @return True if part is empty
*/
@@ -1226,6 +1256,7 @@ public class Graph {
/**
* Converts path to string
*
* @param list Collection of objects
* @return String representation of the path
*/
@@ -1239,6 +1270,7 @@ public class Graph {
/**
* Gets unique part list.
*
* @param list List of parts
* @return Unique list of parts
*/
@@ -1254,6 +1286,7 @@ public class Graph {
/**
* Gets list of unique references of part without going through throw edges.
*
* @param part Part
* @param throwEdges Throw edges
* @return List of unique references
@@ -1272,6 +1305,7 @@ public class Graph {
/**
* Gets of loop backedges
*
* @param localData Local data
* @param loops Loops
* @param throwStates Throw states
@@ -1293,8 +1327,8 @@ public class Graph {
}
/**
* Final process stack.
* Override this method to provide custom behavior.
* Final process stack. Override this method to provide custom behavior.
*
* @param stack Translate stack
* @param output Output
* @param path Path
@@ -1304,6 +1338,7 @@ public class Graph {
/**
* Final process all.
*
* @param list List of GraphTargetItems
* @param level Level
* @param localData Local data
@@ -1327,10 +1362,11 @@ public class Graph {
}
/**
* Processes sub blocks.
* TODO: make this clearer what it does
* Processes sub blocks. TODO: make this clearer what it does
*
* @param b Block
* @param replacement If not null, then if last item of block is PushItem, then it will be replaced with this item
* @param replacement If not null, then if last item of block is PushItem,
* then it will be replaced with this item
* @return If all blocks ends with PushItem
*/
private boolean processSubBlk(Block b, GraphTargetItem replacement) {
@@ -1373,8 +1409,8 @@ public class Graph {
}
/**
* Final process after.
* Override this method to provide custom behavior.
* Final process after. Override this method to provide custom behavior.
*
* @param list List of GraphTargetItems
* @param level Level
* @param localData Local data
@@ -1397,8 +1433,8 @@ public class Graph {
}
/**
* Final process.
* Override this method to provide custom behavior.
* Final process. Override this method to provide custom behavior.
*
* @param list List of GraphTargetItems
* @param level Level
* @param localData Local data
@@ -1485,6 +1521,7 @@ public class Graph {
/**
* Expands gotos.
*
* @param list
*/
private void expandGotos(List<GraphTargetItem> list) {
@@ -1511,6 +1548,7 @@ public class Graph {
/**
* Processes if gotos.
*
* @param alreadyProcessedBlocks Already processed blocks
* @param allGotos All gotos
* @param list List of GraphTargetItems
@@ -1553,12 +1591,12 @@ public class Graph {
/**
* Processes if gotos.
*
* if (xxx) { y ; goto a } else { z ; goto a }
*
* =>
*
* if (xxx) { y } else { z } goto a
* <p>
* if (xxx) { y ; goto a } else { z ; goto a }
* <p>
* =>
* <p>
* if (xxx) { y } else { z } goto a
*
* @param allGotos All gotos
* @param list List of GraphTargetItems
@@ -1633,6 +1671,7 @@ public class Graph {
/**
* Processes ifs.
*
* @param list List of GraphTargetItems
*/
protected final void processIfs(List<GraphTargetItem> list) {
@@ -1819,7 +1858,9 @@ public class Graph {
}
/**
* Checks continue at the end of block and remove it when its from nearest loop.
* Checks continue at the end of block and remove it when its from nearest
* loop.
*
* @param commands List of GraphTargetItems
* @param loop Loop
*/
@@ -1850,6 +1891,7 @@ public class Graph {
/**
* Checks whether list of items is empty.
*
* @param output List of GraphTargetItems
* @return True if list of items is empty
*/
@@ -1866,8 +1908,9 @@ public class Graph {
}
/**
* Check before decompiling next section.
* Override this method to provide custom behavior.
* Check before decompiling next section. Override this method to provide
* custom behavior.
*
* @param currentRet Current return
* @param foundGotos Found gotos
* @param partCodes Part codes
@@ -1887,7 +1930,8 @@ public class Graph {
* @param currentLoop Current loop
* @param staticOperation Unused
* @param path Path
* @return List of GraphTargetItems to replace current output and stop further processing. Null to continue.
* @return List of GraphTargetItems to replace current output and stop
* further processing. Null to continue.
* @throws InterruptedException
*/
protected List<GraphTargetItem> check(List<GraphTargetItem> currentRet, List<GotoItem> foundGotos, Map<GraphPart, List<GraphTargetItem>> partCodes, Map<GraphPart, Integer> partCodePos, Set<GraphPart> visited, GraphSource code, BaseLocalData localData, Set<GraphPart> allParts, TranslateStack stack, GraphPart parent, GraphPart part, List<GraphPart> stopPart, List<StopPartKind> stopPartKind, List<Loop> loops, List<ThrowState> throwStates, List<GraphTargetItem> output, Loop currentLoop, int staticOperation, String path) throws InterruptedException {
@@ -1895,8 +1939,8 @@ public class Graph {
}
/**
* Check of Part passing output. Allows you to switch part for another.
* If not overriden, then it calls checkPart.
* Check of Part passing output. Allows you to switch part for another. If
* not overriden, then it calls checkPart.
*
* @param output List of GraphTargetItems
* @param stack Translate stack
@@ -1904,7 +1948,8 @@ public class Graph {
* @param prev Previous part
* @param part Part
* @param allParts All parts
* @return Return same part to continue processing or return another part to continue to other part. Or return null to stop.
* @return Return same part to continue processing or return another part to
* continue to other part. Or return null to stop.
*/
protected GraphPart checkPartWithOutput(List<GraphTargetItem> output, TranslateStack stack, BaseLocalData localData, GraphPart prev, GraphPart part, Set<GraphPart> allParts) {
return checkPart(stack, localData, prev, part, allParts);
@@ -1912,12 +1957,14 @@ public class Graph {
/**
* Check of part. Allows you to switch part for another.
*
* @param stack Translate stack
* @param localData Local data
* @param prev Previous part
* @param part Part
* @param allParts All parts
* @return Return same part to continue processing or return another part to continue to other part. Or return null to stop.
* @return Return same part to continue processing or return another part to
* continue to other part. Or return null to stop.
*/
protected GraphPart checkPart(TranslateStack stack, BaseLocalData localData, GraphPart prev, GraphPart part, Set<GraphPart> allParts) {
return part;
@@ -1925,6 +1972,7 @@ public class Graph {
/**
* Translates part and get its stack.
*
* @param localData Local data
* @param part Part
* @param stack Translate stack
@@ -1942,6 +1990,7 @@ public class Graph {
/**
* Translates part.
*
* @param localData Local data
* @param part Part
* @param stack Translate stack
@@ -1973,6 +2022,7 @@ public class Graph {
/**
* Checks for Continue and Break items at current part.
*
* @param output List of GraphTargetItems
* @param part Part
* @param stopPart Stop part
@@ -2007,8 +2057,8 @@ public class Graph {
}
/**
* Check loop.
* Can be overriden to provide custom behavior.
* Check loop. Can be overriden to provide custom behavior.
*
* @param output List of GraphTargetItems
* @param loopItem Loop item
* @param localData Local data
@@ -2023,6 +2073,7 @@ public class Graph {
/**
* Sets loop phase to 0 on loops.
*
* @param loops List of loops
*/
private void clearLoops(List<Loop> loops) {
@@ -2033,6 +2084,7 @@ public class Graph {
/**
* Sets state to 0 on throw states.
*
* @param throwStates List of throw states
*/
private void clearThrowStates(List<ThrowState> throwStates) {
@@ -2043,6 +2095,7 @@ public class Graph {
/**
* Loop detection.
*
* @param localData Local data
* @param part Part
* @param loops List of loops
@@ -2059,8 +2112,9 @@ public class Graph {
}
/**
* Checks whether a part can be a break candidate.
* Can be overriden to provide custom behavior.
* Checks whether a part can be a break candidate. Can be overriden to
* provide custom behavior.
*
* @param localData Local data
* @param part Part
* @param throwStates List of throw states
@@ -2071,8 +2125,9 @@ public class Graph {
}
/**
* Check part in get loops walk.
* Can be overriden to provide custom behavior.
* Check part in get loops walk. Can be overriden to provide custom
* behavior.
*
* @param part Graph part
*/
protected void checkGetLoopsPart(GraphPart part) {
@@ -2081,6 +2136,7 @@ public class Graph {
/**
* Finds parts outside try statement
*
* @param ts Throw state
* @param part Graph part
* @param ret List of Graph parts
@@ -2102,6 +2158,7 @@ public class Graph {
/**
* Walks parts to detect loops.
*
* @param localData Local data
* @param part Graph part
* @param loops List of loops
@@ -2510,6 +2567,7 @@ public class Graph {
/**
* Gets all Continue commands in sub blocks.
*
* @param commands List of GraphTargetItems
* @param result Result
* @param loopId Loop id
@@ -2532,8 +2590,8 @@ public class Graph {
}
/**
* Get next parts of a part.
* Can be overriden to provide custom behavior.
* Get next parts of a part. Can be overriden to provide custom behavior.
*
* @param localData Local data
* @param part Part
* @return List of GraphParts
@@ -2544,6 +2602,7 @@ public class Graph {
/**
* Check before processing with output.
*
* @param currentRet Current return
* @param foundGotos Found gotos
* @param partCodes Part codes
@@ -2572,6 +2631,7 @@ public class Graph {
/**
* Checks whether part is loop continue, break or precontinue.
*
* @param part Graph part
* @param loops List of loops
* @param throwStates List of throw states
@@ -2595,9 +2655,9 @@ public class Graph {
}
/**
* Checks whether part can be continue of a loop.
* Defaults to true.
* Override this method to provide custom behavior.
* Checks whether part can be continue of a loop. Defaults to true. Override
* this method to provide custom behavior.
*
* @param localData Local data
* @param part Graph part
* @param loops List of loops
@@ -2609,9 +2669,9 @@ public class Graph {
}
/**
* Checks whether part can be checked over visited parts list.
* Defaults to true.
* Can be overriden to provide custom behavior.
* Checks whether part can be checked over visited parts list. Defaults to
* true. Can be overriden to provide custom behavior.
*
* @param localData Local data
* @param part Graph part
* @return True if part can be checked over visited parts list
@@ -2621,9 +2681,12 @@ public class Graph {
}
/**
* Checks whether the list of items can be converted to comma separated list.
* Checks whether the list of items can be converted to comma separated
* list.
*
* @param list List of GraphTargetItems
* @return True if the list of items can be converted to comma separated list
* @return True if the list of items can be converted to comma separated
* list
*/
protected final boolean canBeCommaised(List<GraphTargetItem> list) {
for (GraphTargetItem item : list) {
@@ -2636,6 +2699,7 @@ public class Graph {
/**
* Walks graph parts and converts them to target items.
*
* @param foundGotos Found gotos
* @param partCodes Part codes
* @param partCodePos Part code position
@@ -2660,6 +2724,7 @@ public class Graph {
/**
* Walks graph parts and converts them to target items.
*
* @param foundGotos Found gotos
* @param partCodes Part codes
* @param partCodePos Part code position
@@ -2894,9 +2959,7 @@ public class Graph {
precontinueCommands = printGraph(foundGotos, partCodes, partCodePos, subVisited, localData, new TranslateStack(path), allParts, null, backup, stopPart2, stopPartKind2, loops, throwStates, null, staticOperation, path, recursionLevel + 1);
currentLoop.loopPreContinue = backup;
checkContinueAtTheEnd(precontinueCommands, currentLoop);
if (!precontinueCommands.isEmpty() && precontinueCommands.get(precontinueCommands.size() - 1) instanceof IfItem) {
IfItem ifi = (IfItem) precontinueCommands.get(precontinueCommands.size() - 1);
boolean ok = false;
@@ -2910,11 +2973,11 @@ public class Graph {
&& ((ifi.onFalse.size() == 1) && (ifi.onFalse.get(0) instanceof BreakItem) && (((BreakItem) ifi.onFalse.get(0)).loopId == currentLoop.id))) {
ok = true;
}
if (ok) {
if (ok) {
doWhileCandidate = true;
}
}
}
if (!doWhileCandidate) {
for (GraphTargetItem item : precontinueCommands) {
if (item instanceof Block) {
@@ -3370,13 +3433,13 @@ public class Graph {
}
if (isLoop && loopItem != null && currentLoop != null) {
processIfs(loopItem.commands);
processSwitches(loopItem.commands, currentLoop.id);
processOther(loopItem.commands, currentLoop.id);
checkContinueAtTheEnd(loopItem.commands, currentLoop);
//DoWhile based on precontinue
if (!loopTypeFound && (!loopItem.commands.isEmpty())) {
List<List<GraphTargetItem>> continueCommands1 = new ArrayList<>();
@@ -3391,19 +3454,19 @@ public class Graph {
&& ((ifi.onFalse.size() == 1) && (ifi.onFalse.get(0) instanceof ContinueItem) && (((ContinueItem) ifi.onFalse.get(0)).loopId == currentLoop.id))) {
invert = true;
}
GraphTargetItem expr = ifi.expression;
if (invert) {
expr = expr.invert(null);
}
exprList.add(expr);
ret.add(index, li = new DoWhileItem(null, expr.getLineStartItem(), currentLoop, loopItem.commands, exprList));
loopTypeFound = true;
loopTypeFound = true;
}
}
//Loop with condition at the beginning (While)
if (!loopTypeFound && (!loopItem.commands.isEmpty())) {
if (!loopTypeFound && (!loopItem.commands.isEmpty())) {
if (loopItem.commands.get(0) instanceof IfItem) {
IfItem ifi = (IfItem) loopItem.commands.get(0);
@@ -3458,7 +3521,7 @@ public class Graph {
//findGotoTargets - comment this out:
if (!precontinueCommands.isEmpty()) {
List<List<GraphTargetItem>> continueCommands = new ArrayList<>();
getContinuesCommands(commands, continueCommands, currentLoop.id);
@@ -3476,7 +3539,7 @@ public class Graph {
}
finalComm.addAll(precontinueCommands);
}
}
if (!finalComm.isEmpty()) {
ret.add(index, li = new ForItem(expr.getSrc(), expr.getLineStartItem(), currentLoop, new ArrayList<>(), exprList.get(exprList.size() - 1), finalComm, commands));
} else {
@@ -3490,7 +3553,7 @@ public class Graph {
}
}
}
if (!loopTypeFound && !precontinueCommands.isEmpty()) {
loopItem.commands.addAll(precontinueCommands);
}
@@ -3567,8 +3630,9 @@ public class Graph {
}
/**
* Checks switch statement.
* Override this method to add custom switch handling.
* Checks switch statement. Override this method to add custom switch
* handling.
*
* @param localData Local data
* @param switchItem Switch item
* @param otherSides Other sides
@@ -3579,16 +3643,18 @@ public class Graph {
}
/**
* Checks all parts of the graph after they are populated.
* Override this method to add custom checks.
* Checks all parts of the graph after they are populated. Override this
* method to add custom checks.
*
* @param allBlocks All blocks
*/
protected void checkGraph(List<GraphPart> allBlocks) {
}
/**
* Checks IP and allows to modify it.
* Override this method to add custom IP checks.
* Checks IP and allows to modify it. Override this method to add custom IP
* checks.
*
* @param ip Current IP
* @return New IP
*/
@@ -3598,6 +3664,7 @@ public class Graph {
/**
* Searches for part by IP.
*
* @param ip IP
* @param allParts All parts
* @return
@@ -3616,6 +3683,7 @@ public class Graph {
/**
* Makes connected set of GraphParts from GraphSource.
*
* @param code Graph source
* @param allBlocks All blocks to populate parts into.
* @param exceptions Exceptions
@@ -3644,6 +3712,7 @@ public class Graph {
/**
* Makes connected set of GraphParts from GraphSource.
*
* @param parent Parent part
* @param path Path
* @param code Graph source
@@ -3795,8 +3864,9 @@ public class Graph {
}
/**
* Prepares local data for branch.
* Override this method to add custom branch handling.
* Prepares local data for branch. Override this method to add custom branch
* handling.
*
* @param localData Local data
* @return Local data for a branch
*/
@@ -3806,6 +3876,7 @@ public class Graph {
/**
* Get source items for a part
*
* @param part Part
* @return List of source items
*/
@@ -3834,6 +3905,7 @@ public class Graph {
/**
* Moves all pushitems from commands to stack.
*
* @param commands Commands
* @param stack Stack
*/
@@ -3853,8 +3925,9 @@ public class Graph {
}
/**
* Moves all stack items to commands.
* (If it's not a branch stack resistant or other special case)
* Moves all stack items to commands. (If it's not a branch stack resistant
* or other special case)
*
* @param commands Commands
* @param stack Stack
*/
@@ -3902,6 +3975,7 @@ public class Graph {
/**
* Handles switch statement.
*
* @param switchedObject Switched object
* @param switchStartItem Switch start item
* @param foundGotos Found gotos
@@ -4172,9 +4246,9 @@ public class Graph {
}
/**
* Checks if part is a switch.
* Defaults to false.
* Override this method to add custom switch handling.
* Checks if part is a switch. Defaults to false. Override this method to
* add custom switch handling.
*
* @param part Part
* @return True if part is a switch
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph;
/**
* Exception thrown in the graph.
*
* @author JPEXS
*/
public class GraphException {
@@ -38,6 +39,7 @@ public class GraphException {
/**
* Constructs a new exception
*
* @param start Start IP
* @param end End IP
* @param target Target IP

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -24,9 +24,9 @@ import java.util.List;
import java.util.Stack;
/**
* Represents a part of a graph.
* Block of instructions which are executed in sequence.
* No jumps or branches are allowed inside a GraphPart.
* Represents a part of a graph. Block of instructions which are executed in
* sequence. No jumps or branches are allowed inside a GraphPart.
*
* @author JPEXS
*/
public class GraphPart implements Serializable {
@@ -67,32 +67,29 @@ public class GraphPart implements Serializable {
public int discoveredTime;
/**
* Finished time in DFS
* Calculated in setTime.
* Finished time in DFS Calculated in setTime.
*/
public int finishedTime;
/**
* Closed time.
* The node is closed when all its input edges are already visited.
* Calculated in Graph.calculateClosedTime.
* Closed time. The node is closed when all its input edges are already
* visited. Calculated in Graph.calculateClosedTime.
*/
public int closedTime;
/**
* Order in DFS.
* Calculated in setTime.
* Order in DFS. Calculated in setTime.
*/
public int order;
/**
* Number of parts following this part.
* Calculated in setNumblocks.
* Number of parts following this part. Calculated in setNumblocks.
*/
public int numBlocks = Integer.MAX_VALUE;
/**
* Sets the time of this part in DFS.
*
* @param time Time
* @param ordered Ordered parts
* @param visited Visited parts
@@ -118,6 +115,7 @@ public class GraphPart implements Serializable {
/**
* Sets the number of blocks following this part.
*
* @param numBlocks Number of blocks
*/
public void setNumblocks(int numBlocks) {
@@ -132,6 +130,7 @@ public class GraphPart implements Serializable {
/**
* Checks if this part leads to another part.
*
* @param localData Local data
* @param gr Graph
* @param code Code
@@ -215,6 +214,7 @@ public class GraphPart implements Serializable {
/**
* Checks if this part leads to another part.
*
* @param localData Local data
* @param gr Graph
* @param code Code
@@ -234,6 +234,7 @@ public class GraphPart implements Serializable {
/**
* Constructs a new GraphPart.
*
* @param start Start IP
* @param end End IP
*/
@@ -244,6 +245,7 @@ public class GraphPart implements Serializable {
/**
* To string.
*
* @return String representation
*/
@Override
@@ -260,6 +262,7 @@ public class GraphPart implements Serializable {
/**
* Checks if this part contains an IP.
*
* @param ip IP
* @return True if this part contains the IP
*/
@@ -269,6 +272,7 @@ public class GraphPart implements Serializable {
/**
* Gets the height of this part - number of instructions in this part.
*
* @return Height
*/
public int getHeight() {
@@ -277,6 +281,7 @@ public class GraphPart implements Serializable {
/**
* Gets IP at offset from start.
*
* @param offset Offset
* @return IP
*/
@@ -295,6 +300,7 @@ public class GraphPart implements Serializable {
/**
* Hash code.
*
* @return Hash code
*/
@Override
@@ -306,6 +312,7 @@ public class GraphPart implements Serializable {
/**
* Equals.
*
* @param obj Object
* @return True if equals
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,6 +20,7 @@ import java.util.List;
/**
* Exception when part of the graph is changed.
*
* @author JPEXS
*/
public class GraphPartChangeException extends Exception {
@@ -36,6 +37,7 @@ public class GraphPartChangeException extends Exception {
/**
* Constructs a new GraphPartChangeException
*
* @param output Output
* @param ip IP
*/
@@ -46,6 +48,7 @@ public class GraphPartChangeException extends Exception {
/**
* Gets the IP
*
* @return IP
*/
public int getIp() {
@@ -54,6 +57,7 @@ public class GraphPartChangeException extends Exception {
/**
* Gets the output
*
* @return Output
*/
public List<GraphTargetItem> getOutput() {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,6 +20,7 @@ import java.util.Objects;
/**
* Edge of a graph. Represents a connection between two GraphParts.
*
* @author JPEXS
*/
public class GraphPartEdge {
@@ -36,6 +37,7 @@ public class GraphPartEdge {
/**
* Constructs a new edge
*
* @param from From
* @param to To
*/
@@ -46,6 +48,7 @@ public class GraphPartEdge {
/**
* Hash code
*
* @return Hash code
*/
@Override
@@ -58,6 +61,7 @@ public class GraphPartEdge {
/**
* Equals
*
* @param obj Object to compare
* @return True if equals
*/
@@ -84,6 +88,7 @@ public class GraphPartEdge {
/**
* To string
*
* @return String representation
*/
@Override

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,6 +22,7 @@ import java.util.List;
/**
* List which can store parts of the graph for each element.
*
* @author JPEXS
*/
public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
@@ -38,6 +39,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Constructs GraphPartMarkedArrayList from another collection.
*
* @param collection
*/
@SuppressWarnings("unchecked")
@@ -63,6 +65,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Starts new part.
*
* @param part Part
*/
public void startPart(GraphPart part) {
@@ -78,6 +81,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Adds element to the collection.
*
* @param e element whose presence in this collection is to be ensured
* @return true if this collection changed as a result of the call
*/
@@ -89,6 +93,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Inserts the specified element at the specified position in this list.
*
* @param index index at which the specified element is to be inserted
* @param element element to be inserted
*/
@@ -100,6 +105,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Returns the parts at the specified index.
*
* @param index index of the element
* @return parts at the specified index
*/
@@ -109,6 +115,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Gets the index of the part in the list.
*
* @param part
* @return
*/
@@ -124,6 +131,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Adds all elements from the collection to this collection.
*
* @param c collection containing elements to be added to this collection
* @return true if this collection changed as a result of the call
*/
@@ -144,8 +152,9 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Inserts all elements in the specified collection into this list at the
*
* @param index index at which to insert the first element from the
* specified collection
* specified collection
* @param c collection containing elements to be added to this list
* @return true if this list changed as a result of the call
*/
@@ -166,6 +175,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Removes the first occurrence of the specified element from this list, if
*
* @param o element to be removed from this list, if present
* @return true if an element was removed as a result of this call
*/
@@ -179,6 +189,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Removes the element at the specified position in this list. Shifts any
*
* @param index the index of the element to be removed
* @return the element that was removed from the list
*/
@@ -199,6 +210,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Returns a view of the portion of this list between the specified
*
* @param fromIndex low endpoint (inclusive) of the subList
* @param toIndex high endpoint (exclusive) of the subList
* @return a view of the specified range within this list
@@ -217,6 +229,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Returns a shallow copy of this ArrayList instance.
*
* @return a clone of this ArrayList instance
*/
@Override
@@ -226,6 +239,7 @@ public class GraphPartMarkedArrayList<E> extends ArrayList<E> {
/**
* Removes from this list all of its elements that are contained in the
*
* @param c collection containing elements to be removed from this list
* @return true if this list changed as a result of the call
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -21,6 +21,7 @@ import java.util.LinkedList;
/**
* Queue of GraphPart objects.
*
* @author JPEXS
*/
public class GraphPartQueue extends LinkedList<GraphPart> {
@@ -28,7 +29,9 @@ public class GraphPartQueue extends LinkedList<GraphPart> {
public Loop currentLoop;
/**
* Constructs a GraphPartQueue containing the elements of the specified collection.
* Constructs a GraphPartQueue containing the elements of the specified
* collection.
*
* @param c
*/
public GraphPartQueue(Collection<? extends GraphPart> c) {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -23,6 +23,7 @@ import java.util.Objects;
/**
* Represents a path in a graph.
*
* @author JPEXS
*/
public class GraphPath implements Serializable {
@@ -43,7 +44,9 @@ public class GraphPath implements Serializable {
public final String rootName;
/**
* Constructs a GraphPath with the given root name, branch IPs and branch indices.
* Constructs a GraphPath with the given root name, branch IPs and branch
* indices.
*
* @param rootName Root name
* @param branchIps Branch IPs
* @param branchIndices Branch indices
@@ -56,6 +59,7 @@ public class GraphPath implements Serializable {
/**
* Constructs a GraphPath with the given branch IPs and branch indices.
*
* @param branchIps Branch IPs
* @param branchIndices Branch indices
*/
@@ -74,6 +78,7 @@ public class GraphPath implements Serializable {
/**
* Checks whether the path starts with the given path.
*
* @param p
* @return True if the path starts with the given path, false otherwise
*/
@@ -98,6 +103,7 @@ public class GraphPath implements Serializable {
/**
* Returns a new parent GraphPath with the given length.
*
* @param len Length
* @return
*/
@@ -111,7 +117,9 @@ public class GraphPath implements Serializable {
}
/**
* Returns a new sub GraphPath with the given branch index and code position.
* Returns a new sub GraphPath with the given branch index and code
* position.
*
* @param branchIndex Branch index
* @param codePos Code position
* @return New sub GraphPath
@@ -125,6 +133,7 @@ public class GraphPath implements Serializable {
/**
* Constructs a GraphPath with the given root name.
*
* @param rootName Root name
*/
public GraphPath(String rootName) {
@@ -133,6 +142,7 @@ public class GraphPath implements Serializable {
/**
* Gets length of the path.
*
* @return Length
*/
public int length() {
@@ -141,6 +151,7 @@ public class GraphPath implements Serializable {
/**
* Gets the branch index at the given index.
*
* @param index Index
* @return Branch index
*/
@@ -150,6 +161,7 @@ public class GraphPath implements Serializable {
/**
* Gets the IP at the given index.
*
* @param index Index
* @return IP
*/
@@ -159,6 +171,7 @@ public class GraphPath implements Serializable {
/**
* Hash code.
*
* @return Hash code
*/
@Override
@@ -172,6 +185,7 @@ public class GraphPath implements Serializable {
/**
* Equals.
*
* @param obj Eq
* @return
*/
@@ -205,6 +219,7 @@ public class GraphPath implements Serializable {
/**
* Hash code for a list of integers.
*
* @param arr List of integers
* @return Hash code
*/
@@ -223,6 +238,7 @@ public class GraphPath implements Serializable {
/**
* Checks whether two lists of integers match.
*
* @param arr List of integers
* @param arr2 List of integers
* @return True if the lists match, false otherwise
@@ -241,6 +257,7 @@ public class GraphPath implements Serializable {
/**
* Returns a string representation of the GraphPath.
*
* @return String representation
*/
@Override

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -26,18 +26,21 @@ import java.util.Set;
/**
* Graph source abstract class
*
* @author JPEXS
*/
public abstract class GraphSource implements Serializable {
/**
* Gets the size of the graph source
*
* @return The size of the graph source
*/
public abstract int size();
/**
* Gets the graph source item at the specified position
*
* @param pos Position of the graph source item
* @return The graph source item at the specified position
*/
@@ -45,12 +48,14 @@ public abstract class GraphSource implements Serializable {
/**
* Checks if the graph source is empty
*
* @return True if the graph source is empty, false otherwise
*/
public abstract boolean isEmpty();
/**
* Translates the part of the graph source
*
* @param graph Graph
* @param part Graph part
* @param localData Local data
@@ -67,12 +72,14 @@ public abstract class GraphSource implements Serializable {
/**
* Gets the important addresses
*
* @return Set of important addresses
*/
public abstract Set<Long> getImportantAddresses();
/**
* Converts instruction at the specified position to string
*
* @param pos Position of the instruction
* @return Instruction as string
*/
@@ -80,6 +87,7 @@ public abstract class GraphSource implements Serializable {
/**
* Visits the code
*
* @param ip Start position
* @param lastIp Last position
* @param refs References
@@ -142,6 +150,7 @@ public abstract class GraphSource implements Serializable {
/**
* Visits the code
*
* @param alternateEntries Alternate entries
* @return References
* @throws InterruptedException
@@ -163,6 +172,7 @@ public abstract class GraphSource implements Serializable {
/**
* Converts address to position
*
* @param adr Address
* @return Position
*/
@@ -170,6 +180,7 @@ public abstract class GraphSource implements Serializable {
/**
* Converts address to position
*
* @param adr Address
* @param nearest Nearest
* @return Position
@@ -178,6 +189,7 @@ public abstract class GraphSource implements Serializable {
/**
* Gets the address after the code
*
* @return Address after the code
*/
public long getAddressAfterCode() {
@@ -190,6 +202,7 @@ public abstract class GraphSource implements Serializable {
/**
* Converts position to address
*
* @param pos Position
* @return Address
*/
@@ -197,6 +210,7 @@ public abstract class GraphSource implements Serializable {
/**
* Converts position to address
*
* @param pos Position
* @param allowPosAfterCode Allow position after code
* @return Address

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,12 +22,14 @@ import java.util.List;
/**
* Item of Graph source. Usually an instruction.
*
* @author JPEXS
*/
public interface GraphSourceItem extends Serializable, Cloneable {
/**
* Translate the item to target items.
*
* @param localData Local data
* @param stack Stack
* @param output Output list
@@ -39,6 +41,7 @@ public interface GraphSourceItem extends Serializable, Cloneable {
/**
* Gets the number of stack items that are popped by this item.
*
* @param localData Local data
* @param stack Stack
* @return Number of stack items that are popped by this item
@@ -47,6 +50,7 @@ public interface GraphSourceItem extends Serializable, Cloneable {
/**
* Gets the number of stack items that are pushed by this item.
*
* @param localData Local data
* @param stack Stack
* @return Number of stack items that are pushed by this item
@@ -55,49 +59,56 @@ public interface GraphSourceItem extends Serializable, Cloneable {
/**
* Gets file offset.
*
* @return File offset
*/
public long getFileOffset();
/**
* Checks whether this item is a jump.
*
* @return True if this item is a jump, false otherwise
*/
public boolean isJump();
/**
* Checks whether this item is a branch.
*
* @return True if this item is a branch, false otherwise
*/
public boolean isBranch();
/**
* Checks whether this item is an exit (throw, return, etc.).
*
* @return True if this item is an exit, false otherwise
*/
public boolean isExit();
/**
* Gets the address.
*
* @return Address
*/
public long getAddress();
/**
* Gets the line offset.
*
* @return Line offset
*/
public long getLineOffset();
/**
* Checks whether the loops are ignored.
* FIXME: What is this, how to use it?
* Checks whether the loops are ignored. FIXME: What is this, how to use it?
*
* @return True if the loops are ignored, false otherwise
*/
public boolean ignoredLoops();
/**
* Gets branches
*
* @param code Code
* @return List of IPs to branch to
*/
@@ -105,38 +116,45 @@ public interface GraphSourceItem extends Serializable, Cloneable {
/**
* Checks whether this item is ignored.
*
* @return True if this item is ignored, false otherwise
*/
public boolean isIgnored();
/**
* Sets whether this item is ignored.
*
* @param ignored True if this item is ignored, false otherwise
* @param pos Sub position
*/
public void setIgnored(boolean ignored, int pos);
/**
* Checks whether this item is a DeobfuscatePop instruction.
* It is a special instruction for deobfuscation.
* @return True if this item is a DeobfuscatePop instruction, false otherwise
* Checks whether this item is a DeobfuscatePop instruction. It is a special
* instruction for deobfuscation.
*
* @return True if this item is a DeobfuscatePop instruction, false
* otherwise
*/
public boolean isDeobfuscatePop();
/**
* Gets the line in the high level source code.
*
* @return Line
*/
public int getLine();
/**
* Gets the high level source code file name.
*
* @return File name
*/
public String getFile();
/**
* Gets length of the item in bytes.
*
* @return Length of the item in bytes
*/
public abstract int getBytesLength();

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,24 +22,28 @@ import java.util.List;
/**
* Container for source items.
*
* @author JPEXS
*/
public interface GraphSourceItemContainer {
/**
* Gets the size of the header.
*
* @return The size of the header.
*/
public long getHeaderSize();
/**
* Gets the sizes of the container parts.
*
* @return List of sizes of the container parts.
*/
public List<Long> getContainerSizes();
/**
* Sets the size of the container part.
*
* @param index Index of the container part.
* @param size Size of the container part.
*/
@@ -47,6 +51,7 @@ public interface GraphSourceItemContainer {
/**
* Gets the ASM source between the specified position.
*
* @param pos Index of container part
* @return ASM source between the specified position
*/
@@ -54,6 +59,7 @@ public interface GraphSourceItemContainer {
/**
* Parses the division
*
* @param size Size up to this point
* @param lexer Lexer
* @return
@@ -62,12 +68,15 @@ public interface GraphSourceItemContainer {
/**
* Gets the names of the registers.
* @return The names of the registers. Map of register index and register name.
*
* @return The names of the registers. Map of register index and register
* name.
*/
public HashMap<Integer, String> getRegNames();
/**
* Translates the container to high level code.
*
* @param contents List of contents of the container parts
* @param lineStartItem Start source item of the line
* @param stack Stack
@@ -80,6 +89,7 @@ public interface GraphSourceItemContainer {
/**
* Gets the name of the container.
*
* @return The name of the container
*/
public String getName();

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,6 +20,7 @@ import java.io.Serializable;
/**
* Graph source item with a position.
*
* @author JPEXS
*/
public class GraphSourceItemPos implements Serializable {
@@ -36,6 +37,7 @@ public class GraphSourceItemPos implements Serializable {
/**
* Constructs a GraphSourceItemPos
*
* @param item Source item
* @param pos Position
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -52,12 +52,12 @@ import java.util.Set;
/**
* Graph target item - an item in high level representation of the code.
* Decompilation target.
*
* @author JPEXS
*/
public abstract class GraphTargetItem implements Serializable, Cloneable {
//Precedence levels
public static final int PRECEDENCE_PRIMARY = 0;
public static final int PRECEDENCE_POSTFIX = 1;
@@ -129,6 +129,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets the line start item
*
* @return Line start item
*/
public GraphSourceItem getLineStartItem() {
@@ -137,6 +138,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts a value to an item
*
* @param r Value
* @return Graph target item
*/
@@ -191,6 +193,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Simplifies something
*
* @param it Graph target item
* @param implicitCoerce Implicit coerce
* @return Simplified graph target item
@@ -230,6 +233,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Simplifies this.
*
* @param implicitCoerce Implicit coerce
* @return Simplified graph target item
*/
@@ -239,6 +243,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets line.
*
* @return Line
*/
public int getLine() {
@@ -250,6 +255,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets file.
*
* @return File
*/
public String getFile() {
@@ -261,6 +267,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets first graph part.
*
* @return First graph part
*/
public GraphPart getFirstPart() {
@@ -283,6 +290,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Constructs GraphTargetItem
*
* @param src Source item
* @param lineStartItem Line start item
* @param precedence Precedence
@@ -293,6 +301,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Constructs GraphTargetItem
*
* @param src Source item
* @param lineStartItem Line start item
* @param precedence Precedence
@@ -307,6 +316,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets source item
*
* @return Source item
*/
public GraphSourceItem getSrc() {
@@ -315,6 +325,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets more source items
*
* @return More source items
*/
public List<GraphSourceItemPos> getMoreSrc() {
@@ -327,6 +338,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets highlight src data
*
* @return
*/
protected HighlightData getSrcData() {
@@ -339,6 +351,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets position
*
* @return Position
*/
protected int getPos() {
@@ -347,6 +360,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets needed sources
*
* @return Needed sources
*/
public List<GraphSourceItemPos> getNeededSources() {
@@ -365,6 +379,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string semicoloned.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -386,6 +401,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks if semicolon is needed
*
* @return True if semicolon is needed
*/
public boolean needsSemicolon() {
@@ -394,6 +410,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string as Boolean.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -405,6 +422,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string as String.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -416,6 +434,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string as int.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -427,6 +446,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string as Number.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -438,6 +458,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string.
*
* @return String
*/
@Override
@@ -447,6 +468,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -465,6 +487,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string.
*
* @param localData Local data
* @return String
* @throws InterruptedException
@@ -475,6 +498,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string.
*
* @param localData Local data
* @return String
* @throws InterruptedException
@@ -488,6 +512,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Append this to a writer.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -497,6 +522,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Append this to a writer.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -508,6 +534,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Append this to a writer.
*
* @param writer Writer
* @param localData Local data
* @param implicitCoerce Implicit coerce
@@ -544,6 +571,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets precedence.
*
* @return Precedence
*/
public int getPrecedence() {
@@ -552,6 +580,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks if this can be evaluated statically.
*
* @return True if this can be evaluated statically
*/
public boolean isCompileTime() {
@@ -564,6 +593,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks if this can be evaluated statically.
*
* @param dependencies Dependencies
* @return True if this can be evaluated statically
*/
@@ -573,6 +603,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks if this can be evaluated statically.
*
* @param dependencies Dependencies
* @return True if this can be evaluated statically
*/
@@ -581,8 +612,9 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
}
/**
* Checks whether this has side effects.
* For example function call has side effect, but variable access does not.
* Checks whether this has side effects. For example function call has side
* effect, but variable access does not.
*
* @return True if this has side effects
*/
public boolean hasSideEffect() {
@@ -600,6 +632,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks whether it is computed via variables.
*
* @return True if it is computed via variables
*/
public boolean isVariableComputed() {
@@ -608,6 +641,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Computes EcmaScript result.
*
* @return EcmaScript result
*/
public Object getResult() {
@@ -616,6 +650,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Computes EcmaScript result as number.
*
* @return EcmaScript result as number
*/
public Double getResultAsNumber() {
@@ -624,6 +659,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Computes EcmaScript result as string.
*
* @return EcmaScript result as string
*/
public String getResultAsString() {
@@ -632,6 +668,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Computes EcmaScript result as boolean.
*
* @return EcmaScript result as boolean
*/
public Boolean getResultAsBoolean() {
@@ -640,6 +677,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string without quotes.
*
* @param localData Local data
* @return String
*/
@@ -657,6 +695,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string without quotes.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -671,6 +710,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Appends this to a writer without quotes.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -682,6 +722,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets this without coercion.
*
* @return This without coercion
*/
public GraphTargetItem getNotCoerced() {
@@ -690,6 +731,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets this without coercion and without duplicates.
*
* @return This without coercion and without duplicates
*/
public GraphTargetItem getNotCoercedNoDup() {
@@ -698,6 +740,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets this through registers.
*
* @return This through registers
*/
public GraphTargetItem getThroughRegister() {
@@ -706,6 +749,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks whether this needs a new line.
*
* @return True if this needs a new line
*/
public boolean needsNewLine() {
@@ -714,6 +758,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks whether this handles new line.
*
* @return True if this handles new line
*/
public boolean handlesNewLine() {
@@ -722,6 +767,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to string with new line.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -739,6 +785,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks whether this is empty.
*
* @return True if this is empty
*/
public boolean isEmpty() {
@@ -747,6 +794,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets through items that cannot be statically computed.
*
* @return Through item that cannot be statically computed
*/
public GraphTargetItem getThroughNotCompilable() {
@@ -755,6 +803,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets item through duplicates.
*
* @return Item through duplicates
*/
public GraphTargetItem getThroughDuplicate() {
@@ -763,6 +812,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks whether the value equals.
*
* @param target Target
* @return True if the value equals
*/
@@ -772,6 +822,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to source (low level code).
*
* @param localData Local data
* @param generator Source generator
* @return Source
@@ -783,6 +834,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to source (low level code) and ignore return value.
*
* @param localData Local data
* @param generator Source generator
* @return Source
@@ -797,6 +849,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Converts this to source (low level code). with BinaryOp
*
* @param op Binary operation
* @param action Action
* @return Source
@@ -809,6 +862,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Merges Object list to one list of GraphTargetItems
*
* @param localData Local data
* @param gen Source generator
* @param tar Objects
@@ -844,12 +898,14 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks whether this has return value.
*
* @return True if this has return value
*/
public abstract boolean hasReturnValue();
/**
* Gets all sub items.
*
* @return All sub items
*/
public List<GraphTargetItem> getAllSubItems() {
@@ -867,6 +923,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets all sub items recursively.
*
* @return All sub items recursively
*/
public Set<GraphTargetItem> getAllSubItemsRecursively() {
@@ -882,6 +939,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Visits this recursively.
*
* @param visitor Visitor
*/
public final void visitRecursively(GraphTargetVisitorInterface visitor) {
@@ -900,6 +958,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Visits this recursively without using Blocks.
*
* @param visitor Visitor
*/
public final void visitRecursivelyNoBlock(GraphTargetVisitorInterface visitor) {
@@ -918,6 +977,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Visits this.
*
* @param visitor Visitor
*/
public void visit(GraphTargetVisitorInterface visitor) {
@@ -928,6 +988,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Visits this without using Blocks.
*
* @param visitor
*/
public void visitNoBlock(GraphTargetVisitorInterface visitor) {
@@ -936,12 +997,14 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets return type.
*
* @return
*/
public abstract GraphTargetItem returnType();
/**
* Clone this.
*
* @return Cloned item
*/
@Override
@@ -955,6 +1018,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Inverts this item.
*
* @param src Source item
* @return Inverted item
*/
@@ -964,6 +1028,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Appends this to a writer.
*
* @param prevLineItem Previous line item
* @param writer Writer
* @param localData Local data
@@ -1005,6 +1070,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Append this to a writer as a Block.
*
* @param prevLineItem
* @param writer
* @param localData
@@ -1019,6 +1085,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Gets this as long.
*
* @return
*/
public long getAsLong() {
@@ -1032,6 +1099,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks whether this is identical to other.
*
* @param other Other
* @return True if this is identical to other
*/
@@ -1041,6 +1109,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Alternative of Objects.equals() for GraphTargetItem.
*
* @param o1 Object 1
* @param o2 Object 2
* @return True if objects are value equal

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,18 +20,21 @@ import java.util.Collection;
/**
* Graph source visitor interface.
*
* @author JPEXS
*/
public interface GraphTargetVisitorInterface {
/**
* Visits a graph target item.
*
* @param item Graph target item
*/
public void visit(GraphTargetItem item);
/**
* Visits all graph target items.
*
* @param items Collection of graph target items
*/
public void visitAll(Collection<GraphTargetItem> items);

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -25,6 +25,7 @@ import java.util.Set;
/**
* A loop in a graph.
*
* @author JPEXS
*/
public class Loop implements Serializable {
@@ -40,9 +41,9 @@ public class Loop implements Serializable {
public GraphPart loopBreak;
/**
* Precontinue part of the loop.
* A precontinue is a part of the loop that is executed before the continue part.
* Example of this is a for loop with continue statement.
* Precontinue part of the loop. A precontinue is a part of the loop that is
* executed before the continue part. Example of this is a for loop with
* continue statement.
*/
public GraphPart loopPreContinue;
@@ -77,8 +78,8 @@ public class Loop implements Serializable {
public int reachableMark;
/**
* Phase of the loop.
* The decompiler marks here whether the loop is already processed or not.
* Phase of the loop. The decompiler marks here whether the loop is already
* processed or not.
*/
public int phase;
@@ -89,6 +90,7 @@ public class Loop implements Serializable {
/**
* Constructs a loop
*
* @param id Unique id of the loop
* @param loopContinue Continue part of the loop
* @param loopBreak Break part of the loop
@@ -101,6 +103,7 @@ public class Loop implements Serializable {
/**
* To string method
*
* @return String representation of the loop
*/
@Override
@@ -119,6 +122,7 @@ public class Loop implements Serializable {
/**
* Hash code
*
* @return Hash code of the loop
*/
@Override
@@ -130,6 +134,7 @@ public class Loop implements Serializable {
/**
* Equals
*
* @param obj Object to compare
* @return True if the object is equal to this loop
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.graph.model.LocalData;
/**
* Special item for marking a position in the graph.
*
* @author JPEXS
*/
public class MarkItem extends GraphTargetItem {
@@ -33,6 +34,7 @@ public class MarkItem extends GraphTargetItem {
/**
* Constructs a new mark item.
*
* @param mark Mark string
*/
public MarkItem(String mark) {
@@ -42,6 +44,7 @@ public class MarkItem extends GraphTargetItem {
/**
* Appends this item to the writer.
*
* @param writer Writer
* @param localData Local data
* @return
@@ -53,6 +56,7 @@ public class MarkItem extends GraphTargetItem {
/**
* Gets the mark string.
*
* @return
*/
public String getMark() {
@@ -61,6 +65,7 @@ public class MarkItem extends GraphTargetItem {
/**
* Checks if this item is empty.
*
* @return Always true
*/
@Override
@@ -70,6 +75,7 @@ public class MarkItem extends GraphTargetItem {
/**
* Checks if this item has a return value.
*
* @return Always false
*/
@Override
@@ -79,6 +85,7 @@ public class MarkItem extends GraphTargetItem {
/**
* Gets the return type of this item.
*
* @return Unbounded
*/
@Override

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,6 +22,7 @@ import java.util.Set;
/**
* An item that cannot be statically computed.
*
* @author JPEXS
*/
public class NotCompileTimeItem extends GraphTargetItem {
@@ -33,6 +34,7 @@ public class NotCompileTimeItem extends GraphTargetItem {
/**
* Constructs a new NotCompileTimeItem.
*
* @param instruction Instruction
* @param lineStartIns Line start instruction
* @param object Object that cannot be statically computed
@@ -44,6 +46,7 @@ public class NotCompileTimeItem extends GraphTargetItem {
/**
* Whether this item can be computed statically.
*
* @param dependencies Dependencies
* @return Whether this item can be computed statically
*/
@@ -52,9 +55,9 @@ public class NotCompileTimeItem extends GraphTargetItem {
return false;
}
/**
* Gets through the object that cannot be statically computed.
*
* @return Through the object that cannot be statically computed
*/
@Override
@@ -67,6 +70,7 @@ public class NotCompileTimeItem extends GraphTargetItem {
/**
* Appends this item to the writer.
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -79,6 +83,7 @@ public class NotCompileTimeItem extends GraphTargetItem {
/**
* Whether this item has a return value.
*
* @return Whether this item has a return value
*/
@Override
@@ -88,6 +93,7 @@ public class NotCompileTimeItem extends GraphTargetItem {
/**
* Gets the return type of this item.
*
* @return Return type of this item
*/
@Override

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.graph.model.BinaryOp;
/**
* Not equals type item.
*
* @author JPEXS
*/
public interface NotEqualsTypeItem extends BinaryOp {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,12 +18,14 @@ package com.jpexs.decompiler.graph;
/**
* Stack for scope.
*
* @author JPEXS
*/
public class ScopeStack extends TranslateStack {
/**
* Constructs a new ScopeStack.
*
* @param allowEmpty Whether empty stack is allowed
*/
public ScopeStack(boolean allowEmpty) {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -21,6 +21,7 @@ import java.util.Set;
/**
* Second pass data.
*
* @author JPEXS
*/
public class SecondPassData {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph;
/**
* Second pass exception.
*
* @author JPEXS
*/
public class SecondPassException extends RuntimeException {
@@ -29,6 +30,7 @@ public class SecondPassException extends RuntimeException {
/**
* Constructs a new SecondPassException.
*
* @param data Second pass data
*/
public SecondPassException(SecondPassData data) {
@@ -37,6 +39,7 @@ public class SecondPassException extends RuntimeException {
/**
* Gets the second pass data.
*
* @return Second pass data
*/
public SecondPassData getData() {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph;
/**
* Simple value interface.
*
* @author JPEXS
*/
public interface SimpleValue {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -38,12 +38,14 @@ import java.util.List;
/**
* Source generator interface. A low-level code generator.
*
* @author JPEXS
*/
public interface SourceGenerator {
/**
* Generates source code for PushItem.
*
* @param localData Local data
* @param item PushItem
* @return List of GraphSourceItem
@@ -53,6 +55,7 @@ public interface SourceGenerator {
/**
* Generates source code for PopItem.
*
* @param localData Local data
* @param item PopItem
* @return List of GraphSourceItem
@@ -62,6 +65,7 @@ public interface SourceGenerator {
/**
* Generates source code for TrueItem.
*
* @param localData Local data
* @param item TrueItem
* @return List of GraphSourceItem
@@ -71,6 +75,7 @@ public interface SourceGenerator {
/**
* Generates source code for FalseItem.
*
* @param localData Local data
* @param item FalseItem
* @return List of GraphSourceItem
@@ -80,6 +85,7 @@ public interface SourceGenerator {
/**
* Generates source code for AndItem.
*
* @param localData Local data
* @param item AndItem
* @return List of GraphSourceItem
@@ -89,6 +95,7 @@ public interface SourceGenerator {
/**
* Generates source code for OrItem.
*
* @param localData Local data
* @param item OrItem
* @return List of GraphSourceItem
@@ -98,6 +105,7 @@ public interface SourceGenerator {
/**
* Generates source code for IfItem.
*
* @param localData Local data
* @param item IfItem
* @return List of GraphSourceItem
@@ -107,6 +115,7 @@ public interface SourceGenerator {
/**
* Generates source code for TernarOpItem.
*
* @param localData Local data
* @param item TernarOpItem
* @return List of GraphSourceItem
@@ -116,6 +125,7 @@ public interface SourceGenerator {
/**
* Generates source code for WhileItem.
*
* @param localData Local data
* @param item WhileItem
* @return List of GraphSourceItem
@@ -125,6 +135,7 @@ public interface SourceGenerator {
/**
* Generates source code for DoWhileItem.
*
* @param localData Local data
* @param item DoWhileItem
* @return List of GraphSourceItem
@@ -134,6 +145,7 @@ public interface SourceGenerator {
/**
* Generates source code for ForItem.
*
* @param localData Local data
* @param item ForItem
* @return List of GraphSourceItem
@@ -143,6 +155,7 @@ public interface SourceGenerator {
/**
* Generates source code for SwitchItem.
*
* @param localData Local data
* @param item SwitchItem
* @return List of GraphSourceItem
@@ -152,6 +165,7 @@ public interface SourceGenerator {
/**
* Generates source code for NotItem.
*
* @param localData Local data
* @param item NotItem
* @return List of GraphSourceItem
@@ -161,6 +175,7 @@ public interface SourceGenerator {
/**
* Generates source code for DuplicateItem.
*
* @param localData Local data
* @param item DuplicateItem
* @return List of GraphSourceItem
@@ -170,6 +185,7 @@ public interface SourceGenerator {
/**
* Generates source code for BreakItem.
*
* @param localData Local data
* @param item BreakItem
* @return List of GraphSourceItem
@@ -179,6 +195,7 @@ public interface SourceGenerator {
/**
* Generates source code for ContinueItem.
*
* @param localData Local data
* @param item ContinueItem
* @return List of GraphSourceItem
@@ -188,6 +205,7 @@ public interface SourceGenerator {
/**
* Generates source code for commands.
*
* @param localData Local data
* @param commands List of GraphTargetItem
* @return List of GraphSourceItem
@@ -197,6 +215,7 @@ public interface SourceGenerator {
/**
* Generates source code for CommaExpressionItem.
*
* @param localData Local data
* @param item CommaExpressionItem
* @param withReturnValue If true, the return value is used
@@ -207,6 +226,7 @@ public interface SourceGenerator {
/**
* Generates source code for TypeItem.
*
* @param localData Local data
* @param item TypeItem
* @return List of GraphSourceItem
@@ -216,6 +236,7 @@ public interface SourceGenerator {
/**
* Generates DiscardValue action.
*
* @param localData Local data
* @param item GraphTargetItem
* @return List of GraphSourceItem

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph;
/**
* Kind of stop part.
*
* @author JPEXS
*/
public enum StopPartKind {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -21,6 +21,7 @@ import java.util.Set;
/**
* State of throwing exception in a method.
*
* @author JPEXS
*/
public class ThrowState {
@@ -57,6 +58,7 @@ public class ThrowState {
/**
* Hash code
*
* @return Hash code
*/
@Override
@@ -68,6 +70,7 @@ public class ThrowState {
/**
* Equals
*
* @param obj Object
* @return True if equals
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,12 +18,14 @@ package com.jpexs.decompiler.graph;
/**
* Exception thrown when there is a problem with translating the graph.
*
* @author JPEXS
*/
public class TranslateException extends RuntimeException {
/**
* Constructs new TranslateException with the specified detail message.
*
* @param s The detail message.
*/
public TranslateException(String s) {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
/**
* Stack for translation.
*
* @author JPEXS
*/
public class TranslateStack extends Stack<GraphTargetItem> {
@@ -48,6 +49,7 @@ public class TranslateStack extends Stack<GraphTargetItem> {
/**
* Constructs new TranslateStack with the specified path.
*
* @param path The path.
*/
public TranslateStack(String path) {
@@ -56,6 +58,7 @@ public class TranslateStack extends Stack<GraphTargetItem> {
/**
* Gets the path.
*
* @return The path.
*/
public String getPath() {
@@ -64,6 +67,7 @@ public class TranslateStack extends Stack<GraphTargetItem> {
/**
* Gets the pop item.
*
* @return The pop item.
*/
private PopItem getPop() {
@@ -76,6 +80,7 @@ public class TranslateStack extends Stack<GraphTargetItem> {
/**
* Gets the item at the specified index.
*
* @param index index of the element to return
* @return The element at the specified position in this list
*/
@@ -92,6 +97,7 @@ public class TranslateStack extends Stack<GraphTargetItem> {
/**
* Gets the item at the top of the stack.
*
* @return The item at the top of the stack.
*/
@Override
@@ -107,6 +113,7 @@ public class TranslateStack extends Stack<GraphTargetItem> {
/**
* Gets the item at the specified index from the top of the stack.
*
* @param index The index.
* @return The item at the specified index from the top of the stack.
*/
@@ -122,6 +129,7 @@ public class TranslateStack extends Stack<GraphTargetItem> {
/**
* Pop the item at the top of the stack.
*
* @return The item at the top of the stack.
*/
@Override

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -23,6 +23,7 @@ import java.util.Objects;
/**
* Represents a function type.
*
* @author JPEXS
*/
public class TypeFunctionItem extends GraphTargetItem {
@@ -41,6 +42,7 @@ public class TypeFunctionItem extends GraphTargetItem {
/**
* Creates a new instance of TypeFunctionItem
*
* @param fullTypeName Full type name
*/
public TypeFunctionItem(String fullTypeName) {
@@ -50,6 +52,7 @@ public class TypeFunctionItem extends GraphTargetItem {
/**
* Hash code
*
* @return Hash code
*/
@Override
@@ -61,6 +64,7 @@ public class TypeFunctionItem extends GraphTargetItem {
/**
* Equals
*
* @param obj Object to compare
* @return True if equal
*/
@@ -78,6 +82,7 @@ public class TypeFunctionItem extends GraphTargetItem {
/**
* Appends to writer
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -91,6 +96,7 @@ public class TypeFunctionItem extends GraphTargetItem {
/**
* Gets the return type
*
* @return Return type
*/
@Override
@@ -98,9 +104,9 @@ public class TypeFunctionItem extends GraphTargetItem {
return this;
}
/**
* Checks whether this function has a return value
*
* @return True if has a return value
*/
@Override
@@ -110,6 +116,7 @@ public class TypeFunctionItem extends GraphTargetItem {
/**
* Returns a string representation of this function
*
* @return String representation
*/
@Override

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -28,12 +28,12 @@ import java.util.Objects;
/**
* Type item.
*
* @author JPEXS
*/
public class TypeItem extends GraphTargetItem {
//Basic type items
public static TypeItem BOOLEAN = new TypeItem(DottedChain.BOOLEAN);
public static TypeItem STRING = new TypeItem(DottedChain.STRING);
@@ -64,6 +64,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Constructs a new instance of TypeItem
*
* @param s Full type name
*/
public TypeItem(String s) {
@@ -72,6 +73,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Constructs a new instance of TypeItem
*
* @param s Full type name
* @param ns Namespace
*/
@@ -81,6 +83,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Constructs a new instance of TypeItem
*
* @param fullTypeName Full type name
*/
public TypeItem(DottedChain fullTypeName) {
@@ -89,6 +92,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Constructs a new instance of TypeItem
*
* @param fullTypeName Full type name
* @param ns Namespace
*/
@@ -98,6 +102,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Constructs a new instance of TypeItem
*
* @param fullTypeName Full type name
* @param subtypes Subtypes
* @param ns Namespace
@@ -110,6 +115,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Hash code
*
* @return Hash code
*/
@Override
@@ -122,6 +128,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Equals
*
* @param obj Object to compare
* @return True if equal
*/
@@ -145,6 +152,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Appends to writer
*
* @param writer Writer
* @param localData Local data
* @return Writer
@@ -165,6 +173,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Gets the return type
*
* @return Return type
*/
@Override
@@ -174,6 +183,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Checks whether this function has a return value
*
* @return True if has a return value
*/
@Override
@@ -183,6 +193,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Returns a string representation of this function
*
* @return String representation
*/
@Override
@@ -192,6 +203,7 @@ public class TypeItem extends GraphTargetItem {
/**
* Converts this item to low-level source code.
*
* @param localData Local data
* @param generator Source generator
* @return List of graph source items

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -28,6 +28,7 @@ import java.util.List;
/**
* Logical AND.
*
* @author JPEXS
*/
public class AndItem extends BinaryOpItem implements CompoundableBinaryOp {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.graph.TypeItem;
/**
* Any item.
*
* @author JPEXS
*/
public class AnyItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -21,8 +21,8 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import java.util.List;
/**
* Binary operation interface.
* Operation on two operands.
* Binary operation interface. Operation on two operands.
*
* @author JPEXS
*/
public interface BinaryOp {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -28,8 +28,8 @@ import java.util.Objects;
import java.util.Set;
/**
* Binary operation.
* Operation on two operands.
* Binary operation. Operation on two operands.
*
* @author JPEXS
*/
public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp {
@@ -94,7 +94,7 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp {
}
return writer;
}
protected void operandToString(GraphTargetItem operand, GraphTextWriter writer, LocalData localData) throws InterruptedException {
operand.toString(writer, localData, "");
}

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -29,6 +29,7 @@ import java.util.List;
/**
* Block.
*
* @author JPEXS
*/
public class BlockItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -28,6 +28,7 @@ import java.util.List;
/**
* Break statement.
*
* @author JPEXS
*/
public class BreakItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,6 +20,7 @@ import java.util.List;
/**
* Callable interface.
*
* @author JPEXS
*/
public interface Callable {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -28,6 +28,7 @@ import java.util.List;
/**
* Comma expression.
*
* @author JPEXS
*/
public class CommaExpressionItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.graph.TypeItem;
/**
* Comment item.
*
* @author JPEXS
*/
public class CommentItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph.model;
/**
* Compoundable binary operation interface.
*
* @author JPEXS
*/
public interface CompoundableBinaryOp extends BinaryOp {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -28,6 +28,7 @@ import java.util.List;
/**
* Continue statement.
*
* @author JPEXS
*/
public class ContinueItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -33,6 +33,7 @@ import java.util.List;
/**
* Do-while loop.
*
* @author JPEXS
*/
public class DoWhileItem extends LoopItem implements Block {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -29,6 +29,7 @@ import java.util.Set;
/**
* Duplicate item.
*
* @author JPEXS
*/
public class DuplicateItem extends GraphTargetItem implements SimpleValue {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.graph.TypeItem;
/**
* Empty command.
*
* @author JPEXS
*/
public class EmptyCommand extends GraphTargetItem {

View File

@@ -1,24 +1,24 @@
/*
* Copyright (C) 2010-2024 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.model;
/**
* Exit item interface.
* Commands like return, throw, etc...
* Exit item interface. Commands like return, throw, etc...
*
* @author JPEXS
*/
public interface ExitItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -29,6 +29,7 @@ import java.util.Set;
/**
* False value.
*
* @author JPEXS
*/
public class FalseItem extends GraphTargetItem implements LogicalOpItem, SimpleValue {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -33,6 +33,7 @@ import java.util.List;
/**
* For loop.
*
* @author JPEXS
*/
public class ForItem extends LoopItem implements Block {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -27,6 +27,7 @@ import java.util.List;
/**
* Goto.
*
* @author JPEXS
*/
public class GotoItem extends GraphTargetItem implements Block {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -33,6 +33,7 @@ import java.util.Set;
/**
* If statement.
*
* @author JPEXS
*/
public class IfItem extends GraphTargetItem implements Block {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -24,6 +24,7 @@ import java.util.Set;
/**
* Integer value.
*
* @author JPEXS
*/
public class IntegerValueItem extends GraphTargetItem implements IntegerValueTypeItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph.model;
/**
* Interface for items that have integer value type.
*
* @author JPEXS
*/
public interface IntegerValueTypeItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.graph.TypeItem;
/**
* Label.
*
* @author JPEXS
*/
public class LabelItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -29,6 +29,7 @@ import java.util.Set;
/**
* Local data for decompilation.
*
* @author JPEXS
*/
public class LocalData {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
/**
* Logical operation item interface.
*
* @author JPEXS
*/
public interface LogicalOpItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -23,6 +23,7 @@ import java.util.List;
/**
* Base class for loops.
*
* @author JPEXS
*/
public abstract class LoopItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -31,6 +31,7 @@ import java.util.Set;
/**
* Logical NOT.
*
* @author JPEXS
*/
public class NotItem extends UnaryOpItem implements LogicalOpItem, Inverted {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -28,6 +28,7 @@ import java.util.List;
/**
* Logical OR.
*
* @author JPEXS
*/
public class OrItem extends BinaryOpItem implements CompoundableBinaryOp {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -26,6 +26,7 @@ import java.util.List;
/**
* Parenthesis.
*
* @author JPEXS
*/
public class ParenthesisItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -28,6 +28,7 @@ import java.util.List;
/**
* Pop item from the stack.
*
* @author JPEXS
*/
public class PopItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -28,6 +28,7 @@ import java.util.Objects;
/**
* Push item on the stack.
*
* @author JPEXS
*/
public class PushItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.graph.TypeItem;
/**
* Script end.
*
* @author JPEXS
*/
public class ScriptEndItem extends GraphTargetItem implements ExitItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -33,6 +33,7 @@ import java.util.List;
/**
* Switch statement.
*
* @author JPEXS
*/
public class SwitchItem extends LoopItem implements Block {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -29,6 +29,7 @@ import java.util.Objects;
/**
* Ternar operator.
*
* @author JPEXS
*/
public class TernarOpItem extends GraphTargetItem {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -29,6 +29,7 @@ import java.util.Set;
/**
* True value.
*
* @author JPEXS
*/
public class TrueItem extends GraphTargetItem implements LogicalOpItem, SimpleValue {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
/**
* Unary operator interface.
*
* @author JPEXS
*/
public interface UnaryOp {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -26,6 +26,7 @@ import java.util.Set;
/**
* Unary operator.
*
* @author JPEXS
*/
public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp {
@@ -146,7 +147,7 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp {
int hash = 3;
return hash;
}
protected void operandToString(GraphTargetItem operand, GraphTextWriter writer, LocalData localData) throws InterruptedException {
operand.toString(writer, localData, "");
}

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
/**
* Unbounded type.
*
* @author JPEXS
*/
public class UnboundedTypeItem extends AVM2Item {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -25,6 +25,7 @@ import java.util.List;
/**
* Universal loop.
*
* @author JPEXS
*/
public class UniversalLoopItem extends WhileItem implements Block {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -33,6 +33,7 @@ import java.util.List;
/**
* While statement.
*
* @author JPEXS
*/
public class WhileItem extends LoopItem implements Block {

View File

@@ -1,4 +1,4 @@
/**
* High-level model of the graph.
*/
package com.jpexs.decompiler.graph.model;
package com.jpexs.decompiler.graph.model;

View File

@@ -1,4 +1,4 @@
/**
* Control flow graph and its decompiling.
*/
package com.jpexs.decompiler.graph;
package com.jpexs.decompiler.graph;

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph.precontinues;
/**
* Do-while loop.
*
* @author JPEXS
*/
public class DoWhileNode extends Node {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -29,7 +29,6 @@ import java.util.Map;
import java.util.Set;
/**
*
* Detects "precontinues" in Graph. A precontinue is target of continue
* statement in a for loop. For loop in this case has single backedge.
* Precontinue is predeccessor of loops backedge. Precontinue can have branches
@@ -371,9 +370,8 @@ public class GraphPrecontinueDetector {
return node;
}
visited.add(node);
//Note to my future self: Do not make this twoway ifs only since it may break && and || operations in expressions
/*
if(a)
{

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph.precontinues;
/**
* If statement.
*
* @author JPEXS
*/
public class IfNode extends Node {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -21,6 +21,7 @@ import java.util.List;
/**
* Joined nodes.
*
* @author JPEXS
*/
public class JoinedNode extends Node {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -22,6 +22,7 @@ import java.util.List;
/**
* Node in the graph.
*
* @author JPEXS
*/
public class Node {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 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.
*/
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph.precontinues;
/**
* While loop.
*
* @author JPEXS
*/
public class WhileNode extends Node {

View File

@@ -1,4 +1,4 @@
/**
* Detection of precontinues in loops.
*/
package com.jpexs.decompiler.graph.precontinues;
package com.jpexs.decompiler.graph.precontinues;