Antti-Juhani Kaijanaho: LALR parsing is sooo fun
I'm writing a grammar for Hao, a programming language I am designing (ow, design is such a poor word for this. painting?) loosely based on Lasu's specs. I run into LALR conflicts, and it takes forever to chase them. LALR grammars are not the easiest things to debug. Unfortunately, the alternatives are much worse; if easier to debug, then less maintaineable. Baad. All baad.
It would be nice to have a program that would accept a grammar which is not LALR(1) or LL(1) or whatever the program uses internally but does transfer the grammar automatically into the appropriate format, if possible. (Many languages are LALR(1) but the most natural grammars for them are not.)
2004-05-05T23:15+0300 - /en/programming
Trackback url: http://antti-juhani.kaijanaho.info/blog/en/programming/lr.trackback (trackback on rikki / trackback is broken)
Re: Announcing Ibid's Editor
What applications do you use that editor for?
- Josh, ti, 14 kesä 2005 19:06
Re: Announcing Ibid's Editor
Currently nothing, since it is not ready for production use. I have played with it mainly by reconstructing emails so that quotes become transclusions, but that's not a realistic application for production use. I hope it will be useful enough for writing all sorts of texts eventually. Texts that need the ability to quote from other texts will benefit, so scholarly writing is certainly one application.
- Antti-Juhani Kaijanaho, ke, 15 kesä 2005 10:47
I see.
Xanalogical text is an interesting idea. I would definately jump on the bandwagon to get it ported to win32 if I had any skills what-so-ever.
I suppose a Xanalogical IDE for your compiler isn't to far away.
- Josh, to, 16 kesä 2005 15:35
Re: Java sucks!
Even more reason to push Sun to open source Java in it's entirety!! Fill out the little form at http://www.sun.com/company/cgov/contact.cgi ;-)
- Ben Hill, la, 21 elo 2004 14:24
Re: Java sucks!
What is wrong with evil free binaries? Why is open source any better??? Maybe you should think 2x about how companies paid someone to sit there 9 to 5 weeding out bugs in compiler while volunteers dabble on it after they come home from work, shower, watch tv, some xxx time, then fired up the computer for 30 mins to work on it before going to bed.
- jiMMy, la, 11 syys 2004 09:54
Re: Java sucks!
Who said anything about Open Source? :)
And I dare say jiMMy's knowledge on free software development is about as insightful as his writing is beautiful.
- Antti-Juhani Kaijanaho, su, 12 syys 2004 12:42
Re: LARL parsing is sooo fun
Have you tried spark? It's a python parser, but is neither left or right associative, you can do productions like "exp := exp + exp" and it will deal with it. I don't know exactly how. (But it works!) They've got papers explaining how it works if you care that much ;)
http://pages.cpsc.ucalgary.ca/~aycock/spark/
- Perry Lorier, to, 06 touko 2004 05:26
Re: LALR parsing is sooo fun
Apparently Spark uses Earley's algorithm, which is much more powerful than the usual LL(1) or LALR(1). Interestingly, recent Bison versions allow the use of GLR, an algorithm of similar parsing power to Earley's algorithm.
- Antti-Juhani Kaijanaho, to, 06 touko 2004 11:07
Your Comment