[mercury-users] Accessing global state in moose

Ralph Becket rafe at cs.mu.OZ.AU
Tue Feb 24 09:00:46 AEDT 2004


Peter Ross, Monday, 23 February 2004:
> 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?

Can you thread Global through the productions?  For example,

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

-- Ralph
--------------------------------------------------------------------------
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