[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reserved Words
From: |
Akim Demaille |
Subject: |
Re: Reserved Words |
Date: |
Thu, 20 Feb 2003 15:57:10 +0100 |
User-agent: |
Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 |
| Is there a version of Bison which can handle this situation ?
|
| Are there any simple solutions (maybe using other compatible
| compilers - I've got a lot of code so I don't want to manually
| convert it) ?
You might want to try recent versions of Bison, and the GLR output.
The idea is:
string: DEFINE;
string: DECLARE;
string: DATE;
definition: DEFINE string string
etc. for each keyword. Then, the GLR parser will keep only the valid
interpretation, even with "define define define" (not that I would
recommend such a syntax).
| Are there any hacks I can make in Bison ?
Yep. Look for Heisenberg tokens on the web, it's an alternative.