Re: [Haskell-cafe] happy + alex parsing question

2011-02-17 Thread Roman Dzvinkovsky
Thanks, adding state to lexer seems to be the way to go. 2011/2/16 Mihai Maruseac mihai.marus...@gmail.com On Wed, Feb 16, 2011 at 5:31 PM, Roman Dzvinkovsky romand...@gmail.com wrote: Hi, using alex+happy, how could I parse lines like these? mr username says message\n where both

[Haskell-cafe] happy + alex parsing question

2011-02-16 Thread Roman Dzvinkovsky
Hi, using alex+happy, how could I parse lines like these? mr username says message\n where both username and message may contain arbitrary characters (except eol)? If I make lexer tokens mr { T_Mr } says { T_Says } \r?\n{ T_Eol } .{ T_Char $$ } and parser 'mr '{

Re: [Haskell-cafe] happy + alex parsing question

2011-02-16 Thread Mihai Maruseac
On Wed, Feb 16, 2011 at 5:31 PM, Roman Dzvinkovsky romand...@gmail.com wrote: Hi, using alex+happy, how could I parse lines like these? mr username says message\n where both username and message may contain arbitrary characters (except eol)? If I make lexer tokens mr     { T_Mr }

Re: [Haskell-cafe] happy + alex parsing question

2011-02-16 Thread Stephen Tetley
On 16 February 2011 15:31, Roman Dzvinkovsky romand...@gmail.com wrote: using alex+happy, how could I parse lines like these? mr username says message\n Alex has both user states and powerful regex and character set operators (complement and set difference), that said, LR parsing plus Alex