param_list ::= '(' param_list1 ')' param_list1 ::= /*empty*/ ::= param (',' param) param ::= name shape
| 3557 | // ::= param (',' param)* |
| 3558 | // param ::= name shape |
| 3559 | bool HloParserImpl::ParseParamList() { |
| 3560 | if (!ParseToken(TokKind::kLparen, |
| 3561 | "expects '(' at the beginning of param list")) { |
| 3562 | return false; |
| 3563 | } |
| 3564 | |
| 3565 | if (lexer_.GetKind() == TokKind::kRparen) { |
| 3566 | // empty |
| 3567 | } else { |
| 3568 | do { |
| 3569 | Shape shape; |
| 3570 | std::string name; |
| 3571 | if (!ParseName(&name) || !ParseShape(&shape)) { |
| 3572 | return false; |
| 3573 | } |
| 3574 | } while (EatIfPresent(TokKind::kComma)); |
| 3575 | } |
| 3576 | return ParseToken(TokKind::kRparen, "expects ')' at the end of param list"); |
| 3577 | } |
| 3578 | |
| 3579 | // dimension_sizes ::= '[' dimension_list ']' |
| 3580 | // dimension_list |
nothing calls this directly
no test coverage detected