denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Denemo-devel] Re: lyimporter: clef


From: Richard Shann
Subject: [Denemo-devel] Re: lyimporter: clef
Date: Thu, 19 Aug 2010 09:35:23 +0100

Yes, clef does not appear in the keywords in the lilypond lexer. 


When doing the denemo version lilypond parser, I put in a new rule
        | CLEF_ STRING_  ...
immediately before

        | TIME_T fraction  ...
in the command_element rule. (You mentioned command_even, a typo for
command_event?). The CLEF_ is an extra keyword invented for Denemo.


So I obviously hit the same problem when doing the Denemo clone of the
LilyPond parser. LilyPond probably allows what comes after \clef to be
more complex than a simple string hence the obscurity. It is difficult
for me to trace what LilyPond does because to do that I would want your
parser/lexer checked in. That is, when your workaround rule is commented
out, it goes down a certain path, and  seeing that path will take me to
the corresponding piece of LilyPond code (perhaps another bit of
scan_escaped_word with something else expected to follow).
So try to check in your code all the time, as long as it is not linked
in to the executing program you won't break anything. Much.

Richard

On Wed, 2010-08-18 at 22:31 +0200, Nils Gey wrote:
> How is \clef "G" done in lilypond parser again? no sign of clef there, nor in 
> the lexer. Denemo had \clef = CLEF in its list of tokens/escaped words so our 
> scheme parser detects clef. I have a working rule in command_even with
> 
> CLEF DBLQUOTE NOTENAME_PITCH DBLQUOTE
> 
> but this is very custom because " -> DBLQUOTE is not an original parser.yy 
> token. This alone is not bad because parser.yy can do \" in the parser 
> itself, where lalr-scm needs tokens and does not accept strings or chars 
> directly. 
> Like I said, the \clef rule is working but it breaks other things this way 
> because the lexer suddenly returns DBLQUOTE where the (lilypond-)parser does 
> not expect them, e.g. here
> 
>  \context Voice = "PartPOneVoiceOne"  \PartPOneVoiceOne
> 
> so how is \clef done in lilypond? Maybe you told me already, but I forgot 
> then :(
> 
> Nils




reply via email to

[Prev in Thread] Current Thread [Next in Thread]