[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reserved Words
From: |
Mike Aubury |
Subject: |
Reserved Words |
Date: |
Fri, 14 Feb 2003 20:24:15 +0000 |
OK - read everything I can and spent months on this..
I need to be able to write code which will parse :
define date date
or even
define define date
(and a lot more besides...)
which defines a variable called 'date' or 'define' to be a date datatype...
(I didn't write the language)
We've got something that tries to work out whether the next token should be an
identifier or not and runs accordingly, by looking at the y.output and
generating a list of possible next tokens..
This works for 80% of the cases - but we get into problems when we move around
the bison stack...
SO -
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) ?
Are there any hacks I can make in Bison ?
I was thinking about trying YYERROR (if it doesn't process - treat it as an
identifier and try again) - How would I go about this ?
Any help much appreciated..
- Reserved Words,
Mike Aubury <=