Package javassist.compiler.ast

Examples of javassist.compiler.ast.ASTree


/*      */
/*      */   private ArrayInit parseArrayInitializer(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*  666 */     this.lex.get();
/*  667 */     ASTree expr = parseExpression(tbl);
/*  668 */     ArrayInit init = new ArrayInit(expr);
/*  669 */     while (this.lex.lookAhead() == 44) {
/*  670 */       this.lex.get();
/*  671 */       expr = parseExpression(tbl);
/*  672 */       ASTList.append(init, expr);
View Full Code Here


/*      */     throws CompileError
/*      */   {
/*  684 */     if (this.lex.get() != 40) {
/*  685 */       throw new SyntaxError(this.lex);
/*      */     }
/*  687 */     ASTree expr = parseExpression(tbl);
/*  688 */     if (this.lex.get() != 41) {
/*  689 */       throw new SyntaxError(this.lex);
/*      */     }
/*  691 */     return expr;
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public ASTree parseExpression(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*  698 */     ASTree left = parseConditionalExpr(tbl);
/*  699 */     if (!isAssignOp(this.lex.lookAhead())) {
/*  700 */       return left;
/*      */     }
/*  702 */     int t = this.lex.get();
/*  703 */     ASTree right = parseExpression(tbl);
/*  704 */     return AssignExpr.makeAssign(t, left, right);
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   private ASTree parseConditionalExpr(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*  718 */     ASTree cond = parseBinaryExpr(tbl);
/*  719 */     if (this.lex.lookAhead() == 63) {
/*  720 */       this.lex.get();
/*  721 */       ASTree thenExpr = parseExpression(tbl);
/*  722 */       if (this.lex.get() != 58) {
/*  723 */         throw new CompileError(": is missing", this.lex);
/*      */       }
/*  725 */       ASTree elseExpr = parseExpression(tbl);
/*  726 */       return new CondExpr(cond, thenExpr, elseExpr);
/*      */     }
/*      */
/*  729 */     return cond;
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   private ASTree parseBinaryExpr(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*  774 */     ASTree expr = parseUnaryExpr(tbl);
/*      */     while (true) {
/*  776 */       int t = this.lex.lookAhead();
/*  777 */       int p = getOpPrecedence(t);
/*  778 */       if (p == 0) {
/*  779 */         return expr;
View Full Code Here

/*      */   {
/*  804 */     int t = this.lex.get();
/*  805 */     if (t == 323) {
/*  806 */       return parseInstanceOf(tbl, expr);
/*      */     }
/*  808 */     ASTree expr2 = parseUnaryExpr(tbl);
/*      */     while (true) {
/*  810 */       int t2 = this.lex.lookAhead();
/*  811 */       int p2 = getOpPrecedence(t2);
/*  812 */       if ((p2 != 0) && (prec > p2))
/*  813 */         expr2 = binaryExpr2(tbl, expr2, p2);
View Full Code Here

/*      */     case 405:
/* 1021 */       this.lex.get();
/* 1022 */       return new DoubleConst(this.lex.getDouble(), token);
/*      */     }
/*      */
/* 1029 */     ASTree expr = parsePrimaryExpr(tbl);
/*      */     while (true)
/*      */     {
/*      */       int t;
/* 1032 */       switch (this.lex.lookAhead()) {
/*      */       case 40:
/* 1034 */         expr = parseMethodCall(tbl, expr);
/* 1035 */         break;
/*      */       case 91:
/* 1037 */         if (this.lex.lookAhead(1) == 93) {
/* 1038 */           int dim = parseArrayDimension();
/* 1039 */           if ((this.lex.get() != 46) || (this.lex.get() != 307)) {
/* 1040 */             throw new SyntaxError(this.lex);
/*      */           }
/* 1042 */           expr = parseDotClass(expr, dim);
/* 1043 */           continue;
/*      */         }
/* 1045 */         ASTree index = parseArrayIndex(tbl);
/* 1046 */         if (index == null) {
/* 1047 */           throw new SyntaxError(this.lex);
/*      */         }
/* 1049 */         expr = Expr.make(65, expr, index);
/*      */
View Full Code Here

/*      */     case 406:
/* 1239 */       return new StringL(this.lex.getString());
/*      */     case 328:
/* 1241 */       return parseNew(tbl);
/*      */     case 40:
/* 1243 */       ASTree expr = parseExpression(tbl);
/* 1244 */       if (this.lex.get() == 41) {
/* 1245 */         return expr;
/*      */       }
/* 1247 */       throw new CompileError(") is missing", this.lex);
/*      */     }
View Full Code Here

/* 1307 */     if (this.lex.lookAhead() == 93) {
/* 1308 */       this.lex.get();
/* 1309 */       return null;
/*      */     }
/*      */
/* 1312 */     ASTree index = parseExpression(tbl);
/* 1313 */     if (this.lex.get() != 93) {
/* 1314 */       throw new CompileError("] is missing", this.lex);
/*      */     }
/* 1316 */     return index;
/*      */   }
View Full Code Here

/*  130 */     return null;
/*      */   }
/*      */
/*      */   Initializer getInit()
/*      */   {
/*  135 */     ASTree tree = getInitAST();
/*  136 */     if (tree == null) {
/*  137 */       return null;
/*      */     }
/*  139 */     return Initializer.byExpr(tree);
/*      */   }
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.