Re: LL(1) vs LALR(1) parsers

Saileshwar Krishnamurthy <>
Thu, 9 Nov 1995 22:17:26 GMT

          From comp.compilers

Related articles
LL(1) vs LALR(1) parsers (Odd Arild Olsen) (1995-11-04)
Re: LL(1) vs LALR(1) parsers (Saileshwar Krishnamurthy) (1995-11-09)
Re: LL(1) vs LALR(1) parsers (Sebastian Schmidt) (1995-11-10)
Re: LL(1) vs LALR(1) parsers (1995-11-10)
Re: LL(1) vs LALR(1) parsers (1995-11-14)
Re: LL(1) vs LALR(1) parsers (steve (s.s.) simmons) (1995-11-15)
Re: LL(1) vs LALR(1) parsers (Terence John Parr) (1995-11-20)
Re: LL(1) vs LALR(1) parsers (1995-11-22)
[20 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: Saileshwar Krishnamurthy <>
Keywords: parse, LL(1), LALR
Organization: Compilers Central
References: 95-11-051
Date: Thu, 9 Nov 1995 22:17:26 GMT

Odd Arild Olsen <> writes:

        Odd> grammars, but many languages can be described by LL(1)
        Odd> grammars. If LL(1) can yield faster, smaller and more
        Odd> understandable parsers with better error handling for
        Odd> many languages, why isn't this method more elaborated?

As I understand it:

A standard (easily understandable) grammar of a typical programming
language often isn't LL(1). However normally after eliminating
left-recursion and left-factoring (and other transformations) the
grammar can be converted to one that is LL(1). However these
transformtations make the new grammar pretty difficult to understand.
So while the parser may be reasonably easy to understand, it becomes
difficult to use that grammar and embed semantic routines in it -
'coz the original version will probably be what is most intuitive.
However most standard grammars will not need conversion to make them

Also parser-controlled semantic stacks mesh excellently with LR
parsers, and are pretty much a pain for LL parsers (In LL parsers,
the semantic stack cannot grow in parallel with the parse stack)

        Odd> the various Small-C compilers were recursive
        Odd> descending. Which common languages can not be parsed by
        Odd> LL(1) grammars?

They can be parsed perhaps, but the final LL(1) grammar that
corresponds to the language will probably not be so intuitively
obvious. Whoops, I find it difficult to convince myself whenever I
eliminate left-recursion for a toy grammar !

Post a followup to this message

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