|
|
Subscribe / Log in / New account

Bison 3.3 released

Bison 3.3 released

Posted Jan 29, 2019 16:59 UTC (Tue) by Wol (subscriber, #4433)
In reply to: Bison 3.3 released by quotemstr
Parent article: Bison 3.3 released

There speaks a voice that has never worked in the real world ...

I always like to give as my example of trying to parse valid syntax

REM: REM = REM(6,2) ;* This calculates a remainder and puts it in the variable called REM

That is, if you haven't noticed, the token REM used in four different ways in the same statement - as a label, a variable, a function, and a statement. And all those uses are valid in differing dialects of the same computer language.

The option of designing the language/grammar is not always there for the poor sods trying to write the lexer/parser.

Cheers,
Wol


to post comments

Bison 3.3 released

Posted Jan 29, 2019 17:10 UTC (Tue) by quotemstr (subscriber, #45331) [Link] (1 responses)

Your comment is full of snark and says nothing. Even LALR(1) grammars can generate a token in multiple contexts, and you don't need to tolerate conflicts to do it. Any grammar you can express with conflicts you can express without them too.

Bison 3.3 released

Posted Feb 6, 2019 13:46 UTC (Wed) by branden (guest, #7029) [Link]

"Given the constraints of size on the PDP 11, anything but LR(1) was infeasable. But using ambiguous grammars and broadening the shift/reduce test to trest operator precedence fit right into that pattern. Another thing that I think was unique to Yacc at the time was introducing symbols that matched the empty string whose reduction caused program actions. Many similar parser systems at the time could not deal with these "empty" symbols." -- Steve Johnson

"So you're the reason (Plan 9) awk has 83 reduce-reduce conflicts (and
42 shift-reduce)." -- Rob Pike

"As I remember, the original EQN grammar had >300 S/R conflicts and 50 or so RR conflicts. But it mostly did what you wanted. I think Al Aho got faint when he looked it it, though... (It got better when precedence was added...)" -- Steve Johnson


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds