From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 1DAF3BB81 for ; Thu, 22 Sep 2005 08:50:00 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8M6nxmY001563 for ; Thu, 22 Sep 2005 08:49:59 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA30708 for ; Thu, 22 Sep 2005 08:49:58 +0200 (MET DST) Received: from alex.barettalocal.com (host52-173.pool82105.interbusiness.it [82.105.173.52]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j8M6nwTP002427 for ; Thu, 22 Sep 2005 08:49:58 +0200 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by alex.barettalocal.com (Postfix) with ESMTP id 7BC9E2BAB6C; Thu, 22 Sep 2005 08:47:25 +0200 (CEST) Message-ID: <4332537C.10909@barettadeit.com> Date: Thu, 22 Sep 2005 08:47:24 +0200 From: Alex Baretta User-Agent: Debian Thunderbird 1.0.2 (X11/20050602) X-Accept-Language: en-us, en MIME-Version: 1.0 To: skaller Cc: ocaml Subject: Re: [Caml-list] ocamllex question References: <1127327675.23425.111.camel@rosella> In-Reply-To: <1127327675.23425.111.camel@rosella> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43325417.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43325416.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 caml-list:01 ocamllex:01 lexbuf:01 ocamllex:01 lexer:01 recursive:01 lexer:01 token:01 emacs:01 lexbuf:01 baretta:01 wrote:01 string:03 string:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 skaller wrote: > Can eof be read from a lexbuf more than once by an ocamllex lexer? > In particular is a recursive lexer matches an eof and > returns to its caller, can the parent caller still read > another eof? > > In other words, is the character stream postpended by one eof > or an infinite stream of them? "eof" in ocamllex is a "condition" not a token. It's like "\b" in emacs, which matches the empty string but only at the beginning or end of a word. In ocamllex "eof" matches the empty string at the end of a lexbuf, thus matching eof is non-destructive lexbuf-wise and can repeated any number of times. Alex -- ********************************************************************* http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. +39 02 370 111 55 fax. +39 02 370 111 54 Our technology: The Application System/Xcaml (AS/Xcaml) The FreerP Project