[antlr-interest] CSharp3 and SQLCLR

Sam Harwell sharwell at pixelminegames.com
Sat Mar 19 14:39:47 PDT 2011


Hi David,

The latest source distribution of the C# port of ANTLR can be downloaded
from the following link:
http://www.tunnelvisionlabs.com/downloads/antlr/antlr-dotnet-source-3.3.1.77
05.7z

Note that while Antlr3.Runtime uses C# 3 features in only a few places, the
generated grammars and Antlr3.StringTemplate are a completely different
story. The generated grammars use partial methods extensively, and the
StringTemplate port uses lambda functions very extensively. With work, you
could probably make the grammars/runtime run on .NET 2, but I wouldn't count
on using StringTemplate.

Thank you,
Sam Harwell

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of David Goodlaxson
Sent: Wednesday, March 16, 2011 3:21 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] CSharp3 and SQLCLR

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-sqlcl
r-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

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list