[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Grammar: meaning of terminals
From: |
Harmath Dénes |
Subject: |
Re: Grammar: meaning of terminals |
Date: |
Sun, 7 Mar 2010 22:51:39 +0100 |
On 2010.03.04., at 19:36, Patrick McCarty wrote:
> 2010/3/4 Harmath Dénes <address@hidden>:
>> Greetings all,
>>
>> it's great to have a grammar of LilyPond in the NR! But there are terminal
>> rules which are not strings (BOOK_IDENTIFIER, CHORD_MODIFIER etc.). Where
>> can their definitions be learned?
>
> If you do a `git grep' for them in the source tree, you will see that
> many of these terminals come to life in the lexing stage.
I see. The -p option gives even more useful output.
> For example, BOOK_IDENTIFIER is the return value of
> Lily_lexer::try_special_identifiers() in lily/parser.yy, but only if
> its second argument is a Book smob.
>
> -Patrick
It's not exactly clear to me how lexing and parsing are related, since there
are lexer rules (e.g. NOTENAME_PITCH) which can be set from Scheme code. Could
someone shed a light on this?
Thanks,
thSoft