[edit] keep in mind this is just a simple example. Awk is just one tool in the toolbox.<p>Take a look at &#x27;The AWK Programming Language &#x27; Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger.<p><a href="http:&#x2F;&#x2F;www.amazon.com&#x2F;The-AWK-Programming-Language-Alfred&#x2F;dp&#x2F;020107981X" rel="nofollow">http:&#x2F;&#x2F;www.amazon.com&#x2F;The-AWK-Programming-Language-Alfred&#x2F;dp...</a><p>Yes, its that Aho and Kerninghan...<p>operators to C function mapping. you can run like so.<p>$ awk -f fixed.awk &lt; fixst.in &gt; fixed.c<p>--- fixed.awk ---<p><pre><code>  BEGIN {
  	printf(&quot;#include &lt;stdio.h&gt;\n&quot;);
  	printf(&quot;typedef long fixed;\n&quot;);
  	printf(&quot;void *send(fixed *this, char *message, ...);\n&quot;);
  }
  &#x2F;^{&#x2F; { 
  	Ndecl = 0;
  	printf(&quot;{\n&quot;);
  }
  &#x2F;^}&#x2F; { 
  	while(--Ndecl &gt;= 0)
  		printf(&quot;\t%s\n&quot;, Destructor[Ndecl]);
  	printf(&quot;}\n&quot;);
  }
  &#x2F;^:&#x2F; {
  	if($2~&#x2F;fixed&#x2F;) {
  		sub(&#x2F;;&#x2F;, &quot;&quot;, $3);
  		printf(&quot;\tfixed *%s = send(NULL, \&quot;fixed\&quot;);\n&quot;, $3);
  		Destructor[Ndecl++] = &quot;send(&quot; $3 &quot;, \&quot;~fixed\&quot;);&quot;
  	}
  	else if ($4 ~ &#x2F;(double)&#x2F;) {
  		sub(&#x2F;;&#x2F;, &quot;&quot;, $5);
  		printf(&quot;\tsend(%s, \&quot;double\&quot;, &amp;%s);\n&quot;, $5, $2);
  	}		
    	else if ($3 ~ &#x2F;^=&#x2F;) {
     		sub(&#x2F;;&#x2F;, &quot;&quot;, $4);
    		printf(&quot;\tsend(%s, \&quot;=\&quot;, %s);\n&quot;, $2, $4);
    	}
    	else if ($3 ~ &#x2F;^\+&#x2F;) {
    		sub(&#x2F;;&#x2F;, &quot;&quot;, $4);
  		printf(&quot;\tsend(%s, \&quot;+=\&quot;, %s);\n&quot;, $2, $4);
  	}
  	else if ($3 ~ &#x2F;^\*&#x2F;) {
  		sub(&#x2F;;&#x2F;, &quot;&quot;, $4);
  		printf(&quot;\tsend(%s, \&quot;*=\&quot;, %s);\n&quot;, $2, $4);
  	}
  }
  &#x2F;^[^{}:]&#x2F; { print }
</code></pre>
--- fixst.in ---<p><pre><code>  int main()
  {
  :	fixed a;
  :	fixed b;
  :	fixed t0;
  :	fixed t1;
  	double f;
  :	a  = 1.00;
  :	b  = 9.99;
  :	t0 = 0.00;
  :	t1 = 2.00;
  :	t0 += t1;
  :	t0 *= b;
  :	t0 += a;
  :	f  = (double)t0;
  }</code></pre>