Programatica Tools

Directory tools/base/defs

The README file is displayed below the directory index.

NameLast modifiedSize
Parent Directory  -  
DefinedNames.hs21-Jul-2005 00:02 2.7K 
DefinedNamesBase.hs21-Jul-2005 00:02 956  
DefinedNamesBaseStruct.hs21-Jul-2005 00:02 4.3K 
Flags.ghc27-Apr-2006 03:28 105  
FreeNames.hs12-May-2005 22:58 2.1K 
FreeNamesBase.hs23-Oct-2002 00:28 597  
FreeNamesBaseStruct.hs11-Oct-2005 01:09 4.9K 
NameMaps.hs03-May-2005 09:23 3.2K 
NameMapsBase.hs05-Mar-2002 03:04 1.1K 
NameMapsBaseStruct.hs16-Dec-2004 01:36 8.4K 
PNT.hs19-May-2005 04:48 1.8K 
ReAssoc.hs20-Oct-2002 09:12 1.9K 
ReAssocBase.hs06-Dec-2004 23:36 815  
ReAssocBaseStruct.hs06-Dec-2004 23:36 3.7K 
ReAssocModule.hs22-Oct-2002 23:42 633  
ScopeModule.hs21-Jul-2005 00:02 8.7K 
ScopeNames.hs04-Mar-2003 06:17 938  
ScopeNamesBase.hs29-Oct-2001 22:37 507  
ScopeNamesBaseStruct.hs12-May-2005 22:58 5.6K 
Tst.hs25-Jun-2005 09:06 639  
UniqueNames.hs17-Feb-2004 19:59 2.6K 
tests/01-Feb-2002 00:13 -  
Extensible Haskell front-end for the Programatica projects - directory base/parse2

Extensible Haskell front-end for the Programatica projects

What is in this directory (base/defs)

This directory defines functions for identifiers in abstract syntax trees. We use overloading to allow the same function names to be reused in extended versions of the syntax. The functions are thus methods in a small number of classes. These classes are:

Class Description
DefinedNames
ClassMethods
...
A method to compute the set of names introduced by declarations and patterns. Also, in a separate class, a method to compute the set of methods defined by a class declaration.
FreeNames A method to compute the set of names that occur free in declarations, expressions, patterns and type expressions
NameMaps Traverse an abstract syntax tree and apply a given function to every identifier. Some context information is provided by the traversal function.
ReAssoc Rewrite expressions according to operator precedence and associativity.
ScopeNames Pair identifiers with the environment in which it should be interpreted.

For each of these classes, there is

  1. one module defining the class and some related auxiliary functions,
  2. one module defining re-usable instances for the base language structure,
  3. one module defining the knot-tying recursive definitions for the base language (Haskell 98).
Modules
Class definition re-usable instances knot-tying instances
DefinedNames DefinedNamesBaseStruct DefinedNamesBase
FreeNames FreeNamesBaseStruct FreeNamesBase
NameMaps NameMapsBaseStruct NameMapsBase
ReAssoc ReAssocBaseStruct ReAssocBase
ScopeNames ScopeNamesBaseStruct ScopeNamesBase

There are some additional modules in this directory:

ModulePurpose
PNT A data type PNT for identifiers carrying information on what unique entity it refers to, what type of entity it is (class, type, value, ...) and the position where it occurred in the source code.
UniqueNames Data type Orig (origin) to identity where something is defined. Data type PN to tag an identifier with an origin.
ReAssocModule A function for applying the reAssoc method to a module in the appropriate top level environment.
ScopeModule Functions for applying the scoping pass to a module. The output is an abstract syntax tree containing identifiers of type PNT.