private Stmnt parseTry(SymbolTable tbl) throws CompileError { lex.get(); // TRY Stmnt block = parseBlock(tbl); ASTList catchList = null; while (lex.lookAhead() == CATCH) { lex.get(); // CATCH if (lex.get() != '(') throw new SyntaxError(lex); SymbolTable tbl2 = new SymbolTable(tbl); Declarator d = parseFormalParam(tbl2); if (d.getArrayDim() > 0 || d.getType() != CLASS) throw new SyntaxError(lex); if (lex.get() != ')') throw new SyntaxError(lex); Stmnt b = parseBlock(tbl2); catchList = ASTList.append(catchList, new Pair(d, b)); } Stmnt finallyBlock = null; if (lex.lookAhead() == FINALLY) { lex.get(); // FINALLY finallyBlock = parseBlock(tbl); } return Stmnt.make(TRY, block, catchList, finallyBlock); }
private Stmnt parseTry(SymbolTable tbl) throws CompileError { lex.get(); // TRY Stmnt block = parseBlock(tbl); ASTList catchList = null; while (lex.lookAhead() == CATCH) { lex.get(); // CATCH if (lex.get() != '(') throw new SyntaxError(lex); SymbolTable tbl2 = new SymbolTable(tbl); Declarator d = parseFormalParam(tbl2); if (d.getArrayDim() > 0 || d.getType() != CLASS) throw new SyntaxError(lex); if (lex.get() != ')') throw new SyntaxError(lex); Stmnt b = parseBlock(tbl2); catchList = ASTList.append(catchList, new Pair(d, b)); } Stmnt finallyBlock = null; if (lex.lookAhead() == FINALLY) { lex.get(); // FINALLY finallyBlock = parseBlock(tbl); } return Stmnt.make(TRY, block, catchList, finallyBlock); }
private Stmnt parseTry(SymbolTable tbl) throws CompileError { lex.get(); // TRY Stmnt block = parseBlock(tbl); ASTList catchList = null; while (lex.lookAhead() == CATCH) { lex.get(); // CATCH if (lex.get() != '(') throw new SyntaxError(lex); SymbolTable tbl2 = new SymbolTable(tbl); Declarator d = parseFormalParam(tbl2); if (d.getArrayDim() > 0 || d.getType() != CLASS) throw new SyntaxError(lex); if (lex.get() != ')') throw new SyntaxError(lex); Stmnt b = parseBlock(tbl2); catchList = ASTList.append(catchList, new Pair(d, b)); } Stmnt finallyBlock = null; if (lex.lookAhead() == FINALLY) { lex.get(); // FINALLY finallyBlock = parseBlock(tbl); } return Stmnt.make(TRY, block, catchList, finallyBlock); }
private Stmnt parseTry(SymbolTable tbl) throws CompileError { lex.get(); // TRY Stmnt block = parseBlock(tbl); ASTList catchList = null; while (lex.lookAhead() == CATCH) { lex.get(); // CATCH if (lex.get() != '(') throw new SyntaxError(lex); SymbolTable tbl2 = new SymbolTable(tbl); Declarator d = parseFormalParam(tbl2); if (d.getArrayDim() > 0 || d.getType() != CLASS) throw new SyntaxError(lex); if (lex.get() != ')') throw new SyntaxError(lex); Stmnt b = parseBlock(tbl2); catchList = ASTList.append(catchList, new Pair(d, b)); } Stmnt finallyBlock = null; if (lex.lookAhead() == FINALLY) { lex.get(); // FINALLY finallyBlock = parseBlock(tbl); } return Stmnt.make(TRY, block, catchList, finallyBlock); }
private Stmnt parseTry(SymbolTable tbl) throws CompileError { lex.get(); // TRY Stmnt block = parseBlock(tbl); ASTList catchList = null; while (lex.lookAhead() == CATCH) { lex.get(); // CATCH if (lex.get() != '(') throw new SyntaxError(lex); SymbolTable tbl2 = new SymbolTable(tbl); Declarator d = parseFormalParam(tbl2); if (d.getArrayDim() > 0 || d.getType() != CLASS) throw new SyntaxError(lex); if (lex.get() != ')') throw new SyntaxError(lex); Stmnt b = parseBlock(tbl2); catchList = ASTList.append(catchList, new Pair(d, b)); } Stmnt finallyBlock = null; if (lex.lookAhead() == FINALLY) { lex.get(); // FINALLY finallyBlock = parseBlock(tbl); } return Stmnt.make(TRY, block, catchList, finallyBlock); }
private Stmnt parseTry(SymbolTable tbl) throws CompileError { lex.get(); // TRY Stmnt block = parseBlock(tbl); ASTList catchList = null; while (lex.lookAhead() == CATCH) { lex.get(); // CATCH if (lex.get() != '(') throw new SyntaxError(lex); SymbolTable tbl2 = new SymbolTable(tbl); Declarator d = parseFormalParam(tbl2); if (d.getArrayDim() > 0 || d.getType() != CLASS) throw new SyntaxError(lex); if (lex.get() != ')') throw new SyntaxError(lex); Stmnt b = parseBlock(tbl2); catchList = ASTList.append(catchList, new Pair(d, b)); } Stmnt finallyBlock = null; if (lex.lookAhead() == FINALLY) { lex.get(); // FINALLY finallyBlock = parseBlock(tbl); } return Stmnt.make(TRY, block, catchList, finallyBlock); }
private Stmnt parseTry(SymbolTable tbl) throws CompileError { lex.get(); // TRY Stmnt block = parseBlock(tbl); ASTList catchList = null; while (lex.lookAhead() == CATCH) { lex.get(); // CATCH if (lex.get() != '(') throw new SyntaxError(lex); SymbolTable tbl2 = new SymbolTable(tbl); Declarator d = parseFormalParam(tbl2); if (d.getArrayDim() > 0 || d.getType() != CLASS) throw new SyntaxError(lex); if (lex.get() != ')') throw new SyntaxError(lex); Stmnt b = parseBlock(tbl2); catchList = ASTList.append(catchList, new Pair(d, b)); } Stmnt finallyBlock = null; if (lex.lookAhead() == FINALLY) { lex.get(); // FINALLY finallyBlock = parseBlock(tbl); } return Stmnt.make(TRY, block, catchList, finallyBlock); }