caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sen Horak <sen.horak@gmail.com>
To: virgile.prevosto@m4x.org
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Stream parser/make_lexer
Date: Mon, 27 Jun 2005 13:24:39 +0200	[thread overview]
Message-ID: <a80eebd405062704245210ee3@mail.gmail.com> (raw)
In-Reply-To: <27873377050626065224e12c67@mail.gmail.com>

Hi,

Thanks for this. Your answer fixed the problem.

Additionally, i was wrongly using 'String instead of 'Ident. 'String
it appears, is
for quoted text - which of course is in the manual. My bad.

SH

On 6/26/05, Virgile Prevosto <virgile.prevosto@gmail.com> wrote:
> Hello,
> 2005/6/26, Sen Horak <sen.horak@gmail.com>:
> > let parse = parser
> >       [<'Kwd "name=";'String t>] -> wm#setname t
> >   |  ...
> >
> > let istream = of_channel stdin
> > The program exits with a Stream.Failure exception. The "stream
> > builders" documentation clearly says that we are not to mix the of_*
> > functions to build streams with <> streams - so I guess this is
> > expected. Although I've come across some examples that use of_string
> > to build the char stream and use the lexer on it.
> >
> 
> I can be wrong, but I think that the documentation prohibits stuff like
> let s = Stream.of_string "foo" in [< s; s >], that is building a
> stream with both the of_* functions and the [< >] notation. This is
> not the case here, since [< >] is used only for pattern matching.
> 
> Concerning your original problem, I think that the main issue is that
> "name=" is not a valid keyword for lexer. Try to split it in "name"
> and "=" (cf documentation of Genlex.token), i.e. do something like
> let lexer = Genlex.make_lexer ["name"; "="; ...]
> let parse = parser [< 'Kwd "name"; 'Kwd "="; 'String t >] -> ...
> 
> --
> E tutto per oggi, a la prossima volta
> Virgile
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


      reply	other threads:[~2005-06-27 11:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-26 10:12 Sen Horak
2005-06-26 12:18 ` [Caml-list] " Oliver Bandel
2005-06-26 13:25   ` Sen Horak
2005-06-26 14:24     ` Oliver Bandel
2005-06-26 13:52 ` Virgile Prevosto
2005-06-27 11:24   ` Sen Horak [this message]

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=a80eebd405062704245210ee3@mail.gmail.com \
    --to=sen.horak@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=virgile.prevosto@m4x.org \
    /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).