Programatica Tools

Directory tools/base/defs

The README file is displayed below the directory index.

NameLast modifiedSize
Parent Directory  -
DefinedNames.hs2005-07-21 00:02 2.7K
DefinedNamesBase.hs2005-07-21 00:02 956
DefinedNamesBaseStruct.hs2005-07-21 00:02 4.3K
Flags.ghc2006-04-27 03:28 105
FreeNames.hs2005-05-12 22:58 2.1K
FreeNamesBase.hs2002-10-23 00:28 597
FreeNamesBaseStruct.hs2005-10-11 01:09 4.9K
NameMaps.hs2005-05-03 09:23 3.2K
NameMapsBase.hs2002-03-05 03:04 1.1K
NameMapsBaseStruct.hs2004-12-16 01:36 8.4K
PNT.hs2005-05-19 04:48 1.8K
ReAssoc.hs2002-10-20 09:12 1.9K
ReAssocBase.hs2004-12-06 23:36 815
ReAssocBaseStruct.hs2004-12-06 23:36 3.7K
ReAssocModule.hs2002-10-22 23:42 633
ScopeModule.hs2009-01-04 11:18 8.7K
ScopeNames.hs2003-03-04 06:17 938
ScopeNamesBase.hs2001-10-29 22:37 507
ScopeNamesBaseStruct.hs2005-05-12 22:58 5.6K
Tst.hs2005-06-25 09:06 639
UniqueNames.hs2009-01-04 11:18 2.6K
tests/2002-02-01 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.