Package org.allspice.structured.statement

Examples of org.allspice.structured.statement.Statement


      test = new ConstExpr(Boolean.TRUE,range) ;
    }
    else {
        test = term ;
    }
    Statement whileState = new WhileStatement(test,whilebody,range) ;
    if (init == null) {
      return new FIFO<Statement>(whileState) ;
    }
    if (init instanceof ExprForInit) {
        Expr e = ((ExprForInit)init).e ;
View Full Code Here


  }

  private static boolean firstIsSuperInit(final ArrayList<Statement> body) {
    Iterator<Statement> i = body.iterator() ;
    if (i.hasNext()) {
      Statement st = i.next() ;
      if (st instanceof ExprStatement) {
        ExprStatement es = (ExprStatement)st ;
        Expr e = es.e ;
        if (e instanceof CallExpr) {
          CallExpr ce = (CallExpr)e ;
View Full Code Here

public class TestSetStaticField extends MyTestCase {
  public static interface BooleanSetFieldTest {
    public void meth(boolean arg1) ;
  }
  public void test0() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","boolean_field",null),ARG0,null),null) ;
    BooleanSetFieldTest obj = makeObject(BooleanSetFieldTest.class,st,new ReturnStatement(null)) ;
    obj.meth(true) ;
    assertEquals(StaticFieldTestClass.boolean_field,true) ;
    obj.meth(false) ;
View Full Code Here

  }
  public static interface ByteSetFieldTest {
    public void meth(byte arg1) ;
  }
  public void test1() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","byte_field",null),ARG0,null),null) ;
    ByteSetFieldTest obj = makeObject(ByteSetFieldTest.class,st,new ReturnStatement(null)) ;
    obj.meth((byte)45) ;
    assertEquals(StaticFieldTestClass.byte_field,(byte)45) ;
  }
View Full Code Here

  }
  public static interface ShortSetFieldTest {
    public void meth(short arg1) ;
  }
  public void test2() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","short_field",null),ARG0,null),null) ;
    ShortSetFieldTest obj = makeObject(ShortSetFieldTest.class,st,new ReturnStatement(null)) ;
    obj.meth((short)45) ;
    assertEquals(StaticFieldTestClass.short_field,(short)45) ;
  }
View Full Code Here

  }
  public static interface CharSetFieldTest {
    public void meth(char arg1) ;
  }
  public void test3() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","char_field",null),ARG0,null),null) ;
    CharSetFieldTest obj = makeObject(CharSetFieldTest.class,st,new ReturnStatement(null)) ;
    obj.meth((char)45) ;
    assertEquals(StaticFieldTestClass.char_field,(char)45) ;
  }
View Full Code Here

  }
  public static interface IntSetFieldTest {
    public void meth(int arg1) ;
  }
  public void test5() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","int_field",null),ARG0,null),null) ;
    IntSetFieldTest obj = makeObject(IntSetFieldTest.class,st,new ReturnStatement(null)) ;
    obj.meth(5) ;
    assertEquals(StaticFieldTestClass.int_field,5) ;
  }
View Full Code Here

  }
  public static interface FloatSetFieldTest {
    public void meth(float arg1) ;
  }
  public void test6() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","float_field",null),ARG0,null),null) ;
    FloatSetFieldTest obj = makeObject(FloatSetFieldTest.class,st,new ReturnStatement(null)) ;
    obj.meth(5F) ;
    assertTrue(StaticFieldTestClass.float_field == 5F) ;
  }
View Full Code Here

  }
  public static interface LongSetFieldTest {
    public void meth(long arg1) ;
  }
  public void test7() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","long_field",null),ARG0,null),null) ;
    LongSetFieldTest obj = makeObject(LongSetFieldTest.class,st,new ReturnStatement(null)) ;
    obj.meth(5L) ;
    assertEquals(StaticFieldTestClass.long_field,5L) ;
  }
View Full Code Here

  }
  public static interface DoubleSetFieldTest {
    public void meth(double arg1) ;
  }
  public void test8() throws Exception {
    Statement st = new ExprStatement(new SetValueExpr(
        new FieldVarExpr("org.allspice.structuredtobc.test.StaticFieldTestClass","double_field",null),ARG0,null),null) ;
    DoubleSetFieldTest obj = makeObject(DoubleSetFieldTest.class,st,new ReturnStatement(null)) ;
    obj.meth(5D) ;
    assertTrue(StaticFieldTestClass.double_field == 5D) ;
  }
View Full Code Here

TOP

Related Classes of org.allspice.structured.statement.Statement

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.