Package org.renjin.compiler.ir.tac

Examples of org.renjin.compiler.ir.tac.IRBodyBuilder$TopLevelContext


  private IRFunctionTable functionTable = new IRFunctionTable();
 
  @Test
  public void simple() {
    ExpressionVector ast = RParser.parseSource("x + sqrt(x * y)\n");
    IRBodyBuilder factory = new IRBodyBuilder(functionTable);
    IRBody ir = factory.build(ast);
    factory.dump( ast );
  }
View Full Code Here


    assumingBasePackagesLoad();
    topLevelContext.evaluate(
    RParser.parseSource(new InputStreamReader(getClass().getResourceAsStream("/meanOnline.R"))));
   
    Closure closure = (Closure) topLevelContext.getGlobalEnvironment().getVariable("mean.online");
    IRBodyBuilder factory = new IRBodyBuilder(functionTable);
    factory.dump(closure.getBody());
  }
View Full Code Here

    factory.dump(closure.getBody());
  }
 
  private void dump(String rcode) {
    ExpressionVector ast = RParser.parseSource(rcode + "\n");
    IRBodyBuilder factory = new IRBodyBuilder(functionTable);
    IRBody ir = factory.build(ast);
   
    System.out.println(ir.toString());
  }
View Full Code Here

    System.out.println(ir.toString());
  }
 
  private IRBody build(String rcode) {
    ExpressionVector ast = RParser.parseSource(rcode + "\n");
    IRBodyBuilder factory = new IRBodyBuilder(functionTable);
    return factory.build(ast);
  }
View Full Code Here

  protected IRFunctionTable functionTable = new IRFunctionTable();

  protected IRBody buildScope(String rcode) {
    ExpressionVector ast = RParser.parseSource(rcode + "\n");
    return new IRBodyBuilder(functionTable).build(ast);
 
View Full Code Here

  private static void showCfg(String rcode) {

    ExpressionVector ast = RParser.parseSource(rcode + "\n");
    IRFunctionTable functionTable = new IRFunctionTable();
    IRBody block = new IRBodyBuilder(functionTable).build(ast);

    System.out.println(block);
   
    final ControlFlowGraph cfg = new ControlFlowGraph(block);
  
View Full Code Here

    mv.visitEnd();
  }
 
  private void writeBody(MethodVisitor mv) {
    IRFunctionTable functionTable = new IRFunctionTable();
    IRBodyBuilder builder = new IRBodyBuilder(functionTable);
    IRBody body = builder.build(exp);
   
    ByteCodeVisitor visitor = new ByteCodeVisitor(generationContext, mv);
   
    ControlFlowGraph cfg = new ControlFlowGraph(body);
    for(BasicBlock bb : cfg.getBasicBlocks()) {
View Full Code Here

      .doCompileAndLoad(closure);
  }
 
  public static Class<Closure> compileAndLoad(Closure closureSexp) {
    IRFunctionTable functionTable = new IRFunctionTable();
    IRBodyBuilder builder = new IRBodyBuilder(functionTable);
    return compileAndLoad(new IRFunction(closureSexp.getFormals(), closureSexp.getBody(), builder.build(closureSexp.getBody())));
  }
View Full Code Here

TOP

Related Classes of org.renjin.compiler.ir.tac.IRBodyBuilder$TopLevelContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.