dmd support for IDEs and the D tool chain
Ellery Newcomer
ellery-newcomer at utulsa.edu
Fri Oct 16 14:36:18 PDT 2009
Nick Sabalausky wrote:
> "Justin Johansson" <no at spam.com> wrote in message
> news:hbamfa$v3b$1 at digitalmars.com...
>> Nick Sabalausky Wrote:
>>
>>> "Ellery Newcomer" <ellery-newcomer at utulsa.edu> wrote in message
>>> news:hbak0n$q5b$1 at digitalmars.com...
>>>> Nick Sabalausky wrote:
>>>>> "Denis Koroskin" <2korden at gmail.com> wrote in message
>>>>> news:op.u1v7jdgco7cclz at korden-pc...
>>>>>> Yes, it's a DMD port. Unfortunately, there is no other mature D
>>>>>> front-end
>>>>>> at present. Other folks are working on D compilers (dil, dang, ...)
>>>>>> but
>>>>>> the progress is very slow.
>>>>> FWIW, I've been meaning to try to write a D grammar for GOLD when I
>>>>> get a
>>>>> chance (the Haxe grammar I wrote only took a few days). If that pans
>>>>> out
>>>>> (depends just how simple and unambiguous the grammar is), then that
>>>>> could
>>>>> be
>>>>> used with Goldie as a starting point (ie, lex/parse would be taken
>>>>> care
>>>>> of.
>>>>> Semantic analysis, optimization and back-end would need to be added
>>>>> in).
>>>>>
>>>> All but the hard parts :)
>>> Yea, like I said, "FWIW" ;)
>>>
>>>> I could count the number of places that are ambiguous syntactically or
>>>> semantically on one hand, and maybe the number of places that require
>>>> arbitrary lookahead also. Do LALR parsers care about arbitrary
>>>> lookahead? LL(k) parsers do.
>>> Beats me, I'm not nearly as up on parsing theory as I'd like to be. Could
>>> you give me a simple example?
>> There are a zillion tutorials relating to parsing on the web.
>>
>> Try googling:
>>
>> parsing theory tutorial
>>
>> 2nd hit: An introduction to parsing
>>
>
> That mentioned, in the section about LL(k), "If both A<B and A<B> are legal
> expressions, where B can be of arbitrary length, then no finite amount of
> look-ahead will allow this to be parsed."
>
> I did a quick test in gold (LALR), and this handles the above just fine:
>
> ------------------------------
> "Name" = 'Test'
> "Author" = 'Test'
> "Version" = 'Test'
> "About" = 'Test'
>
> "Start Symbol" = <Type1Or2>
>
> <Type1Or2> ::= <Type1> | <Type2>
> <Type1> ::= 'A' '<' <Bs>
> <Type2> ::= 'A' '<' <Bs> '>'
> <Bs> ::= 'B' | <Bs> 'B'
>
> ------------------------------
>
> However, that one example alone doesn't necessarily prove that it's always
> doable.
>
>
>
Bad example. <Bs> is regular. Try making it nested parens or something
like that. (It isn't LL(k), but it is pretty trivial anyways. ANTLR3 can
handle it without fuss)
More information about the Digitalmars-d
mailing list