Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] lex: including regex definitions from a separate file
Date: Mon, 19 Nov 2007 23:44:12 +0100	[thread overview]
Message-ID: <1195512252.474211bc703fb@webmail.in-berlin.de> (raw)
In-Reply-To: <4741F21C.4090806@gnu.org>

Zitat von Sam Steingold <sds@gnu.org>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I have several lexers in the same directory and I want them to share the
> regexp definitions.
> is there a way to put the regexp definitions in foo.mll and include them
>  in bar.mll?
[...]

You can't share the definitions, only the generated scanner-functions
and tables/tokens (but I never looked at these thingas in detail,
I normally only used the scanner functions).


It is possible to have more than one lexer definition
in a ocamllex-file. So, if you not necessarily need
all those seperated files, you can use one *.mll file
and throw in all scanner-definitions.

But be aware on possibly name-problems then,
if some scanner-definitions might have the same name.
As you then have all things in one compilation unit, you can't distinguish
function "token" from another function "token", so you may have to
rename your functions in the scanner.


Ciao,
   Oliver


      parent reply	other threads:[~2007-11-19 22:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-19 20:29 Sam Steingold
2007-11-19 21:24 ` [Caml-list] " Richard Jones
2007-11-19 22:44 ` Oliver Bandel [this message]

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=1195512252.474211bc703fb@webmail.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --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