Package javassist.compiler.ast

Examples of javassist.compiler.ast.Stmnt


/*  240 */     int t = this.lex.lookAhead();
/*  241 */     if (t == 123)
/*  242 */       return parseBlock(tbl);
/*  243 */     if (t == 59) {
/*  244 */       this.lex.get();
/*  245 */       return new Stmnt(66);
/*      */     }
/*  247 */     if ((t == 400) && (this.lex.lookAhead(1) == 58)) {
/*  248 */       this.lex.get();
/*  249 */       String label = this.lex.getString();
/*  250 */       this.lex.get();
View Full Code Here


/*      */     throws CompileError
/*      */   {
/*  282 */     if (this.lex.get() != 123) {
/*  283 */       throw new SyntaxError(this.lex);
/*      */     }
/*  285 */     Stmnt body = null;
/*  286 */     SymbolTable tbl2 = new SymbolTable(tbl);
/*  287 */     while (this.lex.lookAhead() != 125) {
/*  288 */       Stmnt s = parseStatement(tbl2);
/*  289 */       if (s != null) {
/*  290 */         body = (Stmnt)ASTList.concat(body, new Stmnt(66, s));
/*      */       }
/*      */     }
/*  293 */     this.lex.get();
/*  294 */     if (body == null) {
/*  295 */       return new Stmnt(66);
/*      */     }
/*  297 */     return body;
/*      */   }
View Full Code Here

/*      */   private Stmnt parseIf(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*  304 */     int t = this.lex.get();
/*  305 */     ASTree expr = parseParExpression(tbl);
/*  306 */     Stmnt thenp = parseStatement(tbl);
/*      */     Stmnt elsep;
/*      */     Stmnt elsep;
/*  308 */     if (this.lex.lookAhead() == 313) {
/*  309 */       this.lex.get();
/*  310 */       elsep = parseStatement(tbl);
/*      */     }
/*      */     else {
/*  313 */       elsep = null;
/*      */     }
/*  315 */     return new Stmnt(t, expr, new ASTList(thenp, new ASTList(elsep)));
/*      */   }
View Full Code Here

/*      */   private Stmnt parseWhile(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*  323 */     int t = this.lex.get();
/*  324 */     ASTree expr = parseParExpression(tbl);
/*  325 */     Stmnt body = parseStatement(tbl);
/*  326 */     return new Stmnt(t, expr, body);
/*      */   }
View Full Code Here

/*      */
/*      */   private Stmnt parseDo(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*  332 */     int t = this.lex.get();
/*  333 */     Stmnt body = parseStatement(tbl);
/*  334 */     if ((this.lex.get() != 346) || (this.lex.get() != 40)) {
/*  335 */       throw new SyntaxError(this.lex);
/*      */     }
/*  337 */     ASTree expr = parseExpression(tbl);
/*  338 */     if ((this.lex.get() != 41) || (this.lex.get() != 59)) {
/*  339 */       throw new SyntaxError(this.lex);
/*      */     }
/*  341 */     return new Stmnt(t, expr, body);
/*      */   }
View Full Code Here

/*      */
/*  352 */     SymbolTable tbl2 = new SymbolTable(tbl);
/*      */
/*  354 */     if (this.lex.get() != 40)
/*  355 */       throw new SyntaxError(this.lex);
/*      */     Stmnt expr1;
/*      */     Stmnt expr1;
/*  357 */     if (this.lex.lookAhead() == 59) {
/*  358 */       this.lex.get();
/*  359 */       expr1 = null;
/*      */     }
/*      */     else {
/*  362 */       expr1 = parseDeclarationOrExpression(tbl2, true);
/*      */     }
/*      */     ASTree expr2;
/*      */     ASTree expr2;
/*  364 */     if (this.lex.lookAhead() == 59)
/*  365 */       expr2 = null;
/*      */     else {
/*  367 */       expr2 = parseExpression(tbl2);
/*      */     }
/*  369 */     if (this.lex.get() != 59)
/*  370 */       throw new CompileError("; is missing", this.lex);
/*      */     Stmnt expr3;
/*      */     Stmnt expr3;
/*  372 */     if (this.lex.lookAhead() == 41)
/*  373 */       expr3 = null;
/*      */     else {
/*  375 */       expr3 = parseExprList(tbl2);
/*      */     }
/*  377 */     if (this.lex.get() != 41) {
/*  378 */       throw new CompileError(") is missing", this.lex);
/*      */     }
/*  380 */     Stmnt body = parseStatement(tbl2);
/*  381 */     return new Stmnt(t, expr1, new ASTList(expr2, new ASTList(expr3, body)));
/*      */   }
View Full Code Here

/*      */   private Stmnt parseSwitch(SymbolTable tbl)
/*      */     throws CompileError
/*      */   {
/*  393 */     int t = this.lex.get();
/*  394 */     ASTree expr = parseParExpression(tbl);
/*  395 */     Stmnt body = parseSwitchBlock(tbl);
/*  396 */     return new Stmnt(t, expr, body);
/*      */   }
View Full Code Here

/*      */   private Stmnt parseSwitchBlock(SymbolTable tbl) throws CompileError {
/*  400 */     if (this.lex.get() != 123) {
/*  401 */       throw new SyntaxError(this.lex);
/*      */     }
/*  403 */     SymbolTable tbl2 = new SymbolTable(tbl);
/*  404 */     Stmnt s = parseStmntOrCase(tbl2);
/*  405 */     if (s == null) {
/*  406 */       throw new CompileError("empty switch block", this.lex);
/*      */     }
/*  408 */     int op = s.getOperator();
/*  409 */     if ((op != 304) && (op != 310)) {
/*  410 */       throw new CompileError("no case or default in a switch block", this.lex);
/*      */     }
/*      */
/*  413 */     Stmnt body = new Stmnt(66, s);
/*  414 */     while (this.lex.lookAhead() != 125) {
/*  415 */       Stmnt s2 = parseStmntOrCase(tbl2);
/*  416 */       if (s2 != null) {
/*  417 */         int op2 = s2.getOperator();
/*  418 */         if ((op2 == 304) || (op2 == 310)) {
/*  419 */           body = (Stmnt)ASTList.concat(body, new Stmnt(66, s2));
/*  420 */           s = s2;
/*      */         }
/*      */         else {
/*  423 */           s = (Stmnt)ASTList.concat(s, new Stmnt(66, s2));
/*      */         }
/*      */       }
/*      */     }
/*  427 */     this.lex.get();
/*  428 */     return body;
View Full Code Here

/*  432 */     int t = this.lex.lookAhead();
/*  433 */     if ((t != 304) && (t != 310)) {
/*  434 */       return parseStatement(tbl);
/*      */     }
/*  436 */     this.lex.get();
/*      */     Stmnt s;
/*      */     Stmnt s;
/*  438 */     if (t == 304)
/*  439 */       s = new Stmnt(t, parseExpression(tbl));
/*      */     else {
/*  441 */       s = new Stmnt(310);
/*      */     }
/*  443 */     if (this.lex.get() != 58) {
/*  444 */       throw new CompileError(": is missing", this.lex);
/*      */     }
/*  446 */     return s;
View Full Code Here

/*      */     }
/*  457 */     ASTree expr = parseExpression(tbl);
/*  458 */     if (this.lex.get() != 41) {
/*  459 */       throw new SyntaxError(this.lex);
/*      */     }
/*  461 */     Stmnt body = parseBlock(tbl);
/*  462 */     return new Stmnt(t, expr, body);
/*      */   }
View Full Code Here

TOP

Related Classes of javassist.compiler.ast.Stmnt

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.