BlockfaceParser extends AbstractRegexParser { @Override public void parse(ParseContext parseContext) { Chunk currentChunk = parseContext.getCurrent(); Matcher matcher = BLOCKFACE.matcher(currentChunk.getText()); if(!matcher.matches()) { patternNotMatched(parseContext,BLOCKFACE); return; } MatchBuilder builder = new MatchBuilder() .add(matcher) .add(MatchType.COMPLETE) .add(parseContext) .add(BLOCKFACE, 1, TokenType.ON) .add(BLOCKFACE, 2, TokenType.ON_STREET) .add(BLOCKFACE, 3, TokenType.BETWEEN) .add(BLOCKFACE, 4, TokenType.CROSS_STREET_ONE) .add(BLOCKFACE, 5, TokenType.AND) .add(BLOCKFACE, 6, TokenType.CROSS_STREET_TWO); handleMatch(builder.build(), ChunkType.BLOCKFACE); }  @Override void parse(ParseContext parseContext);  }
@Test public void testParse() { testParser(parser, LOGGER); }