www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Bison 3.8.1 released with D backend

reply Carl Sturtivant <sturtivant gmail.com> writes:
The D back-end for deterministic parsers contributed by Adela 
Vais is now available with the release of Bison 3.8.1 !

https://github.com/adelavais

See https://savannah.gnu.org/forum/forum.php?forum_id=10047 for 
details.
Sep 15 2021
next sibling parent Carl Sturtivant <sturtivant gmail.com> writes:
Quote:

*** A skeleton for the D programming language

   The "lalr1.d" skeleton is now officially part of Bison.

   It was originally contributed by Oliver Mangold, based on Paolo 
Bonzini's
   lalr1.java, and was improved by H. S. Teoh.  Adela Vais then 
took over
   maintenance and invested a lot of efforts to complete, test and 
document
   it.

   It now supports all the bells and whistles of the other 
deterministic
   parsers, which include: pull/push interfaces, verbose and 
custom error
   messages, lookahead correction, token constructors, 
internationalization,
   locations, printers, token and symbol prefixes, etc.

   Two examples demonstrate the D parsers: a basic one 
(examples/d/simple),
   and an advanced one (examples/d/calc).
Sep 15 2021
prev sibling next sibling parent reply Tejas <notrealemail gmail.com> writes:
On Wednesday, 15 September 2021 at 13:24:25 UTC, Carl Sturtivant 
wrote:
 The D back-end for deterministic parsers contributed by Adela 
 Vais is now available with the release of Bison 3.8.1 !

 https://github.com/adelavais

 See https://savannah.gnu.org/forum/forum.php?forum_id=10047 for 
 details.
I'm sorry for being ignorant, but what does it mean to have a \<insert language\> back-end in Bison? Does it mean that the parser program that `Bison` will output will be a `.d` file? Assuming I'm correct: What does it matter whether the parser is a `.c .cpp .d .pl` or whatever file? I'm really sorry I'm coming off as abrasive/ungrateful. I have no intention to belittle the author or the work she has done. But I'm really curious: What changes if `Bison` outputs it's parser in some language other than the one it originally targeted(perhaps that was C?) I'm really sorry if this appears dismissive, I just don't know how to phrase it any better.
Sep 15 2021
next sibling parent Carl Sturtivant <sturtivant gmail.com> writes:
On Wednesday, 15 September 2021 at 14:48:06 UTC, Tejas wrote:
 I'm sorry for being ignorant, but what does it mean to have a 
 \<insert language\> back-end in Bison?

 Does it mean that the parser program that `Bison` will output 
 will be a `.d` file?

 Assuming I'm correct:

 What does it matter whether the parser is a `.c .cpp .d .pl` or 
 whatever file?

 I'm really sorry I'm coming off as abrasive/ungrateful. I have 
 no intention to belittle the author or the work she has done.

 But I'm really curious: What changes if `Bison` outputs it's 
 parser in some language other than the one it originally 
 targeted(perhaps that was C?)

 I'm really sorry if this appears dismissive, I just don't know 
 how to phrase it any better.
A question asking for its author to be educated would be more suitably posted in the Learn forum.
Sep 15 2021
prev sibling parent reply Paul Backus <snarwin gmail.com> writes:
On Wednesday, 15 September 2021 at 14:48:06 UTC, Tejas wrote:
 Assuming I'm correct:

 What does it matter whether the parser is a `.c .cpp .d .pl` or 
 whatever file?

 I'm really sorry I'm coming off as abrasive/ungrateful. I have 
 no intention to belittle the author or the work she has done.

 But I'm really curious: What changes if `Bison` outputs it's 
 parser in some language other than the one it originally 
 targeted(perhaps that was C?)
Generally speaking, a parser is not a program that you'd run in isolation. When you generate a parser with Bison, it's usually because you want to incorporate that parser into some larger program, like a compiler or a language server. In general, having Bison output its parser in $LANGUAGE makes it easier to incorporate that parser into larger programs written in $LANGUAGE. So giving Bison the ability to output D makes it easier to incorporate Bison-generated parsers into D programs.
Sep 15 2021
parent Tejas <notrealemail gmail.com> writes:
On Wednesday, 15 September 2021 at 17:55:19 UTC, Paul Backus 
wrote:
 On Wednesday, 15 September 2021 at 14:48:06 UTC, Tejas wrote:
 Assuming I'm correct:

 What does it matter whether the parser is a `.c .cpp .d .pl` 
 or whatever file?

 I'm really sorry I'm coming off as abrasive/ungrateful. I have 
 no intention to belittle the author or the work she has done.

 But I'm really curious: What changes if `Bison` outputs it's 
 parser in some language other than the one it originally 
 targeted(perhaps that was C?)
Generally speaking, a parser is not a program that you'd run in isolation. When you generate a parser with Bison, it's usually because you want to incorporate that parser into some larger program, like a compiler or a language server. In general, having Bison output its parser in $LANGUAGE makes it easier to incorporate that parser into larger programs written in $LANGUAGE. So giving Bison the ability to output D makes it easier to incorporate Bison-generated parsers into D programs.
Yep, that's what I thought of in Discord and was validated there as well that this was it :D After a while, my mind started drifting that `pegged` already does this, but then I realized it probably doesn't create `LALR(1)` parsers, only sticking to Expression Grammars, but Bison does that.
Sep 15 2021
prev sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Wed, Sep 15, 2021 at 01:24:25PM +0000, Carl Sturtivant via
Digitalmars-d-announce wrote:
 
 The D back-end for deterministic parsers contributed by Adela Vais is
 now available with the release of Bison 3.8.1 !
 
 https://github.com/adelavais
 
 See https://savannah.gnu.org/forum/forum.php?forum_id=10047 for details.
Great news! T -- Unix was not designed to stop people from doing stupid things, because that would also stop them from doing clever things. -- Doug Gwyn
Sep 20 2021