comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Writing a scanner and parser in Ada
Date: Mon, 25 Dec 2017 18:08:36 +0100
Date: 2017-12-25T18:08:36+01:00	[thread overview]
Message-ID: <p1rbaj$1241$1@gioia.aioe.org> (raw)
In-Reply-To: 285de3c1-6c16-47b3-83b7-ec3419c8d324@googlegroups.com

On 2017-12-25 17:35, Yves Cloutier wrote:

> Yes my Perl version does all that in 1 pass, but one of the things I
> want to do is have it generate for different targets. Groff was my
> initial one. I wan't creating any kind of AST but I think I'll want to
> do that in my rewrite to make things simpler and allow for generating
> for other targets like maybe Latex, or epub etc...

You don't need AST for that. Simply define code generator interface 
(tagged) with abstract operations generating pieces of code. For each 
target have a derived type implementing these operations. Pass a 
class-wide Target object as a parameter to the parser. If the actual is 
of Groff_Target the result is groff etc.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2017-12-25 17:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-24  1:15 Writing a scanner and parser in Ada Yves Cloutier
2017-12-24  4:07 ` Robert Eachus
2017-12-25 16:32   ` Yves Cloutier
2017-12-24  9:08 ` Dmitry A. Kazakov
2017-12-24 15:09   ` Niklas Holsti
2017-12-25 16:37     ` Yves Cloutier
2017-12-25 16:35   ` Yves Cloutier
2017-12-25 17:08     ` Dmitry A. Kazakov [this message]
2017-12-25 18:57       ` Yves Cloutier
2017-12-25 19:19         ` Dmitry A. Kazakov
2017-12-26 18:06           ` Shark8
2017-12-26 21:45             ` Dmitry A. Kazakov
2017-12-26 22:20             ` Dmitry A. Kazakov
2017-12-24 14:40 ` Tero Koskinen
2017-12-25 16:36   ` Yves Cloutier
2017-12-24 15:33 ` Lucretia
replies disabled

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