cil-0.1.0: An interface to CIL.

Language.CIL

Description

Parsing the C Intermediate Language (CIL). CIL provides a manageable means to analyze and compile C code.

The common method to reduce C to CIL is to use the cilly driver:

 cilly --merge --keepmerged { c-files-and-options }

http://cil.sourceforge.net/

Synopsis

Documentation

type Name = StringSource

Identifiers.

data Type Source

Types.

Constructors

Void 
Array Int Type 
Ptr Type 
Volatile Type

A volatile qualified type.

Typedef Type 
Struct [(Name, Type)] 
Union [(Name, Type)] 
Enum [(Name, Int)] 
BitField Type [(Name, Int)] 
StructRef Name

Reference to a struct type.

UnionRef Name

Reference to a union type.

EnumRef Name

Reference to an enum type.

TypedefRef Name

Reference to a previously defined typedef.

Function Type [Type] 
Int8 
Int16 
Int32 
Word8 
Word16 
Word32 
Float 
Double 

Instances

data Init Source

Initialization expressions.

Constructors

Init Expr 
InitList [Init] 

Instances

data Apply Source

Function application.

Constructors

Apply Expr [Expr] 

Instances

parseCIL :: String -> ByteString -> StmtSource

Parses a merged CIL program, given a file name and contents.

position :: Pos a => a -> StringSource

Format the file position of something with ties to the orignial source, like a Stmt or Expr.