Post Reply 
HP-42S Compiler for Niklaus Wirth's PL/0 Language
02-17-2024, 05:02 PM
Post: #3
RE: HP-42S Compiler for Niklaus Wirth's PL/0 Language
(02-17-2024 10:41 AM)Thomas Klemm Wrote:  In his talk "Reinventing the Parser Generator" David Beazley explains his ply project that is used here:

That was fun to watch Smile Especially the part where he said he hopes the ply project dies...

"Reinventing the Parser Generator" is a big stretch IMO. More like "Implementing Lex and Yacc in Python and how to Mess it Up" Big Grin

Seriously. Ply doesn't even warn when token regex patterns are subsumed, only for us to find out the tokenizer we wrote does not work? Hacking around a way to define a "PRINT" token to not match ID is pure evil. And what about LALR conflicts? Yacc and Bison not only warn, but also output annotated LALR states (dot rules) that help identify the problem to correct. Ambiguous grammars lead to all sorts of nasty problems. Disingenuous to disparage the Dragon book. It's all there and better. Don't teach students tools to use. Teach them how to write them and write them well by teaching the beauty of the underlying algebraic structures and corresponding algorithms. Then use tools, because you don't have to reinvent them. Unless you can significantly improve them (good luck).

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP-42S Compiler for Niklaus Wirth's PL/0 Language - robve - 02-17-2024 05:02 PM



User(s) browsing this thread: 1 Guest(s)