[antlr-interest] CSharp3 and SQLCLR

David Goodlaxson David.Goodlaxson at microfocus.com
Wed Mar 16 13:20:55 PDT 2011


Hello - (this is probably a query directed to Sam Harwell or Jim Idle)

The short version of this request is that I'd like to get a consistent set of sources and VC projects for the C# port of Antlr3.Runtime and Antlr3.StringTemplate, if that's possible. 

The long version:

For a project I'm currently working on, we'd like to deploy a C# SQL parser and supporting Antlr .dlls to a MS SqlServer 2008 instance (SQLCLR). 

(The parser will parse dynamic SQL from client or server applications and transform it on the fly before it is passed to SQL Server.)

I'm currently working with Sam Harwell's C# port of Antlr 3.3 - Antlr.exe version 3.3.0.7239. I'd like to deploy an assembly of my C# parser, Antlr3.Runtime.dll and Antlr3.StringTemplate.dll to SqlServer.

The existing Antlr3.Runtime and StringTemplate are verifiable (so there's no problem with .NET CLRs), but SQLCLR adds several restrictions (which unfortunately don't seem to be spelled out in one place).

For example, static fields under SQLCLR have to be readonly. This is the output of one of our development tools when run against the Antlr3 runtime:

  E:Antlr3.Runtime failed SQLCLR validation
  E: Location     : G:\AntlrCSharp\Antlr3.Runtime.dll
.NET Version : 3.3.0.7239
File Version : 3.3.0.7239

  E:Type : Antlr.Runtime.Tree.TreeParser ->
  E: Field dotdot should be readonly
  E: Field doubleEtc should be readonly
  E: Field dotdotPattern should be readonly
  E: Field doubleEtcPattern should be readonly

There's also a (probably minor) wrinkle in that SQLServer 2008 is locked into .Net V2 for now: 
- http://blogs.msdn.com/b/dohollan/archive/2010/07/08/sql-server-2008-r2-sqlclr-net-framework-version.aspx

My question is, what's the best way for me to proceed with this project? Can I get a consistent set of sources and visual studio projects that will let me modify and build Antlr3.Runtime.dll and Antlr3.StringTemplate, and see whether I can make SQLCLR happy with them?

I tried pulling down the Antlr3.StringTemplate from github, but it only had a repository link to Antlr3.Runtime, so I wasn't able to build it.

Thanks,
Dave Goodlaxson
 
Please consider the environment before printing this e-mail.
This message has been scanned by MailController - portal1.mailcontroller.co.uk


More information about the antlr-interest mailing list