[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Illogical parser hang
From: |
Karel Kulhavy |
Subject: |
Illogical parser hang |
Date: |
Tue, 9 Oct 2007 12:12:24 +0200 |
User-agent: |
Mutt/1.5.12-2006-07-14 |
Hello
I wrote a simple grammar that has only one symbol 'a' and a reduce reduce
conflict. Yet, if I feed a single 'b' as a text to the input, the parser
generated by Bison hangs. Shouldn't it be immediately obvious to the parser
that if there is no 'b' in the grammar and the first token he gets on the input
is 'b' that the input is invalid?
See attached pinnacle.tgz, unpack it and enter. Then type "make". It will
demonstrate the hang.
How I came to the problem - I am writing a BASIC interpreter. I discovered it
hangs if someone accidentally types ';' after a command even when ';' is an
invalid token in the BASIC and is never used in the grammar. I simplified the
compiler as much as was possible while it still hangs and got this.
CL<
pinnacle.tgz
Description: application/tar-gz
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Illogical parser hang,
Karel Kulhavy <=