Wrox Programmer Forums
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 11th, 2005, 01:17 AM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default sql parser

Hi,
I need a sql parser with limited sql statement support.
Now, i have some methods that support read,delete,insert,upadte of records to a text file,and a simple .net provider that supprot filling and updating of DataSet.

Your ideas will help me!


 
Old January 14th, 2005, 04:41 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

well,there are two ways here,
1-writing your own parser,
2-using .NET classes(System.Text.RegularExpression)
---------
about way one,
1-you should write a Context-Free grammar for your statements,your grammars should be unambiguous(because it results more performances)
2-you should write a procedure acts like a Token(it reads every symbol(word) from your statement)
3-you should use a stack and push the first element of your grammar inside it,
4-then you call Token,if TopofStack is noneterminal you should select the right production from your grammar(according to the top of stack and Token)and pop that noneterminal and push other noneterminal Symbols...
if you follow this algorithm you will parse your string(even you can execute some other procedures during you parssing operation..)
this I told you could be very fast(O(n))...(because your context-free grammar was unambiguous)...also in every step of your parssing you can do some other operations according to your requirements in your program.
(this I told you is easy but you should be familiar with the concepts of Context-Free grammars,Scanner,Token,unambiguous Grammars,....)
----------
about way 2
I think you can look inside System.Text.RegularExpressions nemespace and use RegularExpressions for your statements.

_____________________________
Mehdi.
software engineering student.
Looking for a good job for summer 2005.
 
Old January 14th, 2005, 04:50 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

also you can try GoldParser.

_____________________________
Mehdi.
software engineering student.
Looking for a good job for summer 2005.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Html parser francofm76 Pro PHP 1 July 31st, 2007 09:54 AM
Parser Error rwalker Crystal Reports 0 May 8th, 2006 03:47 PM
HTML parser madhukp Classic ASP Basics 1 February 2nd, 2006 05:19 PM
Parser Error ashokparchuri General .NET 0 June 3rd, 2005 03:14 AM
php parser fakhrul Pro PHP 9 August 10th, 2004 11:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.