Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Define parser and printer consistently
@ 2010-12-09  4:47 Dawid Toton
  0 siblings, 0 replies; 2+ messages in thread
From: Dawid Toton @ 2010-12-09  4:47 UTC (permalink / raw)
  To: caml-list

I'm going to define a parser and a printer for a simple grammar.
Is there a way to define both of them in a single construct using some 
existing OCaml tool?

For example, I have a keyword "function". The usual parser would contain 
a mapping like:
"function" -> `Function
and the straightforward printer would do:
`Function -> "function"

What is the best way to combine these definitions, so that duplication 
would be minimized?
To be precise, avoiding duplication is not exactly what I need. I'm 
looking for something that would prevent making inconsistent changes to 
the parser and the printer.

Dawid


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

end of thread, other threads:[~2010-12-09 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20101209110003.3C0B3BBAF@yquem.inria.fr>
2010-12-09 11:11 ` Define parser and printer consistently CUOQ Pascal
2010-12-09  4:47 Dawid Toton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox