Language.C.Analysis.AstAnalysis

language-c-0.3.2.1: Analysis and generation of C code

Portability | ghc
Stability | alpha
Maintainer | benedikt.huber@gmail.com
Safe Haskell | None

Language.C.Analysis.AstAnalysis

Description

Analyse the parse tree

Traverses the AST, analyses declarations and invokes handlers.

Synopsis

- analyseAST :: MonadTrav m => CTranslUnit -> m GlobalDecls
- analyseExt :: MonadTrav m => CExtDecl -> m ()
- analyseFunDef :: MonadTrav m => CFunDef -> m ()
- analyseExtDecls :: MonadTrav m => CDecl -> m ()

# Documentation

analyseAST :: MonadTrav m => CTranslUnit -> m GlobalDecls

Analyse the given AST

`analyseAST ast` results in global declaration dictionaries. If you want to perform specific actions on declarations or definitions, you may provide callbacks in the `MonadTrav` `m`.

Returns the set of global declarations and definitions which where successfully translated. It is the users responsibility to check whether any hard errors occured (`runTrav` does this for you).

analyseExt :: MonadTrav m => CExtDecl -> m ()

Analyse an top-level declaration

analyseFunDef :: MonadTrav m => CFunDef -> m ()

Analyse a function definition

analyseExtDecls :: MonadTrav m => CDecl -> m ()

Analyse a top-level declaration other than a function definition