@Test public void unknown_file() throws Exception { ActionParser<AstNode> parser = parser(MyGrammarKeys.NUMERIC); try { parser.parse(new File("unknown")); Assert.fail("expceted exception"); } catch (RuntimeException e) { assertThat(e.getCause()).isInstanceOf(NoSuchFileException.class); } }
public N parse(File file) { try { char[] chars = new String(Files.readAllBytes(Paths.get(file.getPath())), charset).toCharArray(); return parse(new Input(chars, file.toURI())); } catch (IOException e) { throw new RuntimeException(e); } }
ActionParser { public N parse(File file) { try { char[] chars = new String(Files.readAllBytes(Paths.get(file.getPath())), charset).toCharArray(); return parse(new Input(chars, file.toURI())); } catch (IOException e) { throw new RuntimeException(e); } } }
ActionParser { public N parse(File file) { try { char[] chars = new String(Files.readAllBytes(Paths.get(file.getPath())), charset).toCharArray(); return parse(new Input(chars, file.toURI())); } catch (IOException e) { throw new RuntimeException(e); } } ActionParser(Charset charset, LexerlessGrammarBuilder b, Class grammarClass, Object treeFactory, NodeBuilder nodeBuilder, GrammarRuleKey rootRule); }
ActionParser { public N parse(File file) { try { char[] chars = new String(Files.readAllBytes(Paths.get(file.getPath())), charset).toCharArray(); return parse(new Input(chars, file.toURI())); } catch (IOException e) { throw new RuntimeException(e); } } ActionParser(Charset charset, LexerlessGrammarBuilder b, Class grammarClass, Object treeFactory, NodeBuilder nodeBuilder, GrammarRuleKey rootRule); N parse(File file); N parse(String source); GrammarRuleKey rootRule(); }
ActionParser { public N parse(File file) { try { char[] chars = new String(Files.readAllBytes(Paths.get(file.getPath())), charset).toCharArray(); return parse(new Input(chars, file.toURI())); } catch (IOException e) { throw new RuntimeException(e); } } ActionParser(Charset charset, LexerlessGrammarBuilder b, Class grammarClass, Object treeFactory, NodeBuilder nodeBuilder, GrammarRuleKey rootRule); N parse(File file); N parse(String source); GrammarRuleKey rootRule();  }