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] lexer disambiguation?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-08-31 (21:09)
From: Michael Leary <leary@n...>
Subject: [Caml-list] lexer disambiguation?
since the lexer looks like an ordinary ocaml function (more or less), does
the disambiguation boil down to:

1. the longest series of bytes that matches a single rule
2. match the first rule in the function that matches #1

and mechanically, if the input looks like:

some series of bytes ¥99¢  @#%#@$  
 with newlines

does it do a pattern match on (assuming whitespace is a token):

s(* match some rule *)
so(* match some rule *)
som(* match some rule *)
some(* match some rule *)
some (* match some rule, and also the whitespace rule, so do the some rule,
then repeat matching starting with the concatenation of the leftover ' '
and the next byte *)

Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr