comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <PChapin@vtc.vsc.edu>
Subject: Re: LALR parser question
Date: Tue, 30 Apr 2013 07:55:02 -0400
Date: 2013-04-30T07:55:02-04:00	[thread overview]
Message-ID: <d8qdnahCsYmKLOLM4p2dnAA@giganews.com> (raw)
In-Reply-To: <op.wwb5wszeule2fv@cardamome>


On 04/30/2013 12:11 AM, Yannick Duchêne (Hibou57) wrote:

> The main issue with this argument, is that performance isn't a big issue
> at this stage. What comes next — analyses, transformations, code
> generation — is more important for the overall performance of a
> compiler. Then anyway, being exact is far more important than being
> fast, for a compiler, and in that matter, the two previous points values
> a lot more (the points about clarity and precision).

I've started toying around with building an Ada 2012 parser using the 
ANTLR v4 parser generator tool. I haven't gotten very far with this yet 
so it's too early to draw any conclusions but ANTLR is quite powerful so 
I'm hoping the process will be fairly enjoyable... educational at least :)

ANTRL v3 generates LL(*) parsers. I understand ANTLR v4 uses a somewhat 
different algorithm and is quite liberal with what it will accept. I 
started by just typing in the grammar in the Ada reference manual and, 
aside from the left recursive loops, ANTRL v4 accepted it as is. (I'm 
not naive enough to believe that's good enough... so don't worry about 
that).

The cool thing about ANTLR v4 is that it separates the actions from the 
grammar itself so one can use the same grammar to generate parsers in 
multiple languages. At least that's the idea. It remains to be seen how 
well it will actually work for Ada.

Peter




  reply	other threads:[~2013-04-30 11:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-28 13:37 LALR parser question Stephen Leake
2013-04-28 14:43 ` Dmitry A. Kazakov
2013-04-30  1:19   ` Yannick Duchêne (Hibou57)
2013-04-30  2:03     ` John B. Matthews
2013-04-30  4:11       ` Yannick Duchêne (Hibou57)
2013-04-30 11:55         ` Peter C. Chapin [this message]
2013-04-30 13:14           ` john
2013-04-30 14:14             ` Dmitry A. Kazakov
2013-05-01 11:33             ` Peter C. Chapin
2013-04-30 16:06     ` Shark8
2013-04-30 17:15       ` Yannick Duchêne (Hibou57)
2013-04-30 17:51         ` Shark8
2013-04-30 18:52           ` Yannick Duchêne (Hibou57)
2013-05-01 12:31         ` Stephen Leake
2013-05-01 13:57           ` Shark8
2013-04-30 21:18       ` Dmitry A. Kazakov
2013-04-30 22:09         ` Shark8
2013-05-02  1:49 ` Randy Brukardt
2013-05-02  2:39   ` Yannick Duchêne (Hibou57)
2013-05-02 21:57     ` Randy Brukardt
2013-05-06 18:25     ` Oliver Kellogg
2013-05-03  9:45   ` Stephen Leake
2013-05-03 22:57     ` Randy Brukardt
2013-05-06  9:45     ` Stephen Leake
replies disabled

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