caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Emmanuel Onzon <emmanuel.onzon@ens-lyon.fr>
To: caml-list@yquem.inria.fr
Subject: dypgen : a generator of dynamically extensible parsers for OCaml
Date: Fri, 20 Oct 2006 18:52:39 +0200	[thread overview]
Message-ID: <20061020185239.5bm4tlwmty50koso@mouette.ens-lyon.fr> (raw)

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


                 reply	other threads:[~2006-10-20 16:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061020185239.5bm4tlwmty50koso@mouette.ens-lyon.fr \
    --to=emmanuel.onzon@ens-lyon.fr \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).