Hi Jonathan,

On Sat, Mar 02, 2013 at 08:44:10AM -0800, Jonathan Kotker wrote:
> I was looking through the CIL codebase in search of a function that would
> convert a statement into an element of the CIL representation.
> 
> The larger context of this problem is as follows: I have a C file, and I
> also have another file (a non-legal C file) with assignments such as:

It is not clear to me why these statements are not a legal C file.

> The best I could find was the function "cStmt" within "formatCil.ml".

It should help you, indeed.  Did you read the related documentation?
http://kerneis.github.com/cil/doc/html/cil/attributes.html#toc5

So I would try to open the file, read it line by line, and pass each of them to
Formatcil.cStmt (or all at once, and use Formatcil.cStmts ; you have a sample
use of the latter in the link above).  Then, write a simple visitor taking your
list of statements and patching the AST.

Maybe you could give a concrete minimal example of what you are trying to do.

Best,
-- 
Gabriel

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to