[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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. 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) <http://www.asxcaml.org/> The FreerP Project <http://www.freerp.org/>