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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,13b4e394fcd91d4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.199.73 with SMTP id ji9mr13414453pbc.5.1328000978314; Tue, 31 Jan 2012 01:09:38 -0800 (PST) Path: lh20ni244243pbb.0!nntp.google.com!news1.google.com!goblin3!goblin1!goblin.stu.neva.ru!news.astraweb.com!border6.a.newsrouter.astraweb.com!feed.xsnews.nl!border-1.ams.xsnews.nl!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 31 Jan 2012 10:09:37 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: OpenToken: Handling the empty word token References: <62121d9d-f208-4e78-a109-749742da14a6@h12g2000yqg.googlegroups.com> <1jvlv7i0tn14u.b5d2cwsqhl2h$.dlg@40tude.net> <82ehuibdwt.fsf@stephe-leake.org> In-Reply-To: Message-ID: <4f27afd1$0$6633$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 31 Jan 2012 10:09:37 CET NNTP-Posting-Host: 6c64f044.newsspool2.arcor-online.net X-Trace: DXC=KZCVd_DRRPK02Sh8E_NfIAA9EHlD;3YcB4Fo<]lROoRA8kFejVHNdlKh1 On 31.01.12 01:56, Randy Brukardt wrote: > "Stephen Leake" wrote in message > news:82ehuibdwt.fsf@stephe-leake.org... >> "Randy Brukardt" writes: > ... >>> I'd be surprised if OpenToken didn't have something similar; >> >> Not quite. Because OpenToken uses Ada types to build the grammar, we >> need an explicit Epsilon token (full code below): > > I see. It appears that OpenToken uses an LL-derived parsing scheme. (It > appears to be a version of recursive descent, which is an LL scheme.] And > it's important to note that LL parsing cannot include epsilon tokens and > have problems with left-recursion. LL parsing can include empty words. But then, the grammar might be such that predicting the next rule via FIRST and FOLLOW sets does not lead to a single result. (In which case one could say "cannot parse" or boldly move on and pick a production, try it, and if it fails, try the next, I should think.) No guarantees.