Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Design Error (and its Solution) in SQL Query Parser?
Design Error (and its Solution) in SQL Query Parser? [message #585463] Fri, 27 April 2007 08:03
Christian Beckel is currently offline Christian BeckelFriend
Messages: 14
Registered: July 2009
Junior Member
This is a multipart message in MIME format.
--=_alternative 002C3AF5C12572CA_=
Content-Type: text/plain; charset="US-ASCII"

Hello,

After spending a long time on extending the SQL Query Parser and the
corresponding Lexer I'm quite sure there must be something wrong in the
SQL parser code (package org.eclipse.datatools.sqltools.parsers.sql).

The class SQLParserManager, which is to be extended by each parser
extension, provides an abstract method to create and obtain the
corresponding Lexer before the parsing process. However, it returns an
object of type SQLLexer, being the lpg-generated lexer rather than the
Abstract Lexer which can be used as a base class for custom Lexers.

This fact that an SQLLexer object is needed rather than an
AbstractSQLLexer makes it impossible to use a custom Lexer, since the
lpg-generated class SQLLexer is not extendable. Changing each occurrence
of SQLLexer in the SQLQueryManager to AbstractSQLLexer solves this problem
easily, and has no effect on the rest of the parser (since all the methods
which are called during the lexing process are declared by the abstract
class, anyway.

What's the best way to fix this important problem? Should I provide a
patch to someone?

Greetings,

Christian Beckel

--=_alternative 002C3AF5C12572CA_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Hello,</font>
<br>
<br><font size=2 face="sans-serif">After spending a long time on extending
the SQL Query Parser and the corresponding Lexer I'm quite sure there must
be something wrong in the SQL parser code (package org.eclipse.datatools.sqltools.parsers.sql).</font>
<br>
<br><font size=2 face="sans-serif">The class SQLParserManager, which is
to be extended by each parser extension, provides an abstract method to
create and obtain the corresponding Lexer before the parsing process. However,
it returns an object of type SQLLexer, being the lpg-generated lexer rather
than the Abstract Lexer which can be used as a base class for custom Lexers.</font>
<br>
<br><font size=2 face="sans-serif">This fact that an SQLLexer object is
needed rather than an AbstractSQLLexer makes it impossible to use a custom
Lexer, since the lpg-generated class SQLLexer is not extendable. Changing
each occurrence of SQLLexer in the SQLQueryManager to AbstractSQLLexer
solves this problem easily, and has no effect on the rest of the parser
(since all the methods which are called during the lexing process are declared
by the abstract class, anyway.</font>
<br>
<br><font size=2 face="sans-serif">What's the best way to fix this important
problem? Should I provide a patch to someone?</font>
<br>
<br><font size=2 face="sans-serif">Greetings,</font>
<br>
<br><font size=2 face="sans-serif">Christian Beckel</font>
<br>
--=_alternative 002C3AF5C12572CA_=--
Previous Topic:Bug in the ProfileDetailsPropertyPage's classes
Next Topic:Object type parameters and results for ODA
Goto Forum:
  


Current Time: Fri Apr 26 20:22:31 GMT 2024

Powered by FUDForum. Page generated in 0.02612 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top