Package org.renjin.sexp

Examples of org.renjin.sexp.ExpressionVector


    List<SEXP> expressions = Lists.newArrayList();
    while(parser.parse()) {
      expressions.add(parser.getResult());
    }
   
    ExpressionVector vector = new ExpressionVector(expressions);
    session.evaluate(vector);
   
   
  }
View Full Code Here


  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

    IRBodyBuilder factory = new IRBodyBuilder(functionTable);
    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

public class CompilerTestCase {

  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);
   
View Full Code Here

    SEXP expr = parse(source);
    return new FormulaInterpreter().interpret((FunctionCall) expr);
  }

  private SEXP parse(String source) {
    ExpressionVector tree = RParser.parseSource(source + "\n");
    SEXP expr = tree.getElementAsSEXP(0);
    return expr;
  }
View Full Code Here

    public void visit(ExpressionVector vector) {
      List<SEXP> list = Lists.newArrayList();
      for(SEXP exp : vector) {
        list.add( substitute(exp ));
      }
      result = new ExpressionVector(list, vector.getAttributes());
    }
View Full Code Here

   */
  private void processRScript(File scriptFile, String logicalDatasetName) throws IOException {

    Session session = new SessionBuilder().build();
    FileReader reader = new FileReader(scriptFile);
    ExpressionVector source = RParser.parseAllSource(reader);
    reader.close();
   
    session.getTopLevelContext().evaluate(source);
   
    PairList.Builder pairList = new PairList.Builder();
View Full Code Here

TOP

Related Classes of org.renjin.sexp.ExpressionVector

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.