caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* camlp4 - can you customize the lexer?
@ 2008-05-09  9:40 Richard Jones
  2008-05-09  9:44 ` [Caml-list] " Jon Harrop
  2008-05-10 20:38 ` Nicolas Pouillard
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Jones @ 2008-05-09  9:40 UTC (permalink / raw)
  To: caml-list


The Camlp4 wiki contains an intriguing line "Connecting your own
Lexer.", but no link or information.  I want to modify the OCaml lexer
to add a syntax for integer literals of my own type.  Can this be
done?  How?

Rich.

-- 
Richard Jones
Red Hat


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

* Re: [Caml-list] camlp4 - can you customize the lexer?
  2008-05-09  9:40 camlp4 - can you customize the lexer? Richard Jones
@ 2008-05-09  9:44 ` Jon Harrop
  2008-05-10 20:38 ` Nicolas Pouillard
  1 sibling, 0 replies; 3+ messages in thread
From: Jon Harrop @ 2008-05-09  9:44 UTC (permalink / raw)
  To: caml-list

On Friday 09 May 2008 10:40:36 Richard Jones wrote:
> The Camlp4 wiki contains an intriguing line "Connecting your own
> Lexer.", but no link or information.  I want to modify the OCaml lexer
> to add a syntax for integer literals of my own type.  Can this be
> done?  How?

I have asked this question periodically for about a year now. I believe the 
answer is "no".

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


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

* Re: [Caml-list] camlp4 - can you customize the lexer?
  2008-05-09  9:40 camlp4 - can you customize the lexer? Richard Jones
  2008-05-09  9:44 ` [Caml-list] " Jon Harrop
@ 2008-05-10 20:38 ` Nicolas Pouillard
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Pouillard @ 2008-05-10 20:38 UTC (permalink / raw)
  To: Richard Jones; +Cc: caml-list

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

Excerpts from Richard Jones's message of Fri May 09 11:40:36 +0200 2008:
> 
> The Camlp4 wiki contains an intriguing line "Connecting your own
> Lexer.", but no link or information.  I want to modify the OCaml lexer
> to add a syntax for integer literals of my own type.  Can this be
> done?  How?

Since  Camlp4,  is  now  a  lot  more  modular.  This can be done by providing
*another*  Lexer  module  with  a  compatible signature. Then one create a new
Camlp4.PreCast module by copy/pasting and using the new Lexer module.
However the default lexer of Camlp4 is not extensible.

Best regards,

-- 
Nicolas Pouillard aka Ertai

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

end of thread, other threads:[~2008-05-10 20:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-09  9:40 camlp4 - can you customize the lexer? Richard Jones
2008-05-09  9:44 ` [Caml-list] " Jon Harrop
2008-05-10 20:38 ` Nicolas Pouillard

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