help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining LR(k)-ness


From: Hans Aberg
Subject: Re: Determining LR(k)-ness
Date: Thu, 19 Nov 2009 00:19:11 +0100


On 18 Nov 2009, at 23:41, John Levine wrote:

For an arbitrary .y file, I'd like to know if it's possible to get
some report detail that would tell me (when using the %glr-parser
option) what was the maximum 'k' lookahead used for that grammar.

Unless it has been changed lately, it just uses LALR(1) and splits the
parse when ambiguous.

That's what it does.  Bison can tell you whether a grammar is LALR(1),
but if it's not it can't tell you what class of language it is.

Only that there is some work going on to do a LR(1). But it may not have reached the %glr feature then.

It is my impression that most practical GLR grammars have parses that
collapse pretty quickly after they split, but I don't have any
statistics to back that up.

That is supposed to be true about natural languages, too. Perhaps that is the reason - human create both. But human languages have context dependent tokenization, which cannot be handled by a traditional Flex- Bison setup.

  Hans






reply via email to

[Prev in Thread] Current Thread [Next in Thread]