[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regarding Bison 3.5 D backend

From: Akim Demaille
Subject: Re: Regarding Bison 3.5 D backend
Date: Fri, 31 Jan 2020 06:05:43 +0100

Hi Francesco,

> Le 30 janv. 2020 à 19:04, lagfra <address@hidden> a écrit :
> Hi,
> I'm a D user and I've seen the forum thread by Akim Demaille regarding bison 
> 3.5
> and its D backend:
> I've never contributed to Bison but I'm familiar with it (especially since 
> I've
> been using Bison and Yacc on a large C++ project for a while now).


> It would be
> great to have a D backend which is capable of supporting the whole range of
> features Bison has, still I have little knowledge of where I should start if I
> wanted to contribute. So my questions are:
> - Is there a list of features which are implemented in Bison's D backend from
>  which I could get an understanding of what's working and what's not?

Not really, but I can guide you.

>  I've seen
>  your examples but it's difficult to grasp the limitations of the backend from
>  there. Example: I've read on the manual that GLR parsers are not supported in
>  the java interface, is it true about D's interface as well?

GLR parsers are really tricky to implement, it's a whole different backend
that takes them in charge.  In theory they can certainly share a lot of code,
but in practice (so far), they are separated.  And, no, there is no GLR backend
for D.  Actually, there's only one for C; the one for C++ wraps the
C one.  However there is ongoing work by Valentin Tolmer to rewrite the C++
GLR backend in real C++.  Once he's done, it will probably be a good starting
point to write one for D, if need be.

However, that's a huge undertaking, there are many simpler things to do before.

> - Which are, in your opinion, the resources I should use as documentation 
> apart
>  from the source code and the gnu manual at [1], if any? I ask since I have
>  little familiarity with Bison's codebase and would be nice to have some tips.

Sure.  The implementation of the backends in particular ("skeletons" in Bison
parlance) is tricky: we use M4, a powerful text-based preprocessor, to do that.
And it takes a while to be fluent with it.

But we're here, and we'll guide you.

In fact, at least at the beginning, it will be easier that you show how things
should be, then I'll write them into Bison.  We should start from the example,
and gradually improve it until it matches D standards.

> - How do you test the various backend and Bison in general? Is there some kind
>  of development guide?

See README and README-hacking.

> Thank you for your help in advance. In the meantime I'll play with bison :)


For a start, I recommend that you extend examples/d/calc.y in various ways
to see how it behaves.  And have a look at the generated code.

And be sure to pull bison from its git repo.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]