help-bison
[Top][All Lists]
Advanced

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

Re: GLR ambiguity


From: Hans Aberg
Subject: Re: GLR ambiguity
Date: Thu, 14 Jun 2007 14:01:55 +0200

On 14 Jun 2007, at 12:48, Alessandro Di Marco wrote:

I was trying to create a GLR grammar for natural languages

Though your efforts are welcome, Flex/Bison are not made for parsing natural languages, the problem is with sentences like
  Time flies like an arrow, fruit flies like a banana.
where different word groupings can produce different grammar constructs.

...when I stuck on the
following s/r ambiguity.
...
text:
          /* empty */
        | text sentence
        ;

sentence:
          WORD EOL
        | DOUBLEQ WORD EOL
        | DOUBLEQ WORD EOL DOUBLEQ
        ;

Some shift/reduce conflicts can be resolved using token precedence (% left, etc.); see the thread "how to resolve if/elseif/else ambiguity?" (archive URL is in the long headers of the mail you get from this list). I am not using GLR, so perhaps somebody else can help you with that.

  Hans Aberg






reply via email to

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