[antlr-interest] Dynamic token generation
Jan van der Ven
jhvdven at xs4all.nl
Mon Jan 28 14:27:37 PST 2008
Dear Antlr Community,
First of all, let me tell you that our SourceForge project is still
using Antlr 2.7. We are not old-fashioned, we just do not have the time
to cope with all the new versions of the splendid tools we are working with.
Having said that, my problem as described below, might force an upgrade
and if required we will do so.
We are extending the QuantumDB eclipse plugin
(http://sourceforge.net/projects/quantum) with grammar recognition
capabilities. You can find the base grammar file here:
http://quantum.cvs.sourceforge.net/quantum/quantum-plugin/src/com/quantum/core/sql/grammar/DmlSQL2.g?view=log.
It is an adaptation of Mr Vnuk's DmlSQL2.g file. It is full of code. It
handles only SQL-92. Any feedback on the file as it is will be
appreciated, but the problem at hand is the following:
- Each database has its own set of keywords
- Each database has its own set of functions
Quantum uses a JDBC driver to connect to the specific database. Most
drivers report a list of keywords and functions. I would like these to
appear as tokens in the grammar. This means that a rule would refer to a
token as a KEYWORD, but the KEYWORD should be defined at runtime. Is
this possible?
Kind regards,
Jan
More information about the antlr-interest
mailing list