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.