On 3 Aug 2007, at 08:01, Hans (Req man) wrote:
In order to come to an achievable goal I considered this to
difficult to start with. So I took two examples from the current
English diction phrase checks. My first level of ambition is to
check a sentence for the existence of a certain phrase. And if
possible I do not want to spell out every possibility all the time.
As you demonstrated yourself it is easy to find new instances all
the time.
If we were able to introduce the verb 'to be' with all its
different instances, and reuse that all the time that would help
enormously. Because now if we take another phrase with the verb to
be, like 'to be capable to', the same thing starts over again. A
second step could be that if a phrase consists of two sub phrases
<to be><able> also the different sequence <able><to be> could be
found.
Does this clarification helps? Is this goal achievable with the
help of flex and bison?
I think using Flex and Bison might be difficult to use, because they
head towards correct parsing of the language, finding all
possibilities. Your goal is just finding some phrases inside the
program.
It reminds me of the program Eliza, one version is implemented in
Prolog. Have you given though to that?
It is possible to blend the two: The Haskell interpreter Hugs <http://
haskell.org/hugs> has a MiniProlog demo. I translated it into C++,
and replacing its slow non-deterministic parser with a Flex-Bison
combination. Great for experimenting with Prolog derived programming
techniques as it is high level and OO.
Hans Aberg
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison