Parsing using Monads 
Author Message
 Parsing using Monads

The last time I wrote a parser in Haskell (a few years ago, I am
afraid), I used combinator parsing as explained in this nice paper by
Graham Hutton

        o "Higher-order functions for parsing", Graham Hutton, Journal
of
          Functional Programming, Volume 2, Number 3, July 1992.
Available
          on the web from:

http://www.*-*-*.com/ #parsing.

I think that following the same idea, it has been extended to use
Monads, something I think it is called Monad Parsing.
I have not seen any reference to that in the section about parsing in
the comp.lang.funtional FAQ recently posted.

Can anybody point me to...?
   * papers
   * links where I can get Haskell code implementing the basics
   * even better if there is a parser of any language using monads (if
source available)
   * even better if that parser is for Java

Thanks in advance,

Javier Deniz



Tue, 24 Jul 2001 03:00:00 GMT  
 Parsing using Monads

Hi Javier

If you look around a bit more on Graham's web site that you mention yourself
(http://www.cs.nott.ac.uk/Department/Staff/gmh/bib.html#parsing) you will
find the paper you want
(http://www.cs.nott.ac.uk/Department/Staff/gmh/bib.html#monparsing). It also
conatins references to other papers on monadic parsers by Wadler and Fokker

Quote:
>   * even better if that parser is for Java

If you want them *in* Java, go to
http://www.cs.uu.nl/docs/vakken/go/1998/parser.tar.Z

Yours,

Erik Meijer



Fri, 27 Jul 2001 03:00:00 GMT  
 Parsing using Monads

Javier> The last time I wrote a parser in Haskell (a few years ago, I am
Javier> afraid), I used combinator parsing as explained in this nice paper by
Javier> Graham Hutton

Javier>         o "Higher-order functions for parsing", Graham Hutton, Journal
Javier> of
Javier>           Functional Programming, Volume 2, Number 3, July 1992.
Javier> Available
Javier>           on the web from:

Javier> http://www.cs.nott.ac.uk/Department/Staff/gmh/bib.html#parsing.

Javier> I think that following the same idea, it has been extended to use
Javier> Monads, something I think it is called Monad Parsing.
Javier> I have not seen any reference to that in the section about parsing in
Javier> the comp.lang.funtional FAQ recently posted.

Javier> Can anybody point me to...?
Javier>    * papers
Javier>    * links where I can get Haskell code implementing the basics
Javier>    * even better if there is a parser of any language using monads (if
Javier> source available)
Javier>    * even better if that parser is for Java

Lucky may be what you are looking for...

http://kiste.ki.informatik.uni-frankfurt.de/~klose/lucky.html

-----from that page:-----

Lucky

A haskell parser generator using monadic parser combinators

When i was working on my masters thesis, i developed lucky, a parser generator for haskell. Lucky makes use of monadic
parser combinators, which where introduced by Graham Hutton and Erik Meijer. Lucky has the following features:

    Lucky is very easy to use
    Lucky was developed to be compatible with happy (version 0.9, see manual below for further details)
    Lucky has an excellent syntax error detection
    There are no constraints to the input grammar like LALR(1), so you will not need to handle any shift/reduce or
    reduce/reduce conflicts

Dowanloads, online and printable documentation is available at the Lucky-Manual page.

----------

HTH
        Marko



Sat, 28 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Memoize Function using State Monad

2. ST Monad Using Data Constructor

3. Help! : State monad using constructor classes

4. Problem using Clarion String Methods to parse raw HTML

5. Lexing and Parsing using the Eiffel Libraries

6. Parse bug when used from a library

7. A utility function to parse lists using backtracking.

8. Using instr to parse macro paramaters

9. code for parsing XSL document using prolog

10. Parsing a .CSV file using Tcl

11. Using seek to parse a file

12. Using Tcl to parse HTML pasted from Word

 

 
Powered by phpBB® Forum Software