Package javassist.compiler.ast

Examples of javassist.compiler.ast.ASTree


/*  621 */     this.bytecode.addOpcode(op);
/*  622 */     this.hasReturned = true;
/*      */   }
/*      */
/*      */   private void atThrowStmnt(Stmnt st) throws CompileError {
/*  626 */     ASTree e = st.getLeft();
/*  627 */     compileExpr(e);
/*  628 */     if ((this.exprType != 307) || (this.arrayDim > 0)) {
/*  629 */       throw new CompileError("bad throw statement");
/*      */     }
/*  631 */     this.bytecode.addOpcode(191);
View Full Code Here


/*      */     else {
/*  717 */       size = 1;
/*      */     }
/*  719 */     incMaxLocals(size);
/*      */
/*  723 */     ASTree init = d.getInitializer();
/*  724 */     if (init != null) {
/*  725 */       doTypeCheck(init);
/*  726 */       atVariableAssign(null, 61, null, d, init, false);
/*      */     }
/*      */   }
View Full Code Here

/*      */
/*      */   protected void atAssignExpr(AssignExpr expr, boolean doDup)
/*      */     throws CompileError
/*      */   {
/*  742 */     int op = expr.getOperator();
/*  743 */     ASTree left = expr.oprand1();
/*  744 */     ASTree right = expr.oprand2();
/*  745 */     if ((left instanceof Variable)) {
/*  746 */       atVariableAssign(expr, op, (Variable)left, ((Variable)left).getDeclarator(), right, doDup);
/*      */     }
/*      */     else
/*      */     {
View Full Code Here

/*  957 */     int token = expr.getOperator();
/*      */
/*  961 */     int k = lookupBinOp(token);
/*  962 */     if (k >= 0) {
/*  963 */       expr.oprand1().accept(this);
/*  964 */       ASTree right = expr.oprand2();
/*  965 */       if (right == null) {
/*  966 */         return;
/*      */       }
/*  968 */       int type1 = this.exprType;
/*  969 */       int dim1 = this.arrayDim;
/*  970 */       String cname1 = this.className;
/*  971 */       right.accept(this);
/*  972 */       if (dim1 != this.arrayDim) {
/*  973 */         throw new CompileError("incompatible array types");
/*      */       }
/*  975 */       if ((token == 43) && (dim1 == 0) && ((type1 == 307) || (this.exprType == 307)))
/*      */       {
View Full Code Here

/*      */
/*      */   private String checkCastExpr(CastExpr expr, String name)
/*      */     throws CompileError
/*      */   {
/* 1385 */     String msg = "invalid cast";
/* 1386 */     ASTree oprand = expr.getOprand();
/* 1387 */     int dim = expr.getArrayDim();
/* 1388 */     int type = expr.getType();
/* 1389 */     oprand.accept(this);
/* 1390 */     int srcType = this.exprType;
/* 1391 */     if ((invalidDim(srcType, this.arrayDim, this.className, type, dim, name, true)) || (srcType == 344) || (type == 344))
/*      */     {
/* 1393 */       throw new CompileError("invalid cast");
/*      */     }
View Full Code Here

/*      */
/*      */   public void atExpr(Expr expr)
/*      */     throws CompileError
/*      */   {
/* 1449 */     int token = expr.getOperator();
/* 1450 */     ASTree oprand = expr.oprand1();
/* 1451 */     if (token == 46) {
/* 1452 */       String member = ((Symbol)expr.oprand2()).get();
/* 1453 */       if (member.equals("class"))
/* 1454 */         atClassObject(expr);
/*      */       else
View Full Code Here

/*      */   }
/*      */   public abstract void atCallExpr(CallExpr paramCallExpr) throws CompileError;
/*      */
/*      */   protected abstract void atFieldRead(ASTree paramASTree) throws CompileError;
/*      */
/* 1533 */   public void atClassObject(Expr expr) throws CompileError { ASTree op1 = expr.oprand1();
/* 1534 */     if (!(op1 instanceof Symbol)) {
/* 1535 */       throw new CompileError("fatal error: badly parsed .class expr");
/*      */     }
/* 1537 */     String cname = ((Symbol)op1).get();
/* 1538 */     if (cname.startsWith("[")) {
View Full Code Here

TOP

Related Classes of javassist.compiler.ast.ASTree

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.