ANNOUNCE: Alex version 2.0
I am pleased to announce version 2.0 of Alex, the lexical analyser generator for Haskell. Based on Chris Dornan's original version of Alex, this new version contains some significant changes: - A revised syntax, more closely matching that of lex and Happy. - A rewritten back-end, producing smaller, faster, lexers. - A more flexible programmer interface, allowing simple tokenisers to be produced with very little code, and allowing monads to be threaded through the lexer. Read the release notes for the full story: http://www.haskell.org/alex/doc/html/about.html#RELNOTES This version has been tested on GHC: I have a development version of GHC using an Alex lexer, which beats the orignal hand-optimised lexer. Distributions can be obtained from Alex's new home: http://www.haskell.org/alex/ Alex is now distributed under a BSD-style license. Share and enjoy, Simon Marlow: simonmar@microsoft.com Chris Dornan: cdornan@arm.com Isaac Jones: ijones@syntaxpolice.org
Has anyone an example of <reg>{n,k} regular expression in Alex 2.0? I can not get them to work, alex won't parse them (not the way I write them anyway) Immanuel -- *************************************************************************** It makes me uncomfortable to see An English spinster of the middle class Describe the amorous effects of `brass', Reveal so frankly and with such sobriety The economic basis of society. W.H. Auden -- Immanuel Litzroth Software Development Engineer Enfocus Software Kleindokkaai 3-5 B-9000 Gent Belgium Voice: +32 9 269 23 90 Fax : +32 9 269 16 91 Email: Immanuell@enfocus.be web : www.enfocus.be ***************************************************************************
On Friday 22 August 2003 13.04, Immanuel Litzroth wrote:
Has anyone an example of <reg>{n,k} regular expression in Alex 2.0? I can not get them to work, alex won't parse them (not the way I write them anyway) Immanuel
Hi, Here comes a silly example which in any case works as expected on my linux system with alex and ghc. file "foo.x" contains: ------------------------------------ { module Main (main) where } %wrapper "basic" words :- $white+ ; A{3,5} { \s -> () } { main = do s <- getContents print (length (alexScanTokens s)) } ------------------------------------------- % alex foo.x % ghc --make foo.hs % a.out < testfile.txt Regards Per
"Per" == Per Larsson <per@L4i.se> writes: Per> Here comes a silly example which in any case works as Per> expected on my linux system with alex and ghc.
Per> file "foo.x" contains: ------------------------------------ { Per> module Main (main) where } Per> %wrapper "basic" Per> words :- Per> $white+ ; A{3,5} { \s -> () } Per> { main = do s <- getContents print (length (alexScanTokens Per> s)) } ------------------------------------------- Per> % alex foo.x % ghc --make foo.hs % a.out < testfile.txt Per> Regards Per _______________________________________________ Per> Haskell mailing list Haskell@haskell.org Per> http://www.haskell.org/mailman/listinfo/haskell ok, i'll try this, but I was trying to write the in the regexp section, e.g. @test = A{3,4} and that did not work. Should it? Immanuel -- *************************************************************************** It makes me uncomfortable to see An English spinster of the middle class Describe the amorous effects of `brass', Reveal so frankly and with such sobriety The economic basis of society. W.H. Auden -- Immanuel Litzroth Software Development Engineer Enfocus Software Kleindokkaai 3-5 B-9000 Gent Belgium Voice: +32 9 269 23 90 Fax : +32 9 269 16 91 Email: Immanuell@enfocus.be web : www.enfocus.be ***************************************************************************
participants (3)
-
Immanuel Litzroth -
Per Larsson -
Simon Marlow