LALR(1) and Trolltech’s Creative Fridays

If you followed, you've seen a new addition: QLALR. It's a LALR(1) parser generator, created by Roberto Raggi of Qt Designer and KDevelop fame. Originally developed as Creative Friday project, it quickly got used in various projects within Trolltech. One example is the new script engine - no surprise, Roberto also had his fingers in this one - but also the new XML stream-reader. Writing a fast bottom-up XML parser was a welcome challenge, and with the flexibility of QLALR actually an enjoyable ride.

QLALR is not very well documented, but if you do understand LALR(1) and have used tools like yacc before, you should get along well with the examples. Admittingly, knowing Roberto has also helped. For the lexer, you can use QLALR with whatever scanner generator you like, or you handcraft it. I've also seen a few scanner generators in Trolltech, maybe one will make it on labs some day.

Btw, the last link demonstrates another new feature of our web site: we finally have the snapshot documentation online, regenerated from the source code repository daily.

Blog Topics: