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
using different lexers with one parser?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-18 (10:01)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] using different lexers with one parser?
On Wed, Apr 18, 2007 at 09:38:20AM +0200, Hendrik Tews wrote:
> Oliver Bandel <oliver@first.in-berlin.de> writes:
>    Is it possible (without too much effort) to switch
>    the lexer during parsing (from within the parser)?
> Yes, see
> http://caml.inria.fr/pub/ml-archives/caml-list/2003/09/3e7f3495840e2bc851b91c3dba8abab9.en.html

OK; I hoped to find a solution without the global-switching-var hacks;
something that is built in in ocamlyacc.

Maybe formy purposes then it's better to write my own
parser and call ocamllex-generated functions directly.

> The main problem is the lookahead token.

OK; then I better hackmy own parser.
As the fileformat is not too hard,
this should be the better way.