| 317 | } |
| 318 | |
| 319 | private static MatchDataElement.DirectiveType expectDirective(String directive) throws ParserException { |
| 320 | return switch(directive) { |
| 321 | case "phase" -> INPLAY_PHASE; |
| 322 | case "intention" -> INTENTION; |
| 323 | case "set" -> SET_PIECE_EXECUTION_BLOCK; |
| 324 | case "break" -> BREAK; |
| 325 | case "HT" -> HALF_TIME; |
| 326 | case "possessor" -> POSSESSOR_DEFINITION; |
| 327 | case "transition" -> TRANSITION_CHAIN_BLOCK; |
| 328 | case "substitution" -> SUBSTITUTION; |
| 329 | case "fair_play" -> FAIR_PLAY; |
| 330 | case "injury" -> INJURY; |
| 331 | default -> throw new ParserException("Keyword expected"); |
| 332 | }; |
| 333 | } |
| 334 | |
| 335 | private static void expectToken(String token, String currentToken) throws ParserException { |
| 336 | if (!token.equals(currentToken)) { |