• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Making a parser for SQL?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I been writing a larger project, and as part of the project i need to make standard SQL lex and syntax analyzer - parser. Since i am relatively new to this topic, and there are many experienced members on this forum, i have few questions:

1. Since SQL is common, are there already made parsers that can be downloaded - like some libraries end etc...?

2. If 1. is not the case what is the best way to make a parser. Since this is such lenghty question, i dont expect to to write it here - recommend some tutorials, etc..

Any and all advice is much appriciated.

PS. This parser will just be used for checking syntax and nothing else.
 
Rancher
Posts: 43028
76
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The subject has come up before; do these previous discussions help?
 
Vladislav Simovic
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:The subject has come up before; do these previous discussions help?



They might, i need to study them more carefully.
 
Marshal
Posts: 76862
366
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
Vladislav Simovic
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote: . . . and welcome to the Ranch



Thanks for the welcome ;-)
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ANTLR is a great tool and they have some SQL grammars up there you can just use. ANTLRWorks is free and helps a lot in the grammar debugging process, which is slow and painful

Now, something you must know is that SQL itself isn´t THAT standard. SQL is an ANSI standard but each vendor implement its own subset of it. If you take a look in the small words, you´ll see that each vendor implements different levels of SQL, sometimes adding their own sugar and proprietary extensions. So be careful.

Best regards

Leo K.
 
Don't listen to Steve. Just read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic