• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AstIRFactory类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.ibm.wala.cast.ir.ssa.AstIRFactory的典型用法代码示例。如果您正苦于以下问题:Java AstIRFactory类的具体用法?Java AstIRFactory怎么用?Java AstIRFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AstIRFactory类属于com.ibm.wala.cast.ir.ssa包,在下文中一共展示了AstIRFactory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: makeHTMLCGBuilder

点赞 3

import com.ibm.wala.cast.ir.ssa.AstIRFactory; //导入依赖的package包/类
public static JSCFABuilder makeHTMLCGBuilder(URL url,
        CGBuilderType builderType) throws IOException, WalaException {
    IRFactory<IMethod> irFactory = AstIRFactory.makeDefaultFactory();
    CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs
                                       ? new CorrelatedPairExtractorFactory(translatorFactory, url)
                                       : null;
    JavaScriptLoaderFactory loaders = new WebPageLoaderFactory(
        translatorFactory, preprocessor);
    SourceModule[] scriptsArray = makeHtmlScope(url, loaders);

    JSCFABuilder builder = makeCGBuilder(loaders, scriptsArray,
                                         builderType, irFactory);
    if (builderType.extractCorrelatedPairs)
        builder.setContextSelector(new PropertyNameContextSelector(builder
                                   .getAnalysisCache(), 2, builder.getContextSelector()));
    builder.setBaseURL(url);
    return builder;
}
 

开发者ID:logicalhacking,
项目名称:DASCA,
代码行数:19,
代码来源:ImprovedJSCallGraphBuilderUtil.java

示例2: makeScriptCGBuilder

点赞 2

import com.ibm.wala.cast.ir.ssa.AstIRFactory; //导入依赖的package包/类
/**
 * create a CG builder for script.  Note that the script at dir/name is loaded via the classloader, not from the filesystem.
 */
public static JSCFABuilder makeScriptCGBuilder(String dir, String name, CGBuilderType builderType, ClassLoader loader) throws IOException, WalaException {
  URL script = getURLforFile(dir, name, loader);
  CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, script) : null;
  JavaScriptLoaderFactory loaders = JSCallGraphUtil.makeLoaders(preprocessor);

  AnalysisScope scope = makeScriptScope(dir, name, loaders, loader);

  return makeCG(loaders, scope, builderType, AstIRFactory.makeDefaultFactory());
}
 

开发者ID:wala,
项目名称:WALA-start,
代码行数:13,
代码来源:JSCallGraphBuilderUtil.java

示例3: makeHTMLCGBuilder

点赞 2

import com.ibm.wala.cast.ir.ssa.AstIRFactory; //导入依赖的package包/类
public static JSCFABuilder makeHTMLCGBuilder(URL url, CGBuilderType builderType, Function<Void, JSSourceExtractor> fExtractor) throws IOException, WalaException {
  IRFactory<IMethod> irFactory = AstIRFactory.makeDefaultFactory();
  CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, url) : null;
  JavaScriptLoaderFactory loaders = new WebPageLoaderFactory(translatorFactory, preprocessor);
  SourceModule[] scriptsArray = makeHtmlScope(url, loaders, fExtractor);
  
  JSCFABuilder builder = makeCGBuilder(loaders, scriptsArray, builderType, irFactory);
  if(builderType.extractCorrelatedPairs)
    builder.setContextSelector(new PropertyNameContextSelector(builder.getAnalysisCache(), 2, builder.getContextSelector()));
  builder.setBaseURL(url);
  return builder;
}
 

开发者ID:wala,
项目名称:WALA-start,
代码行数:13,
代码来源:JSCallGraphBuilderUtil.java

示例4: makeHTMLCGBuilder

点赞 2

