cvs commit: fptools/ghc/compiler Makefile fptools/ghc/compiler/ut ils StringBuffer.lhs fptools/hslibs/lang ForeignObj.hi-boot fptools/ghc/compiler/main HscMain.lhs ParsePkgConf.y fptools/ghc/compiler/ parser Lexer.x Ctype.lhs Parser.y ...
Simon Marlow <[email protected]> Mon, 8 Sep 2003 04:52:27 -0700
| Newsgroups | gmane.comp.lang.haskell.cvs.hslibs |
|---|---|
| Message-ID | <200309081152.EAA04645__49606.2296595939$1063022009@glass.cse.ogi.edu> |
simonmar 2003/09/08 04:52:27 PDT
Modified files:
ghc/compiler Makefile
ghc/compiler/utils StringBuffer.lhs
hslibs/lang ForeignObj.hi-boot
ghc/compiler/main HscMain.lhs ParsePkgConf.y
ghc/compiler/parser Ctype.lhs Parser.y RdrHsSyn.lhs
ghc/compiler/basicTypes IdInfo.hi-boot-6 SrcLoc.lhs
ghc/compiler/rename RnHiFiles.lhs
testsuite/tests/ghc-regress/parser/should_fail all.T
read024.stderr
Added files:
ghc/compiler/parser Lexer.x
Log:
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).
Revision Changes Path
1.253 +42 -44 fptools/ghc/compiler/Makefile
1.60 +109 -453 fptools/ghc/compiler/utils/StringBuffer.lhs
1.5 +1 -1 fptools/hslibs/lang/ForeignObj.hi-boot
1.184 +18 -21 fptools/ghc/compiler/main/HscMain.lhs
1.14 +20 -22 fptools/ghc/compiler/main/ParsePkgConf.y
1.9 +4 -5 fptools/ghc/compiler/parser/Ctype.lhs
1.122 +186 -213 fptools/ghc/compiler/parser/Parser.y
1.57 +77 -78 fptools/ghc/compiler/parser/RdrHsSyn.lhs
1.3 +1 -1 fptools/ghc/compiler/basicTypes/IdInfo.hi-boot-6
1.24 +49 -25 fptools/ghc/compiler/basicTypes/SrcLoc.lhs
1.82 +5 -4 fptools/ghc/compiler/rename/RnHiFiles.lhs
1.13 +2 -1 fptools/testsuite/tests/ghc-regress/parser/should_fail/all.T
1.2 +1 -0 fptools/testsuite/tests/ghc-regress/parser/should_fail/read024.stderr