| 517 | } |
| 518 | |
| 519 | void VerStatementParser::visitFor_variable_declaration( |
| 520 | sv2017Parser::For_variable_declarationContext *ctx, |
| 521 | vector<unique_ptr<HdlIdDef>> &res) { |
| 522 | // for_variable_declaration: |
| 523 | // ( KW_VAR )? data_type for_variable_declaration_var_assign |
| 524 | // ( COMMA for_variable_declaration_var_assign )* |
| 525 | // ; |
| 526 | auto _dt = ctx->data_type(); |
| 527 | VerTypeParser tp(this); |
| 528 | VerExprParser ep(this); |
| 529 | |
| 530 | auto dt = tp.visitData_type(_dt); |
| 531 | auto dt_tmp = dt.get(); |
| 532 | bool is_latched = ctx->KW_VAR() != nullptr; |
| 533 | bool first = true; |
| 534 | for (auto _fvdas : ctx->for_variable_declaration_var_assign()) { |
| 535 | // for_variable_declaration_var_assign: identifier ASSIGN expression; |
| 536 | auto name = ep.getIdentifierStr(_fvdas->identifier()); |
| 537 | if (first) |
| 538 | first = false; |
| 539 | else |
| 540 | dt = dt_tmp->clone_uniq(); |
| 541 | auto _def_val = _fvdas->expression(); |
| 542 | auto def_val = ep.visitExpression(_def_val); |
| 543 | auto vd = create_object<HdlIdDef>(_fvdas, name, move(dt), move(def_val), |
| 544 | HdlDirection::DIR_INTERNAL, is_latched); |
| 545 | res.push_back(move(vd)); |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | void VerStatementParser::visitFor_initialization( |
| 550 | sv2017Parser::For_initializationContext *ctx, |
nothing calls this directly
no test coverage detected