comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada 2012 grammar
Date: Thu, 24 Oct 2013 22:19:28 +0200
Date: 2013-10-24T22:19:28+02:00	[thread overview]
Message-ID: <qjnh8glnjdnx.18103uc3iehvi.dlg@40tude.net> (raw)
In-Reply-To: ffe8ecd4-065d-4c4c-b211-f9dad0f1959f@googlegroups.com

On Thu, 24 Oct 2013 08:01:13 -0700 (PDT), David Pereira wrote:

> I would like to extend it to some new contract constructs, but writing a
> complete parser is a huge (and extremely time-consuming) task that I would
> like to avoid :).

Difficult for parsing are only expressions. The language itself is very
simple to parse using recursive descent parser, e.g. to generate an AST. To
write a table-driven parse would be one-day work or so.

Ada expressions parser can be found here:

http://www.dmitry-kazakov.de/ada/components.htm#12.9

However it is Ada 95. The difference AFAIK to Ada 2005 is reserved words
like "interface" to filter out from identifiers. To Ada 2012 it is
conditional expressions. Not difficult to add.

I would not bother either with grammars.

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


  parent reply	other threads:[~2013-10-24 20:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 15:01 Ada 2012 grammar David Pereira
2013-10-24 16:49 ` G.B.
2013-10-24 21:11   ` David Pereira
2013-10-26  2:07     ` Stephen Leake
2013-10-26  5:57       ` Shark8
2013-11-11 14:55         ` Stephen Leake
2013-10-24 16:55 ` Dan'l Miller
2013-10-24 17:05   ` Marc C
2013-10-24 21:12   ` David Pereira
2013-10-24 20:19 ` Dmitry A. Kazakov [this message]
2013-10-24 22:29   ` David Pereira
replies disabled

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