caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Stream parsers
@ 2000-02-01  1:53 Frank A. Christoph
  0 siblings, 0 replies; only message in thread
From: Frank A. Christoph @ 2000-02-01  1:53 UTC (permalink / raw)
  To: CAML List

I have a problem with reporting error locations in stream parsers. Using the
count at the beginning of a parser match, I can get the token number of the
first element that matched a clause. But when the parser expression looks
like this (using the new syntax):

  parser bp [< e = p; 'T ?? err bp >] -> ...

you have to bend over backwards to figure out what token number the error
could have occurred on, since p could have parsed an arbitrary number of
tokens already. Is there any easy way to work around this?

Would it be possible to change the semantics of the expression on the rhs of
?? so that it is a function which gets passed the token count after having
matched the previous stream component (p, in my example)? Or, if you want to
maintain retain the current semantics, add a new form with three ?'s...

--fac




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-02-02 15:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-01  1:53 Stream parsers Frank A. Christoph

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).