Examples of Declarator


Examples of javassist.compiler.ast.Declarator

/* 554 */       this.className = "java/lang/Object";
/*     */     }
/*     */     else {
/* 557 */       setType(cc);
/*     */     }
/* 559 */     Declarator decl = new Declarator(this.exprType, this.className, this.arrayDim, varNo, new Symbol(varName));
/*     */
/* 562 */     tbl.append(varName, decl);
/* 563 */     return is2word(this.exprType, this.arrayDim) ? 2 : 1;
/*     */   }
View Full Code Here

Examples of javassist.compiler.ast.Declarator

/* 585 */         cname = typeDesc.substring(1, typeDesc.length() - 1);
/*     */       else {
/* 587 */         cname = typeDesc.substring(dim + 1, typeDesc.length() - 1);
/*     */       }
/*     */     }
/* 590 */     Declarator decl = new Declarator(type, cname, dim, varNo, new Symbol(varName));
/*     */
/* 592 */     tbl.append(varName, decl);
/*     */   }
View Full Code Here

Examples of javassist.compiler.ast.Declarator

/*      */     throws CompileError
/*      */   {
/*   43 */     ASTList mods = parseMemberMods();
/*      */
/*   45 */     boolean isConstructor = false;
/*      */     Declarator d;
/*   46 */     if ((this.lex.lookAhead() == 400) && (this.lex.lookAhead(1) == 40)) {
/*   47 */       Declarator d = new Declarator(344, 0);
/*   48 */       isConstructor = true;
/*      */     }
/*      */     else {
/*   51 */       d = parseFormalType(tbl);
/*      */     }
/*   53 */     if (this.lex.get() != 400)
/*   54 */       throw new SyntaxError(this.lex);
/*      */     String name;
/*      */     String name;
/*   57 */     if (isConstructor)
/*   58 */       name = "<init>";
/*      */     else {
/*   60 */       name = this.lex.getString();
/*      */     }
/*   62 */     d.setVariable(new Symbol(name));
/*   63 */     if ((isConstructor) || (this.lex.lookAhead() == 40)) {
/*   64 */       return parseMethod1(tbl, isConstructor, mods, d);
/*      */     }
/*   66 */     return parseField(tbl, mods, d);
/*      */   }
View Full Code Here

Examples of javassist.compiler.ast.Declarator

/*      */   {
/*  184 */     int t = this.lex.lookAhead();
/*  185 */     if ((isBuiltinType(t)) || (t == 344)) {
/*  186 */       this.lex.get();
/*  187 */       int dim = parseArrayDimension();
/*  188 */       return new Declarator(t, dim);
/*      */     }
/*      */
/*  191 */     ASTList name = parseClassType(tbl);
/*  192 */     int dim = parseArrayDimension();
/*  193 */     return new Declarator(name, dim);
/*      */   }
View Full Code Here

Examples of javassist.compiler.ast.Declarator

/*      */   }
/*      */
/*      */   private Declarator parseFormalParam(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*  207 */     Declarator d = parseFormalType(tbl);
/*  208 */     if (this.lex.get() != 400) {
/*  209 */       throw new SyntaxError(this.lex);
/*      */     }
/*  211 */     String name = this.lex.getString();
/*  212 */     d.setVariable(new Symbol(name));
/*  213 */     d.addArrayDim(parseArrayDimension());
/*  214 */     tbl.append(name, d);
/*  215 */     return d;
/*      */   }
View Full Code Here

Examples of javassist.compiler.ast.Declarator

/*  475 */       this.lex.get();
/*  476 */       if (this.lex.get() != 40) {
/*  477 */         throw new SyntaxError(this.lex);
/*      */       }
/*  479 */       SymbolTable tbl2 = new SymbolTable(tbl);
/*  480 */       Declarator d = parseFormalParam(tbl2);
/*  481 */       if ((d.getArrayDim() > 0) || (d.getType() != 307)) {
/*  482 */         throw new SyntaxError(this.lex);
/*      */       }
/*  484 */       if (this.lex.get() != 41) {
/*  485 */         throw new SyntaxError(this.lex);
/*      */       }
View Full Code Here

Examples of javassist.compiler.ast.Declarator

/*      */     }
/*      */
/*  571 */     if (isBuiltinType(t)) {
/*  572 */       t = this.lex.get();
/*  573 */       int dim = parseArrayDimension();
/*  574 */       return parseDeclarators(tbl, new Declarator(t, dim));
/*      */     }
/*  576 */     if (t == 400) {
/*  577 */       int i = nextIsClassType(0);
/*  578 */       if ((i >= 0) &&
/*  579 */         (this.lex.lookAhead(i) == 400)) {
/*  580 */         ASTList name = parseClassType(tbl);
/*  581 */         int dim = parseArrayDimension();
/*  582 */         return parseDeclarators(tbl, new Declarator(name, dim));
/*      */       }
/*      */     }
/*      */     Stmnt expr;
/*      */     Stmnt expr;
/*  587 */     if (exprList)
View Full Code Here

Examples of javassist.compiler.ast.Declarator

/*  641 */     if (this.lex.lookAhead() == 61) {
/*  642 */       this.lex.get();
/*  643 */       init = parseInitializer(tbl);
/*      */     }
/*      */
/*  646 */     Declarator decl = d.make(symbol, dim, init);
/*  647 */     tbl.append(name, decl);
/*  648 */     return decl;
/*      */   }
View Full Code Here

Examples of javassist.compiler.ast.Declarator

/*      */     case 411:
/*      */     case 412:
/* 1230 */       return new Keyword(t);
/*      */     case 400:
/* 1232 */       String name = this.lex.getString();
/* 1233 */       Declarator decl = tbl.lookup(name);
/* 1234 */       if (decl == null) {
/* 1235 */         return new Member(name);
/*      */       }
/* 1237 */       return new Variable(name, decl);
/*      */     case 406:
View Full Code Here

Examples of javassist.compiler.ast.Declarator

/*    */   }
/*    */   public SymbolTable getParent() {
/* 31 */     return this.parent;
/*    */   }
/*    */   public Declarator lookup(String name) {
/* 34 */     Declarator found = (Declarator)get(name);
/* 35 */     if ((found == null) && (this.parent != null)) {
/* 36 */       return this.parent.lookup(name);
/*    */     }
/* 38 */     return found;
/*    */   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.