Examples of methodDecl


Examples of javassist.compiler.ast.MethodDecl

/*  132 */         this.lex.get();
/*      */       }
/*      */
/*      */     }
/*      */
/*  138 */     return new MethodDecl(mods, new ASTList(d, ASTList.make(parms, throwsList, null)));
/*      */   }
View Full Code Here

Examples of org.allspice.structured.MethodDecl

        FieldDecl fdec = (FieldDecl)fom ;
        StubResolver fldstub = new SimpleResolver(finfo.getFullQualified(fdec.type)) ;
        stub = stub.addField(new FieldStub(fdec.name,enclosing,fldstub,fdec.fieldAttrs.isStatic,false,fdec.intializer));
      }
      else if (fom instanceof MethodDecl) {
        MethodDecl mdec = (MethodDecl)fom ;
        FIFO<StubResolver> types = new FIFO<StubResolver>() ;
        for(VarDecl vd: mdec.parameters) {
          types = types.insert(new SimpleResolver(finfo.getFullQualified(vd.type))) ;
        }
        boolean isStatic = false ;
View Full Code Here

Examples of org.allspice.structured.MethodDecl

      boolean foundInit = false ;
      FieldAttrs fa = new FieldAttrs().setVisibility(Visibility.PUBLIC).setStatic(true) ;
      ImmutableCollection<Statement> body = new FIFO<Statement>() ;
      for(FieldOrMethod fom: cdecl.decls) {
        if (fom instanceof MethodDecl) {
          MethodDecl mdd = (MethodDecl)fom ;
          if (mdd.name.equals("<clinit>")) {
            body = body.insertAll(mdd.body) ;
            continue ;
          }
          try {
            MethodDef def = getDef(converter,classPool,cdecl,mdd,fuinfo,fdcls,errors);
            if (def.name.equals("<init>")) {
              foundInit = true ;
            }
            cd = cd.addMethod(def) ;
          } catch (CompilerException e) {
            errors.add(e) ;
          }
        }
        else if (fom instanceof FieldDecl) {
          FieldDecl fdecl = (FieldDecl)fom ;
          if (fdecl.fieldAttrs.isStatic && fdecl.intializer != null) {
            SetValueExpr se = new SetValueExpr(new FieldVarExpr(cname.toString(),fdecl.name,null),fdecl.intializer,null) ;
            body = body.insert(new ExprStatement(se,null)) ;         
          }
        }
      }
      MethodDecl clinit = new MethodDecl(fa,"void","<clinit>",new FIFO<VarDecl>(),new FIFO<String>(),body) ;
      if (!foundInit && cdecl.classType != ClassType.INTERFACE) {
        FieldAttrs ifa = new FieldAttrs().setVisibility(Visibility.PUBLIC) ;
        MethodDecl mdd = new MethodDecl(ifa,"void","<init>",new FIFO<VarDecl>(),new FIFO<String>(),new FIFO<Statement>()) ;
        try {
          cd = cd.addMethod(getDef(converter,classPool,cdecl,mdd,fuinfo,fdcls,errors)) ;
        } catch (CompilerException e) {
          errors.add(e) ;
        }
View Full Code Here

Examples of org.allspice.structured.MethodDecl

**/
private static final ImmutableCollection<FieldOrMethod> reduce30(PositionRange range,Parser parser,ParserState state) {
      ImmutableCollection<Statement> compoundstatement = (ImmutableCollection<Statement>)state.reductions.head.o ;
{
  FieldAttrs fa = new FieldAttrs().setStatic(true) ;
  MethodDecl decl = new MethodDecl(fa,"void","<clinit>",new FIFO<VarDecl>(), new FIFO<String>(), compoundstatement) ;
  return new FIFO<FieldOrMethod>(decl) ;
}
}
View Full Code Here

Examples of org.allspice.structured.MethodDecl

      String ID = (String)state.reductions.tail.tail.tail.tail.tail.head.o ;
      ImmutableCollection<VarDecl> parameterlist_opt = (ImmutableCollection<VarDecl>)state.reductions.tail.tail.tail.head.o ;
      ImmutableCollection<String> throws_opt = (ImmutableCollection<String>)state.reductions.tail.head.o ;
      ImmutableCollection<Statement> compoundstatement = (ImmutableCollection<Statement>)state.reductions.head.o ;
{
  MethodDecl decl = new MethodDecl(fieldattrs,"void","<init>",parameterlist_opt, throws_opt, compoundstatement,ID) ;
  return new FIFO<FieldOrMethod>(decl) ;
}
}
View Full Code Here

Examples of org.allspice.structured.MethodDecl

      String ID = (String)state.reductions.tail.tail.tail.tail.tail.head.o ;
      ImmutableCollection<VarDecl> parameterlist_opt = (ImmutableCollection<VarDecl>)state.reductions.tail.tail.tail.head.o ;
      ImmutableCollection<String> throws_opt = (ImmutableCollection<String>)state.reductions.tail.head.o ;
      ImmutableCollection<Statement> compoundstatement = (ImmutableCollection<Statement>)state.reductions.head.o ;
{
  MethodDecl methodDecl = new MethodDecl(fieldattrs,type,ID,parameterlist_opt, throws_opt,compoundstatement);
  return new FIFO<FieldOrMethod>(methodDecl) ;
}
}
View Full Code Here

Examples of org.allspice.structured.MethodDecl

      String type = (String)state.reductions.tail.tail.tail.tail.tail.tail.head.o ;
      String ID = (String)state.reductions.tail.tail.tail.tail.tail.head.o ;
      ImmutableCollection<VarDecl> parameterlist_opt = (ImmutableCollection<VarDecl>)state.reductions.tail.tail.tail.head.o ;
      ImmutableCollection<String> throws_opt = (ImmutableCollection<String>)state.reductions.tail.head.o ;
{
  MethodDecl methodDecl = new MethodDecl(fieldattrs.setAbstract(true),type,ID,parameterlist_opt, throws_opt, new FIFO<Statement>());
  return new FIFO<FieldOrMethod>(methodDecl) ;
}
}
View Full Code Here

Examples of org.allspice.structured.MethodDecl

      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))) ;
    }
    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()) ;
View Full Code Here

Examples of org.jvnet.sorcerer.Tag.MethodDecl

                    if(token!=null)
                        gen.add(new DeclName(lineMap,token));

                    ParsedType pt = getParsedType((TypeElement) e.getEnclosingElement());

                    gen.add(new MethodDecl(cu, srcPos, mt, e,
                        pt.findOverriddenMethods(elements, e),
                        pt.findOverridingMethods(elements, e)
                        ));
                }
View Full Code Here

Examples of org.xvr.s3D.methodDecl

     
      return indexOfSpace > 0 ? define.substring(0, indexOfSpace):define;
    }
   
    if (element instanceof methodDecl) {
      methodDecl method = (methodDecl) element;
      funcName name = method.getName();
      if(name != null)
        return method.getName().getFunctionName();
      return "";
    }

   
    return element.toString();
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.