Package org.allspice.structured

Examples of org.allspice.structured.VarDecl


  public static interface ComplexArrayTest {
    public int[][] meth() ;
  }
  public void test1() throws Exception {
    ComplexArrayTest obj = makeObject(ComplexArrayTest.class,new DeclareStatement(
        new FIFO<VarDecl>(new VarDecl("int[][]","i",new ArrayOfExpr(null,
            new FIFO<Expr>(
              new ArrayOfExpr(null,new FIFO<Expr>(
                  new ConstExpr(Integer.valueOf(6),null),
                  new ConstExpr(Integer.valueOf(9),null)
                  )),
View Full Code Here


  public static interface WhileTest {
    public int meth(int arg0) ;
  }
  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),
View Full Code Here

      String returnType = getName(meth.getReturnType()) ;
      String name = meth.getName() ;
      ImmutableCollection<VarDecl> vars = new FIFO<VarDecl>() ;
      int i = 0 ;
      for(Class<?> arg: meth.getParameterTypes()) {
        vars = vars.insert(new VarDecl(getName(arg),"arg"+i)) ;
        i++ ;
      }
      FieldAttrs fa = new FieldAttrs().setVisibility(Visibility.PUBLIC) ;
      meths = meths.insert(new MethodDecl(fa,returnType,name,vars, new FIFO<String>(),new FIFO<Statement>(stats))) ;
    }
View Full Code Here

private static final VarDecl reduce10(PositionRange range,Parser parser,ParserState state) {
      String type = (String)state.reductions.tail.tail.head.o ;
      String ID = (String)state.reductions.tail.head.o ;
      String arraydims = (String)state.reductions.head.o ;
{
  return new VarDecl(type+arraydims,ID,null,true) ;
}
}
View Full Code Here

private static final VarDecl reduce11(PositionRange range,Parser parser,ParserState state) {
      String type = (String)state.reductions.tail.tail.head.o ;
      String ID = (String)state.reductions.tail.head.o ;
      String arraydims = (String)state.reductions.head.o ;
{
  return new VarDecl(type+arraydims,ID) ;
}
}
View Full Code Here

* @param parser
* @param state
* @return The object
**/
private static final ImmutableCollection<VarDecl> reduce12(PositionRange range,Parser parser,ParserState state) {
      VarDecl param = (VarDecl)state.reductions.head.o ;
{
  return new FIFO<VarDecl>(param) ;
}
}
View Full Code Here

* @param state
* @return The object
**/
private static final ImmutableCollection<VarDecl> reduce13(PositionRange range,Parser parser,ParserState state) {
      ImmutableCollection<VarDecl> parameterlist = (ImmutableCollection<VarDecl>)state.reductions.tail.tail.head.o ;
      VarDecl param = (VarDecl)state.reductions.head.o ;
{
  return parameterlist.insert(param) ;
}
}
View Full Code Here

      ImmutableCollection<CatchBlock> catchclause = (ImmutableCollection<CatchBlock>)state.reductions.tail.tail.tail.tail.tail.tail.head.o ;
      String type = (String)state.reductions.tail.tail.tail.head.o ;
      String ID = (String)state.reductions.tail.tail.head.o ;
      ImmutableCollection<Statement> compoundstatement = (ImmutableCollection<Statement>)state.reductions.head.o ;
{
  CatchBlock cb = new CatchBlock(new VarDecl(type,ID),compoundstatement) ;
  return catchclause.insert(cb) ;
}
}
View Full Code Here

TOP

Related Classes of org.allspice.structured.VarDecl

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.