[m-rev.] lex and moose changed
Peter Schachte
schachte at cs.mu.OZ.AU
Fri Aug 3 19:07:30 AEST 2001
> > A sequence or stream type class should solve that. I'd define a sequence as
> > having an emtpy/1 predicate and a next/3 predicate that returns the next and
> > rest. A stream would be the same as a sequence, except it would have only
> > unique (destructive) modes.
>
> You've just hit a snag there: the token predicates I was using depended on
> being able to backtrack to find the longest matching token. A stream type
> class with unique modes would be the same as using read_char now. It would
> be nice to have a stream that used transparent putback on backtracking.
I guess I'd call them sequences rather than streams, then. Of course, that
could be done.
But I think the better solution is to somehow compile the grammar into a
deterministic tokenizer.
--
Peter Schachte Even if you are a minority of one, the
mailto:schachte at cs.mu.OZ.AU truth is the truth.
http://www.cs.mu.oz.au/~schachte/ -- Mahatma Gandhi
Phone: +61 3 8344 9166
PGP key available, see web page
--------------------------------------------------------------------------
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