March 30, 2011
Trass3r wrote:
> Rainer Schuetze Wrote:
>> I've set up a comparison with some notes here:
>>
>> http://www.dsource.org/projects/visuald/wiki/GrammarComparison
> 
> Very nice comparison style.
> What would be an appropriate way to discuss grammar changes?
> I think many things should be simplified/clarified.

I'd welcome this. I see a few options, but none is currently perfect:

- in a wiki. both dsource and wiki4d don't seem to have discussion pages, though. I'm not sure the comparison tables can be converted to something maintainable - it's currently very verbose html.
- here on the newsgroup. this would probably have the widest audience, but also might easily get lost. maybe with keeping track of ideas/results in wiki4d.
- in bugzilla. this might get spread into multiple entries causing loss of the overview of the overall grammar.

> 
> For example, isn't AutoDeclaration already covered by Decl -> StorageClasses Decl and so on?
> Also there are 3 different instances of mixin: MixinExpression, MixinStatement and MixinDeclaration. Even though they all come down to the same thing.
> Modifiers like shared are repeated, e.g. in BasicType, Attribute, TypeSpecialization. Also your proposed TypeWithModifier somewhat replicates parts of BasicType (just without the parentheses) 

I think, the different mixin variants are ok, because you might want to generate different AST for these. But the confusion of const/shared/immutable etc in Attribute,StorageClass,Types,etc causes a lot of headaches.
March 30, 2011
I just forked the d-programming-language.org repo on github to fix some grammar errors as a start.
I think results should directly go into such a fork so a pull request can be issued later and everything might be merged in at once.

Will open a new thread for it.
March 30, 2011
On 03/30/2011 08:40 AM, Rainer Schuetze wrote:
>> What would be an appropriate way to discuss grammar changes?
>> I think many things should be simplified/clarified.
>
> I'd welcome this. I see a few options, but none is currently perfect:
>
> - in a wiki. both dsource and wiki4d don't seem to have discussion pages,
> though. I'm not sure the comparison tables can be converted to something
> maintainable - it's currently very verbose html.
> - here on the newsgroup. this would probably have the widest audience, but also
> might easily get lost. maybe with keeping track of ideas/results in wiki4d.
> - in bugzilla. this might get spread into multiple entries causing loss of the
> overview of the overall grammar.

I'd vote for wiki + newsgroup. Anyway, if you just put it on a wiki page and announce it here, this would probably launch thread that would feed the page back, hopefully.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com

March 30, 2011
On 3/29/2011 2:48 PM, Rainer Schuetze wrote:
>> Could you please add a bugzilla entry for your wiki notes?
>
> I hope you mean an entry with a link to the wiki. The comparison itself might a
> bit too large itself for bugzilla (html is larger than 800kB) ;-)

A link is fine.
March 31, 2011

Walter Bright wrote:
> On 3/29/2011 2:48 PM, Rainer Schuetze wrote:
>>> Could you please add a bugzilla entry for your wiki notes?
>>
>> I hope you mean an entry with a link to the wiki. The comparison itself might a
>> bit too large itself for bugzilla (html is larger than 800kB) ;-)
> 
> A link is fine.

Done now: http://d.puremagic.com/issues/show_bug.cgi?id=5803

An update of the chart involves a lot of manual editing to keep comments, but the size of the tables makes every editor so slow, it is really painful. So I'm not sure I'll find the time to update it soon, I think I need an alternative way to do it first.
April 03, 2011
On Mon, 28 Mar 2011 09:02:45 -0700, Luca Boasso wrote:

> A complete D grammar is one of the objectives of my GSOC 2011 ANTLR proposal, if I got accepted you will have one :)

Luca -

You might want to be aware that it appears that the dmd2 front end uses Pratt parsing rather than being based on EBNF.  That being the case, it might be much easier (not to say more useful) to specify the language semantics in a more compatible format than EBNF.  If you've had sophmore level CS theory, then Pratt's original paper is very readable, and highly recommended.

Best,
Jason

http://hall.org.ua/halls/wizzard/pdf/Vaughan.Pratt.TDOP.pdf

;;;         Pratt, Vaughan R., ``Top Down Operator Precedence,'' ;;;         ACM Symposium on Principles of Programming Languages ;;;         Boston, MA; October, 1973.

April 04, 2011
On 29/03/2011 07:46, Rainer Schuetze wrote:
>
> Having written a D2 parser a few month ago in the hope it will be
> helpful to Visual D (just finds it way into the plugin right now), I've
> noticed quite some inaccuracies in the "official" grammar on the
> website. Some of these are probably already in bugzilla, some of them
> might be personal taste and should be discussed, though.
>
> I've set up a comparison with some notes here:
>
> http://www.dsource.org/projects/visuald/wiki/GrammarComparison
>
> The parser was written manually, so the proposed grammar was not
> directly used to generate the parser and might still contain errors.
>
> I've extracted the website grammar using some combination of scripts
> from the ddoc sources, so if there is interest, I can dig them up...
>
> Rainer
>

BTW, I wanna thank for this work (current and upcoming), it is likely useful for other IDE projects as well ;)


-- 
Bruno Medeiros - Software Engineer
April 04, 2011
On Mon, Apr 4, 2011 at 8:11 PM, Bruno Medeiros <brunodomedeiros+spam@com.gmail> wrote:
>
> BTW, I wanna thank for this work (current and upcoming), it is likely useful
> for other IDE projects as well ;)
>

Ditto.

I have started work on D language support for NetBeans (IMHO it's MUCH better editor than Eclipse) and started to write grammar for javaCC, but since there is ongoing work on ANTLR parser I'll wait for that to be done and integrate it into plugin I'm working on. :)
April 04, 2011
On 4/4/11 1:51 PM, Aleksandar Ružičić wrote:
> On Mon, Apr 4, 2011 at 8:11 PM, Bruno Medeiros
> <brunodomedeiros+spam@com.gmail>  wrote:
>>
>> BTW, I wanna thank for this work (current and upcoming), it is likely useful
>> for other IDE projects as well ;)
>>
>
> Ditto.
>
> I have started work on D language support for NetBeans (IMHO it's MUCH
> better editor than Eclipse) and started to write grammar for javaCC,
> but since there is ongoing work on ANTLR parser I'll wait for that to
> be done and integrate it into plugin I'm working on. :)

Aleksandar, would you be willing to work with the student working on ANTLR as a mentor? Please let me know and I'll send details about applying as a mentor.

Andrei
April 04, 2011
On Mon, 04 Apr 2011 14:51:02 -0400, Aleksandar Ružičić <ruzicic.aleksandar@gmail.com> wrote:

> On Mon, Apr 4, 2011 at 8:11 PM, Bruno Medeiros
> <brunodomedeiros+spam@com.gmail> wrote:
>>
>> BTW, I wanna thank for this work (current and upcoming), it is likely useful
>> for other IDE projects as well ;)
>>
>
> Ditto.
>
> I have started work on D language support for NetBeans (IMHO it's MUCH
> better editor than Eclipse) and started to write grammar for javaCC,
> but since there is ongoing work on ANTLR parser I'll wait for that to
> be done and integrate it into plugin I'm working on. :)

I would absolutely love NetBeans support for D.

-Steve