예제 #1
0
void
SemanticAnalysis::visitBlockStatement(BlockStatement *node)
{
    StatementList *stmts = node->statements();
    for (size_t i = 0; i < stmts->length(); i++) {
        Statement *stmt = stmts->at(i);
        stmt->accept(this);
    }
}
예제 #2
0
bool
SemanticAnalysis::analyze()
{
    ParseTree *tree = tu_->tree();
    StatementList *statements = tree->statements();
    for (size_t i = 0; i < statements->length(); i++) {
        Statement *stmt = statements->at(i);
        if (stmt->isFunctionStatement())
            stmt->accept(this);
        if (!cc_.canContinueProcessing())
            return false;
    }
    return cc_.phasePassed();
}