| 73 | } |
| 74 | |
| 75 | std::unique_ptr<HdlFunctionDef> VhdlSubProgramParser::visitFunction_specification( |
| 76 | vhdlParser::Function_specificationContext *ctx) { |
| 77 | // function_specification: |
| 78 | // ( PURE IMPURE )? FUNCTION designator |
| 79 | // subprogram_header |
| 80 | // ( ( PARAMETER )? LPAREN formal_parameter_list RPAREN )? RETURN type_mark |
| 81 | // ; |
| 82 | auto designator = ctx->designator(); |
| 83 | auto returnT = VhdlExprParser::visitType_mark(ctx->type_mark()); |
| 84 | assert(returnT); |
| 85 | |
| 86 | bool isOperator = VhdlLiteralParser::isStrDesignator(designator); |
| 87 | auto name = VhdlLiteralParser::visitDesignator(designator); |
| 88 | |
| 89 | auto fpl = ctx->formal_parameter_list(); |
| 90 | std::unique_ptr<std::vector<std::unique_ptr<HdlIdDef>>> paramList; |
| 91 | if (fpl) |
| 92 | paramList = visitFormal_parameter_list(fpl); |
| 93 | |
| 94 | return create_object<HdlFunctionDef>(ctx, name, isOperator, |
| 95 | std::move(returnT), std::move(paramList)); |
| 96 | } |
| 97 | |
| 98 | std::unique_ptr<std::vector<std::unique_ptr<HdlIdDef>>> VhdlSubProgramParser::visitFormal_parameter_list( |
| 99 | vhdlParser::Formal_parameter_listContext *ctx) { |
nothing calls this directly
no outgoing calls
no test coverage detected