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 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).