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 X-Google-Thread: 103376,f384032a8c47ef0d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: about OpenToken Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <439b6ac7$0$20862$636a55ce@news.free.fr> Date: Sun, 11 Dec 2005 12:00:02 +0100 Message-ID: NNTP-Posting-Date: 11 Dec 2005 12:00:03 MET NNTP-Posting-Host: c6728dad.newsread2.arcor-online.net X-Trace: DXC=bfCFh6Eg?Via0B5i45NL;dQ5U85hF6f;djW\KbG]kaMhn6A=Y6OiEad81\REX0Hi4jWRXZ37ga[7jjTA67ckJ=XeG7]IM_fcfYk X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:6822 Date: 2005-12-11T12:00:03+01:00 List-Id: On Sun, 11 Dec 2005 00:54:49 +0100, Lionel Draghi wrote: > Here is my problem : I am implementing a recursive descent parser, and > my grammar contains optionnals keywords, that will be ignored. > Here is an exemple: > - do this and this > - do this and also this > "also" is an optionnal keyword. > > I am wondering what is the best way to deal with this. > What comes to my mind is to create a selection (In OpenToken parlance) > between the keyword "also" and a null token, child of the abstract > "Recognizer.Nothing" token. If optional keywords cannot appear in any context in any number then this will not work. > It seems far to complex to be the right way. Any hints? Far too simple you mean... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de