From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Parsing Ada?
Date: Tue, 2 Jun 2015 18:36:21 +0200
Date: 2015-06-02T18:36:21+02:00 [thread overview]
Message-ID: <7cpxfz18lg2r$.ymcopru7qn8x.dlg@40tude.net> (raw)
In-Reply-To: 87pp5es5u4.fsf@adaheads.sparre-andersen.dk
On Tue, 02 Jun 2015 13:33:07 +0200, Jacob Sparre Andersen wrote:
> I would prefer to compile the grammar to Ada source text,
> which I then could compile into the program.
That is the core of the problem, then. Why would you do such thing? To
parse Ada you only need a recursive descent parser which is a couple of
hours to write.
> What open source parsers/parser generators are there for use in Ada
> programs? And what are your experiences with them?
I never bothered to write an Ada program parser because I considered it
trivial. All small compilers I wrote, from some very strange languages used
in automation, are recursive descent plus expression parser (if necessary).
This goes for each case statement at each level of the recursive descent
parser:
http://www.dmitry-kazakov.de/ada/components.htm#12.4.4
I don't know how many would be, a half of dozen, I suppose. Ada is a well
structured regular language.
This is for getting/skipping an expression:
http://www.dmitry-kazakov.de/ada/components.htm#12.9
This is to skip blanks in the source:
http://www.dmitry-kazakov.de/ada/components.htm#12.4.2
That's it. No structures/trees ever needed unless you generate them
yourself.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2015-06-02 16:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 11:33 Parsing Ada? Jacob Sparre Andersen
2015-06-02 12:09 ` G.B.
2015-06-02 12:36 ` Jacob Sparre Andersen
2015-06-02 14:47 ` Luke A. Guest
2015-06-02 16:36 ` Dmitry A. Kazakov [this message]
2015-06-03 22:39 ` Randy Brukardt
2015-06-04 7:45 ` Dmitry A. Kazakov
2015-06-03 7:58 ` Stephen Leake
2015-06-03 8:36 ` J-P. Rosen
2015-06-03 11:04 ` Simon Wright
2015-06-04 6:59 ` Jacob Sparre Andersen
2015-06-04 10:24 ` J-P. Rosen
2015-06-04 12:15 ` jan.de.kruyf
2015-06-04 12:30 ` jan.de.kruyf
2015-06-05 8:02 ` Simon Wright
2015-06-08 7:53 ` Jacob Sparre Andersen
2015-06-05 9:34 ` Stephen Leake
2015-06-08 8:34 ` Jacob Sparre Andersen
2015-06-08 22:45 ` wowwomenonwheels205
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox