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 #30230] Fri, 27 April 2007 08:03 Go to next message
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_=--
Re: Design Error (and its Solution) in SQL Query Parser? [message #30446 is a reply to message #30230] Thu, 03 May 2007 20:31 Go to previous message
Brian Payton is currently offline Brian PaytonFriend
Messages: 154
Registered: July 2009
Senior Member
I agree this is a problem. Our example parsers either use the SQLLexer
class directly or extend it, rather than creating a new lexer. Please
open a bug report for Data Tools in Bugzilla, component SQL Query
Parser, and attach a patch file.

Regards,
Brian Payton
DTP SQL Development Tools committer

cbeckel@de.ibm.com wrote:
>
> 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
Re: Design Error (and its Solution) in SQL Query Parser? [message #585541 is a reply to message #30230] Thu, 03 May 2007 20:31 Go to previous message
Brian Payton is currently offline Brian PaytonFriend
Messages: 154
Registered: July 2009
Senior Member
I agree this is a problem. Our example parsers either use the SQLLexer
class directly or extend it, rather than creating a new lexer. Please
open a bug report for Data Tools in Bugzilla, component SQL Query
Parser, and attach a patch file.

Regards,
Brian Payton
DTP SQL Development Tools committer

cbeckel@de.ibm.com wrote:
>
> 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
Previous Topic:Object type parameters and results for ODA
Next Topic:SQL Parsing of DB2 dialect
Goto Forum:
  


Current Time: Thu Sep 19 02:14:35 GMT 2024

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

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

Back to the top