Let's stop parser Hell

deadalnix deadalnix at gmail.com
Thu Jul 5 15:24:11 PDT 2012


Le 05/07/2012 18:28, Jonathan M Davis a écrit :
> On Thursday, July 05, 2012 18:04:11 Roman D. Boiko wrote:
>> On Thursday, 5 July 2012 at 15:40:53 UTC, Jacob Carlborg wrote:
>>> On 2012-07-05 15:08, Roman D. Boiko wrote:
>>>> Anyway I propose to enumerate major use cases first.
>>>
>>> Haven't we already done that a couple of times.
>>
>> Well, we did something like that for DCT... but I doubt that it
>> would fit general needs.
>>
>> If we had, why haven't they been analyzed, classified, discussed,
>> etc.? Or have they?
>
> It's been discussed before, but there are some obvious use cases such as
> syntax highlighting, code formatting, and manipulation of D source files (e.g.
> to strip out the unit tests).
>
> We need to have a lexer in Phobos which parsers D code and generates a range
> of tokens, and we need to have a parser in Phobos which operates on a range of
> tokens. As discussed previously, there is desire to have the lexer and parser
> ported from dmd's frontend to D for Phobos so that what we get is easily
> maintainable alongside dmd's frontend and produces the same results (and is
> fast).

You never looked at dmd frontend soure code don't you ? It is a horror 
museum, and if we want to have something in D, I certainly wouldn't copy 
that.


More information about the Digitalmars-d mailing list