Examples of IRLabel


Examples of org.renjin.compiler.ir.tac.IRLabel

   
    // since "if" is being used in the context of an expression, we need
    // to store its final value somewhere
    Temp ifResult = builder.newTemp();
   
    IRLabel trueTarget = builder.newLabel();
    IRLabel falseTarget = builder.newLabel();
    IRLabel endLabel = builder.newLabel();
   
    IfStatement jump = new IfStatement(condition, trueTarget, falseTarget);
    builder.addStatement(jump);
   
    // evaluate "if true" expression
View Full Code Here

Examples of org.renjin.compiler.ir.tac.IRLabel

  @Override
  public void addStatement(IRBodyBuilder builder, TranslationContext context, FunctionCall call) {

    SimpleExpression condition = builder.translateSimpleExpression(context, call.getArgument(0));
    IRLabel trueLabel = builder.newLabel();
    IRLabel falseLabel = builder.newLabel();
    IRLabel endLabel;

    if(hasElse(call)) {
      endLabel = builder.newLabel();
    } else {
      endLabel = falseLabel;
View Full Code Here

Examples of org.renjin.compiler.ir.tac.IRLabel

    return new Constant(Null.INSTANCE);
  }

  @Override
  public void addStatement(IRBodyBuilder builder, TranslationContext context, FunctionCall call) {
    IRLabel beginLabel = builder.addLabel();
    IRLabel exitLabel = builder.newLabel();
   
    LoopContext loopContext = new LoopContext(beginLabel, exitLabel);
    builder.translateStatements(loopContext, call.getArgument(0));
   
    builder.addStatement(new GotoStatement(beginLabel));
View Full Code Here

Examples of org.renjin.compiler.ir.tac.IRLabel

  @Override
  public Expression translateToExpression(IRBodyBuilder builder,
      TranslationContext context, FunctionCall call) {
   
    Temp result = builder.newTemp();
    IRLabel firstTrue = builder.newLabel(); /* first is true, need to check second */
    IRLabel firstNA = builder.newLabel(); /* first is NA, need to check second */
   
    IRLabel test2Label = builder.newLabel(); /* conduct second test */

    IRLabel falseLabel = builder.newLabel();
    IRLabel naLabel = builder.newLabel();
    IRLabel finishLabel = builder.newLabel();
   
    // check the first condition
    SimpleExpression condition1 = builder.translateSimpleExpression(context, call.getArgument(0));
    builder.addStatement(new IfStatement(condition1, firstTrue, falseLabel, firstNA));
   
View Full Code Here

Examples of org.renjin.compiler.ir.tac.IRLabel

  @Override
  public void addStatement(IRBodyBuilder builder, TranslationContext context,
      FunctionCall call) {
   
    IRLabel test2Label = builder.newLabel();
    IRLabel finishLabel = builder.newLabel();
   
    // check the first condition
    SimpleExpression condition1 = builder.translateSimpleExpression(context, call.getArgument(0));
    builder.addStatement(new IfStatement(condition1, test2Label, finishLabel, test2Label));
   
View Full Code Here

Examples of org.renjin.compiler.ir.tac.IRLabel

  @Override
  public Expression translateToExpression(IRBodyBuilder builder,
      TranslationContext context, FunctionCall call) {

    Temp result = builder.newTemp();
    IRLabel firstFalse = builder.newLabel(); /* first is false, need to check second */
    IRLabel firstNA = builder.newLabel(); /* first is NA, need to check second */
   
    IRLabel test2Label = builder.newLabel(); /* conduct second test */

    IRLabel trueLabel = builder.newLabel();
    IRLabel naLabel = builder.newLabel();
    IRLabel finishLabel = builder.newLabel();
   
    // check the first condition
    SimpleExpression condition1 = builder.translateSimpleExpression(context, call.getArgument(0));
    builder.addStatement(new IfStatement(condition1, trueLabel, firstFalse, firstNA));
   
View Full Code Here

Examples of org.renjin.compiler.ir.tac.IRLabel

  @Override
  public void addStatement(IRBodyBuilder builder, TranslationContext context,
      FunctionCall call) {
   
    IRLabel test2Label = builder.newLabel();
    IRLabel finishLabel = builder.newLabel();
   
    // check the first condition
    SimpleExpression condition1 = builder.translateSimpleExpression(context, call.getArgument(0));
    builder.addStatement(new IfStatement(condition1, finishLabel, test2Label, test2Label));
   
View Full Code Here

Examples of org.renjin.compiler.ir.tac.IRLabel

    Expression vector =
        factory.translateSimpleExpression(context, call.getArgument(1));
   
    SEXP body = call.getArgument(2);

    IRLabel counterLabel = factory.newLabel();
    IRLabel bodyLabel = factory.newLabel();
    IRLabel nextLabel = factory.newLabel();
    IRLabel exitLabel = factory.newLabel();
      
    // initialize the counter
    factory.addStatement(new Assignment(counter, new Constant(0)));
    factory.addStatement(new Assignment(length,
        new Length((Expression)vector)));
View Full Code Here

Examples of org.renjin.compiler.ir.tac.IRLabel

   
    SEXP condition = call.getArgument(0);
   
    SEXP body = call.getArgument(1);

    IRLabel checkLabel = factory.newLabel();
    IRLabel bodyLabel = factory.newLabel();
    IRLabel exitLabel = factory.newLabel();
      
    // check the counter and potentially loop
    factory.addLabel(checkLabel);
    factory.addStatement(
        new IfStatement(factory.translateSimpleExpression(context, condition),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.