Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ANN] Shallow Parser for t-SQL

8 views
Skip to first unread message

Shashank Date

unread,
Apr 9, 2005, 5:31:01 PM4/9/05
to
Shallow Parser for t-SQL
------------------------

A library to shallow parse t-SQL statements and generate a simple
data-structure (array of TSQLStmt objects) for further consumption.
t-SQL is the procedural language for Microsoft SQL Server 2000.

Version
-------

0.0.1 (2005/04/09) *** alpha ***

Installation
------------

Download and unzip the zip file in any temporary directory.
Execute the included "install.rb" script:

C:\temp\release\> ruby install.rb

License
-------

Ruby's

Dependencies
------------

None

URL
---

http://rubyforge.org/projects/tsql-analyzer/

Example Usage
-------------

require 'tsql_shparser'

shp = TSQL_ShParser.new.parse("select col1, col2, col3 from Table1")

p shp[0].all_columns.to_arr #-> ['COL1','COL2','COL3']
p shp[0].all_tables.to_arr #-> ['TABLE1']

shp[0].list_select_expressions.map{|e| p e.to_arr}
#-> [["COL1", ","], ["COL2", ","], ["COL3"]]

Warning
-------

This is an alpha release. Plenty of bugs !

BUG REPORTS
-----------

Please make sure that the t-SQL script that exposes a bug, parses
correctly under Query Analyzer before submitting a report.

Author
------

Shashank Date
shank...@yahoo.com


0 new messages