public class SelfDecompiler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
TIMEOUT |
Constructor and Description |
---|
SelfDecompiler() |
Modifier and Type | Method and Description |
---|---|
Vertex |
createUniqueFormula(Vertex formula,
Network network)
Print the formula to create a unique instance of it.
|
Vertex |
createUniqueTemplate(Vertex formula,
Network network)
Print the formula to create a unique instance of it.
|
Vertex |
decompileEquation(Vertex equation,
Network network)
Check if the equation is bytecode and decompile.
|
Vertex |
decompileExpression(Vertex equation,
Network network)
Check if the expression is bytecode and decompile.
|
Vertex |
decompileFunction(Vertex equation,
Network network)
Check if the function is bytecode and decompile.
|
Vertex |
decompileState(Vertex state,
Network network)
Check if the state is bytecode and decompile.
|
java.lang.String |
decompileStateMachine(Vertex state,
Network network)
Print the Self code for the state machine.
|
static SelfDecompiler |
getDecompiler() |
boolean |
getPrintIds() |
void |
parseArgumentsByteCode(Vertex equation,
java.io.DataInputStream dataStream,
Vertex type,
Network network)
Parse the operation arguments.
|
Vertex |
parseCaseByteCode(java.io.DataInputStream dataStream,
Network network)
Parse the CASE bytecode.
|
Vertex |
parseDoByteCode(java.io.DataInputStream dataStream,
Network network)
Parse the DO bytecode.
|
Vertex |
parseEquationByteCode(Vertex equation,
BinaryData data,
Network network)
Parse the equation from bytecode.
|
Vertex |
parseExpressionByteCode(Vertex equation,
BinaryData data,
Network network)
Parse the expression from bytecode.
|
Vertex |
parseFunctionByteCode(Vertex equation,
BinaryData data,
Network network)
Parse the function from bytecode.
|
Vertex |
parseGotoByteCode(java.io.DataInputStream dataStream,
Network network)
Parse the GOTO bytecode.
|
Vertex |
parseOperatorByteCode(java.io.DataInputStream dataStream,
Network network)
Parse the operator and its arguments from bytecode.
|
Vertex |
parsePushByteCode(java.io.DataInputStream dataStream,
Network network)
Parse the PUSH bytecode.
|
void |
parseQuotientByteCode(Vertex state,
java.io.DataInputStream dataStream,
Network network)
Parse the GOTO bytecode.
|
Vertex |
parseReturnByteCode(java.io.DataInputStream dataStream,
Network network)
Parse the RETURN bytecode.
|
Vertex |
parseStateByteCode(java.io.DataInputStream dataStream,
Network network)
Parse the state and its cases from bytecode.
|
Vertex |
parseStateByteCode(Vertex state,
BinaryData data,
Network network)
Parse the state from bytecode.
|
void |
printArguments(Vertex equation,
Primitive type,
java.lang.String[] tokens,
boolean reverse,
boolean newLine,
boolean unravel,
java.io.Writer writer,
java.lang.String indent,
java.util.List<Vertex> variables,
java.util.List<Vertex> equations,
java.util.Set<Vertex> elements,
boolean space,
Network network)
Print the operation arguments.
|
void |
printCase(Vertex equation,
java.io.Writer writer,
java.lang.String indent,
java.util.Set<Vertex> elements,
java.util.List<Vertex> newVariables,
java.util.List<Vertex> newEquations,
java.util.List<Vertex> newStates,
Network network)
Print the IF condition and any variables and states that it references.
|
boolean |
printComments(Vertex element,
java.io.Writer writer,
java.lang.String indent,
boolean newLine,
Network network)
Print comments
|
void |
printData(Vertex vertex,
java.io.Writer writer)
Print the vertex data.
|
void |
printElement(Vertex vertex,
java.io.Writer writer,
java.lang.String indent,
java.util.List<Vertex> equations,
java.util.List<Vertex> variables,
java.util.Set<Vertex> elements,
Network network)
Print the vertex, either a state, variable, equation, or raw data.
|
void |
printEquation(Vertex equation,
java.io.Writer writer,
java.lang.String indent,
java.util.Set<Vertex> elements,
Network network)
Print the equation and any equations it references that have not been printed.
|
void |
printFormula(Vertex formula,
java.io.Writer writer,
java.lang.String indent,
java.util.List<Vertex> equations,
java.util.List<Vertex> variables,
java.util.Set<Vertex> elements,
Network network) |
void |
printGoto(Vertex equation,
java.io.Writer writer,
java.lang.String indent,
java.util.Set<Vertex> elements,
Network network,
long start,
long timeout)
Print the GOTO condition and any variables and states that it references.
|
void |
printOperator(Vertex equation,
java.io.Writer writer,
java.lang.String indent,
java.util.List<Vertex> equations,
java.util.List<Vertex> variables,
java.util.Set<Vertex> elements,
Network network)
Print the equation and any equations it references that have not been printed.
|
void |
printPush(Vertex equation,
java.io.Writer writer,
java.lang.String indent,
java.util.Set<Vertex> elements,
Network network,
long start,
long timeout)
Print the PUSH condition and any variables and states that it references.
|
void |
printReturn(Vertex equation,
java.io.Writer writer,
java.lang.String indent,
java.util.Set<Vertex> elements,
Network network,
long start,
long timeout)
Print the RETURN condition and any variables it references.
|
void |
printState(Vertex state,
java.io.Writer writer,
java.lang.String indent,
java.util.Set<Vertex> elements,
Network network,
long start,
long timeout)
Print the state and any referenced states or variables that have not yet been printed.
|
void |
printStateMachine(Vertex state,
java.io.Writer writer,
Network network,
long start,
long timeout)
Print the Self code for the state machine.
|
void |
printTemplate(Vertex formula,
java.io.Writer writer,
java.lang.String indent,
java.util.List<Vertex> expressions,
java.util.List<Vertex> variables,
java.util.Set<Vertex> elements,
Network network) |
void |
printVariable(Vertex variable,
java.io.Writer writer,
java.lang.String indent,
java.util.Set<Vertex> elements,
Network network)
Print the variable and any variables it references that have not been printed.
|
static void |
setDecompiler(SelfDecompiler compiler) |
void |
setPrintIds(boolean printIds) |
java.lang.String |
toString() |
public static SelfDecompiler getDecompiler()
public static void setDecompiler(SelfDecompiler compiler)
public java.lang.String decompileStateMachine(Vertex state, Network network)
public void printStateMachine(Vertex state, java.io.Writer writer, Network network, long start, long timeout)
public boolean printComments(Vertex element, java.io.Writer writer, java.lang.String indent, boolean newLine, Network network) throws java.io.IOException
java.io.IOException
public void printState(Vertex state, java.io.Writer writer, java.lang.String indent, java.util.Set<Vertex> elements, Network network, long start, long timeout) throws java.io.IOException
java.io.IOException
public void printData(Vertex vertex, java.io.Writer writer) throws java.io.IOException
java.io.IOException
public void printElement(Vertex vertex, java.io.Writer writer, java.lang.String indent, java.util.List<Vertex> equations, java.util.List<Vertex> variables, java.util.Set<Vertex> elements, Network network) throws java.io.IOException
java.io.IOException
public void printFormula(Vertex formula, java.io.Writer writer, java.lang.String indent, java.util.List<Vertex> equations, java.util.List<Vertex> variables, java.util.Set<Vertex> elements, Network network) throws java.io.IOException
java.io.IOException
public Vertex createUniqueTemplate(Vertex formula, Network network)
public void printTemplate(Vertex formula, java.io.Writer writer, java.lang.String indent, java.util.List<Vertex> expressions, java.util.List<Vertex> variables, java.util.Set<Vertex> elements, Network network) throws java.io.IOException
java.io.IOException
public Vertex createUniqueFormula(Vertex formula, Network network)
public void printVariable(Vertex variable, java.io.Writer writer, java.lang.String indent, java.util.Set<Vertex> elements, Network network) throws java.io.IOException
java.io.IOException
public void printArguments(Vertex equation, Primitive type, java.lang.String[] tokens, boolean reverse, boolean newLine, boolean unravel, java.io.Writer writer, java.lang.String indent, java.util.List<Vertex> variables, java.util.List<Vertex> equations, java.util.Set<Vertex> elements, boolean space, Network network) throws java.io.IOException
java.io.IOException
public void parseArgumentsByteCode(Vertex equation, java.io.DataInputStream dataStream, Vertex type, Network network) throws java.io.IOException
java.io.IOException
public Vertex decompileFunction(Vertex equation, Network network)
public Vertex decompileExpression(Vertex equation, Network network)
public Vertex decompileEquation(Vertex equation, Network network)
public Vertex decompileState(Vertex state, Network network)
public void printEquation(Vertex equation, java.io.Writer writer, java.lang.String indent, java.util.Set<Vertex> elements, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseExpressionByteCode(Vertex equation, BinaryData data, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseFunctionByteCode(Vertex equation, BinaryData data, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseEquationByteCode(Vertex equation, BinaryData data, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseStateByteCode(Vertex state, BinaryData data, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseStateByteCode(java.io.DataInputStream dataStream, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseCaseByteCode(java.io.DataInputStream dataStream, Network network) throws java.io.IOException
java.io.IOException
public Vertex parsePushByteCode(java.io.DataInputStream dataStream, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseDoByteCode(java.io.DataInputStream dataStream, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseReturnByteCode(java.io.DataInputStream dataStream, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseGotoByteCode(java.io.DataInputStream dataStream, Network network) throws java.io.IOException
java.io.IOException
public void parseQuotientByteCode(Vertex state, java.io.DataInputStream dataStream, Network network) throws java.io.IOException
java.io.IOException
public void printOperator(Vertex equation, java.io.Writer writer, java.lang.String indent, java.util.List<Vertex> equations, java.util.List<Vertex> variables, java.util.Set<Vertex> elements, Network network) throws java.io.IOException
java.io.IOException
public Vertex parseOperatorByteCode(java.io.DataInputStream dataStream, Network network) throws java.io.IOException
java.io.IOException
public void printCase(Vertex equation, java.io.Writer writer, java.lang.String indent, java.util.Set<Vertex> elements, java.util.List<Vertex> newVariables, java.util.List<Vertex> newEquations, java.util.List<Vertex> newStates, Network network) throws java.io.IOException
java.io.IOException
public void printGoto(Vertex equation, java.io.Writer writer, java.lang.String indent, java.util.Set<Vertex> elements, Network network, long start, long timeout) throws java.io.IOException
java.io.IOException
public void printPush(Vertex equation, java.io.Writer writer, java.lang.String indent, java.util.Set<Vertex> elements, Network network, long start, long timeout) throws java.io.IOException
java.io.IOException
public void printReturn(Vertex equation, java.io.Writer writer, java.lang.String indent, java.util.Set<Vertex> elements, Network network, long start, long timeout) throws java.io.IOException
java.io.IOException
public boolean getPrintIds()
public void setPrintIds(boolean printIds)
public java.lang.String toString()
toString
in class java.lang.Object