Package javassist.compiler.ast

Examples of javassist.compiler.ast.ASTree


    protected ASTree getInitAST() { return null; }

    /* Called by CtClassType.addField().
     */
    Initializer getInit() {
        ASTree tree = getInitAST();
        if (tree == null)
            return null;
        else
            return Initializer.byExpr(tree);
    }
View Full Code Here


            drv.compileExpr(expression);
        }

        int getConstantValue(ConstPool cp, CtClass type) {
            try {
                ASTree t = Javac.parseExpr(expression, new SymbolTable());
                return getConstantValue2(cp, type, t);
            }
            catch (CompileError e) {
                return 0;
            }
View Full Code Here

    protected ASTree getInitAST() { return null; }

    /* Called by CtClassType.addField().
     */
    Initializer getInit() {
        ASTree tree = getInitAST();
        if (tree == null)
            return null;
        else
            return Initializer.byExpr(tree);
    }
View Full Code Here

            drv.compileExpr(expression);
        }

        int getConstantValue(ConstPool cp, CtClass type) {
            try {
                ASTree t = Javac.parseExpr(expression, new SymbolTable());
                return getConstantValue2(cp, type, t);
            }
            catch (CompileError e) {
                return 0;
            }
View Full Code Here

/*  890 */       drv.compileExpr(this.expression);
/*      */     }
/*      */
/*      */     int getConstantValue(ConstPool cp, CtClass type) {
/*      */       try {
/*  895 */         ASTree t = Javac.parseExpr(this.expression, new SymbolTable());
/*  896 */         return getConstantValue2(cp, type, t);
/*      */       } catch (CompileError e) {
/*      */       }
/*  899 */       return 0;
/*      */     }
View Full Code Here

/*      */
/*      */   public void atNewArrayExpr(NewExpr expr) throws CompileError {
/*  156 */     int type = expr.getArrayType();
/*  157 */     ASTList size = expr.getArraySize();
/*  158 */     ASTList classname = expr.getClassName();
/*  159 */     ASTree init = expr.getInitializer();
/*  160 */     if (init != null) {
/*  161 */       init.accept(this);
/*      */     }
/*  163 */     if (size.length() > 1) {
/*  164 */       atMultiNewArray(type, classname, size);
/*      */     } else {
/*  166 */       ASTree sizeExpr = size.head();
/*  167 */       if (sizeExpr != null) {
/*  168 */         sizeExpr.accept(this);
/*      */       }
/*  170 */       this.exprType = type;
/*  171 */       this.arrayDim = 1;
/*  172 */       if (type == 307)
/*  173 */         this.className = resolveClassName(classname);
View Full Code Here

/*      */   }
/*      */
/*      */   public void atArrayInit(ArrayInit init) throws CompileError {
/*  180 */     ASTList list = init;
/*  181 */     while (list != null) {
/*  182 */       ASTree h = list.head();
/*  183 */       list = list.tail();
/*  184 */       if (h != null)
/*  185 */         h.accept(this);
/*      */     }
/*      */   }
View Full Code Here

/*      */   protected void atMultiNewArray(int type, ASTList classname, ASTList size)
/*      */     throws CompileError
/*      */   {
/*  193 */     int dim = size.length();
/*  194 */     for (int count = 0; size != null; size = size.tail()) {
/*  195 */       ASTree s = size.head();
/*  196 */       if (s == null) {
/*      */         break;
/*      */       }
/*  199 */       count++;
/*  200 */       s.accept(this);
/*      */     }
/*      */
/*  203 */     this.exprType = type;
/*  204 */     this.arrayDim = dim;
/*  205 */     if (type == 307)
View Full Code Here

/*      */   }
/*      */
/*      */   public void atAssignExpr(AssignExpr expr) throws CompileError
/*      */   {
/*  213 */     int op = expr.getOperator();
/*  214 */     ASTree left = expr.oprand1();
/*  215 */     ASTree right = expr.oprand2();
/*  216 */     if ((left instanceof Variable)) {
/*  217 */       atVariableAssign(expr, op, (Variable)left, ((Variable)left).getDeclarator(), right);
/*      */     }
/*      */     else
/*      */     {
View Full Code Here

/*  319 */           expr.setOprand2(null);
/*  320 */           this.className = "java/lang/String";
/*      */         }
/*      */       }
/*      */       else {
/*  324 */         ASTree left = expr.oprand1();
/*  325 */         ASTree right = expr.oprand2();
/*  326 */         left.accept(this);
/*  327 */         int type1 = this.exprType;
/*  328 */         right.accept(this);
/*  329 */         if (!isConstant(expr, token, left, right)) {
/*  330 */           computeBinExprType(expr, token, type1);
/*      */         }
/*      */       }
/*      */     }
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.