[mercury-users] using mercury for parsing/scanning

Dave Slutzkin dave_slutzkin at yahoo.com
Mon Dec 31 12:37:27 AEDT 2001


Hi.

When using DCGs to scan character strings, is there an
alternative to this:

keyword -->
   ['K','E','Y','W','O','R','D']

I'm hoping for some syntactic sugar - I'm too lazy to
type in all the quotes and commas every time.

Also, I'm currently reading input a word at a time and
then passing around the character strings.  Is it
better to do this or to read input straight from the
stream every time?  (My current solution involves some
pushback when the current word isn't all consumed.)  I
am just doing scanning, not parsing yet, so I never
need more than one word.

thanks,

Dave.

http://my.yahoo.com.au - My Yahoo!
- It's My Yahoo! Get your own!
--------------------------------------------------------------------------
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