@Test void parseNull() { assertThrows(NullPointerException.class, () -> SUT.parse(null)); }
public Map<String, TypeDefinition> parse(InputStream source) { MSpecLexer lexer; try { lexer = new MSpecLexer(CharStreams.fromStream(source)); } catch (IOException e) { throw new RuntimeException(e); } MessageFormatListener listener = new MessageFormatListener(); new ParseTreeWalker().walk(listener, new MSpecParser(new CommonTokenStream(lexer)).file()); return listener.getTypes(); }
MessageFormatParser { public Map<String, TypeDefinition> parse(InputStream source) { MSpecLexer lexer; try { lexer = new MSpecLexer(CharStreams.fromStream(source)); } catch (IOException e) { throw new RuntimeException(e); } MessageFormatListener listener = new MessageFormatListener(); new ParseTreeWalker().walk(listener, new MSpecParser(new CommonTokenStream(lexer)).file()); return listener.getTypes(); } }
MessageFormatParser { public Map<String, TypeDefinition> parse(InputStream source) { MSpecLexer lexer; try { lexer = new MSpecLexer(CharStreams.fromStream(source)); } catch (IOException e) { throw new RuntimeException(e); } MessageFormatListener listener = new MessageFormatListener(); new ParseTreeWalker().walk(listener, new MSpecParser(new CommonTokenStream(lexer)).file()); return listener.getTypes(); }  }
MessageFormatParser { public Map<String, TypeDefinition> parse(InputStream source) { MSpecLexer lexer; try { lexer = new MSpecLexer(CharStreams.fromStream(source)); } catch (IOException e) { throw new RuntimeException(e); } MessageFormatListener listener = new MessageFormatListener(); new ParseTreeWalker().walk(listener, new MSpecParser(new CommonTokenStream(lexer)).file()); return listener.getTypes(); }  Map<String, TypeDefinition> parse(InputStream source); }
MessageFormatParser { public Map<String, TypeDefinition> parse(InputStream source) { MSpecLexer lexer; try { lexer = new MSpecLexer(CharStreams.fromStream(source)); } catch (IOException e) { throw new RuntimeException(e); } MessageFormatListener listener = new MessageFormatListener(); new ParseTreeWalker().walk(listener, new MSpecParser(new CommonTokenStream(lexer)).file()); return listener.getTypes(); }  Map<String, TypeDefinition> parse(InputStream source);  }