comp.lang.ada
 help / color / mirror / Atom feed
From: Yves Cloutier <yves.cloutier@gmail.com>
Subject: Re: Writing a scanner and parser in Ada
Date: Mon, 25 Dec 2017 08:35:41 -0800 (PST)
Date: 2017-12-25T08:35:41-08:00	[thread overview]
Message-ID: <285de3c1-6c16-47b3-83b7-ec3419c8d324@googlegroups.com> (raw)
In-Reply-To: <p1nqr5$1oer$1@gioia.aioe.org>

On Sunday, December 24, 2017 at 4:08:56 AM UTC-5, Dmitry A. Kazakov wrote:
> On 2017-12-24 02:15, Yves Cloutier wrote:
> 
> > I'd like to know if there are any examples of how to write a scanner
> > and parser in Ada.
> 
> Table-driven parser:
> 
>     http://www.dmitry-kazakov.de/ada/components.htm#Parsers_etc
> 
> > I have a pet project where I have a DSL that I want to use as input,
> > scan, parse, then output as Groff code.
> 
> Normally for a domain-specific language you would do all that in a 
> single step: match source against current table, descent/ascent and/or 
> generate code, repeat.
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

Hi Dimitry,

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

I'll have a look, thanks for the link!


  parent reply	other threads:[~2017-12-25 16:35 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 [this message]
2017-12-25 17:08     ` Dmitry A. Kazakov
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