|
From: | Han-Wen Nienhuys |
Subject: | Re: SCM-ification of parser |
Date: | Wed, 17 May 2006 17:31:59 +0200 |
User-agent: | Thunderbird 1.5.0.2 (X11/20060501) |
Erik Sandberg schreef:
Hi,The attahed patch changes all Music* types in the parser to SCM. I think I fixed some memory leaks also.
yes, this is good.
The next step in parser split-up is to move rules out to Scheme. There will be a lot of functions, so I suggest we create a new make-music.scm for this.
Regarding naming, we already have a make-foo-music for plain SCM use. I propose to have
foo: bar baz ; => (make-syntax-foo .. )It would also be nice if you could fold in various other runtime configuration mechanisms (eg. lookup for -| -^ and other scripts, the pipeSymbol hack).
Also, I'm not sure if -in the long run- you should use lily_module_constant. I think it makes more sense to store the production rules in the parser object, just like the definition of eg. pipeSymbol.
We will need a mechanism for handling music origins in a good way. I suggest that an optional parameter for origin is added to all make-*-music functions (or perhaps even automate this with a define-make-music-function macro)
There is already generic location support from the bison side, using $@ I think. I think it's best to use that.
In order to verify that I don't break stuff, I plan to do the following:For each rule that will be moved out, I first create some .ly code that the rule is used for. Then I move the rule out to Scheme, and verify that \displayMusic still gives the same output.The reson why I start with this before music streams are implemented, is that many rules need to be exported, so when patch reviewing lag comes in the way for continuing music stream work, I can use my time to export a couple of rules instead.
As long as you move carefully, and don't break lilypond , that should be fine.
-- Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com
[Prev in Thread] | Current Thread | [Next in Thread] |