Package javassist.compiler.ast

Examples of javassist.compiler.ast.ASTList


/*  142 */     if (expr.isArray()) {
/*  143 */       atNewArrayExpr(expr);
/*      */     } else {
/*  145 */       CtClass clazz = this.resolver.lookupClassByName(expr.getClassName());
/*  146 */       String cname = clazz.getName();
/*  147 */       ASTList args = expr.getArguments();
/*  148 */       atMethodCallCore(clazz, "<init>", args);
/*  149 */       this.exprType = 307;
/*  150 */       this.arrayDim = 0;
/*  151 */       this.className = MemberResolver.javaToJvmName(cname);
/*      */     }
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) {
View Full Code Here

/*  175 */         this.className = null;
/*      */     }
/*      */   }
/*      */
/*      */   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

/*  372 */     if (isConstant(expr, 43, left, right)) {
/*  373 */       return null;
/*      */     }
/*  375 */     if (((type1 == 307) && (dim1 == 0) && ("java/lang/String".equals(cname))) || ((this.exprType == 307) && (this.arrayDim == 0) && ("java/lang/String".equals(this.className))))
/*      */     {
/*  378 */       ASTList sbufClass = ASTList.make(new Symbol("java"), new Symbol("lang"), new Symbol("StringBuffer"));
/*      */
/*  380 */       ASTree e = new NewExpr(sbufClass, null);
/*  381 */       this.exprType = 307;
/*  382 */       this.arrayDim = 0;
/*  383 */       this.className = "java/lang/StringBuffer";
View Full Code Here

/*      */
/*  486 */     return false;
/*      */   }
/*      */
/*      */   private static Expr makeAppendCall(ASTree target, ASTree arg) {
/*  490 */     return CallExpr.makeCall(Expr.make(46, target, new Member("append")), new ASTList(arg));
/*      */   }
View Full Code Here

/*      */
/*      */   public void atCallExpr(CallExpr expr) throws CompileError {
/*  626 */     String mname = null;
/*  627 */     CtClass targetClass = null;
/*  628 */     ASTree method = expr.oprand1();
/*  629 */     ASTList args = (ASTList)expr.oprand2();
/*      */
/*  631 */     if ((method instanceof Member)) {
/*  632 */       mname = ((Member)method).get();
/*  633 */       targetClass = this.thisClass;
/*      */     }
View Full Code Here

/*  83 */       super.atFieldAssign(expr, op, left, right);
/*     */     }
/*     */   }
/*     */
/*     */   public void atCastExpr(CastExpr expr) throws CompileError {
/*  87 */     ASTList classname = expr.getClassName();
/*  88 */     if ((classname != null) && (expr.getArrayDim() == 0)) {
/*  89 */       ASTree p = classname.head();
/*  90 */       if (((p instanceof Symbol)) && (classname.tail() == null)) {
/*  91 */         String typename = ((Symbol)p).get();
/*  92 */         if (typename.equals(this.codeGen.returnCastName)) {
/*  93 */           atCastToRtype(expr);
/*  94 */           return;
/*     */         }
View Full Code Here

/*     */
/*     */   public CtMember compile(String src)
/*     */     throws CompileError
/*     */   {
/*  88 */     Parser p = new Parser(new Lex(src));
/*  89 */     ASTList mem = p.parseMember1(this.stable);
/*     */     try {
/*  91 */       if ((mem instanceof FieldDecl)) {
/*  92 */         return compileField((FieldDecl)mem);
/*     */       }
/*  94 */       CtBehavior cb = compileMethod(p, (MethodDecl)mem);
View Full Code Here

/* 156 */       varNo += (is2word(this.exprType, this.arrayDim) ? 2 : 1);
/*     */     }
/*     */   }
/*     */
/*     */   public void atCastExpr(CastExpr expr) throws CompileError {
/* 161 */     ASTList classname = expr.getClassName();
/* 162 */     if ((classname != null) && (expr.getArrayDim() == 0)) {
/* 163 */       ASTree p = classname.head();
/* 164 */       if (((p instanceof Symbol)) && (classname.tail() == null)) {
/* 165 */         String typename = ((Symbol)p).get();
/* 166 */         if (typename.equals(this.returnCastName)) {
/* 167 */           atCastToRtype(expr);
/* 168 */           return;
/*     */         }
View Full Code Here

/*      */   }
/*      */
/*      */   public ASTList parseMember(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*   33 */     ASTList mem = parseMember1(tbl);
/*   34 */     if ((mem instanceof MethodDecl)) {
/*   35 */       return parseMethod2(tbl, (MethodDecl)mem);
/*      */     }
/*   37 */     return mem;
/*      */   }
View Full Code Here

TOP

Related Classes of javassist.compiler.ast.ASTList

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.