Parsing Ada 95/2005
(1) By theruran on 2022-12-27 03:03:19 [link] [source]
There seems to be an elisp LALR parser in ELPA ada-mode. Maybe we can adapt that and make our lives easier.
I also have this paper bookmarked, although it is ancient: An LALR (1) grammar for (revised) Ada
The Ada 95 BNF syntax is included in the Reference Manual Annex P.
(2) By root on 2022-12-29 21:38:15 in reply to 1 [link] [source]
I was not aware of ada-mode's LALR parser, thanks! I had also not seen Annex P, which will for sure help.
However, I am concerned with ada-mode's parser... It is part of ELPA, which means it is part of GNU, which means it is GPLv3 licensed. Of course, we cannot just copy-paste it as we are not working with ELisp. But using/translating GPLv3 code may require that ours be also GPLv3, which I would like to avoid. I will make a forum thread to discuss the license.
(3) By anonymous on 2024-03-15 07:43:44 in reply to 1 [source]
There is a YACC grammar file and lex specification in this adaic page, it seems to be ok to parse the Ada source files in GCC 3.4.6. I'm going to use this to write my bootstrap compiler: https://www.adaic.org/ada-resources/standards/ada-95-documents/
The links of the grammar file and lex spec: https://www.adaic.org/resources/add_content/standards/95lrm/grammar9x.y https://www.adaic.org/resources/add_content/standards/95lrm/lexer9x.l