Search in sources :

Example 1 with VarTable

use of kalang.core.VarTable in project kalang by kasonyang.

the class InitializationAnalyzer method visitTryStmt.

@Override
public Type visitTryStmt(TryStmt node) {
    List<VarTable<LocalVarNode, Void>> assignedList = new ArrayList(node.getCatchStmts().size() + 1);
    enterNewFrame();
    assignedList.add(assignedVars);
    visit(node.getExecStmt());
    exitFrame();
    for (CatchBlock cs : node.getCatchStmts()) {
        enterNewFrame();
        assignedList.add(assignedVars);
        visit(cs);
        exitFrame();
    }
    addIntersectedAssignedVar(assignedList.toArray(new VarTable[assignedList.size()]));
    Statement finallyStmt = node.getFinallyStmt();
    if (finallyStmt != null) {
        visit(finallyStmt);
    }
    return null;
}
Also used : VarTable(kalang.core.VarTable) CatchBlock(kalang.ast.CatchBlock) Statement(kalang.ast.Statement) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 CatchBlock (kalang.ast.CatchBlock)1 Statement (kalang.ast.Statement)1 VarTable (kalang.core.VarTable)1