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
Thread safe Str
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-01-11 (07:04)
From: Chris King <colanderman@g...>
Subject: Re: [Caml-list] Thread safe Str
On 11 Jan 2005 14:54:30 +1100, skaller <skaller@users.sourceforge.net> wrote:
> If you want captures use the proper tool, namely a parser,
> [...]
> If some technology is to be integrated, please use the right technology
> and integrate Ocamllex.

Event-based parsers are not the "proper tool" for many applications. 
Why write a lexer and all its necessary event handlers when one can
just write "s/foo(.*)bar/bar\1foo/g"?  Regular expressions were
designed for pattern matching and substitution, and the latter
function is why they have captures.  Lexers were designed for parsing,
not substitution, and thus excel at the former while making the latter
difficult.  Regexps are certainly the wrong tool for parsing, but they
do have their place.