Analysis for bodies of functions

Bueno, Denis denbuen at
Thu Jun 25 15:22:46 EDT 2009

On 6/25/09 12:30 PM, "Aaron Tomb" <aarontomb at> wrote:
> If you look at the darcs version of the package:
>     darcs get
> you'll find a number of new functions. In particular, you might find
> analyseFunctionBody, tExpr, and tStmt to be interesting. If you use
> the traversal monad in Language.C.Analysis.TravMonad you can register
> callbacks at various points in the traversal.

If this is the way I need to get the results of analysing the function body,
I can do it.

> There is no code, right now, to return a table of the sort returned by
> analyseAST that includes local variables, but it might not be hard to
> write one.

I did actually check out darcs -- excellent!  I saw that function, but
wasn't sure, since the code hasn't been released, if it was just stubbed, or
really implemented.  I'm willing to debug it, if I run into problems.

Would one write such a table by gradually accumulating into a table using
the callbacks of the TravMonad?

> Also, the type checking code in tExpr and tStmt is still experimental.
> I think it works in many or most cases, but I'm not positive that it's
> entirely correct.

Type checking doesn't matter much to me, as in my application I'll be
parsing/analysing code I know compiles.


More information about the Language-c mailing list