[antlr-interest] Re:SQL CSharp parser:Its working! Thank you..

Addi Jamshidi ajpb at yahoo.com
Fri Nov 15 02:50:47 PST 2002


Brian,

My reason for XML is so the parser can be used as an
independent multi-language, multi-platform component.
The parser is in C#, and yet there are interfaces from
C++, C, and even Java that would use the component.
They simply send the SQL to be parsed in some form of
a string prsentation, and in turn they will receive a
string that is a description of the parsed tree.
"string" object is the only common thing all languages
and platforms have in common, and XML seems to be the
perfect solution for this ( but of course I maybe
overlooking something - which most likely can very
well be the case)!

Having said that, for now I really dont care much
about making this parser so generalized to be useable
from different languages and platforms. So I am
looking for the best, easiest and "QUICKEST" way of
developing the means to traverse through the parsed
tree and extract the meta data (something that using
XML DOM would otherwise provide)...

> Well, maybe you could try to use the built-in AST 
> serialization-to-XML mechanism 

Can you elaborate on this? This sounds interesting but
not sure if it means what it implies. So I will be
thankful if you can explain this a bit more as what
this would mean and how I can do it?

> consider
> creating an ANTLR 
> TreeParser to extra the metadata. An ANTLR
> TreeParser should be simpler 
> and easier to maintain

Again if I can have more info on this and what this
means and would involve I will be most thankful.. Have
not looked at the documentation on ANTLR, but I assume
this is explained in detail ?? 

Your thoughts on this are greatly appreciated.

Regards,

- Addi


--- Brian Smith <brian-l-smith at uiowa.edu> wrote:
> Addi,
> 
> Why are you wanting to generate XML? IMO, that is
> just an extra step 
> that will cause you extra work. You should consider
> creating an ANTLR 
> TreeParser to extra the metadata. An ANTLR
> TreeParser should be simpler 
> and easier to maintain than whatever you would use
> to process your XML. 
> You will probably have to do this anyway to generate
> the XML as far as I 
> can tell. Well, maybe you could try to use the
> built-in AST 
> serialization-to-XML mechanism and then writing an
> XSLT stylesheet....
> 
> IMO, XML is a tool to use when you can't find a
> parser and can't create 
> one with reasonable effort, or when you need to
> communicate with people 
> that don't have a parser and you can't give them
> yours. In your case, 
> you have a parser that you seem happy with, and
> there is no standard SQL 
> interchange format that I am aware of; the closest
> thing I can think of 
> off the top of my head is OMG CWM+XMI but there are
> not many free tools 
> for that and XMI is difficult to process by hand.
> So, I doubt XML will 
> have any benefits in this situation; that is
> probably why you have had 
> trouble finding tools for XML-ized SQL.
> 
> - Brian
> 
> 
> Addi Jamshidi wrote:
> > Sorry for the bandwidth again...
> > Just wanted to say that I have truly come to
> > appreciate Antlr. This is really a great tool.
> > 
> > I just used the Antlr SQL grammar that is provided
> by
> > Mr. Brent Wiese, and also using the C# parser
> > generator by Michael J., and it works great!
> Needed to
> > do some manual fixing of the generated Csharp
> code,
> > but it was minor.. 
> > 
> > So THANK you Michael J., and Brent Wiese.
> > 
> > Now the only thing that is left is to come up with
> > some sort of a XML schema and have the parser
> generate
> > its parsed tree based on that schema.. Any input
> > and/or help is greatly appreciated. I have zipped
> up
> > the SQL CSharp parser (it is about 280KB) and I
> will
> > be more than happy to send it to anyone who is
> > interested in contributing...
> > 
> > The ironic thing about ANTLR is that not too many
> > people know about it -- or perhaps it is only the
> > ignorants who do not know about it and come to
> know of
> > it purely by accident - as I did... :)
> > 
> > Best Regards,
> > 
> > Addi Jamshidi
> > 
> > 
> > 
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Web Hosting - Let the expert host your site
> > http://webhosting.yahoo.com
> > 
> >  
> > 
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/ 
> > 
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/ 
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list