(Predicate<Character> tokenInclusionPredicate)
| 78 | } |
| 79 | |
| 80 | private String getNextToken(Predicate<Character> tokenInclusionPredicate) { |
| 81 | |
| 82 | StringBuilder result = new StringBuilder(); |
| 83 | |
| 84 | while (index < statement.length()) { |
| 85 | |
| 86 | char currentChar = statement.charAt(index); |
| 87 | |
| 88 | if (tokenInclusionPredicate.test(currentChar)) { |
| 89 | result.append(currentChar); |
| 90 | index++; |
| 91 | } else { |
| 92 | break; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | return result.toString(); |
| 97 | } |
| 98 | |
| 99 | private boolean isNextToken(String token) { |
| 100 | int tokenIndex = 0; |