<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi everyone,</p>
let's consider the example:
<p><font face="Courier New, Courier, monospace">int foo(int p) {</font></p>
<p><font face="Courier New, Courier, monospace"> if ( p)</font></p>
<p><font face="Courier New, Courier, monospace"> /* code
path#1 */<br>
</font></p>
<p><font face="Courier New, Courier, monospace"> return 0;</font></p>
<p><font face="Courier New, Courier, monospace"> else {</font></p>
<p><font face="Courier New, Courier, monospace"> /* code
path#2 */<br>
</font></p>
<p><font face="Courier New, Courier, monospace"> return 1;<br>
</font></p>
<p><font face="Courier New, Courier, monospace"> }</font></p>
<p><font face="Courier New, Courier, monospace">}<br>
</font></p>
<p>1. What is the best solution to get the string representation of
the expression of a return statement?</p>
<p>2. Because I want to perform some transformation with return
statements I have to figure out if they are enclosed in a block? <br>
</p>
<p>The example above should be transformed in something like<br>
</p>
<p><font face="Courier New, Courier, monospace">int foo(int p) {</font></p>
<p><font face="Courier New, Courier, monospace"> if ( p) { /*
<---- */<br>
</font></p>
<p><font face="Courier New, Courier, monospace"> /* do some
processing ... */<br>
</font></p>
<p><font face="Courier New, Courier, monospace"> return 0;</font></p>
<p><font face="Courier New, Courier, monospace"> } /* <--- */<br>
</font></p>
<p><font face="Courier New, Courier, monospace"> else {</font></p>
<p><font face="Courier New, Courier, monospace"> /* do some
processing ... */<br>
</font></p>
<font face="Courier New, Courier, monospace"> return 1;<br>
</font>
<p><font face="Courier New, Courier, monospace"> }</font></p>
<p><font face="Courier New, Courier, monospace">}<br>
</font></p>
Any hints or pointers are welcome.<br>
<p>Thanks</p>
<p>Marcel<br>
</p>
</body>
</html>