SQL Parser/Lexer Extension [message #28496] |
Tue, 03 April 2007 12:59 |
Christian Beckel Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Hello,
I'm extending the extendable SQL Query Parser, being a part of the
SQLTools.
My goal is to add a new keyword to the lexer and add a simple rule to the
parser, containing this keyword.
Extending the parser works fine, but I realized that the base SQL Parser
expects a lexer of type org.eclipse.datatools.sqltools.parsers.sql.lexer,
which is generated with lpg. Thus, copying & extending the lpg files in
order to create my own lexer doesn't work. However, referring to a
presentation given on EclipseConn, that should be the way to do it:
1. Copy LPG lexer template
2. Modify grammar rules in lexer
3. Generate lexer code
Unfortunately, there is no more information available. How can I extend
the parser in a way to use my own Lexer rather then the default one? I
also had the idea to use the default lexer and just add my own lpg-created
SQLKeywordLexer instead,However, this didn't work out either, since the
method to check a token for being a keyword is marked as "final" in the
lexer implementation, and thus cannot be overridden.
Thank you for your help,
Christian Beckel
|
|
|
Powered by
FUDForum. Page generated in 0.03199 seconds