caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: William Lovas <wlovas@stwing.upenn.edu>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] ocamllex/yacc and camlp4
Date: 17 Jun 2004 19:42:08 +1000	[thread overview]
Message-ID: <1087465326.16811.1482.camel@pelican.wigram> (raw)
In-Reply-To: <20040617020421.GA11723@force.stwing.upenn.edu>

On Thu, 2004-06-17 at 12:04, William Lovas wrote:
> On Thu, Jun 17, 2004 at 12:48:01AM +0200, Pierre Weis wrote:
> > In conclusion: pure Camlp4 implementation of ocamllex/ocamlyacc is
> > still an interesting and challenging progamming task for the next few
> > years, if you (or someone else) had the will and time to provide two
> > ``great camlp4 examples'' to the rest of us...
> 
> Is such a thing even possible?  I thought ocamllex/ocamlyacc produced
> parsers for LALR(1) languages while camlp4 produced parsers for LL(k)
> languages.  These two sets do not bear a subset relation in either
> direction, so i would think it impossible to completely implement either
> tool in terms of the other.  Have i misunderstood something?

Yes: there is no need for camlp4 to generate lexers and
parsers replacing those you'd build with ocamllex/ocamlyacc,
the need is to replace the ocamllex/ocamlyacc parsers used
to scan your lexer/grammar specifications -- and that
can easily be done by camlp4 (and for lexers certainly
has been done several times eg ulex).

Having read such specifications 'inline' in Ocaml code,
actually generating the parsers/lexers to implement
the semantics can easily be done by camlp4 by simply
calling an external function.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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:[~2004-06-17  9:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-16  3:26 John Goerzen
2004-06-16  6:56 ` Luc Maranget
2004-06-16 22:48   ` Pierre Weis
2004-06-17  2:04     ` William Lovas
2004-06-17  9:42       ` skaller [this message]
2004-06-17  6:46     ` Alain Frisch
2004-06-17  9:36     ` skaller
2004-06-17  1:44   ` Shawn Wagner
2004-06-29  7:34 ` [Caml-list] Startconditions in ocamllex oliver
2004-06-29  8:00   ` Luc Maranget
2004-06-30  7:45     ` Hendrik Tews

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=1087465326.16811.1482.camel@pelican.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=wlovas@stwing.upenn.edu \
    /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).