Package javassist.compiler.ast

Examples of javassist.compiler.ast.BinExpr


/*      */   }
/*      */
/*      */   static ASTree stripPlusExpr(ASTree expr)
/*      */   {
/*  420 */     if ((expr instanceof BinExpr)) {
/*  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


/*  476 */     return null;
/*      */   }
/*      */
/*      */   private static boolean isPlusExpr(ASTree expr) {
/*  480 */     if ((expr instanceof BinExpr)) {
/*  481 */       BinExpr bexpr = (BinExpr)expr;
/*  482 */       int token = bexpr.getOperator();
/*  483 */       return token == 43;
/*      */     }
/*      */
/*  486 */     return false;
/*      */   }
View Full Code Here

/*      */   private void booleanExpr(ASTree expr)
/*      */     throws CompileError
/*      */   {
/*  511 */     int op = CodeGen.getCompOperator(expr);
/*  512 */     if (op == 358) {
/*  513 */       BinExpr bexpr = (BinExpr)expr;
/*  514 */       bexpr.oprand1().accept(this);
/*  515 */       int type1 = this.exprType;
/*  516 */       int dim1 = this.arrayDim;
/*  517 */       bexpr.oprand2().accept(this);
/*  518 */       if ((dim1 == 0) && (this.arrayDim == 0))
/*  519 */         insertCast(bexpr, type1, this.exprType);
/*      */     }
/*  521 */     else if (op == 33) {
/*  522 */       ((Expr)expr).oprand1().accept(this);
/*  523 */     } else if ((op == 369) || (op == 368)) {
/*  524 */       BinExpr bexpr = (BinExpr)expr;
/*  525 */       bexpr.oprand1().accept(this);
/*  526 */       bexpr.oprand2().accept(this);
/*      */     }
/*      */     else {
/*  529 */       expr.accept(this);
/*      */     }
/*  531 */     this.exprType = 301;
View Full Code Here

/*      */   private boolean booleanExpr(boolean branchIf, ASTree expr)
/*      */     throws CompileError
/*      */   {
/* 1098 */     int op = getCompOperator(expr);
/* 1099 */     if (op == 358) {
/* 1100 */       BinExpr bexpr = (BinExpr)expr;
/* 1101 */       int type1 = compileOprands(bexpr);
/*      */
/* 1104 */       compareExpr(branchIf, bexpr.getOperator(), type1, bexpr);
/*      */     }
/* 1106 */     else if (op == 33) {
/* 1107 */       booleanExpr(!branchIf, ((Expr)expr).oprand1());
/*      */     }
/*      */     else
/*      */     {
/*      */       boolean isAndAnd;
/* 1108 */       if (((isAndAnd = op == 369 ? 1 : 0) != 0) || (op == 368)) {
/* 1109 */         BinExpr bexpr = (BinExpr)expr;
/* 1110 */         booleanExpr(!isAndAnd, bexpr.oprand1());
/* 1111 */         int pc = this.bytecode.currentPc();
/* 1112 */         this.bytecode.addIndex(0);
/*      */
/* 1114 */         booleanExpr(isAndAnd, bexpr.oprand2());
/* 1115 */         this.bytecode.write16bit(pc, this.bytecode.currentPc() - pc + 3);
/* 1116 */         if (branchIf != isAndAnd) {
/* 1117 */           this.bytecode.addIndex(6);
/* 1118 */           this.bytecode.addOpcode(167);
/*      */         }
View Full Code Here

TOP

Related Classes of javassist.compiler.ast.BinExpr

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.