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] function vs. parser
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-09-13 (08:17)
From: SooHyoung Oh <shoh@d...>
Subject: [Caml-list] function vs. parser


Could anyone explain me why "parser" was introduced in Ocaml?
As you know, "function" is using in the caml light-instead of "parser".
"parser" must be a reserved word like "let" and "function", right?

I reviewed  "The Objective Caml system release 3.02", specially
  1.8 Pretty-printing and parsing
      it introduces lex and parser.
  7.1 Streams and stream parser
      it shows the syntax of parser and stream matching.

But I don't know why "parser" was introduced.
Here is an example.

# let next = parser
  [< 'x >] -> x
  | [<>] -> raise (Failure "end of stream")
val next : 'a Stream.t -> 'a = <fun>

Thanks in advance for your help.

SooHyoung Oh

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