caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RE: [Caml-list] CFG Parsers
@ 2004-08-13 15:52 Ennals, Robert
  2004-08-13 15:58 ` Diego Olivier Fernandez Pons
  0 siblings, 1 reply; 8+ messages in thread
From: Ennals, Robert @ 2004-08-13 15:52 UTC (permalink / raw)
  To: David McClain, caml

Have you tried using a combinatory parser?

Such parsers are usually *MUCH* easier to use, allow much wider choices
of grammar, much better error messages etc, and are usually more than
fast enough.

I don't know what combinator parsers are available for O'Caml, but
Parsec (for Haskell) is pretty sweet. 


Does anyone know of any good combinator parsing libraries for O'Caml? If
there aren't any then I might be tempted to do one myself (getting sick
of yacc).


-Rob

> -----Original Message-----
> From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml-
> list@pauillac.inria.fr] On Behalf Of David McClain
> Sent: 13 August 2004 16:42
> To: caml
> Subject: [Caml-list] CFG Parsers
> 
> With all due respect, it appears that I need to reframe my thinking
about
> these YACC parser builders and go backward in time by about 30-40
years.
> Now
> that I'm getting the hang of what it is doing, it looks strongly
> reminiscent
> of the style of programming we did back on old IBM 360's.
> 
> I do notice that YACC becomes very sensitive to slight perturbations
in
> the
> grammar. This is not meant as a criticism of YACC, but rather a plea
for
> some more modern thinking in compiler generators. Perhaps the GLC tool
> will
> do better here.
> 
> The problem seems to be the impedance mismatch between the way humans
are
> led to think when viewing the "structured" YACC input clauses, and the
> more
> or less blind way the computer is actually using that information. I
see
> that being a master of removing reduce/reduce conflicts seems to be a
rite
> of passage. But surely there has to be a better way to approach these
> kinds
> of problems. Just because my ancestors used to hunt with spears
doesn't
> mean
> I still ought to do so.
> 
> David McClain
> Senior Corporate Scientist
> Avisere, Inc.
> 
> +1.520.390.7738 (USA)
> david.mcclain@avisere.com
> 
> 
> 
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives:
> http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:
> http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] CFG Parsers
  2004-08-13 15:52 [Caml-list] CFG Parsers Ennals, Robert
@ 2004-08-13 15:58 ` Diego Olivier Fernandez Pons
  0 siblings, 0 replies; 8+ messages in thread
From: Diego Olivier Fernandez Pons @ 2004-08-13 15:58 UTC (permalink / raw)
  To: Ennals, Robert; +Cc: caml

    Bonjour,

> I don't know what combinator parsers are available for O'Caml, but
> Parsec (for Haskell) is pretty sweet.

There is a port of Parsec for Alice (SML). It should be easy to port
to Caml (actually I did port Parsec to Caml once but wasn't really
convinced).

There also are a few parser combinator libraries for Caml


       Diego Olivier

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] CFG Parsers
  2004-08-16  8:40   ` Diego Olivier Fernandez Pons
  2004-08-17  9:44     ` Alex Cowie
@ 2004-08-18 13:13     ` Christian Lindig
  1 sibling, 0 replies; 8+ messages in thread
From: Christian Lindig @ 2004-08-18 13:13 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons; +Cc: caml-list, james woodyatt


On Aug 16, 2004, at 10:40 AM, Diego Olivier Fernandez Pons wrote:
> - Christian Lindig _lexer_ combinators
> http://caml.inria.fr/caml-list/0870.html
> The library doesn't seem to be available from Lindig's pages anymore

That's true but you can still find them here:

http://www.cminusminus.org/rsync/qc--linux-x86/cllib/

-- Christian

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] CFG Parsers
  2004-08-16  8:40   ` Diego Olivier Fernandez Pons
@ 2004-08-17  9:44     ` Alex Cowie
  2004-08-18 13:13     ` Christian Lindig
  1 sibling, 0 replies; 8+ messages in thread
From: Alex Cowie @ 2004-08-17  9:44 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons; +Cc: caml-list

Diego Olivier Fernandez Pons wrote:

>    Bonjour,
>
>>Could you post some links to these libraries? I did a quick search
>>on Google, but didn't find anything.
>>
>
>Here is what Robert Ennals and I found :
>
>
>- Alice (and Alice parsec)
>
>http://www.ps.uni-sb.de/alice/
>
>
>- Pagoda core fondation
>
>Functional LL(x) parsing with monadic combinators
>
>http://www.wetware.com/jhw/src/pagoda/
>
>
>- CDK (Caml Development Kit)
>
>Two parser combinators libraries Pc and Pc2
>
>http://pauillac.inria.fr/cdk/newdoc/htmlman/cdk_toc.html
>
>
>- Christian Lindig _lexer_ combinators
>
>http://caml.inria.fr/caml-list/0870.html
>
>The library doesn't seem to be available from Lindig's pages anymore
>
>
>- I also remember a toy set of lexer combinators from Cousineau's
>(really old) book on Caml-light but I don't remember if it had also
>parsing combinators or not.
>
>http://caml.inria.fr/books-eng.html#cousineau-mauny
>
>
>        Diego Olivier
>
>-------------------
>To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
>Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
>Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>
Christian Lindig's  lexer (lc) and parser (pc,pc2) combinators are also 
included in the Tony XML parser package 
(http://www.st.cs.uni-sb.de/~lindig/src/) available via the Caml Humps, 
although it is not obvious from the package description!

Alex Cowie
School of Computer and Information Science,
University of South Australia


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] CFG Parsers
  2004-08-14  2:59 ` james woodyatt
@ 2004-08-16  8:40   ` Diego Olivier Fernandez Pons
  2004-08-17  9:44     ` Alex Cowie
  2004-08-18 13:13     ` Christian Lindig
  0 siblings, 2 replies; 8+ messages in thread
