What a coincidence! I recently discovered ABC, and decided that writing an ABC parser would be a great way to get up to speed on Boost's Spirit library. For details on spirit, see http://spirit.sourceforge.net/
I decided to get on this list to see if there were already resources available for parsing. I'm a C++ programmer, so I would want the parser written in C++. I've just started playing with it, but here are my musings so far: I see two tasks: agreeing on the data structure that is the output, and actually writing the parser. I envision a function that looks something like this: bool bSuccess = ParseABC(const char* szSource, CMusic& output, CParsingErrors& errors); Where output is a complex structure that contains a list of tunes, where each tune is a list of directives, and a list of lines made up of a list of notes, bar lines, etc. Creating the CMusic structure so that anything legal in the current or a future version of ABC can be expressed is crucial. CParsingErrors would be a list of errors it found with enough info that a smart program could help the user identify the problem. If possible, even with a syntax error, CMusic should contain as much as it can figure out safely, perhaps with a marker to the places that have syntax errors. It would be hard for me to envision a way to create the CMusic structure so that it would be readable in C or VB, because it would probably make heavy use of container classes. A wrapper could be provided, though. Anyway, as soon as I started thinking about actually doing something with this, I got very busy. I won't have much time to do anything except discuss until mid summer, but after that point, if I can help, I'd be happy to. Paul Rosen --- Life is a musical, every once in a while the plot stops and you start singing and dancing --- http://home.earthlink.net/~paulerosen/brbb/ http://home.earthlink.net/~theplums/ To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html