Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Eric Cooper <ecc@cmu.edu>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] parsing OCaml code
Date: Tue, 19 Jul 2005 15:12:23 -0400	[thread overview]
Message-ID: <20050719191223.GB9123@localhost> (raw)
In-Reply-To: <Pine.LNX.4.62.0507191246030.30865@point>

On Tue, Jul 19, 2005 at 01:05:58PM -0400, Nathaniel J. Gaylinn wrote:
> Does anyone know where I could find Yacc grammar descriptions of
> OCaml, or would I have to write them myself?

OCaml uses ocamlyacc and ocamllex for its front-end: see
.../parsing/parser.mly and lexer.mll.

ocamlyacc is very similar to yacc/bison; reuse of the grammar should
be straightforward.

ocamllex is similar to lex/flex, but it supports mutually recursive
rules instead of lex's explicit "start conditions", so you might have
a bit more work if you want to translate it.

-- 
Eric Cooper             e c c @ c m u . e d u


  reply	other threads:[~2005-07-19 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-19 17:05 Nathaniel J. Gaylinn
2005-07-19 19:12 ` Eric Cooper [this message]
2005-07-19 19:20 ` Sylvain LE GALL

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=20050719191223.GB9123@localhost \
    --to=ecc@cmu.edu \
    --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