Re: a better libtds

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Thu, 18 Aug 2011 22:20:44 +0000
Dann Corbit <[email protected]> wrote:

> This is Microsoft's TDS grammar:
> http://msdn.microsoft.com/en-us/library/dd304582%28v=PROT.13%29.aspx

Yes, it's a start, but it's far from complete description.  

The first step is to reduce TDS to BNF.  The step before that (!) might
be to reduce it to a tabular description from which the BNF and
documentation can be generated.  

> A grammar can be turned into a parser and tree walker with a tool
> like the Gold Parser: http://www.devincook.com/goldparser/

Yes, I was thinking along just those lines.  Gold doesn't run on Linux,
though, and LALR is more complex than we need to parse TDS.  

An LL parser looks ahead only one token, enough for TDS.  I had been
thinking about ANTLR, but RDP

http://www.cs.rhul.ac.uk/research/languages/projects/rdp.html

looks promising.  

Because we're adding a build-time dependency, any parser we use
must be freely available and as portable as FreeTDS itself.  And
it's tiny: the RDP source zip archive is 189,628 bytes, less
than 10% of FreeTDS's 2,136,329.  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.