Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
ocamllex question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-09-22 (06:50)
From: Alex Baretta <alex@b...>
Subject: Re: [Caml-list] ocamllex question
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.


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