camfort-0.700: CamFort - Cambridge Fortran infrastructure

Safe HaskellNone
LanguageHaskell98

Main

Contents

Synopsis

The main entry point to CamFort

main :: IO () Source

The entry point to CamFort. Displays user information, and handlers which functionality is being requested

Options for CamFort and information on the different modes

Which modes do not require an output

refactorings :: [(String, (FileOrDir -> [Filename] -> FileOrDir -> Options -> IO (), String))] Source

List of refactorings provided in CamFort

analyses :: [(String, (FileOrDir -> [Filename] -> FileOrDir -> Options -> IO (), String))] Source

List of analses provided by CamFort

Usage and about information

Wrappers on all of the features

ast :: [Char] -> t -> [Char] -> t1 -> IO () Source

asts :: FileOrDir -> [Filename] -> t -> t1 -> IO () Source

countVarDecls :: FileOrDir -> [Filename] -> t -> t1 -> IO () Source

loops :: FileOrDir -> [Filename] -> t -> t1 -> IO () Source

lvaA :: FileOrDir -> [Filename] -> t -> t1 -> IO () Source

dead :: FileOrDir -> [Filename] -> FileOrDir -> t -> IO () Source

common :: Directory -> [Filename] -> FileOrDir -> t -> IO () Source

unitCriticals :: FileOrDir -> [Filename] -> t -> [Flag] -> IO () Source

Builders for analysers and refactorings

doAnalysis :: (Program A -> Program Annotation) -> FileOrDir -> [Filename] -> IO () Source

Performs an analysis provided by its first parameter on the directory of its second, excluding files listed by its third

doAnalysisSummary :: (Monoid s, Show s) => (Program A -> s) -> FileOrDir -> [Filename] -> IO () Source

Performs an analysis provided by its first parameter which generates information s, which is then combined together (via a monoid)

doAnalysisReport :: ([(Filename, Program A)] -> (String, t1)) -> FileOrDir -> [Filename] -> t -> IO () Source

Performs an analysis which reports to the user, but does not output any files

doAnalysisReport' :: ([(Filename, Program A)] -> (String, t1)) -> FileOrDir -> [Filename] -> t -> IO () Source

doRefactor :: ([(Filename, Program A)] -> (String, [(Filename, Program Annotation)])) -> FileOrDir -> [Filename] -> FileOrDir -> IO () Source

Performs a refactoring provided by its first parameter, on the directory of the second, excluding files listed by third, output to the directory specified by the fourth parameter

Source directory and file handling

readParseSrcDir :: FileOrDir -> [Filename] -> IO [(Filename, SourceText, Program A)] Source

Read files from a direcotry, excluding those listed by the second parameter

isFortran :: [Char] -> Bool Source

predicate on which fileextensions are Fortran files

readParseSrcFile :: Filename -> IO (Filename, SourceText, Program A) Source

Read a specific file, and parse it

checkDir :: [Char] -> IO () Source

Creates a directory (from a filename string) if it doesn't exist

outputFiles :: FileOrDir -> FileOrDir -> [(Filename, SourceText, Program Annotation)] -> IO () Source

Given a directory and list of triples of filenames, with their source text (if it exists) and their AST, write these to the director

changeDir :: Eq a => [a] -> [a] -> [a] -> [a] Source

changeDir is used to change the directory of a filename string. If the filename string has no directory then this is an identity

outputAnalysisFiles :: FileOrDir -> [Program Annotation] -> [Filename] -> IO () Source

output pre-analysis ASTs into the directory with the given file names (the list of ASTs should match the list of filenames)

parse :: Filename -> IO (Program ()) Source

parse file into an un-annotated Fortran AST

fileExt :: [Char] -> [Char] Source

extract a filename's extension

Simple example

fooTrans :: Data from => from -> from Source

A simple, sample transformation using the transformBi function

doFooTrans :: FilePath -> IO (String, [ProgUnit Annotation]) Source

Parse a file and apply the fooTrans transformation, outputting to the filename + .out