[mercury-users] Accessing global state in moose

Peter Ross pro at missioncriticalit.com
Tue Feb 24 03:14:11 AEDT 2004


In the moose samples there is a file called expr.moo

One of the rules is the following

:- rule exprn(int).
exprn(Num)      --->    exprn(A), [+], term(B), { Num = A + B }.
exprn(Num)      --->    exprn(A), [-], term(B), { Num = A - B }.
exprn(Num)      --->    term(Num).

but if I wanted to change the rule to be something like below
where Global is defined in the parser_state

exprn(Num)      --->    exprn(A), [+], term(B), { Num = A + B + Global }.

Is it possible to do this?  If not, does anyone have any hints on how to
adapt moose to support this?

Cheers,
Pete

-- 
Peter Ross		
Software Engineer                                (Work)   +32 2 757 10 15
Mission Critical                                 (Mobile) +32 485 482 559
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list