caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] stream parser jump-back
Date: Mon, 5 Aug 2002 08:40:39 +0200	[thread overview]
Message-ID: <20020805084039.F29829@verdot.inria.fr> (raw)
In-Reply-To: <20020805015938.C17263@max.home>; from max630@mail.ru on Mon, Aug 05, 2002 at 01:59:38AM +0700

Hi,

On Mon, Aug 05, 2002 at 01:59:38AM +0700, Max Kirillov wrote:

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

No.

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

This is complicated, because "module_expr" have several rules starting
with rules already starting "expr". This extension will introduce syntax
errors in many normal cases.

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

You can add a grammar entry defined by a parser. There are examples of
that in the "normal" syntax (pa_o.ml, in Camlp4, subdirectory etc).
See entries "test_ctyp_minusgreater", "test_label_eq",
"test_typevar_list_dot". But I consider they are "hacks" to make
some situation work.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
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-05  6:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-04 18:59 Max Kirillov
2002-08-05  6:40 ` Daniel de Rauglaudre [this message]
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=20020805084039.F29829@verdot.inria.fr \
    --to=daniel.de_rauglaudre@inria.fr \
    --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).