Package javassist.compiler.ast

Examples of javassist.compiler.ast.Expr


/* 480 */     String m = method;
/*     */
/* 482 */     ProceedHandler h = new ProceedHandler(c, m) { private final String val$c;
/*     */       private final String val$m;
/*     */
/* 486 */       public void doit(JvstCodeGen gen, Bytecode b, ASTList args) throws CompileError { Expr expr = Expr.make(35, new Symbol(this.val$c), new Member(this.val$m));
/*     */
/* 488 */         expr = CallExpr.makeCall(expr, args);
/* 489 */         gen.compileExpr(expr);
/* 490 */         gen.addNullIfVoid();
/*     */       }
/*     */
/*     */       public void setReturnType(JvstTypeChecker check, ASTList args)
/*     */         throws CompileError
/*     */       {
/* 496 */         Expr expr = Expr.make(35, new Symbol(this.val$c), new Member(this.val$m));
/*     */
/* 498 */         expr = CallExpr.makeCall(expr, args);
/* 499 */         expr.accept(check);
/* 500 */         check.addNullIfVoid();
/*     */       }
/*     */     };
/* 504 */     this.gen.setProceedHandler(h, "$proceed");
/*     */   }
View Full Code Here


/*  328 */       ASTree expr = st.getLeft();
/*  329 */       doTypeCheck(expr);
/*  330 */       if ((expr instanceof AssignExpr)) {
/*  331 */         atAssignExpr((AssignExpr)expr, false);
/*  332 */       } else if (isPlusPlusExpr(expr)) {
/*  333 */         Expr e = (Expr)expr;
/*  334 */         atPlusPlus(e.getOperator(), e.oprand1(), e, false);
/*      */       }
/*      */       else {
/*  337 */         expr.accept(this);
/*  338 */         if (is2word(this.exprType, this.arrayDim))
/*  339 */           this.bytecode.addOpcode(88);
View Full Code Here

/*  746 */       atVariableAssign(expr, op, (Variable)left, ((Variable)left).getDeclarator(), right, doDup);
/*      */     }
/*      */     else
/*      */     {
/*  750 */       if ((left instanceof Expr)) {
/*  751 */         Expr e = (Expr)left;
/*  752 */         if (e.getOperator() == 65) {
/*  753 */           atArrayAssign(expr, op, (Expr)left, right, doDup);
/*  754 */           return;
/*      */         }
/*      */       }
/*      */
View Full Code Here

/* 1145 */     return false;
/*      */   }
/*      */
/*      */   static int getCompOperator(ASTree expr) throws CompileError {
/* 1149 */     if ((expr instanceof Expr)) {
/* 1150 */       Expr bexpr = (Expr)expr;
/* 1151 */       int token = bexpr.getOperator();
/* 1152 */       if (token == 33)
/* 1153 */         return 33;
/* 1154 */       if (((bexpr instanceof BinExpr)) && (token != 368) && (token != 369) && (token != 38) && (token != 124))
/*      */       {
/* 1157 */         return 358;
View Full Code Here

/*      */       else {
/* 1757 */         badType(expr);
/*      */       }
/*      */     } else {
/* 1760 */       if ((oprand instanceof Expr)) {
/* 1761 */         Expr e = (Expr)oprand;
/* 1762 */         if (e.getOperator() == 65) {
/* 1763 */           atArrayPlusPlus(token, isPost, e, doDup);
/* 1764 */           return;
/*      */         }
/*      */       }
/*      */
View Full Code Here

/*  217 */       atVariableAssign(expr, op, (Variable)left, ((Variable)left).getDeclarator(), right);
/*      */     }
/*      */     else
/*      */     {
/*  221 */       if ((left instanceof Expr)) {
/*  222 */         Expr e = (Expr)left;
/*  223 */         if (e.getOperator() == 65) {
/*  224 */           atArrayAssign(expr, op, (Expr)left, right);
/*  225 */           return;
/*      */         }
/*      */       }
/*      */
View Full Code Here

/*  305 */     int token = expr.getOperator();
/*  306 */     int k = CodeGen.lookupBinOp(token);
/*  307 */     if (k >= 0)
/*      */     {
/*  310 */       if (token == 43) {
/*  311 */         Expr e = atPlusExpr(expr);
/*  312 */         if (e != null)
/*      */         {
/*  316 */           e = CallExpr.makeCall(Expr.make(46, e, new Member("toString")), null);
/*      */
/*  318 */           expr.setOprand1(e);
View Full Code Here

/*  350 */       left.accept(this);
/*  351 */       return null;
/*      */     }
/*      */
/*  354 */     if (isPlusExpr(left)) {
/*  355 */       Expr newExpr = atPlusExpr((BinExpr)left);
/*  356 */       if (newExpr != null) {
/*  357 */         right.accept(this);
/*  358 */         this.exprType = 307;
/*  359 */         this.arrayDim = 0;
/*  360 */         this.className = "java/lang/StringBuffer";
View Full Code Here

/*  421 */       BinExpr e = (BinExpr)expr;
/*  422 */       if ((e.getOperator() == 43) && (e.oprand2() == null))
/*  423 */         return e.getLeft();
/*      */     }
/*  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;
View Full Code Here

/*  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;
/*      */           }
/*      */
/*  660 */           this.exprType = 307;
/*  661 */           this.arrayDim = 0;
/*  662 */           this.className = nfe.getField();
/*  663 */           e.setOperator(35);
/*  664 */           e.setOprand1(new Symbol(MemberResolver.jvmToJavaName(this.className)));
/*      */         }
/*      */
/*  668 */         if (this.arrayDim > 0)
/*  669 */           targetClass = this.resolver.lookupClass("java.lang.Object", true);
/*  670 */         else if (this.exprType == 307)
View Full Code Here

TOP

Related Classes of javassist.compiler.ast.Expr

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.