From: Diego Olivier Fernandez Pons @ 2004-08-16  8:40 UTC (permalink / raw)
  To: james woodyatt; +Cc: caml-list

    Bonjour,

> Could you post some links to these libraries? I did a quick search
> on Google, but didn't find anything.

Here is what Robert Ennals and I found :


- Alice (and Alice parsec)

http://www.ps.uni-sb.de/alice/


- Pagoda core fondation

Functional LL(x) parsing with monadic combinators

http://www.wetware.com/jhw/src/pagoda/


- CDK (Caml Development Kit)

Two parser combinators libraries Pc and Pc2

http://pauillac.inria.fr/cdk/newdoc/htmlman/cdk_toc.html


- Christian Lindig _lexer_ combinators

http://caml.inria.fr/caml-list/0870.html

The library doesn't seem to be available from Lindig's pages anymore


- I also remember a toy set of lexer combinators from Cousineau's
(really old) book on Caml-light but I don't remember if it had also
parsing combinators or not.

http://caml.inria.fr/books-eng.html#cousineau-mauny


        Diego Olivier

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] CFG Parsers
  2004-08-13 16:09 Ennals, Robert
@ 2004-08-14  2:59 ` james woodyatt
  2004-08-16  8:40   ` Diego Olivier Fernandez Pons
  0 siblings, 1 reply; 8+ messages in thread
From: james woodyatt @ 2004-08-14  2:59 UTC (permalink / raw)
  To: The Caml Trade

On 13 Aug 2004, at 09:09, Ennals, Robert wrote:
> From: Diego Olivier Fernandez Pons
>>
>> There also are a few parser combinator libraries for Caml
>
> Could you post some links to these libraries? I did a quick search on
> Google, but didn't find anything.

I suppose now would be an appropriate time to remind the list that the  
Pagoda Core Foundation contains a parser combinator library.  Whether  
it suits your tastes remain to be seen, but I've been pretty happy with  
it so far.   I've found the [Cf_parser] and [Cf_lexer] modules  
especially well-suited for implementing extensible grammars.

The URL for the distribution is here:

	<http://www.wetware.com/jhw/src/pagoda/cf-0.3.tar.gz>	<http:// 
www.wetware.com/jhw/src/pagoda/cf-0.3.tar.bz2>

The auto-generated documentation is online here:

	<http://www.wetware.com/jhw/src/pagoda/doc/cf/>


-- 
j h woodyatt <jhw@wetware.com>
that's my village calling... no doubt, they want their idiot back.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] CFG Parsers
@ 2004-08-13 16:09 Ennals, Robert
  2004-08-14  2:59 ` james woodyatt
  0 siblings, 1 reply; 8+ messages in thread
From: Ennals, Robert @ 2004-08-13 16:09 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons, caml

Could you post some links to these libraries? I did a quick search on
Google, but didn't find anything.

Thanks.


-Rob

> -----Original Message-----
> From: Diego Olivier Fernandez Pons
> [mailto:Diego.FERNANDEZ_PONS@etu.upmc.fr]
> Sent: 13 August 2004 16:59
> To: Ennals, Robert
> Cc: caml
> Subject: RE: [Caml-list] CFG Parsers
> 
>     Bonjour,
> 
> > I don't know what combinator parsers are available for O'Caml, but
> > Parsec (for Haskell) is pretty sweet.
> 
> There is a port of Parsec for Alice (SML). It should be easy to port
> to Caml (actually I did port Parsec to Caml once but wasn't really
> convinced).
> 
> There also are a few parser combinator libraries for Caml
> 
> 
>        Diego Olivier

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Caml-list] CFG Parsers
@ 2004-08-13 15:41 David McClain
  0 siblings, 0 replies; 8+ messages in thread
From: David McClain @ 2004-08-13 15:41 UTC (permalink / raw)
  To: caml

With all due respect, it appears that I need to reframe my thinking about
these YACC parser builders and go backward in time by about 30-40 years. Now
that I'm getting the hang of what it is doing, it looks strongly reminiscent
of the style of programming we did back on old IBM 360's.

I do notice that YACC becomes very sensitive to slight perturbations in the
grammar. This is not meant as a criticism of YACC, but rather a plea for
some more modern thinking in compiler generators. Perhaps the GLC tool will
do better here.

The problem seems to be the impedance mismatch between the way humans are
led to think when viewing the "structured" YACC input clauses, and the more
or less blind way the computer is actually using that information. I see
that being a master of removing reduce/reduce conflicts seems to be a rite
of passage. But surely there has to be a better way to approach these kinds
of problems. Just because my ancestors used to hunt with spears doesn't mean
I still ought to do so.

David McClain
Senior Corporate Scientist
Avisere, Inc.

+1.520.390.7738 (USA)
david.mcclain@avisere.com



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-08-18 13:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-13 15:52 [Caml-list] CFG Parsers Ennals, Robert
2004-08-13 15:58 ` Diego Olivier Fernandez Pons
  -- strict thread matches above, loose matches on Subject: below --
2004-08-13 16:09 Ennals, Robert
2004-08-14  2:59 ` james woodyatt
2004-08-16  8:40   ` Diego Olivier Fernandez Pons
2004-08-17  9:44     ` Alex Cowie
2004-08-18 13:13     ` Christian Lindig
2004-08-13 15:41 David McClain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).