Package org.allspice.structuredtobc.ClassPool

Examples of org.allspice.structuredtobc.ClassPool.FileUnitInfo


  public static List<ClassDef> createClassDef(StdJavaExpressions converter,ClassPool classPool,FileUnit fu) throws CompileFailed {
    List<ClassDef> defs = new ArrayList<ClassDef>() ;
    Collection<Exception> errors = new ArrayList<Exception>() ;
    for(ClassDecl cdecl: fu.classDecl) {
      ClassDef cd ;
      FileUnitInfo fuinfo = classPool.findFileUnit(fu) ;
      TypeName cname = ClassPool.getClassName(fu,cdecl) ;
      switch(cdecl.classType) {
      case ABSTRACT:
        cd = new ClassDef(ClassDefType.ABSTRACT,fu.filename,cname,fuinfo.getFullQualified(cdecl.superClass)) ;
        break ;
      case INTERFACE:
        cd = new ClassDef(ClassDefType.INTERFACE,fu.filename,cname,fuinfo.getFullQualified(cdecl.superClass)) ;
        break ;
      default:
        cd = new ClassDef(ClassDefType.DEFAULT,fu.filename,cname,fuinfo.getFullQualified(cdecl.superClass)) ;
        break ;
      }
      VarStack fdcls = new VarStack() ;
      try {
        fdcls = StdJavaExpressions.makeFieldDecls(classPool,classPool.new SimpleResolver(cname),fdcls);
      } catch (CompilerException e) {
        errors.add(e) ;
      }
      for(String iface: cdecl.interfaces) {
        cd = cd.addInterface(fuinfo.getFullQualified(iface)) ;
      }
      for(FieldOrMethod fom: cdecl.decls) {
        if (fom instanceof FieldDecl) {
          try {
            cd = cd.addField(getDef(converter,classPool,cdecl,(FieldDecl)fom,fuinfo)) ;
View Full Code Here


  }
  public FileUnitInfo getFileUnitInfo() {
    return classPool.findFileUnit(fileUnit);
  }
  public TypeName fullyQualified(String type) {
    final FileUnitInfo findFileUnit = getFileUnitInfo() ;
    if (findFileUnit == null) {
      return new TypeName(type) ;
    }
    return findFileUnit.getFullQualified(type) ;
  }
View Full Code Here

TOP

Related Classes of org.allspice.structuredtobc.ClassPool.FileUnitInfo

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.