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); } }
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(); }