[m-rev.] diff/for review: more library improvements for caribou

Michael Day mikeday at yeslogic.com
Fri Jan 7 18:53:27 AEDT 2005


Hi Zoltan,

> > If so, how does it differ from lex?

Sorry, I was unclear: I meant how does it differ from Ralph Becket's "lex"  
module that is currently included in the extras distribution.

> In two kinds of ways. One kind is the kind forced by the pure nature of
> Mercury. For example, if an action in lex wants to access global state,
> it can just do so, in caribou (my lex lookalike) you have to pass a state
> variable argument pair for each such piece of global state. The second
> kind is syntactic. For example, Mercury uses % for comments. Using %%
> to separate sections of a specification wouldn't work, so caribou uses
> ##declarations, ##rules and ##includes instead.

So by the sound of it, it is a pre-preprocessor that generates Mercury
code, much like the moose parser generator?

That could have some advantages over (Ralph's) lex, which requires
compiling the lexer at runtime; when the patterns are fixed this is an 
overhead best avoided.

Michael

-- 
YesLogic Prince prints XML!
http://yeslogic.com
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list