Is that difficult to write a Shift-Reduce parser

Chariton Karamitas <chakaram@auth.gr>
Sun, 02 May 2010 00:43:41 +0300

          From comp.compilers

Related articles
Is that difficult to write a Shift-Reduce parser kuangpma@gmail.com (kuangpma) (2010-04-29)
Re: Is that difficult to write a Shift-Reduce parser kym@sdf.lonestar.org (russell kym horsell) (2010-05-01)
Is that difficult to write a Shift-Reduce parser chakaram@auth.gr (Chariton Karamitas) (2010-05-02)
Re: Is that difficult to write a Shift-Reduce parser rpw3@rpw3.org (2010-05-01)
Re: Is that difficult to write a Shift-Reduce parser cfc@shell01.TheWorld.com (Chris F Clark) (2010-05-02)
Re: Is that difficult to write a Shift-Reduce parser dot@dotat.at (Tony Finch) (2010-05-04)
Re: Is that difficult to write a Shift-Reduce parser sh006d3592@blueyonder.co.uk (Stephen Horne) (2010-05-07)
Re: Is that difficult to write a Shift-Reduce parser rpw3@rpw3.org (2010-05-09)
| List of all articles for this month |
From: Chariton Karamitas <chakaram@auth.gr>
Newsgroups: comp.compilers
Date: Sun, 02 May 2010 00:43:41 +0300
Organization: Compilers Central
References: 10-04-072
Keywords: parse, LR(1)
Posted-Date: 02 May 2010 22:21:51 EDT

Hello,


A S/R parser is not difficult as in "this equation is difficult to
solve" :-) It's easy but it's a lot of work, that's why we prefer
having yacc do it. Of course, you can do it by hand, but you need to
keep in mind a lot of stuff while constructing the states. Think of it
as trying to multiply two very big integers -- it's easy, but why do
it by hand?


Imho if you want to know how a S/R parser works, you'd better check
how a S/R parser *generator* works. I suggest you take a look at byacc
source code (http://invisible-island.net/byacc/byacc.html). It worked
for me :-)


Cheers
./ck
--
Chariton Karamitas
Undergraduate Student
Electrical and Computer Engineering Department
Fuculty of Engineering
Aristotle University of Thessaloniki, Greece



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.