public class FlowGraphBuilder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FlowGraphBuilder.TripleForSetEntryBlocksWorklist |
Constructor and Description |
---|
FlowGraphBuilder(AstEnv env,
FunctionAndBlockManager fab)
Constructs a flow graph builder.
|
Modifier and Type | Method and Description |
---|---|
void |
addLoadersForHostFunctionSources(java.util.List<java.net.URL> sources)
Creates a call to a function that defines and calls functions containing the host function sources.
|
FlowGraph |
close()
Completes the flow graph construction.
|
FlowGraph |
close(FlowGraph flowGraph,
BasicBlock exitBlock)
Completes the flow graph construction.
|
ASTInfo |
getAstInfo() |
static FlowGraphBuilder |
makeForMain(SourceLocation.SourceLocationMaker sourceLocationMaker) |
static void |
setEntryBlocks(FlowGraphBuilder.TripleForSetEntryBlocksWorklist startingPoint,
java.util.Set<BasicBlock> visited,
FunctionAndBlockManager functionAndBlocksManager)
Recursively sets BasicBlock.entry_block
All blocks between "Begin" and "End" nodes form a region with a changed entry block see
BasicBlock.entry_block |
(package private) Function |
transformCode(java.lang.String source,
int lineOffset,
int columnOffset,
SourceLocation.SourceLocationMaker sourceLocationMaker)
Transforms the given JavaScript source code and appends it to the main function, with location offsets.
|
Function |
transformFunctionBody(java.lang.String source,
java.util.List<java.lang.String> parameterNames,
SourceLocation.SourceLocationMaker sourceLocationMaker)
Creates a Function for the given source.
|
Function |
transformStandAloneCode(java.lang.String source,
SourceLocation.SourceLocationMaker sourceLocationMaker)
Transforms the given stand-alone JavaScript source code and appends it to the main function.
|
Function |
transformWebAppCode(JavaScriptSource s,
SourceLocation.SourceLocationMaker sourceLocationMaker)
Transforms the given web application JavaScript source code.
|
public FlowGraphBuilder(AstEnv env, FunctionAndBlockManager fab)
env
- traversal environmentfab
- function/block managerpublic void addLoadersForHostFunctionSources(java.util.List<java.net.URL> sources)
HostEnvSources
public FlowGraph close()
public FlowGraph close(FlowGraph flowGraph, BasicBlock exitBlock)
flowGraph
- existing flow graph if extending, or null if creating a newexitBlock
- the basic block where the last processed block will exit toclose()
public ASTInfo getAstInfo()
public static FlowGraphBuilder makeForMain(SourceLocation.SourceLocationMaker sourceLocationMaker)
public static void setEntryBlocks(FlowGraphBuilder.TripleForSetEntryBlocksWorklist startingPoint, java.util.Set<BasicBlock> visited, FunctionAndBlockManager functionAndBlocksManager)
BasicBlock.entry_block
Function transformCode(java.lang.String source, int lineOffset, int columnOffset, SourceLocation.SourceLocationMaker sourceLocationMaker)
lineOffset
- number of lines preceding the codecolumnOffset
- number of columns preceding the first line of the codepublic Function transformFunctionBody(java.lang.String source, java.util.List<java.lang.String> parameterNames, SourceLocation.SourceLocationMaker sourceLocationMaker)
function (parameters[0], parameters[1], ...) { SOURCE }
public Function transformStandAloneCode(java.lang.String source, SourceLocation.SourceLocationMaker sourceLocationMaker)
public Function transformWebAppCode(JavaScriptSource s, SourceLocation.SourceLocationMaker sourceLocationMaker)
Copyright © 2009-2019 Aarhus University