9 Mar 2003 17:24:08 -0500

Related articles |
---|

Bermudez-Logothetis LALR(1) Lookahead Algorithm rda@lemma-one.com (Rob Arthan) (2003-02-21) |

Re: Bermudez-Logothetis LALR(1) Lookahead Algorithm rda@lemma-one.com (Rob Arthan) (2003-02-24) |

Re:Bermudez-Logothetis LALR(1) Lookahead Algorithm robert.thorpe@antenova.com (Rob Thorpe) (2003-03-09) |

From: | Rob Thorpe <robert.thorpe@antenova.com> |

Newsgroups: | comp.compilers |

Date: | 9 Mar 2003 17:24:08 -0500 |

Organization: | Compilers Central |

References: | 03-02-126 03-02-152 |

Keywords: | parse, LALR |

Posted-Date: | 09 Mar 2003 17:24:08 EST |

*> Rob Arthan wrote:*

*> This all turns out to be wonderfully easy to implement - it only adds about*

*> 300 non-comment lines of Standard ML code to my earlier SLR(1)-based*

*> parser generator (and about 80 of those are for diagnostics and listings).*

*> I have been put off implementing LALR(1) for over 10 years because of the*

*> uninspiring description of the over-complex (and slow) yacc algorithm in*

*> Aho & Ullman - drat that dragon!*

Though I don't properly understand it, the algorithm in yacc is quite

short, only 400 lines of C. In Standard ML it would probably be a

similar length or shorter.

That said algorithms that work in complex ways, such as any parser

construction algorithm should be completely documented in the source or

in a reference manual. So it's best to pick the one that is easiest to

explain.

--

Robert Thorpe

Software Engineer

Antenova Limited

Far Field House

Albert Road

Stow-cum-Quy

Cambridge

CB5 9AR, UK

t: +44 (0)1223 810603

f: +44 (0)1223 810650

m: +44 (0)7866 552477

www.antenova.com

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.