From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada platforms and pricing, was: Re: a new language, designed for safety ! Date: Thu, 19 Jun 2014 10:51:53 +0200 Organization: cbb software GmbH Message-ID: <1gxzsana2p116.9tf911p5igmt.dlg@40tude.net> References: <1402308235.2520.153.camel@pascal.home.net> <85ioo9yukk.fsf@stephe-leake.org> <255b51cd-b23f-4413-805a-9fea3c70d8b2@googlegroups.com> <5ebe316d-cd84-40fb-a983-9f953f205fef@googlegroups.com> <2100734262424129975.133931laguest-archeia.com@nntp.aioe.org> <857442918424729589.090275laguest-archeia.com@nntp.aioe.org> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: QTaafVZuunHujkJPndFR7g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:187069 Date: 2014-06-19T10:51:53+02:00 List-Id: On Wed, 18 Jun 2014 22:51:46 +0000 (UTC), Simon Clubley wrote: > On 2014-06-18, Simon Clubley wrote: >> >> However, off the top of my head, I don't understand why you can't parse >> an Ada expression using recursive descent, especially if you have access >> to the symbol table (if you need it). Do you have an example, because >> the answer's probably obvious once you point it out. :-) >> > > The above is a bit badly worded. It should say: > >|However, off the top of my head, I don't understand why you can't parse >|an Ada expression using recursive descent, especially since you have >|access to the symbol table (if you need it to solve the specific problem >|you are thinking of). > > IOW, I _think_ all ambiguity should be resolvable with a suitably rich > symbol table. Clearly that's not the case - and there's probably some > really obvious case I am missing. :-) It should be possible, I think, purely theoretically should be. But it would be quite difficult. Recursive descent parser is good for self-repeating nested structures, like [flat] fractals or statements and blocks of Ada. It is not good for structures like expressions. You can unwind an expression into something alike and encode that transformation into the parser, which is a guess [*]. But it does look neither simple nor natural to me. Then there are issues of handling precedence and rudimentary constant folding etc, which should not overburden already complicated semantic analysis. --------------- * There could be pitfalls. The method I am using requires two stacks. Recursive descent parser has only one stack. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de