Question

I now think about write a parser to parse Logical Expressions Relational Algebra to T-Sql Codes and vice-versa! Whether there is an parser to do this? Otherwise how can i do this? What is the basics of writing a parser?

Was it helpful?

Solution

If you don't know the basics of parsing and translation, you need to spend significant energy there first or you will likely not succeed. (Sorry).

This SO answer gives you pointers to the background you need:

Learning to write a compiler

OTHER TIPS

You would do well to look at LINQ expression trees (System.Linq.Expressions), and note that this (in the expression -> TSQL direction) is exactly what LINQ-to-SQL and similar tools do.

Expression trees are designed to be parsed in this manner; However for TSQL -> expression... that is going to be trickier since it is not a simple language, and was not designed for this deconstruction.

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