Programatica Tools

Directory tools/pfe

The README file is displayed below the directory index.
NameLast modifiedSize
Parent Directory  -
Browser/2009-01-04 11:20 -
Flags.ghc2005-07-21 00:02 875
HuMakefile2003-11-24 23:32 206
Makefile2005-02-02 00:38 1.0K
Now.hs2009-01-04 11:16 73
PFE0.hs2005-10-11 01:09 17K
PFE1.hs2002-03-13 09:26 18
PFE2.hs2006-08-12 01:30 5.5K
PFE3.hs2005-05-03 09:23 3.2K
PFE4.hs2006-08-12 01:30 9.4K
PFE_HTML.hs2004-01-17 01:43 1.7K
PFE_Rewrite.hs2005-07-20 01:36 563
PFE_Rewrites.hs2005-07-20 01:36 812
PFE_StdNames.hs2005-07-20 01:36 1.6K
PFEdeps.hs2005-07-21 00:02 7.8K
Pfe0Cmds.hs2005-06-02 04:10 6.2K
Pfe1Cmds.hs2005-05-19 23:20 1.9K
Pfe2Cmds.hs2005-02-06 04:37 1.4K
Pfe3Cmds.hs2005-02-06 04:37 888
Pfe3Metrics.hs2005-02-06 09:08 1.0K
Pfe4Cmds.hs2009-01-04 11:18 6.5K
PfeChase.hs2005-02-06 04:37 2.4K
PfeCleanCmd.hs2005-02-06 09:08 119
PfeDepCmds.hs2005-06-24 02:51 6.2K
PfeHtmlCmds.hs2004-09-01 23:49 1.3K
PfeInteractive.hs2005-02-06 09:08 1.6K
PfeParse.hs2005-07-21 00:02 3.5K
PfeSocket.hs2004-09-01 23:49 2.1K
PfeTransformCmds.hs2006-06-13 00:15 1.6K
PfeVersionCmd.hs2005-02-06 09:08 183
myghci2005-06-25 09:58 138
myhugs2005-06-25 09:07 53
pfe.hs2005-10-11 01:09 1.2K
pfeclient.hs2003-09-27 00:33 161
pfeclient.sh2003-09-20 00:51 186
pfesetup2006-08-12 01:30 1.9K
tstpfe0.hs2002-05-25 20:03 171
tstpfe1.hs2002-05-25 20:03 164
tstpfe2.hs2002-05-25 20:03 164
tstpfe3.hs2002-05-25 20:03 336

Extensible Haskell front-end for the Programatica project

What is in this directory (pfe)

This directory contains modules implementing PFE, the Preliminary Front-End.

PFE provides the infrastructure to work with Haskell programs consisting of a number of interdependent modules, stored in files. We use the term project to denote a collection of Haskell modules that are to be processed together by PFE.

PFE has built-in make(1)-like functionality: it automatically processes files in the right order, and caches results between runs to avoid reparsing and reanalyzing files that haven't changed.


PFE provides the following functionality, which is available both in the form of command line tools and as Haskell functions:
Level 0
Project management: creating a project, adding/removing files to a project. Computing the module dependency graph. Various module level queries.
Level 1
Computing some module properties that can be determined locally and that does not require proper parsing.
Level 2
Analysis of import/export specifications, to determine what is in scope on the top level of each module. This is based on the code decribed in our paper A Formal Specification for the Haskell 98 Module System.
Level 3
Proper parsing of Haskell modules, taking fixity declarations into account. The identifiers in the output of the proper parser are decorated so that they are unique and you can tell what original entity they refer to.
Level 4
Type checking. The type checker can output a syntax tree decorated with type annotations. It can also perform the dictionary translation.
Level 5
Function level dependency graph. This is done after type checking, to properly account for dependencies involving instance declarations. (The module is called PFEdeps.)
Chase (built on top of level 0)
Import chasing. Searches for source files containing needed modules in specified directories. This function assumes that a module M is stored in a file called M.hs or M.lhs. (This is the only function of PFE that assumes a relation between file names and module names.)
HTML (built on top of level 3)
Conversion to HTML, with highlighting and cross references.


PFE is designed to be extensible in several dimensions:
It should be ease to create new command line tools that inherits and extends the provided functionality.
Language extensions.
PFE is parameterized over the source language parser, so the source language is not hardwired in PFE, but there are some restrictions: See ../property for an example of reusing PFE in an extended language.
Monadic abstraction

Authors: TH
Contact: TH