<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Ha haaa!&nbsp; I LOVE this group!&nbsp; While I learn about the CDT (the kind you tramp on in your boots), I find I'm learning something about some CDT computer jargon!&nbsp; Now who'd o' thunk it?&nbsp; <br><br>By the way, I love the CDT-L.&nbsp; I helps me stay motivated, inspired, and it teaches me that there are more things I need to do in the ways of preparing before I can hit the trail.&nbsp; <br><br>About flip-flops ... being about 5'1", I am concerned about river crossings for reasons aside from fast water.&nbsp; I am SHORT!&nbsp; So at first, I had wanted to plan a sobo trip.&nbsp; But when I realized that the waters may be running fast and deep, I wasn't sure that would be feasible for me.&nbsp; So ... I decided to do a nobo.&nbsp; I really want to walk through Montana, though,
 daggummit!&nbsp; And I don't want to have to call my trip short at the very moment I reach the state I want most to visit (oh, I want to see 'em all, but to miss MT would be so disappointing!).&nbsp; I know I could go back and do it the next year if I can plan well enough. So, I wonder about doing a nobo to the Basin, then driving north and flipping back south from Waterton?&nbsp; Might that put me in the Winds at the treacherous time of year, do you think?&nbsp; <br><div>&nbsp;</div>Doris<br><div><div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Jonathan Ley &lt;jonathan@phlumf.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> cdt-l@backcountry.net<br><b><span style="font-weight: bold;">Cc:</span></b> Nicolas Anquetil
 &lt;anquetil.nicolas@gmail.com&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Wed, December 16, 2009 3:26:51 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Cdt-l] finding a function's definition from a call<br></font><br>



  

<font size="2"><font face="Arial">Nicolas,<br>
<br>
To answer your question: Yes, you can analyze C programs using the CDT.
You’ll have lots of quiet time to contemplate such questions, and clear
your head of all the clutter that is probably obfuscating the answers
you seek. However, using the CDT for such a thing can take a while...
maybe up to 5 months to get an answer. And even when you're done, you
might have to use other tools like the AT and PCT to do some comparison
with the CDT results. To answer some other questions you might have…<br>
<br>
-&nbsp; Water is not as much of a problem as you might think, you just have
to plan…<br>
-&nbsp; Pick any route you want in southern NM, they’re all good.<br>
-&nbsp; Most people say the most dramatic scenery is in the Winds<br>
-&nbsp; The Big Sandy situation is a bummer… but if you make a reservation
to stay there, they’ll hold a package for you<br>
-&nbsp; You do need permits in Yellowstone &amp; Glacier, but the process
isn’t so bad… as long as you can stand watching their “bear videos”.<br>
-&nbsp; It depends on the snowpack<br>
-&nbsp; June 15th<br>
<br>
I haven't heard of the AST... where does that go? <br>
<br>
Good luck out there!<br>
<br>
-Jonathan</font></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"></span></font><br>
<br>
<br>
Nicolas Anquetil wrote:
<blockquote type="cite">
  <pre>Hi,<br><br>This is certainly a basic question but I cannot seem to find clear<br>information on the net.<br><br>I want to analyse some C program using CDT.<br><br>When I find in the AST an IASTExpression that I know is a function<br>call (instanceof IASTFunctionCallExpression), how can I find where the<br>function is defined (in what file) ?<br><br>I am experimenting with a simple C project that has 2 files and one<br>function in each file, one of the functions calls the other.<br><br>I could access the name of the FunctionCall and from that the IBinding.<br><br>What next?<br><br>I tried expr.getTranslationUnit().getDefinitionsInAST(name.resolveBinding())<br>with either file as translationUnit<br>but that gave me an empty array :-(<br><br>May be it comes from how I generate the AST?<br><br>ICProject cproj = CoreModel.getDefault().create(proj);<br>for (ICContainer folder : cproj.getSourceRoots()) {<br> for (ITranslationUnit unit :
 folder.getTranslationUnits()) {<br>   IASTTranslationUnit unitAST = unit.getAST();<br>   [...then explore the AST 'unitAST' to find<br>IASTFunctionCallExpression in it ... ]<br><br>Can you help?<br>Please?<br><br>nicolas<br><br>  </pre>
</blockquote>
</div></div></div>
<!-- cg8.c1.mail.mud.yahoo.com compressed/chunked Wed Dec 16 06:16:53 PST 2009 -->
</div><br>

      </body></html>