| 172 | } |
| 173 | |
| 174 | private void parseTime(Statement statement) throws ParserException { |
| 175 | |
| 176 | String minutesToken = tokens.get(index++); |
| 177 | String timeSeparator = tokens.get(index++); |
| 178 | String secondsToken = tokens.get(index++); |
| 179 | |
| 180 | if (!Token.TIME_SEPARATOR.equals(timeSeparator)) { |
| 181 | throw new ParserException("'" + Token.TIME_SEPARATOR + "'" + " expected"); |
| 182 | } |
| 183 | |
| 184 | try { |
| 185 | |
| 186 | int minutes = Integer.parseInt(minutesToken); |
| 187 | int seconds = Integer.parseInt(secondsToken); |
| 188 | |
| 189 | statement.setTime(new MatchTime(minutes, seconds)); |
| 190 | |
| 191 | } catch (NumberFormatException nfe) { |
| 192 | throw new ParserException(ParserException.INVALID_TIME_FORMAT); |
| 193 | } |
| 194 | } |
| 195 | } |