title: Change SQL table/column names in query using c#
body: <p>I am looking to provide a Web API similar to Facebook's FQL interface.
  <a href="https://developers.facebook.com/docs/reference/fql/" rel="nofollow">https://developers.facebook.com/docs/reference/fql/</a></p>
  
  <p>My idea is to create a mapping of real SQL tables to fake ones, with nice friendly names etc, and then apply a condition to the query submitted to restrict access where needed.</p>
  
  <p>My problem comes in find/replacing the real table/column names with the fake ones. Obvioiusly a find replace is a bit lame - and could be worked around.</p>
  
  <p>My plan is to "read" the posted query, interpret it into an object graph of sorts, then recreate the query swapping in the relevant names and appending my mandatory conditions for the table in question.</p>
  
  <p>Does anyone have any ideas on a better way to do this OR some tips on creating an object graph of the query? I have tried traditional lexer/parser techniques but I am struggling to make the code obviously readable. Is there something I could use pre-made?</p>