English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Re: Efficient C++ Interfacing?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-29 (01:35)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Re: Efficient C++ Interfacing?
On Tue, 2004-06-29 at 05:58, Eray Ozkural wrote:
>  The only sad thing about these systems is that they are not 
> written in ocaml. :) 

An Earley parser is easy to make, RD even easier
although it's a bit harder in that case to get the
grammar right.

The main problem is handling the silly identifier/typename
distinction, which is easy to do .. and hard to *undo*:
forgetting things is vital for a functional parser.
Tying the lexer and parser together solves this problem.

I assume performance isn't as vital to you as actually
parsing the input. Earley seems quite feasible for C++,
since in practice there are enough 'stopping symbols'
to restrict the O(n^3) performance problem to small
enough n to be practical.

The bottom line here is that it is a lot of work
to elaborate all the grammar productions, especially
if you want to take MSC/gnu extensions into account
and handle "C" as well (since C has distinct
rules for some things like enums and nested classes).

John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net

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