September 07, 2007 Re: BNF questions and comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to BLS | BLS wrote:
> Matti Niemenmaa schrieb:
>
>> BLS wrote:
>>
>>> Yep. Porting Walter's language/grammar description into EBNF is a
>>> challenge. You may have recognized that I am working on Netbeans IDE
>>> support for D/MiniD... in order to establish code folding I have to
>>> create an NBS Schliemann file which is (mostly) similar to EBNF.
>>> Instead of {} I have to use ()*, in fact a few minor things.
>>> Probabely we can exchange some information ?
>>
>>
>> A lot of people appear to be working on something which needs to parse D.
>>
>> It might be an idea to set up a page on Wiki4D called "CorrectCompleteDGrammar"
>> or something, writing a complete EBNF (or using Walter's syntax, which is also
>> fine) for D which is actually correct.
>>
>
> I like this idea.
>
> // Using this EBNF grammar ???
> S = ModuleDeclaration {Statement} ";" .
> ModuleDeclaration = "module" identifier {"." identifier} ";" .
> and so on ...
>
> /* It will make live easier, when we have a least our "Standard" EBNF defination.
> */
> Bjoern
>
>
What might be fun would be to have one "standard" version in EBNF and then automagically derive others like pure BNF, right recursive, or whatever.
|
September 08, 2007 Re: BNF questions and comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jascha Wetzel | Jascha, many, many thanks.
Just one question :
What is the meaning of : epsilon ?
Bjoern
Jascha Wetzel schrieb:
> Matti Niemenmaa wrote:
>> BLS wrote:
>>> Yep. Porting Walter's language/grammar description into EBNF is a
>>> challenge. You may have recognized that I am working on Netbeans IDE
>>> support for D/MiniD... in order to establish code folding I have to
>>> create an NBS Schliemann file which is (mostly) similar to EBNF.
>>> Instead of {} I have to use ()*, in fact a few minor things.
>>> Probabely we can exchange some information ?
>>
>> A lot of people appear to be working on something which needs to parse D.
>>
>> It might be an idea to set up a page on Wiki4D called "CorrectCompleteDGrammar"
>> or something, writing a complete EBNF (or using Walter's syntax, which is also
>> fine) for D which is actually correct.
>>
>
> i exported the current of the D grammar that i use for SEATD:
> http://seatd.mainia.de/grammar.html
> http://seatd.mainia.de/grammar.xml
|
September 08, 2007 Re: BNF questions and comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to BLS | BLS wrote:
> What is the meaning of : epsilon ?
Usually this means nothing, erm, "nothing" in such a context.
Something like "a <- b / epsilon" is equivalent to "a <- b?".
Regards, Frank
|
September 08, 2007 Re: BNF questions and comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to 0ffh | 0ffh wrote:
> BLS wrote:
>> What is the meaning of : epsilon ?
>
> Usually this means nothing, erm, "nothing" in such a context.
>
> Something like "a <- b / epsilon" is equivalent to "a <- b?".
>
> Regards, Frank
yep, epsilon means, the production rule may produce nothing. in the seatd grammar, in most cases, non-terminals that have an epsilon rule, also have a name with suffix "Opt" for "optional".
note that epsilon rules are just a convenient shortcut:
EnumDeclaration -> "enum" EnumBaseTypeOpt EnumBody
may be rewritten as:
EnumDeclaration -> "enum" EnumBaseType EnumBody
EnumDeclaration -> "enum" EnumBody
|
Copyright © 1999-2021 by the D Language Foundation