help-flex
[Top][All Lists]
Advanced

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

GCF Flex


From: Hans Aberg
Subject: GCF Flex
Date: Sun, 20 Jul 2003 21:31:09 +0200

Can Flex be turned into a GCF (Generalized Context Free) lexer, just as
Bison has a GLR option. There is a need in various situations to scan
forward for ambiguities. One example is the parsing of English, like in
sentences:
    Fruit flies like a banana.
Here, "Fruit flies" can be constructed as a single noun, or a noun followed
by a verb, and the token interpretation of "like" will depend on that.

Even if one does not intend to parse English, the problem will pop up here
and there, for the same reason: Humans can easily cope with such
ambiguities.

One can from this example see that the requirements of a GCF Flex would be:
1. Be able to scan forward to record alternative token interpretations.
2. Be able to report multiple interpretations to the Bison GLR parser, so
that the latter can not only deal with .y grammar ambiguities, but with
token ambiguities as well.

The option 2, might be useful even without the option 1.

  Hans Aberg






reply via email to

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