caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Max Kirillov <max630@mail.ru>
To: caml-list@inria.fr
Subject: [Caml-list] stream parser jump-back
Date: Mon, 5 Aug 2002 01:59:38 +0700	[thread overview]
Message-ID: <20020805015938.C17263@max.home> (raw)

Hello!

Is it possible in a stream parser to parse again already
accepted token.

An example (a little incorrect) follows.

I'd like to make this in camlp:

A(B).c --> let module M = A(B) in M.c

To do that, i write (scematically):

expr:
[[ m = module_expr; "."; e = expr -> ... ]]

"Note" may be parsed as either module expression or a usual
one. But, expr cannot be followed by a period (that's wrong,
I know, but let's forget about it for a while). Then,
writing None, I've got the Stream.Error and parsing error.

So, can I write something like:
[[ TRY (m = module_expr); "."; ... and so on, do get parsing
failure insted of error, and push the successful head of failed
structute back into a stream, to parse it again (as an expr
now)?

Thanks for your attention.
Max.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


             reply	other threads:[~2002-08-04 18:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-04 18:59 Max Kirillov [this message]
2002-08-05  6:40 ` Daniel de Rauglaudre
2002-08-06  3:05   ` Max Kirillov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020805015938.C17263@max.home \
    --to=max630@mail.ru \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).