Examples of ExprStatement


Examples of org.allspice.structured.statement.ExprStatement

    public void meth(char[] arg0,int arg1,char arg2) ;
    public void meth(byte[] arg0,int arg1,byte arg2) ;
    public void meth(short[] arg0,int arg1,short arg2) ;
  }
  public void test0() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(new ArrVarExpr(ARG0,ARG1,null),ARG2,null),null) ;
    SetArrTestInt obj = makeObject(SetArrTestInt.class,st,new ReturnStatement(null)) ;
    {
      int[] arr = new int[4] ;
      obj.meth(arr,2,42) ;
      assertTrue(arr[2] == 42) ;
View Full Code Here

Examples of org.allspice.structured.statement.ExprStatement

  }
  public void test1() throws Exception {
    WhileTest obj = makeObject(WhileTest.class,new DeclareStatement(
        new FIFO<VarDecl>(new VarDecl("int","i"),new VarDecl("int","total")),
        new FIFO<Statement>(
        new ExprStatement(new SetValueExpr(I,new ConstExpr(Integer.valueOf(0),null),null),null),
        new ExprStatement(new SetValueExpr(TOTAL,new ConstExpr(Integer.valueOf(0),null),null),null),
        new WhileStatement(
            new LTExpr(I,ARG0,null),
            new FIFO<Statement>(
            new ExprStatement(new AddInPlaceExpr(I,new ConstExpr(Integer.valueOf(1),null),null),null),
            new ExprStatement(new AddInPlaceExpr(TOTAL,new ConstExpr(Integer.valueOf(2),null),null),null)),null),
        new ReturnStatement(TOTAL,null)
      ),null)) ;
    assertEquals(obj.meth(5),10) ;
    assertEquals(obj.meth(0),0) ;
  }
View Full Code Here

Examples of org.renjin.compiler.ir.tac.statements.ExprStatement

   
    // assignment itself has no side effects,
    // evaluate only the rhs for its side effects
   
    builder.addStatement(
        new ExprStatement(builder.translateExpression(context, call.getArgument(2))));
   
  }
View Full Code Here

Examples of org.renjin.compiler.ir.tac.statements.ExprStatement

  public void addStatement(IRBodyBuilder builder, TranslationContext context,
      FunctionCall call) {
   
    // TODO: does x$a ever have any side effects? Maybe forces a promise?
    // if not, we can do a NO OP here.
    builder.addStatement(new ExprStatement(translateToExpression(builder, context, call)));
   
  }
View Full Code Here

Examples of org.renjin.compiler.ir.tac.statements.ExprStatement

    SimpleExpression condition1 = builder.translateSimpleExpression(context, call.getArgument(0));
    builder.addStatement(new IfStatement(condition1, test2Label, finishLabel, test2Label));
   
    // first condition is ok, check the second
    builder.addLabel(test2Label);
    builder.addStatement(new ExprStatement(builder.translateExpression(context, call.getArgument(1))));
   
    builder.addLabel(finishLabel);
  
  }
View Full Code Here

Examples of org.renjin.compiler.ir.tac.statements.ExprStatement

    SimpleExpression condition1 = builder.translateSimpleExpression(context, call.getArgument(0));
    builder.addStatement(new IfStatement(condition1, finishLabel, test2Label, test2Label));
   
    // first condition is ok, check the second
    builder.addLabel(test2Label);
    builder.addStatement(new ExprStatement(builder.translateExpression(context, call.getArgument(1))));
   
    builder.addLabel(finishLabel);
  
  }
View Full Code Here

Examples of org.renjin.compiler.ir.tac.statements.ExprStatement

  @Override
  public void addStatement(IRBodyBuilder builder, TranslationContext context,
      FunctionCall call) {
    builder.addStatement(
        new ExprStatement(translateToExpression(builder, context, call)));
  }
View Full Code Here

Examples of sizzle.parser.syntaxtree.ExprStatement

  }

  /** {@inheritDoc} */
  @Override
  public SizzleType visit(final ForExprStatement n, final SymbolTable argu) {
    final ExprStatement exprStatement = new ExprStatement(n.f0, n.f1, new NodeToken(";"));

    return exprStatement.accept(this, argu);
  }
View Full Code Here

Examples of sizzle.parser.syntaxtree.ExprStatement

    return varDecl.accept(this, argu);
  }

  @Override
  public String visit(final ForExprStatement n, final SymbolTable argu) {
    final ExprStatement exprStatement = new ExprStatement(n.f0, n.f1, new NodeToken(";"));

    return exprStatement.accept(this, argu);
  }
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.