* dypgen : a generator of dynamically extensible parsers for OCaml
@ 2006-10-20 16:52 Emmanuel Onzon
0 siblings, 0 replies; only message in thread
From: Emmanuel Onzon @ 2006-10-20 16:52 UTC (permalink / raw)
To: caml-list
Hello,
dypgen is a GLR parser generator for Objective Caml. It can generate dynamically
extensible parsers.
The program is available at :
http://perso.ens-lyon.fr/emmanuel.onzon
Here is are two examples of extension of a small language.
This is the example included with the program.
define
list_content := expr(x) = List(x,Nil)
and list_content := expr(x);list_content(y) = List(x,y)
and expr := [] = Nil
and expr := [list_content(x)] = x
and expr := expr(x)::expr(y) = List(x,y)
in
match [1;2;3] with
| a::[b;c] -> b
| _ -> 4
define
expr := | expr(x) | = Node(Leaf,x,Leaf)
and expr := expr(x) | expr(y) | = Node(x,y,Leaf)
and expr := | expr(x) | expr(y) = Node(Leaf,x,y)
and expr := expr(x) | expr(y) | expr(z) = Node(x,y,z)
in
match Node(Leaf,3,Node(Node(Leaf,7,Leaf),5,Node(Leaf,1,Leaf))) with
| (|3|((|7|)|a|(|1|))) -> a
| _ -> 8
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-10-20 16:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-20 16:52 dypgen : a generator of dynamically extensible parsers for OCaml Emmanuel Onzon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).