diff -ur BNFC-2.4.2.0/formats/haskell2/CFtoAlex2.hs BNFC-2.4.2.0-alex3/formats/haskell2/CFtoAlex2.hs --- BNFC-2.4.2.0/formats/haskell2/CFtoAlex2.hs 2011-10-29 00:19:00.596837566 +0200 +++ BNFC-2.4.2.0-alex3/formats/haskell2/CFtoAlex2.hs 2011-10-29 00:20:26.259836814 +0200 @@ -59,6 +59,7 @@ -- "import " ++ errMod, if shareStrings then "import " ++ shareMod else "", if byteStrings then "import qualified Data.ByteString.Char8 as BS" else "", + "import Data.Word (Word8)", "}", "" ] @@ -208,6 +209,14 @@ " let p' = alexMove p c", " in p' `seq` Just (c, (p', c, s))", "", + "alexGetByte :: AlexInput -> Maybe (Word8,AlexInput)", + "alexGetByte (p, _, s) =", + " case "++stringUncons++" s of", + " "++stringNilP++" -> Nothing", + " "++stringConsP++" ->", + " let p' = alexMove p c", + " in p' `seq` Just ((fromIntegral $ ord c), (p', c, s))", + "", "alexInputPrevChar :: AlexInput -> Char", "alexInputPrevChar (p, c, s) = c", "}"