Package javassist.compiler.ast

Examples of javassist.compiler.ast.Expr


/*      */       {
/*  812 */         throw new NoFieldException(name, expr);
/*      */       }
/*      */     }
/*  815 */     if ((expr instanceof Expr)) {
/*  816 */       Expr e = (Expr)expr;
/*  817 */       int op = e.getOperator();
/*  818 */       if (op == 35) {
/*  819 */         Member mem = (Member)e.oprand2();
/*  820 */         CtField f = this.resolver.lookupField(((Symbol)e.oprand1()).get(), mem);
/*      */
/*  822 */         mem.setField(f);
/*  823 */         return f;
/*      */       }
/*  825 */       if (op == 46) {
/*      */         try {
/*  827 */           e.oprand1().accept(this);
/*      */         }
/*      */         catch (NoFieldException nfe) {
/*  830 */           if (nfe.getExpr() != e.oprand1()) {
/*  831 */             throw nfe;
/*      */           }
/*      */
/*  837 */           return fieldAccess2(e, nfe.getField());
/*      */         }
/*      */
/*  840 */         CompileError err = null;
/*      */         try {
/*  842 */           if ((this.exprType == 307) && (this.arrayDim == 0))
/*  843 */             return this.resolver.lookupFieldByJvmName(this.className, (Symbol)e.oprand2());
/*      */         }
/*      */         catch (CompileError ce)
/*      */         {
/*  847 */           err = ce;
/*      */         }
/*      */
/*  866 */         ASTree oprnd1 = e.oprand1();
/*  867 */         if ((oprnd1 instanceof Symbol)) {
/*  868 */           return fieldAccess2(e, ((Symbol)oprnd1).get());
/*      */         }
/*  870 */         if (err != null) {
/*  871 */           throw err;
View Full Code Here


/*  921 */       this.exprType = d.getType();
/*  922 */       this.arrayDim = d.getArrayDim();
/*      */     }
/*      */     else {
/*  925 */       if ((oprand instanceof Expr)) {
/*  926 */         Expr e = (Expr)oprand;
/*  927 */         if (e.getOperator() == 65) {
/*  928 */           atArrayRead(e.oprand1(), e.oprand2());
/*      */
/*  930 */           int t = this.exprType;
/*  931 */           if ((t == 324) || (t == 303) || (t == 306) || (t == 334)) {
/*  932 */             this.exprType = 324;
/*      */           }
View Full Code Here

/* 276 */     if ((name instanceof Symbol)) {
/* 277 */       sbuf.append(((Symbol)name).get());
/* 278 */       return;
/*     */     }
/* 280 */     if ((name instanceof Expr)) {
/* 281 */       Expr expr = (Expr)name;
/* 282 */       if (expr.getOperator() == 46) {
/* 283 */         makeCflowName(sbuf, expr.oprand1());
/* 284 */         sbuf.append('.');
/* 285 */         makeCflowName(sbuf, expr.oprand2());
/* 286 */         return;
/*     */       }
/*     */     }
/*     */
/* 290 */     throw new CompileError("bad $cflow");
View Full Code Here

/* 1191 */     if ((name instanceof Symbol)) {
/* 1192 */       sbuf.append(((Symbol)name).get());
/* 1193 */       return;
/*      */     }
/* 1195 */     if ((name instanceof Expr)) {
/* 1196 */       Expr expr = (Expr)name;
/* 1197 */       if (expr.getOperator() == 46) {
/* 1198 */         toClassName(expr.oprand1(), sbuf);
/* 1199 */         sbuf.append('.');
/* 1200 */         toClassName(expr.oprand2(), sbuf);
/* 1201 */         return;
/*      */       }
/*      */     }
/*      */
/* 1205 */     throw new CompileError("bad static member access", this.lex);
View Full Code Here

/*      */
/*  477 */       if (((Keyword)method).get() == 336)
/*  478 */         targetClass = MemberResolver.getSuperclass(targetClass);
/*      */     }
/*  480 */     else if ((method instanceof Expr)) {
/*  481 */       Expr e = (Expr)method;
/*  482 */       mname = ((Symbol)e.oprand2()).get();
/*  483 */       int op = e.getOperator();
/*  484 */       if (op == 35) {
/*  485 */         targetClass = this.resolver.lookupClass(((Symbol)e.oprand1()).get(), false);
/*      */
/*  487 */         isStatic = true;
/*      */       }
/*  489 */       else if (op == 46) {
/*  490 */         ASTree target = e.oprand1();
/*  491 */         if (((target instanceof Keyword)) &&
/*  492 */           (((Keyword)target).get() == 336))
/*  493 */           isSpecial = true;
/*      */         try
/*      */         {
View Full Code Here

/*      */       }
/* 1029 */       this.resultStatic = is_static;
/* 1030 */       return f;
/*      */     }
/* 1032 */     if ((expr instanceof Expr)) {
/* 1033 */       Expr e = (Expr)expr;
/* 1034 */       int op = e.getOperator();
/* 1035 */       if (op == 35)
/*      */       {
/* 1040 */         CtField f = this.resolver.lookupField(((Symbol)e.oprand1()).get(), (Symbol)e.oprand2());
/*      */
/* 1042 */         this.resultStatic = true;
/* 1043 */         return f;
/*      */       }
/* 1045 */       if (op == 46) {
/* 1046 */         CtField f = null;
/*      */         try {
/* 1048 */           e.oprand1().accept(this);
/*      */
/* 1053 */           if ((this.exprType == 307) && (this.arrayDim == 0)) {
/* 1054 */             f = this.resolver.lookupFieldByJvmName(this.className, (Symbol)e.oprand2());
/*      */           } else {
/* 1056 */             if ((acceptLength) && (this.arrayDim > 0) && (((Symbol)e.oprand2()).get().equals("length")))
/*      */             {
/* 1058 */               return null;
/*      */             }
/* 1060 */             badLvalue();
/*      */           }
/* 1062 */           boolean is_static = Modifier.isStatic(f.getModifiers());
/* 1063 */           if (is_static) {
/* 1064 */             this.bytecode.addOpcode(87);
/*      */           }
/* 1066 */           this.resultStatic = is_static;
/* 1067 */           return f;
/*      */         }
/*      */         catch (NoFieldException nfe) {
/* 1070 */           if (nfe.getExpr() != e.oprand1()) {
/* 1071 */             throw nfe;
/*      */           }
/*      */
/* 1077 */           Symbol fname = (Symbol)e.oprand2();
/* 1078 */           String cname = nfe.getField();
/* 1079 */           f = this.resolver.lookupFieldByJvmName2(cname, fname, expr);
/* 1080 */           this.resolver.recordPackage(cname);
/* 1081 */           this.resultStatic = true;
/* 1082 */           return f;
View Full Code Here

TOP

Related Classes of javassist.compiler.ast.Expr

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.