Question

I need to write parser for some specific language (subset of SQL). As I know, the easiest way to do this is to define grammar in BNF and use yacc-like tool (I have positive experience with GPPG). But when I started, I've realized that these tools produce parser with dependency on some core parser assemblies (e.g. ShiftReduceParser.dll for GPPG). I need to implement parser for Silverilght, so I can't use libs targeted to full framework.

Are there any parser generator tools which can be used in/for Silverilght?

Was it helpful?

Solution

I don't know what framework libraries you're allowed to use in Silverlight, but Coco/R seems pretty light-weight, just needing some stream/text processing from System.IO and System.Text.

OTHER TIPS

Do you need the parser to run inside Silverlight? Can you not instead get the Server to handle that function via WCF or other transport? That way you can use code that you have prior experience with to perform the parsing.

You might want to try a library like ANTLR. Here's an article that shows how to use it for SQL parsing.

You can use the Jigsaw parsing library which is implemented in C# 4.0. There is a detailed article explaining how to build a parser using it here on CodeProject.com.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top