import com.ibm.wala.cast.ir.ssa.AstIRFactory; //导入依赖的package包/类
public static JSCFABuilder makeHTMLCGBuilder(URL url, CGBuilderType builderType) throws IOException, WalaException {
  IRFactory<IMethod> irFactory = AstIRFactory.makeDefaultFactory();
  CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, url) : null;
  JavaScriptLoaderFactory loaders = new WebPageLoaderFactory(translatorFactory, preprocessor);
  SourceModule[] scriptsArray = makeHtmlScope(url, loaders);
  
  JSCFABuilder builder = makeCGBuilder(loaders, scriptsArray, builderType, irFactory);
  if(builderType.extractCorrelatedPairs)
    builder.setContextSelector(new PropertyNameContextSelector(builder.getAnalysisCache(), 2, builder.getContextSelector()));
  builder.setBaseURL(url);
  return builder;
}
 

开发者ID:ylimit,
项目名称:HybridFlow,
代码行数:13,
代码来源:JSCallGraphBuilderUtil.java

示例5: makeScriptCGBuilder

点赞 2

import com.ibm.wala.cast.ir.ssa.AstIRFactory; //导入依赖的package包/类
/**
 * create a CG builder for script. Note that the script at dir/name is
 * loaded via the classloader, not from the filesystem.
 */
public static JSCFABuilder makeScriptCGBuilder(String dir, String name,
        CGBuilderType builderType) throws IOException, WalaException {
    URL script = getURLforFile(dir, name);
    CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs
                                       ? new CorrelatedPairExtractorFactory(translatorFactory, script)
                                       : null;
    JavaScriptLoaderFactory loaders = JSCallGraphUtil
                                      .makeLoaders(preprocessor);

    AnalysisScope scope = makeScriptScope(script, dir, name, loaders);

    return makeCG(loaders, scope, builderType,
                  AstIRFactory.makeDefaultFactory());
}
 

开发者ID:logicalhacking,
项目名称:DASCA,
代码行数:19,
代码来源:ImprovedJSCallGraphBuilderUtil.java

示例6: makeScriptCGBuilder

点赞 2

import com.ibm.wala.cast.ir.ssa.AstIRFactory; //导入依赖的package包/类
/**
 * create a CG builder for script.  Note that the script at dir/name is loaded via the classloader, not from the filesystem.
 */
public static JSCFABuilder makeScriptCGBuilder(String dir, String name, CGBuilderType builderType) throws IOException, WalaException {
  URL script = getURLforFile(dir, name);
  CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, script) : null;
  JavaScriptLoaderFactory loaders = JSCallGraphUtil.makeLoaders(preprocessor);

  AnalysisScope scope = makeScriptScope(script, dir, name, loaders);

  return makeCG(loaders, scope, builderType, AstIRFactory.makeDefaultFactory());
}
 

开发者ID:blackoutjack,
项目名称:jamweaver,
代码行数:13,
代码来源:JSCallGraphBuilderUtil.java

示例7: createIR

点赞 2

import com.ibm.wala.cast.ir.ssa.AstIRFactory; //导入依赖的package包/类
public Map<IMethod, IR> createIR() throws java.io.IOException {
   Map<IMethod, IR> result = new HashMap<IMethod, IR>();
   
   engine.buildAnalysisScope();

   IClassHierarchy cha = engine.getClassHierarchy();

   SSAOptions options = new SSAOptions();
   IRFactory<IMethod> F = AstIRFactory.makeDefaultFactory();
   
   for(Iterator<IClass> clss = cha.iterator(); clss.hasNext(); ) {
     IClass cls = clss.next();
     ClassLoaderReference clr = cls.getClassLoader().getReference(); 
     if ( !(clr.equals(ClassLoaderReference.Primordial)  
                    || 
     clr.equals(ClassLoaderReference.Extension)))
     {		
for (Iterator<IMethod> ms = cls.getDeclaredMethods().iterator(); 
     ms.hasNext(); ) 
{
  IMethod m = ms.next();
  IR ir = F.makeIR(m, Everywhere.EVERYWHERE, options);
  result.put(m, ir);
}
     }
   }
   
   return result;
 }
 

开发者ID:wala,
项目名称:MemSAT,
代码行数:30,
代码来源:IRCreation.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)