Package org.allspice.structured

Examples of org.allspice.structured.ClassDecl


* @param state
* @return The object
**/
private static final FileUnit reduce17(PositionRange range,Parser parser,ParserState state) {
      FileUnit fileunit = (FileUnit)state.reductions.tail.head.o ;
      ClassDecl classdecl = (ClassDecl)state.reductions.head.o ;
{
  return fileunit.addClassDecl(classdecl) ;
}
}
View Full Code Here


      FieldAttrs fieldattrs = (FieldAttrs)state.reductions.tail.tail.tail.tail.head.o ;
      String ID = (String)state.reductions.tail.tail.head.o ;
      ImmutableCollection<String> superinterfaces_opt = (ImmutableCollection<String>)state.reductions.tail.head.o ;
      ImmutableCollection<FieldOrMethod> classitems = (ImmutableCollection<FieldOrMethod>)state.reductions.head.o ;
{
  return new ClassDecl(fieldattrs.visibility,ClassType.INTERFACE,ID,"java.lang.Object",
      superinterfaces_opt,classitems) ;
}
}
View Full Code Here

      String ID = (String)state.reductions.tail.tail.tail.head.o ;
      String superclass_opt = (String)state.reductions.tail.tail.head.o ;
      ImmutableCollection<String> implements_opt = (ImmutableCollection<String>)state.reductions.tail.head.o ;
      ImmutableCollection<FieldOrMethod> classitems = (ImmutableCollection<FieldOrMethod>)state.reductions.head.o ;
{
  return new ClassDecl(fieldattrs.visibility,ClassType.DEFAULT,ID,superclass_opt,
      implements_opt,classitems) ;
}
}
View Full Code Here

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

        i++ ;
      }
      FieldAttrs fa = new FieldAttrs().setVisibility(Visibility.PUBLIC) ;
      meths = meths.insert(new MethodDecl(fa,returnType,name,vars, new FIFO<String>(),new FIFO<Statement>(stats))) ;
    }
    ClassDecl cd = new ClassDecl(Visibility.PUBLIC,ClassType.DEFAULT,"NewClass","java.lang.Object",new FIFO<String>(iface.getName()),meths) ;
    FileUnit fu = new FileUnit().addClassDecl(cd).setPackageName("org.allspice.structuredtobc.test") ;
    ClassLoader loader = ClassConverter.createLoader(StdJavaExpressions.INSTANCE,new FIFO<FileUnit>(fu)) ;
    Class<?> cl = loader.loadClass(ClassPool.getClassName(fu,cd).toString()) ;
    return (T)cl.newInstance() ;   
  }
View Full Code Here

TOP

Related Classes of org.allspice.structured.ClassDecl

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.