Well, considering you really need to parse most fields *anyway* in order for
the parser to have a context for parsing the actual tune data (for example,
if Key is currently G, then the "F" note I just read is actually an F#...),
I'm not sure it makes much sense to leave that decision up to the calling
program.  You're going to have the parsed data in a structure *somewhere*
for the parser itself to access -- may as well pass back that structure as
part of the overall output, and save the calling application extra work.

Fields and settings the parser doesn't recognize *should* be passed back to
the caller as text.  For example, if that key field had a flag like:
    abc2dulcimer:tuning=DAD
...then the parser should pass back that part of the key field intact (or
broken into tag name and tag value, or maybe even the name broken into app
name and tag name) as a substructure of a key structure.  Likewise for many
of the Xcommands, whose scope really doesn't fall into the job of a basic
ABC parser.

But any field which the parser *should* know about should be parsed and the
results passed back to the calling app.

IMHO,
-->Steve Bennett

Remo D. wrote:

> To avoid unnecessary work, I decided to provide separate functions to parse
> the field bodies instead of parsing them anyway.
> 
> In other words, you first receive the entire body of the field as a string
> and then, if you are really really interested, you call a function like:
> 
> k=abcKey(string);
> 
> to really parse the field body, extract all the information and pack them
> into k.

To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html

Reply via email to