title: Good alternative to make a sql-like language transpiler
body: <p>I need to make a DSL which output a SQL-like language. First, I thought in roll my own transpiler using a recursive descent parser + a simple code generation approach. But as the DSL language is really simple and so is the output language, I realized I would try find a less-time and energy, consuming approach where I don't reinvent the wheel, like a more powerful version of C pre-processor. First came on mind was m4, I've had only hear about before, never used it so far. I'm reading some tutorials/documentations but I still unsure if I can accomplish my goal with this tool. 
  For example I want turn:</p>
  
  <pre><code>display a,b,c if a.substring(0, 3) == b.substring(0, 3) and (c + 8 &gt; 20 || c == 0)
  </code></pre>
  
  <p>Would translate into something like that:</p>
  
  <pre><code>SELECT A, B, C from tbl where substring(A, 0, 3) = substring(B, 0, 3) and (c + 8 &gt; 20 or c = 0)
  </code></pre>
  
  <p>So I what's a good way to accomplish this? keep learning <a href="https://en.wikipedia.org/wiki/M4_%28computer_language%29" rel="nofollow"><code>M4</code></a> or should I try another tool (if so, which one) or I'm better off doing my own compiler implementation?</p>