[project @ 2003-09-08 11:52:24 by simonmar]
authorsimonmar <unknown>
Mon, 8 Sep 2003 11:52:27 +0000 (11:52 +0000)
committersimonmar <unknown>
Mon, 8 Sep 2003 11:52:27 +0000 (11:52 +0000)
commit9541ef3440f89f5f275509b1cc64fb9c498dcf73
treea49abc0c10f0c9e5c286ae5fc6fdaaa3eb9cf9b8
parent74fce831a7115e88f374a08d39675c434fbbc07a
[project @ 2003-09-08 11:52:24 by simonmar]
Replace the handwritten lexer with one generated by Alex.

YOU NOW NEED ALEX (v 2.0 or later) TO COMPILE GHC FROM CVS.

Highlights:

  - Faster than the previous lexer (about 10% of total parse time,
    depending on the token mix).

  - More correct than the previous lexer: a couple of minor wibbles
    in the syntax were fixed.

  - Completely accurate source spans for each token are now collected.
    This information isn't used yet, but it will be used to give much
    more accurate error messages in the future.

  - SrcLoc now contains a column field as well as a line number,
    although this is currently ignored when printing out SrcLocs.

  - StringBuffer is now based on a ByteArray# rather than a Ptr, which
    means that StringBuffers are now garbage collected.  Previously
    StringBuffers were hardly ever released, so a GHCi session would
    leak space as more source files were loaded in.

  - Code size reduction: Lexer.x is about the same size as the old
    Lex.lhs, but StringBuffer.lhs is significantly shorter and
    simpler.  Sadly I wasn't able to get rid of parser/Ctypes.hs
    (yet).
ghc/compiler/Makefile
ghc/compiler/basicTypes/IdInfo.hi-boot-6
ghc/compiler/basicTypes/SrcLoc.lhs
ghc/compiler/main/HscMain.lhs
ghc/compiler/main/ParsePkgConf.y
ghc/compiler/parser/Ctype.lhs
ghc/compiler/parser/Lexer.x [new file with mode: 0644]
ghc/compiler/parser/Parser.y
ghc/compiler/parser/RdrHsSyn.lhs
ghc/compiler/rename/RnHiFiles.lhs
ghc/compiler/utils/StringBuffer.lhs