comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: LALR parser question
Date: Tue, 30 Apr 2013 03:19:26 +0200
Date: 2013-04-30T03:19:26+02:00	[thread overview]
Message-ID: <op.wwbxyoz9ule2fv@cardamome> (raw)
In-Reply-To: cfls68cofn7c$.1gsgubjl1vdhk$.dlg@40tude.net

Le Sun, 28 Apr 2013 16:43:06 +0200, Dmitry A. Kazakov  
<mailbox@dmitry-kazakov.de> a écrit:

> On Sun, 28 Apr 2013 08:37:33 -0500, Stephen Leake wrote:
>
>> Any other ways to handle this problem?
>
> Recursive decent parser.

Or return to the original ascent parser:

http://en.wikipedia.org/wiki/LALR_parser
> In 1965, Donald Knuth invented the LR parser (Left to Right,
> Rightmost derivation). The LR parser can recognize any
> deterministic context-free language in linear-bounded time.
> However, rightmost derivation has very large memory requirements
> and implementing an LR parser was impractical due to the limited
> memory of computers at that time. To address this shortcoming, in
> 1969, Frank DeRemer proposed two simplified versions of the LR
> parser, namely the Look-Ahead LR (LALR)

And above in the introduction, commenting about LALR:
> The simplification that takes place results in a parser with
> significantly reduced memory requirements but decreased language
> recognition power.

This suggest LALR is limited by design and the original LR was less  
limited.

I did a top‑down (decent) parser some many years ago, and was not that  
much happy with neither. Either ascent, decent, left‑right or right‑left,  
they all requires to torture the grammar to make the parser generator  
happy.

Note: GNAT uses a hand‑written parser (I'm pretty sure to remember I've  
seen it somewhere).


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



  reply	other threads:[~2013-04-30  1:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-28 13:37 LALR parser question Stephen Leake
2013-04-28 14:43 ` Dmitry A. Kazakov
2013-04-30  1:19   ` Yannick Duchêne (Hibou57) [this message]
2013-04-30  2:03     ` John B. Matthews
2013-04-30  4:11       ` Yannick Duchêne (Hibou57)
2013-04-30 11:55         ` Peter C. Chapin
2013-04-30 13:14           ` john
2013-04-30 14:14             ` Dmitry A. Kazakov
2013-05-01 11:33             ` Peter C. Chapin
2013-04-30 16:06     ` Shark8
2013-04-30 17:15       ` Yannick Duchêne (Hibou57)
2013-04-30 17:51         ` Shark8
2013-04-30 18:52           ` Yannick Duchêne (Hibou57)
2013-05-01 12:31         ` Stephen Leake
2013-05-01 13:57           ` Shark8
2013-04-30 21:18       ` Dmitry A. Kazakov
2013-04-30 22:09         ` Shark8
2013-05-02  1:49 ` Randy Brukardt
2013-05-02  2:39   ` Yannick Duchêne (Hibou57)
2013-05-02 21:57     ` Randy Brukardt
2013-05-06 18:25     ` Oliver Kellogg
2013-05-03  9:45   ` Stephen Leake
2013-05-03 22:57     ` Randy Brukardt
2013-05-06  9:45     ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox