Package javassist.compiler.ast

Examples of javassist.compiler.ast.ASTList.head()


/*      */   }
/*      */
/*      */   public void atArrayInit(ArrayInit init) throws CompileError {
/*  180 */     ASTList list = init;
/*  181 */     while (list != null) {
/*  182 */       ASTree h = list.head();
/*  183 */       list = list.tail();
/*  184 */       if (h != null)
/*  185 */         h.accept(this);
/*      */     }
/*      */   }
View Full Code Here


/*     */   }
/*     */
/*     */   public void atCastExpr(CastExpr expr) throws CompileError {
/*  87 */     ASTList classname = expr.getClassName();
/*  88 */     if ((classname != null) && (expr.getArrayDim() == 0)) {
/*  89 */       ASTree p = classname.head();
/*  90 */       if (((p instanceof Symbol)) && (classname.tail() == null)) {
/*  91 */         String typename = ((Symbol)p).get();
/*  92 */         if (typename.equals(this.codeGen.returnCastName)) {
/*  93 */           atCastToRtype(expr);
/*  94 */           return;
View Full Code Here

/*     */   }
/*     */
/*     */   public void atCastExpr(CastExpr expr) throws CompileError {
/* 161 */     ASTList classname = expr.getClassName();
/* 162 */     if ((classname != null) && (expr.getArrayDim() == 0)) {
/* 163 */       ASTree p = classname.head();
/* 164 */       if (((p instanceof Symbol)) && (classname.tail() == null)) {
/* 165 */         String typename = ((Symbol)p).get();
/* 166 */         if (typename.equals(this.returnCastName)) {
/* 167 */           atCastToRtype(expr);
/* 168 */           return;
View Full Code Here

/*      */
/*  215 */     int var = getMaxLocals();
/*  216 */     incMaxLocals(1);
/*  217 */     while (catchList != null)
/*      */     {
/*  219 */       Pair p = (Pair)catchList.head();
/*  220 */       catchList = catchList.tail();
/*  221 */       Declarator decl = (Declarator)p.getLeft();
/*  222 */       Stmnt block = (Stmnt)p.getRight();
/*      */
/*  224 */       decl.setLocalVar(var);
View Full Code Here

/*  387 */       int s = init.length();
/*  388 */       ASTList list = init;
/*  389 */       for (int i = 0; i < s; i++) {
/*  390 */         this.bytecode.addOpcode(89);
/*  391 */         this.bytecode.addIconst(i);
/*  392 */         list.head().accept(this);
/*  393 */         if (!isRefType(type)) {
/*  394 */           atNumCastExpr(this.exprType, type);
/*      */         }
/*  396 */         this.bytecode.addOpcode(getArrayWriteOp(type, 0));
/*  397 */         list = list.tail();
View Full Code Here

/* 1103 */       params = new CtClass[0];
/*      */     } else {
/* 1105 */       int i = 0;
/* 1106 */       params = new CtClass[plist.length()];
/* 1107 */       while (plist != null) {
/* 1108 */         params[(i++)] = this.resolver.lookupClass((Declarator)plist.head());
/* 1109 */         plist = plist.tail();
/*      */       }
/*      */     }
/*      */
/* 1113 */     return params;
View Full Code Here

/* 1120 */       return null;
/*      */     }
/* 1122 */     int i = 0;
/* 1123 */     CtClass[] clist = new CtClass[list.length()];
/* 1124 */     while (list != null) {
/* 1125 */       clist[(i++)] = this.resolver.lookupClassByName((ASTList)list.head());
/* 1126 */       list = list.tail();
/*      */     }
/*      */
/* 1129 */     return clist;
/*      */   }
View Full Code Here

/*      */
/*      */   public void atMethodDecl(MethodDecl method) throws CompileError {
/*  255 */     ASTList mods = method.getModifiers();
/*  256 */     setMaxLocals(1);
/*  257 */     while (mods != null) {
/*  258 */       Keyword k = (Keyword)mods.head();
/*  259 */       mods = mods.tail();
/*  260 */       if (k.get() == 335) {
/*  261 */         setMaxLocals(0);
/*  262 */         this.inStaticMethod = true;
/*      */       }
View Full Code Here

/*      */       }
/*      */     }
/*      */
/*  266 */     ASTList params = method.getParams();
/*  267 */     while (params != null) {
/*  268 */       atDeclarator((Declarator)params.head());
/*  269 */       params = params.tail();
/*      */     }
/*      */
/*  272 */     Stmnt s = method.getBody();
/*  273 */     atMethodBody(s, method.isConstructor(), method.getReturn().getType() == 344);
View Full Code Here

/*      */       }
/*      */     }
/*  344 */     else if ((op == 68) || (op == 66)) {
/*  345 */       ASTList list = st;
/*  346 */       while (list != null) {
/*  347 */         ASTree h = list.head();
/*  348 */         list = list.tail();
/*  349 */         if (h != null)
/*  350 */           h.accept(this);
/*      */       }
/*      */     }
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.