[mercury-users] lexing and parsing in Mercury

Terrence Brannon princepawn at earthlink.net
Mon Apr 23 06:45:04 AEST 2001


I was talking off- list to someone about Mercury and they said it was
about the best thing going when it came to writing
parsers. Furthermore, 1/2 of the spec for the ICFP Content was to
write a parser for a graphical language.

However, none of the available Mercury docs has any examples of how to
write a parser. How could you write a parser to do the following:

Take sentences of the form VERB OBJECT for a limited number of
combinations of verb and object and in all cases but the VERB
add_verb_object simply say "VERB accomplished".

Ie, 

read book => "read accomplished"
open door => "open accomplished"
open jar  => "open accomplished"
open sesame => "open does not accept the sesame object"
play piano => "play does not accept the piano object... in fact play
	      does not exist'
add_verb_object('play','piano').
play piano => "play accomplished"

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