[cvs-nhc98] Add new trace transformation phase (just after parsing)

User olaf olaf@sparud.net
Wed, 25 Jul 2001 15:17:09 +0200 (CEST)


olaf: Wed Jul 25 15:17:09 CEST 2001

Update of /usr/src/master/nhc/src/compiler98
In directory hinken:/tmp/cvs-serv14588/src/compiler98

Modified Files:
	DbgDataTrans.hs Main.hs Remove1_3.hs TokenId.hs TokenInt.hs 
	TraceId.hs 
Added Files:
	TraceTrans.hs 
Log Message:
Add new trace transformation phase (just after parsing)

The new module TraceTrans is a completely rewritten version of DbgDataTrans and DbgTrans. If you call nhc with -hx it will, after parsing, read and write the .hx files, then apply the new transformation and finally pretty print the result of the transformation. Nearly all names are prefixed by a character.

Note that the new transformation only is for untrusted traced modules. Until a wrapping scheme for trusted modules makes the prelude available, the transformation cannot be properly trusted.

The transformation also needs some new trace generating combinators that are not yet implemented:
mkModule, mkPos, mkAtomId

It also assumes that all combinators are imported from module "T", not the prelude any more (but easy to change for testing).

A few language constructs are still missing, but it should yield syntactically correct transformed Haskell programs for most input.

To handle imports (and exports) of the form TyCon(..) correctly, TraceId should provide an additinal function tyConDataCons :: TraceId -> Maybe [TraceId] that returns the data constructors for a type constructors, if the traceId is a type constructor and all data constructors are exported.