<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 28, 2015 at 2:14 AM, Stephen Tetley <span dir="ltr"><<a href="mailto:stephen.tetley@gmail.com" target="_blank">stephen.tetley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dennis<br>
<br>
For this use case I would make a small, general parser combinator<br>
library / monad on top of XML.Light, then use the new parser<br>
combinators to make a specialized parser for your subset MusicXML.<br>
<br>
The common parser combinator libraries (Parsec, Attoparsec, ...) can't<br>
be used with XML.Light because their mechanics are consuming an input<br>
stream whereas processing XML (or JSON) is moving a cursor through a<br>
tree, but the common API provided by parser combinator libraries can<br>
be re-used productively for a tree (cursor) parser. As well as moving<br>
the cursor, the custom parser monad can handle errors and backtracking<br>
if needed.<br>
<br></blockquote><div><br></div><div>Thanks for the pointers, Stephen. I will look into it. I don't know if I'll have time to learn how to do this though. I'll keep it in mind for the future.</div><div><br></div><div>This is a small, ongoing, no-pressure project, which is even lower pressure when you consider I'm using what I call "just in time" debugging and design. When I look at my use cases, I don't implement any that seem unlikely. If they ever do occur, I can deal with them then. But I don't just ignore cases willy-nilly -- I always consider if they do occur, that the resulting bug will be obvious right away and lead me directly to the answer.</div><div><br></div><div>This is interesting when dealing with music playback. Some unexpected cases won't give an error message but will affect the playback sound -- so I always ask myself, "Will this bug be obvious, really screw up the sound in a major way, so I know it's happening?" Because what I don't want are bugs that create small effects that I might miss for a while so I miss the critical moment they were introduced.</div><div><br></div><div>I don't know the definition of the different processes but does "Just In Time" design/debugging have something to do with Agile?</div><div><br></div><div>D</div><div><br></div><div><br></div></div></div></div>