caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* lexer library
@ 2007-08-18 18:39 skaller
  2007-08-18 22:34 ` [Caml-list] " Jon Harrop
  0 siblings, 1 reply; 4+ messages in thread
From: skaller @ 2007-08-18 18:39 UTC (permalink / raw)
  To: caml-list

I am interested in building a dynamically extensible lexer.. can
anyone recommend any libraries or tools that would help?

I could use Dypgen (extensible GLR parser) for this, but it is 
probably too slow.

A system using combinators (rather than strings) would be preferred,
and Unicode support would be nice too. Ideally the lexer automaton
could be saved with Marshal, in which case the time to build the
automaton isn't important.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] lexer library
  2007-08-18 18:39 lexer library skaller
@ 2007-08-18 22:34 ` Jon Harrop
  2007-08-19 10:13   ` Nicolas Pouillard
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Harrop @ 2007-08-18 22:34 UTC (permalink / raw)
  To: caml-list

On Saturday 18 August 2007 19:39:52 skaller wrote:
> I am interested in building a dynamically extensible lexer.. can
> anyone recommend any libraries or tools that would help?
>
> I could use Dypgen (extensible GLR parser) for this, but it is
> probably too slow.
>
> A system using combinators (rather than strings) would be preferred,
> and Unicode support would be nice too. Ideally the lexer automaton
> could be saved with Marshal, in which case the time to build the
> automaton isn't important.

The new camlp4 looks like it supports this but I'm damned if I can figure out 
how you use it. There is a beautiful tutorial on the Wiki that fizzles out 
just when it gets exciting.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?e


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] lexer library
  2007-08-18 22:34 ` [Caml-list] " Jon Harrop
@ 2007-08-19 10:13   ` Nicolas Pouillard
  2007-08-19 10:29     ` Joel Reymont
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pouillard @ 2007-08-19 10:13 UTC (permalink / raw)
  To: Jon Harrop; +Cc: O'Caml Mailing List

Excerpts from Jon Harrop's message of Sun Aug 19 00:34:44 +0200 2007:
> On Saturday 18 August 2007 19:39:52 skaller wrote:
> > I am interested in building a dynamically extensible lexer.. can
> > anyone recommend any libraries or tools that would help?
> >
> > I could use Dypgen (extensible GLR parser) for this, but it is
> > probably too slow.
> >
> > A system using combinators (rather than strings) would be preferred,
> > and Unicode support would be nice too. Ideally the lexer automaton
> > could be saved with Marshal, in which case the time to build the
> > automaton isn't important.
> 
> The new camlp4 looks like it supports this but I'm damned if I can figure out 
> how you use it. There is a beautiful tutorial on the Wiki that fizzles out 
> just when it gets exciting.
> 

Not  really,  with  the new camlp4 you can change the lexer and the token type
(thanks  to  the  system  module).  One can also dynamically add lexer filters
that  transforms  the  token stream. However the provided default lexer is not
extensible (it's an ocamllex one).

-- 
Nicolas Pouillard aka Ertai


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] lexer library
  2007-08-19 10:13   ` Nicolas Pouillard
@ 2007-08-19 10:29     ` Joel Reymont
  0 siblings, 0 replies; 4+ messages in thread
From: Joel Reymont @ 2007-08-19 10:29 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: Jon Harrop, O'Caml Mailing List


On Aug 19, 2007, at 11:13 AM, Nicolas Pouillard wrote:

> Not  really,  with  the new camlp4 you can change the lexer and the  
> token type (thanks  to  the  system  module).  One can also  
> dynamically add lexer filters that  transforms  the  token stream.

Are there any examples of this?

	Thanks, Joel

--
http://wagerlabs.com






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-19 10:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-18 18:39 lexer library skaller
2007-08-18 22:34 ` [Caml-list] " Jon Harrop
2007-08-19 10:13   ` Nicolas Pouillard
2007-08-19 10:29     ` Joel Reymont

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