caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Pietro Abate <Pietro.Abate@anu.edu.au>
Cc: ocaml ml <caml-list@inria.fr>
Subject: Re: [Caml-list] buidlExpressionParser
Date: Mon, 01 Aug 2005 09:39:31 +1000	[thread overview]
Message-ID: <1122853171.6779.134.camel@localhost.localdomain> (raw)
In-Reply-To: <20050731132119.GA368@pulp.anu.edu.au>

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

On Sun, 2005-07-31 at 23:21 +1000, Pietro Abate wrote:
> Hi all,
> 
> I'm trying to write a generic parser similar to the buidlExpressionParser
> in the haskel library (without using external libraries). I came up with
> a kind of hack that uses the grammar extension mechanism (attached).
> 
> Is there a better way of doing this ?

Do I understand right: you're leveraging the camlp4 library
code to build a general purpose LL(1) parser which will support
runtime extension?

> Does anybody have an example on how to write a simple lexer that I can
> use instead ?

Hmmm ... don't know about 'simple lexer' but I have a library
function that can translate a representation of a labelled sequence
of regexps into a tokeniser.

I would not call this system 'simple' but it is entirely combinator
based, and generates a lex style deterministic finite state automaton.

You may want an NFA based interpreter instead though.

-- 
John Skaller <skaller at users dot sourceforge dot net>


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-07-31 23:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-31 13:21 buidlExpressionParser Pietro Abate
2005-07-31 23:39 ` skaller [this message]
2005-08-01  1:45   ` [Caml-list] buidlExpressionParser Pietro Abate
2005-08-01  8:13     ` skaller
2005-08-12  7:07 ` Pietro Abate

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=1122853171.6779.134.camel@localhost.localdomain \
    --to=skaller@users.sourceforge.net \
    --cc=Pietro.Abate@anu.edu.au \
    --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).