questions

Jonata Goulart jonatahh@hotmail.com
Tue, 20 Aug 2002 14:01:56 +0000


I'm trying to do a simple lex analyser in haskell
I defined the function lexi that is intended to break a string into tokens 
returning them as a list but I received the following error:
ERROR "TesteEval.hs":20 - Syntax error in input (unexpected symbol 
"restante")



isLetter:: Char -> Bool
isLetter c = or [isLower (c), isUpper (c)]

isLetterorDigit:: Char -> Bool
isLetterorDigit c = or [isLetter (c), isDigit (c)]


main = lexi
lexi " "= []
lexi (a:x)
         | isLetter a = token: lexi restante
           where S = takeWhile isLetterorDigit x
line 20 ------>           restante = dropWhile isLetterorDigit x
           token = 'Id' ++ S



_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com