public class TextStoryParser implements StoryParser {
public StoryDetails parseStory(Reader in) {
try {
Lexer lexer = new Lexer(new PushbackReader(in, 1024));
Parser parser = new Parser(lexer);
Start root = parser.parse();
StoryDetailsBuilder builder = new StoryDetailsBuilder();
root.apply(builder);
return builder.getStoryDetails();
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
} catch (LexerException e) {
throw new RuntimeException(e.getMessage());