Richard Robinson writes: | On Mon, Jul 07, 2003 at 03:27:27PM +0000, John Chambers wrote: | > Well, I'm not sure what "support" is needed. | | I meant, if your code was to get worked over to carve the parser out so | that it was linkable with other peoples' code for other uses, would you | accept that in your code, or would it fork off into a separate line of | development (which imo would be less desirable) ? I still haven't got | round to looking, maybe it's like that anyway ...
The abc2ps parser is rather ad hoc. I'm not sure that I'd want to recommend it as a starting point. OTOH, it does do a separate parse pass that builds data structures, and then an output pass that uses those data structures. Writing a different set of output routines could be done without looking at the parse code at all. | > One suggestion for a parser might be to bury this problem inside the | > input routine. It can easily implement the kludgery to detect the | > abc2win ! and replace it with a space. The resulting abc should be | > amenable to systematic parsing. | > | > I do wish that abc2win would itentify itself early in the headers. | | An argument for preprocessor scripts, like "grep" ... This is one of the reasons that I turned jcabc2ps into a normal unix "filter" that reads stdin if there are no input files. That way I can stick any sort of preprocessor on the beginning, and not worry about cleaning up intermediate files. | Or possibly for "canonicalising" mirror sites, though this could get | ugly. Don't look now, but my tune finder does a bit of this. Not much, and few people are likely to notice it. I have occasionally thought about doing it more. Now that my abc2ps clone is a proper filter, it will be a lot easier. I can always look at the tradeoff: Add yet another kludge to jcabc2ps, or pipe the text through a little perl script that converts the text to something that jcabc2ps understands. It turns out that abc is quite easy to parse in perl. It's so easy that a general-purpose parser becomes uninteresting. Such things are difficult to write and hard to use. It's easier to just parse the text on the fly with a few patterns. To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
