public class FlowGraph
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
FlowGraph.FunctionCacheKey
Cache key for dynamically created functions.
|
static class |
FlowGraph.FunctionDynamicSourceCacheKey
Cache key for functions that are created from string expressions at runtime.
|
static class |
FlowGraph.FunctionFileSourceCacheKey
Cache key for functions that are created from files at runtime.
|
Constructor and Description |
---|
FlowGraph(Function main)
Constructs a new uninitialized flow graph.
|
Modifier and Type | Method and Description |
---|---|
void |
addBlock(BasicBlock b)
Adds a block to this flow graph.
|
void |
addFunction(Function f)
Adds the given function to the flow graph.
|
void |
addSyntacticInformation(RawSyntacticInformation rawSyntacticInformation,
ValueLogLocationInformation valueLogLocationInformation)
Adds additional syntactic information to this flowgraph
|
void |
check()
Perform a consistency check of the flow graph (if in debug or test mode).
|
void |
complete()
Runs complete on all the functions in the flow graph.
|
BasicBlock |
getEntryBlock()
Returns the entry block of the flow graph.
|
java.util.Map<FlowGraph.FunctionCacheKey,Function> |
getFunctionCache()
Returns the cache of dynamically created functions.
|
java.util.Collection<Function> |
getFunctions()
Returns the functions, including the main function.
|
Function |
getMain()
Returns the main code.
|
int |
getNumberOfBlocks()
Returns the total number of basic blocks in this flow graph.
|
int |
getNumberOfNodes()
Returns the total number of nodes in this flow graph.
|
int |
getNumberOfUserCodeNodes()
Returns the total number of user-code (i.e.
|
SyntacticQueries |
getSyntacticInformation()
Returns the syntactic information.
|
ValueLogLocationInformation |
getValueLogLocationInformation() |
boolean |
isHostEnvironmentSource(SourceLocation sourceLocation)
Checks if the given location belongs to the host environment.
|
boolean |
isUserCode(AbstractNode n)
Checks if the given node belongs to user code, i.e.
|
void |
registerHostEnvironmentSource(java.net.URL file)
Registers a file as belonging to the host-environment.
|
void |
removeFunctions(java.util.Collection<Function> fs)
Deletes a collection of functions from the flow graph.
|
void |
toDot(java.nio.file.Path dir,
boolean end)
Produces a Graphviz dot representation of each function in this flow graph.
|
void |
toDot(java.io.PrintWriter pw)
Produces a Graphviz dot representation of this flow graph.
|
java.lang.String |
toString()
Returns a string description of this flow graph.
|
public FlowGraph(Function main)
public void addBlock(BasicBlock b)
b
- The basic block to add.public void addFunction(Function f)
public void addSyntacticInformation(RawSyntacticInformation rawSyntacticInformation, ValueLogLocationInformation valueLogLocationInformation)
public void check()
public void complete()
public BasicBlock getEntryBlock()
public java.util.Map<FlowGraph.FunctionCacheKey,Function> getFunctionCache()
public java.util.Collection<Function> getFunctions()
public Function getMain()
public int getNumberOfBlocks()
public int getNumberOfNodes()
public int getNumberOfUserCodeNodes()
public SyntacticQueries getSyntacticInformation()
public ValueLogLocationInformation getValueLogLocationInformation()
public boolean isHostEnvironmentSource(SourceLocation sourceLocation)
public boolean isUserCode(AbstractNode n)
public void registerHostEnvironmentSource(java.net.URL file)
public void removeFunctions(java.util.Collection<Function> fs)
public void toDot(java.nio.file.Path dir, boolean end) throws java.io.IOException
dir
- destination directoryend
- if set, the name contains "final", otherwise "initial"java.io.IOException
- if some file operation fails.public void toDot(java.io.PrintWriter pw)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2009-2019 Aarhus University