Browse thread
[Caml-list] function vs. parser
[
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: | SooHyoung Oh <shoh@d...> |
| Subject: | [Caml-list] function vs. parser |
Hi!
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