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
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to