From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.191.7 with SMTP id p7mr17117217iof.130.1514219741713; Mon, 25 Dec 2017 08:35:41 -0800 (PST) X-Received: by 10.157.67.108 with SMTP id y41mr1034510oti.5.1514219741531; Mon, 25 Dec 2017 08:35:41 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g80no2452570itg.0!news-out.google.com!s63ni4311itb.0!nntp.google.com!g80no2452566itg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 25 Dec 2017 08:35:41 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=174.114.57.218; posting-account=yfhumQoAAACUMOSAPBmheMxZJWoNg1wi NNTP-Posting-Host: 174.114.57.218 References: <2d87298a-4d1f-446a-9d46-d4f03879246b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <285de3c1-6c16-47b3-83b7-ec3419c8d324@googlegroups.com> Subject: Re: Writing a scanner and parser in Ada From: Yves Cloutier Injection-Date: Mon, 25 Dec 2017 16:35:41 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Body-CRC: 1393271559 X-Received-Bytes: 2412 Xref: reader02.eternal-september.org comp.lang.ada:49634 Date: 2017-12-25T08:35:41-08:00 List-Id: 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: >=20 > > I'd like to know if there are any examples of how to write a scanner > > and parser in Ada. >=20 > Table-driven parser: >=20 > http://www.dmitry-kazakov.de/ada/components.htm#Parsers_etc >=20 > > I have a pet project where I have a DSL that I want to use as input, > > scan, parse, then output as Groff code. >=20 > Normally for a domain-specific language you would do all that in a=20 > single step: match source against current table, descent/ascent and/or=20 > generate code, repeat. >=20 > --=20 > 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 t= o 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 re= write to make things simpler and allow for generating for other targets lik= e maybe Latex, or epub etc... I'll have a look, thanks for the link!