Examples of ASTree


Examples of javassist.compiler.ast.ASTree

/*      */     }
/*  425 */     else if ((expr instanceof Expr)) {
/*  426 */       Expr e = (Expr)expr;
/*  427 */       int op = e.getOperator();
/*  428 */       if (op == 35) {
/*  429 */         ASTree cexpr = getConstantFieldValue((Member)e.oprand2());
/*  430 */         if (cexpr != null)
/*  431 */           return cexpr;
/*      */       }
/*  433 */       else if ((op == 43) && (e.getRight() == null)) {
/*  434 */         return e.getLeft();
/*      */       }
/*  436 */     } else if ((expr instanceof Member)) {
/*  437 */       ASTree cexpr = getConstantFieldValue((Member)expr);
/*  438 */       if (cexpr != null) {
/*  439 */         return cexpr;
/*      */       }
/*      */     }
/*  442 */     return expr;
View Full Code Here

Examples of javassist.compiler.ast.ASTree

/*      */
/*      */   public void atExpr(Expr expr)
/*      */     throws CompileError
/*      */   {
/*  562 */     int token = expr.getOperator();
/*  563 */     ASTree oprand = expr.oprand1();
/*  564 */     if (token == 46) {
/*  565 */       String member = ((Symbol)expr.oprand2()).get();
/*  566 */       if (member.equals("length"))
/*  567 */         atArrayLength(expr);
/*  568 */       else if (member.equals("class"))
/*  569 */         atClassObject(expr);
/*      */       else
/*  571 */         atFieldRead(expr);
/*      */     }
/*  573 */     else if (token == 35) {
/*  574 */       String member = ((Symbol)expr.oprand2()).get();
/*  575 */       if (member.equals("class"))
/*  576 */         atClassObject(expr);
/*      */       else
/*  578 */         atFieldRead(expr);
/*      */     }
/*  580 */     else if (token == 65) {
/*  581 */       atArrayRead(oprand, expr.oprand2());
/*  582 */     } else if ((token == 362) || (token == 363)) {
/*  583 */       atPlusPlus(token, oprand, expr);
/*  584 */     } else if (token == 33) {
/*  585 */       booleanExpr(expr);
/*  586 */     } else if (token == 67) {
/*  587 */       fatal();
/*      */     } else {
/*  589 */       oprand.accept(this);
/*  590 */       if ((!isConstant(expr, token, oprand)) &&
/*  591 */         ((token == 45) || (token == 126)) &&
/*  592 */         (CodeGen.isP_INT(this.exprType)))
/*  593 */         this.exprType = 324;
/*      */     }
View Full Code Here

Examples of javassist.compiler.ast.ASTree

/*      */   }
/*      */
/*      */   public void atCallExpr(CallExpr expr) throws CompileError {
/*  626 */     String mname = null;
/*  627 */     CtClass targetClass = null;
/*  628 */     ASTree method = expr.oprand1();
/*  629 */     ASTList args = (ASTList)expr.oprand2();
/*      */
/*  631 */     if ((method instanceof Member)) {
/*  632 */       mname = ((Member)method).get();
/*  633 */       targetClass = this.thisClass;
/*      */     }
/*  635 */     else if ((method instanceof Keyword)) {
/*  636 */       mname = "<init>";
/*  637 */       if (((Keyword)method).get() == 336)
/*  638 */         targetClass = MemberResolver.getSuperclass(this.thisClass);
/*      */       else
/*  640 */         targetClass = this.thisClass;
/*      */     }
/*  642 */     else if ((method instanceof Expr)) {
/*  643 */       Expr e = (Expr)method;
/*  644 */       mname = ((Symbol)e.oprand2()).get();
/*  645 */       int op = e.getOperator();
/*  646 */       if (op == 35) {
/*  647 */         targetClass = this.resolver.lookupClass(((Symbol)e.oprand1()).get(), false);
/*      */       }
/*  650 */       else if (op == 46) {
/*  651 */         ASTree target = e.oprand1();
/*      */         try {
/*  653 */           target.accept(this);
/*      */         }
/*      */         catch (NoFieldException nfe) {
/*  656 */           if (nfe.getExpr() != target) {
/*  657 */             throw nfe;
/*      */           }
View Full Code Here

Examples of javassist.compiler.ast.ASTree

/*      */
/*      */   public void atMethodArgs(ASTList args, int[] types, int[] dims, String[] cnames) throws CompileError
/*      */   {
/*  730 */     int i = 0;
/*  731 */     while (args != null) {
/*  732 */       ASTree a = args.head();
/*  733 */       a.accept(this);
/*  734 */       types[i] = this.exprType;
/*  735 */       dims[i] = this.arrayDim;
/*  736 */       cnames[i] = this.className;
/*  737 */       i++;
/*  738 */       args = args.tail();
View Full Code Here

Examples of javassist.compiler.ast.ASTree

/*      */         catch (CompileError ce)
/*      */         {
/*  847 */           err = ce;
/*      */         }
/*      */
/*  866 */         ASTree oprnd1 = e.oprand1();
/*  867 */         if ((oprnd1 instanceof Symbol)) {
/*  868 */           return fieldAccess2(e, ((Symbol)oprnd1).get());
/*      */         }
/*  870 */         if (err != null) {
/*  871 */           throw err;
View Full Code Here

Examples of javassist.compiler.ast.ASTree

/*     */   }
/*     */
/*     */   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

Examples of javassist.compiler.ast.ASTree

/*     */   }
/*     */
/*     */   public void atCallExpr(CallExpr expr)
/*     */     throws CompileError
/*     */   {
/* 230 */     ASTree method = expr.oprand1();
/* 231 */     if ((method instanceof Member)) {
/* 232 */       String name = ((Member)method).get();
/* 233 */       if ((this.procHandler != null) && (name.equals(this.proceedName))) {
/* 234 */         this.procHandler.doit(this, this.bytecode, (ASTList)expr.oprand2());
/* 235 */         return;
View Full Code Here

Examples of javassist.compiler.ast.ASTree

/*     */
/*     */   public boolean isParamListName(ASTList args)
/*     */   {
/* 297 */     if ((this.paramTypeList != null) && (args != null) && (args.tail() == null))
/*     */     {
/* 299 */       ASTree left = args.head();
/* 300 */       return ((left instanceof Member)) && (((Member)left).get().equals(this.paramListName));
/*     */     }
/*     */
/* 304 */     return false;
/*     */   }
View Full Code Here

Examples of javassist.compiler.ast.ASTree

/*     */   public int getMethodArgsLength(ASTList args)
/*     */   {
/* 317 */     String pname = this.paramListName;
/* 318 */     int n = 0;
/* 319 */     while (args != null) {
/* 320 */       ASTree a = args.head();
/* 321 */       if (((a instanceof Member)) && (((Member)a).get().equals(pname))) {
/* 322 */         if (this.paramTypeList != null)
/* 323 */           n += this.paramTypeList.length;
/*     */       }
/*     */       else {
View Full Code Here

Examples of javassist.compiler.ast.ASTree

/*     */   {
/* 336 */     CtClass[] params = this.paramTypeList;
/* 337 */     String pname = this.paramListName;
/* 338 */     int i = 0;
/* 339 */     while (args != null) {
/* 340 */       ASTree a = args.head();
/* 341 */       if (((a instanceof Member)) && (((Member)a).get().equals(pname))) {
/* 342 */         if (params != null) {
/* 343 */           int n = params.length;
/* 344 */           int regno = indexOfParam1();
/* 345 */           for (int k = 0; k < n; k++) {
/* 346 */             CtClass p = params[k];
/* 347 */             regno += this.bytecode.addLoad(regno, p);
/* 348 */             setType(p);
/* 349 */             types[i] = this.exprType;
/* 350 */             dims[i] = this.arrayDim;
/* 351 */             cnames[i] = this.className;
/* 352 */             i++;
/*     */           }
/*     */         }
/*     */       }
/*     */       else {
/* 357 */         a.accept(this);
/* 358 */         types[i] = this.exprType;
/* 359 */         dims[i] = this.arrayDim;
/* 360 */         cnames[i] = this.className;
/* 361 */         i++;
/*     */       }
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.