3 Jun 08:24
Nabialek trick
Thomas Taylor <thomas.taylor <at> univie.ac.at>
2008-06-03 06:24:50 GMT
2008-06-03 06:24:50 GMT
Hi all, Just wanted to point out that although the example given in the documentation in Techniques/Nabialek trick is functional, I recommend an additional alert: If the rule that is used as target (the rest rule in the example) is declared but not defined everything is fine. However when this rule is also defined unexplained behaviour is the result. In my case valgrind detected lots of invalid reads (trying to read parts of previously free'd memory) and various legal code snippets suddenly seemed to cause a segmentation fault. Maybe this requirement to declare but not define the nabialek trick target rule can be deduced from the documentation, but it was not very obvious to me. Regards, Thomas ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
The first thing I should mention is that the SQL parser is very much
meant as a "toy SQL" parser - not for "real-world" or production use.
It only parses the "select" clause of SQL and even then, not all of that
is supported. It's been a while since I updated or used it, but iirc
sub-queries like the one that you've described aren't supported (not
yet, anyway... ;) ).
Having said that, just in the last few minutes I've downloaded the SQL
parser and made a small modification to it. It is now able to parse
phrases like -
Select mytable.myfielda, mysubquery.myfieldb from mytable;
Select mytable.myfielda as test1, mysubquery.myfieldb as test2 from mytable;
( Don't forget the semicolon at the end of the SQL query.... )
I'll email the amended code to you in a few minutes (direct to your
address to avoid flooding the list with m attachment... :) )
Enjoy! HTH - Bye for now -
- Andy
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
RSS Feed