@Test public void should_report_error_at_end_of_input() { Rule endOfInput = new MutableParsingRule("endOfInput").is(GrammarOperators.endOfInput()); Rule rule = new MutableParsingRule("rule").is("foo", endOfInput); ParseRunner runner = new ParseRunner(rule); ParsingResult result = runner.parse("foo bar".toCharArray()); assertThat(result.isMatched()).isFalse(); ParseError parseError = result.getParseError(); System.out.println(new ParseErrorFormatter().format(parseError)); assertThat(parseError.getErrorIndex()).isEqualTo(3); }
public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); }
ParseRunner { public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); } }
ParseRunner { public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); } ParseRunner(Rule rule); }
ParseRunner { public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); } ParseRunner(Rule rule); ParsingResult parse(char[] input); }
ParseRunner { public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); } ParseRunner(Rule rule); ParsingResult parse(char[] input);  }