cplug-0.2.0.0: Recompile and run partially applied C functions in Haskell, during runtime

Safe HaskellNone
LanguageHaskell2010

Parse

Synopsis

Documentation

parse :: FilePath -> IO (Maybe CTranslUnit) Source

Parse a '.c' file

debugParse :: Bool -> FilePath -> IO (Maybe CTranslUnit) Source

parse, but with debug information

parseFunctions :: FilePath -> IO [CFunctionTemplate] Source

make function templates from a '.c' file

printParsedFunctions :: FilePath -> IO () Source

(For debugging) Print the CFunctionTemplates parsed from a file

fTypeSpec :: CFunctionDef t -> [CDeclarationSpecifier t] Source

`CFunDef [CDeclarationSpecifier a] (CDeclarator a) [CDeclaration a] (CStatement a) a` > CFunDef > [CDeclarationSpecifier a] -- type specifier and qualifier > (CDeclarator a) -- declarator > [CDeclaration a] -- optional declaration list > (CStatement a) -- compound statement a

decIdent :: CDeclarator t -> Maybe Ident Source

decIdent and following are simple unpackers for a datatype from Language.C that I wish used record syntax. `CDeclr (Maybe Ident) [CDerivedDeclarator a] (Maybe (CStringLiteral a)) [CAttribute a] a`

splitTypedVar :: Text -> Maybe (Text, Text) Source

This converts a typed C variable to (type, name), e.g. `"unsigned int x" -> Just ("unsigned int", "x")`. (Returns nothing on empty string.)