Class JSCallGraphUtil
java.lang.Object
com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil
com.ibm.wala.cast.js.ipa.callgraph.JSCallGraphUtil
- Direct Known Subclasses:
JSCallGraphBuilderUtil
,NodejsCallGraphBuilderUtil
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic JavaScriptTranslatorFactory
the translator factory to be used for analysis TODO: pass the factory where needed instead of using a global?Fields inherited from class com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil
AVOID_DUMP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MethodReference
getMethodReference
(String funName) static Collection
<CGNode> Get all the nodes in CG with name funName.static Module
getPrologueFile
(String name) static JavaScriptTranslatorFactory
loadAdditionalFile
(IClassHierarchy cha, JavaScriptLoader cl, ModuleEntry M) loadAdditionalFile
(IClassHierarchy cha, JavaScriptLoader cl, URL url) static IClassHierarchy
makeHierarchy
(AnalysisScope scope, ClassLoaderFactory loaders) static IClassHierarchy
makeHierarchyForScripts
(String... scriptFiles) static JavaScriptLoaderFactory
static JavaScriptLoaderFactory
makeLoaders
(CAstRewriterFactory<?, ?> preprocessor) static JSAnalysisOptions
makeOptions
(AnalysisScope scope, IClassHierarchy cha, Iterable<Entrypoint> roots) static JavaScriptEntryPoints
static void
setTranslatorFactory
(JavaScriptTranslatorFactory translatorFactory) Set up the translator factory.static String
Methods inherited from class com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil
dumpCG, getShortName, getShortName, handleFileNames, makeCache, makeScope, makeScope, makeSourceModule, makeSourceModule
-
Field Details
-
translatorFactory
the translator factory to be used for analysis TODO: pass the factory where needed instead of using a global?
-
-
Constructor Details
-
JSCallGraphUtil
public JSCallGraphUtil()
-
-
Method Details
-
setTranslatorFactory
Set up the translator factory. This method should be called before invokingmakeLoaders()
. -
getTranslatorFactory
-
makeOptions
public static JSAnalysisOptions makeOptions(AnalysisScope scope, IClassHierarchy cha, Iterable<Entrypoint> roots) -
makeLoaders
- Parameters:
preprocessor
- CAst rewriter to use for preprocessing JavaScript source files; may be null
-
makeLoaders
-
makeHierarchyForScripts
public static IClassHierarchy makeHierarchyForScripts(String... scriptFiles) throws ClassHierarchyException - Throws:
ClassHierarchyException
-
makeHierarchy
public static IClassHierarchy makeHierarchy(AnalysisScope scope, ClassLoaderFactory loaders) throws ClassHierarchyException - Throws:
ClassHierarchyException
-
makeScriptRoots
-
getNodes
Get all the nodes in CG with name funName. If funName is of the form"ctor:nm"
, return nodes corresponding to constructor function fornm
. If funName is of the form"suffix:nm"
, return nodes corresponding to functions whose names end withnm
. Otherwise, return nodes for functions whose name matches funName exactly. -
getMethodReference
-
loadAdditionalFile
public static Set<String> loadAdditionalFile(IClassHierarchy cha, JavaScriptLoader cl, URL url) throws IOException - Returns:
- The set of class names that where defined in the CHA as a result loading process.
- Throws:
IOException
-
loadAdditionalFile
public static Set<String> loadAdditionalFile(IClassHierarchy cha, JavaScriptLoader cl, ModuleEntry M) throws IOException - Throws:
IOException
-
simulateToStringForPropertyNames
-
getPrologueFile
-