From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL,RCVD_IN_NJABL_PROXY autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id DB099BC69 for ; Mon, 19 Nov 2007 23:44:13 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPegQUfAbSoIh2dsb2JhbACPFAEBAQgKKQ X-IronPort-AV: E=Sophos;i="4.21,438,1188770400"; d="scan'208";a="4679495" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail1-smtp-roc.national.inria.fr with ESMTP; 19 Nov 2007 23:44:13 +0100 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from einhorn.in-berlin.de (localhost [127.0.0.1]) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id lAJMiCsc019598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 19 Nov 2007 23:44:12 +0100 Received: (from www-data@localhost) by einhorn.in-berlin.de (8.13.6/8.13.6/Submit) id lAJMiC0Y019596 for caml-list@yquem.inria.fr; Mon, 19 Nov 2007 23:44:12 +0100 X-Authentication-Warning: einhorn.in-berlin.de: www-data set sender to oliver@first.in-berlin.de using -f Received: from dslb-088-073-075-250.pools.arcor-ip.net (dslb-088-073-075-250.pools.arcor-ip.net [88.73.75.250]) by webmail.in-berlin.de (IMP) with HTTP for ; Mon, 19 Nov 2007 23:44:12 +0100 Message-ID: <1195512252.474211bc703fb@webmail.in-berlin.de> Date: Mon, 19 Nov 2007 23:44:12 +0100 From: Oliver Bandel To: caml-list Subject: Re: [Caml-list] lex: including regex definitions from a separate file References: <4741F21C.4090806@gnu.org> In-Reply-To: <4741F21C.4090806@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.6 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Spam: no; 0.00; bandel:01 in-berlin:01 hash:01 lexers:01 regexp:01 regexp:01 foo:01 mll:01 mll:01 tokens:01 lexer:01 compilation:01 token:01 token:01 regex:01 Zitat von Sam Steingold : > -----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