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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news2.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news.abs.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: about OpenToken References: <439b6ac7$0$20862$636a55ce@news.free.fr> From: Stephen Leake Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:5be8tACr18V4oa8SvN/EKklMm4k= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 11 Dec 2005 08:14:30 -0500 NNTP-Posting-Host: 66.159.65.1 X-Complaints-To: abuse@toad.net X-Trace: news.abs.net 1134306871 66.159.65.1 (Sun, 11 Dec 2005 08:14:31 EST) NNTP-Posting-Date: Sun, 11 Dec 2005 08:14:31 EST Xref: g2news1.google.com comp.lang.ada:6827 Date: 2005-12-11T08:14:30-05:00 List-Id: Lionel Draghi writes: > Is 3.0b the latest available OpenToken version? I'm using a version of OpenToken that I have patched and enhanced. I'm no longer sure what version I got originally, but since the OpenToken website is dated 9/6/00, it's quite probable I started with 3.0b. Perhaps if there is enough interest, we should start a SourceForge project. > I'am not so sure, because some of the examples don't compile using > gnat 4.0.3 (Debian 4.0.2-4). I have not tried that yet, but I am using GNAT 5.03a. What sorts of errors are you getting? Perhaps it's one of the Ada 2006 features that is incompatible with Ada 95 (like the 'interface' keyword). > 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. I'm not using recursive descent, but I did play with selections and couldn't get them to work. So I just code all variants of the syntax: Grammar : constant Production_List.Instance := Tokens.Statement <= Go_Statement and Go_Statement <= -- go; Nonterminal.Get (Go_ID) + Execute_Action and Go_Statement <= -- go sync; Nonterminal.Get (Go_ID) & Nonterminal.Get (Sync_ID) + Execute_Action and Go_Statement <= -- go count; Nonterminal.Get (Go_ID) & Tokens.Integer + Execute_Action and Go_Statement <= -- go hardware; Nonterminal.Get (Go_ID) & Nonterminal.Get (Hardware_ID) + Execute_Action and Go_Statement <= -- go hardware sync; Nonterminal.Get (Go_ID) & Nonterminal.Get (Hardware_ID) & Nonterminal.Get (Sync_ID) + Execute_Action and Go_Statement <= -- go hardware count; Nonterminal.Get (Go_ID) & Nonterminal.Get (Hardware_ID) & Tokens.Integer + Execute_Action; > PS : and once more question : is there still a mail list for OpenToken > on AdaPower site? (I would like to have a look at the archive) The only things about OpenToken I found on AdaPower point to the OpenToken web site. -- -- Stephe