[m-dev.] for review: rename the lexer and parser modules

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Aug 24 08:32:50 AEST 2000


On 23-Aug-2000, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 22-Aug-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > The other downside is that this change would break backwards
> > compatibility.  The "lexer" and "parser" modules are publically
> > accessible parts of the interface to the Mercury standard library,
> > documented in the library reference manual.
> 
> You are right. However, I thought of a way to avoid this problem.
> I can leave a lexer.m and parser.m in place, but make all their
> interface predicates call the corresponding predicates in mer_lexer
> and mer_parser, and make the types they define be just equivalences
> of the types defined in mer_lexer and mer_parser.
>
> This way, people who import modules lexer or parser expecting the
> old modules will get them, but since the rest of the Mercury library
> will not refer to the lexer and parser modules, they will not be linked
> into programs that have their own lexer or parser modules. I *think*
> this works even with shared objects, although I am not sure,

I don't think that will work, because even if you put the lexer and
parser modules into a separate shared object, if that shared object
library name is listed in the ld command line (as it must be for
backwards compatibility), then I'm pretty sure it will get linked in
at runtime even if no symbol in it is referenced.  Also I think there
may be problems in some grades with the mercury__lexer__init() and
mercury__parser__init() functions if the user defines their own lexer
or parser module.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list