From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Ada 2012 grammar
Date: Fri, 25 Oct 2013 21:07:04 -0500
Date: 2013-10-25T21:07:04-05:00 [thread overview]
Message-ID: <85r4b8lr93.fsf@stephe-leake.org> (raw)
In-Reply-To: c76beb57-d614-4e04-b7b9-326685630747@googlegroups.com
David Pereira <dmrpereira@gmail.com> writes:
> Quinta-feira, 24 de Outubro de 2013 17:49:17 UTC+1, G.B. escreveu:
>> On 24.10.13 17:01, David Pereira wrote:
>>
>> > Does anyone know if there is available a complete grammar for Ada
>> > 2012, lets say, in Flex+Bison or similar compiler construction
>> > tool-chain?
>>
>> The latest Emacs Ada Mode (5.00) has a Wisent style grammar
>>
>> for Ada 2012. "Copyright (C) 2012 Free Software Foundation, Inc."
>>
>> It could be usable after editing it a little.
>
> Dear G.B,
>
> Very nice hint! I am a Emacs user, but didn't occurred that to me
> (shame on me :p).
It is very new.
Website: http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html
The grammar there has conflicts, so it relies on a generalized LALR
parser (http://en.wikipedia.org/wiki/Generalized_LR_parser), which I
implemented in Emacs lisp.
The grammar file can be parsed by a new OpenToken feature, and it will
generate either Ada OpenToken source code, or Emacs lisp for a parser
table; that version of OpenToken is available on the Ada mode website
(not the OpenToken website http://stephe-leake.org/ada/opentoken.html).
However, OpenToken only has a (non-generalized) LALR parser. It would be
interesting to implement a generalized parser for Opentoken; let me know
if you'd like to use that and/or help implement it.
It might not be too hard to eliminate the conflicts so you can use the
OpenToken parser (or some other parser); I did not do that because it
seemed easier (not to say way more fun) to implement the parser :). In
addition, the grammar source is closer to the Ada LRM Annex P this way.
I've improved Ada mode a bit since the last post on the website; it's
quite usable now. The latest is in monotone; see the Ada mode website
for access info. It is time to post another release; maybe this weekend.
Also note that I fixed several bugs in OpenToken, so if it was not
working for you before, you should try it again.
--
-- Stephe
next prev parent reply other threads:[~2013-10-26 2:07 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 [this message]
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
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