MCPcopy Create free account
hub / github.com/Nic30/hdlConvertor / visitConditional_statement

Method visitConditional_statement

src/svConvertor/statementParser.cpp:690–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688}
689
690unique_ptr<iHdlStatement> VerStatementParser::visitConditional_statement(
691 sv2017Parser::Conditional_statementContext *ctx) {
692 //conditional_statement:
693 // ( unique_priority )? KW_IF LPAREN cond_predicate RPAREN statement_or_null
694 // ( KW_ELSE statement_or_null | {_input->LA(1) != KW_ELSE}? );
695 auto c = ctx->cond_predicate();
696 auto s = ctx->statement_or_null();
697 VerExprParser ep(this);
698 auto cond = ep.visitCond_predicate(c);
699
700 auto ifTrue = visitStatement_or_null(s[0]);
701 unique_ptr<iHdlStatement> ifFalse = nullptr;
702 if (s.size() == 2) {
703 ifFalse = visitStatement_or_null(s[1]);
704 }
705 auto ifStm = create_object<HdlStmIf>(ctx, move(cond), move(ifTrue),
706 move(ifFalse));
707 ifStm->__doc__ = commentParser.parse(ctx);
708 HdlStmIf_collapse_elifs(*ifStm);
709 return ifStm;
710}
711
712unique_ptr<HdlStmProcess> VerStatementParser::visitProcedural_timing_control_statement(
713 sv2017Parser::Procedural_timing_control_statementContext *ctx) {

Callers

nothing calls this directly

Calls 3

HdlStmIf_collapse_elifsFunction · 0.85
visitCond_predicateMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected