Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-09 Thread Christian Maeder
Am 08.03.2011 13:50, schrieb Christian Maeder: Am 08.03.2011 13:35, schrieb Hauschild, Klaus (EXT): Hi Christian, Thank you for your help. Now the current version of Parse.hs (http://code.google.com/p/hgmltracer/source/browse/trunk/hGmlTracer/src/Gml/Parse.hs) works well for the test file

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-09 Thread Christian Maeder
Am 09.03.2011 14:44, schrieb Christian Maeder: Am 08.03.2011 13:50, schrieb Christian Maeder: Am 08.03.2011 13:35, schrieb Hauschild, Klaus (EXT): Hi Christian, Thank you for your help. Now the current version of Parse.hs

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Hauschild, Klaus (EXT)
Hi Christian, my version of parseList works currently strange. The input {2\n2} will be parsed fine, but something like { } or so fails with 'expecting space or }'. The redefinition of space is not necessary, it was copied from another tutorial code. How I write a version of parseGml that get

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Christian Maeder
Am 08.03.2011 12:30, schrieb Hauschild, Klaus (EXT): Hi Christian, my version of parseList works currently strange. The input {2\n2} will be parsed fine, but something like { } or so fails with 'expecting space or }'. You must skip (possible) spaces after {, too. (Actually after every

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Christian Maeder
In http://code.google.com/p/hgmltracer/source/browse/trunk/hGmlTracer/src/Gml/Parse.hs I see identifier - many (noneOf ). You should at least consume one character by using many1! This also allows to call many parseGml'' later. C. Am 08.03.2011 12:30, schrieb Hauschild, Klaus (EXT): Hi

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Christian Maeder
Am 08.03.2011 12:30, schrieb Hauschild, Klaus (EXT): Hi Christian, my version of parseList works currently strange. The input {2\n2} will be parsed fine, but something like { } or so fails with 'expecting space or }'. Also } (and ], etc.) should be excluded as identifier letters. } is the

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Hauschild, Klaus (EXT)
Hi Christian, Thank you for your help. Now the current version of Parse.hs (http://code.google.com/p/hgmltracer/source/browse/trunk/hGmlTracer/src/Gml/Parse.hs) works well for the test file fact.gml. Now the last thing is parsing the different numbers (integer and float). If have a rule for

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Christian Maeder
Am 08.03.2011 13:35, schrieb Hauschild, Klaus (EXT): Hi Christian, Thank you for your help. Now the current version of Parse.hs (http://code.google.com/p/hgmltracer/source/browse/trunk/hGmlTracer/src/Gml/Parse.hs) works well for the test file fact.gml.

[Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Hauschild, Klaus (EXT)
Hi, to solve this ICFP task http://www.cs.cornell.edu/icfp/task.htm I'm currnetly working on the parser. With the hint from Thu (reading Phillip Wadlers monadic parser paper) and consulting http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours/Parsing I produce a first working

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Christian Maeder
You should parse keywords using: keyword s = try (string s) notFollowedBy (letter | digit) C. Am 07.03.2011 11:34, schrieb Hauschild, Klaus (EXT): Hi, to solve this ICFP task _http://www.cs.cornell.edu/icfp/task.htm_ I'm currnetly working on the parser. With the hint from Thu (reading

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Hauschild, Klaus (EXT)
Thanks Christian, I adapted the keyword parser and now n - negi does not occur. But there are still other problems to solve. If I activate the parseFunction the parser will answer to fact.gml unexpected end of input, expecting space or }. Any ideas? -Ursprüngliche Nachricht- Von:

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Christian Maeder
Am 07.03.2011 13:48, schrieb Hauschild, Klaus (EXT): Thanks Christian, I adapted the keyword parser and now n - negi does not occur. But there are still other problems to solve. If I activate the parseFunction the parser will answer to fact.gml unexpected end of input, expecting space

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Stephen Tetley
Hi Klaus Unless you have very specific white-space considerations, you really want to be using Parsec's Token and LanguageDef modules. There are examples in the legacy Parsec 2.0 distribution available from Daan Leijen's old website: http://legacy.cs.uu.nl/daan/parsec.html Best wishes Stephen

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Daniel Fischer
On Monday 07 March 2011 13:48:31, Hauschild, Klaus (EXT) wrote: But there are still other problems to solve. One thing that I saw which wasn't mentioned before (or I missed it) is that you need to try parsing binders before parsing identifiers. Currently, all binders are happily accepted as

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Christian Maeder
Am 07.03.2011 14:20, schrieb Stephen Tetley: Hi Klaus Unless you have very specific white-space considerations, you really want to be using Parsec's Token and LanguageDef modules. Well, I would want to use Parsec's Token and LanguageDef modules just to get the white spaces (and comments to