[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison back-tracking
From: |
Akim Demaille |
Subject: |
Re: Bison back-tracking |
Date: |
24 Nov 2000 14:52:25 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
| Backtracking is sometimes required with some grammars, even though Bison
| seems to know how to eliminate that: For example, the grammar
| %token a, b, c, d
| %%
| S: c A d { }
|
| A: a b { } | a { }
| %%
|
| will back-track on the sentence "cad" in a top-down parsing (example 4.14
| from book by Aho et al).
I agree it might be necessary, but after all Bison is here for LALR(1)
period.
In addition recent discussions on the GCC mailing lists seem to reveal
the performances can be really poor (which was expected...).
http://gcc.gnu.org/ml/gcc/2000-11/msg00982.html
| Thanks for pointing this out. I figure the safe way is to abort if the
| error looks serious.
That's safe but not very user friendly. I use many error rules, and
never faced a similar problem. But I do not use actions in between
tokens.