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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: OpenToken: Parsing Ada (subset)? Date: Tue, 16 Jun 2015 16:13:46 +0200 Organization: A noiseless patient Spider Message-ID: References: <878uc3r2y6.fsf@adaheads.sparre-andersen.dk> <85twupvjxo.fsf@stephe-leake.org> <81ceb070-16fe-4578-a09a-eb11a2bbb664@googlegroups.com> <162zj7c2l0ykp$.1rxias18vby83.dlg@40tude.net> <856172bk80.fsf@stephe-leake.org> <1ljiyuuchbxvp.wrtbilkw3rdb.dlg@40tude.net> <85pp4vakmy.fsf@stephe-leake.org> <1a08qrccls0bi$.16y7q3hosklae.dlg@40tude.net> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 16 Jun 2015 14:12:28 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="27798"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Ydz5VUm+OBeFc5llxhwZj0RAcDLZk46E=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <1a08qrccls0bi$.16y7q3hosklae.dlg@40tude.net> Cancel-Lock: sha1:FoygQetFacpAc4T2oJAvIiCoZgk= Xref: news.eternal-september.org comp.lang.ada:26346 Date: 2015-06-16T16:13:46+02:00 List-Id: On 16.06.15 15:24, Dmitry A. Kazakov wrote: >> It does not enforce all the lexical rules for numbers; it allows >> >repeated, leading, and trailing underscores; it doesn't enforce pairs of >> >'#'. > That is exactly the point. It does not parse literal right and you have to > reparse the matched chunk of text once again. What was the gain? Why > wouldn't do it right in single step? (I believe the use case here permits simplifications, meaning that REs are not being used for meticulous, final parsing of Ada.) But '_' seems missing from "[-+0-9a-fA-F.]+". (And obsolete Ada syntax, i.e. substitutes for '#'. Which makes a CFG parser more desirable if '#' or ':' should have matching occurrences. ;-)