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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.52.28.5 with SMTP id x5mr8684224vdg.3.1434562972274; Wed, 17 Jun 2015 10:42:52 -0700 (PDT) X-Received: by 10.182.107.196 with SMTP id he4mr74199obb.16.1434562972237; Wed, 17 Jun 2015 10:42:52 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!z60no1773462qgd.1!news-out.google.com!7ni1211igs.0!nntp.google.com!h15no4610818igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 17 Jun 2015 10:42:52 -0700 (PDT) In-Reply-To: <85twu68cqb.fsf@stephe-leake.org> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.123.142.129; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 97.123.142.129 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> <85twu68cqb.fsf@stephe-leake.org> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <345eeeff-4d59-4b42-8d11-b7567368ea8b@googlegroups.com> Subject: Re: OpenToken: Parsing Ada (subset)? From: Shark8 Injection-Date: Wed, 17 Jun 2015 17:42:52 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2240 X-Received-Body-CRC: 1231584701 Xref: news.eternal-september.org comp.lang.ada:26359 Date: 2015-06-17T10:42:52-07:00 List-Id: On Wednesday, June 17, 2015 at 11:29:51 AM UTC-6, Stephen Leake wrote: >=20 > It's _not_ a "parser"; it's a "lexer". >=20 > Define "right". The line between lexer and parser is a design decision, > not set in stone.=20 >=20 > > and you have to > > reparse the matched chunk of text once again. What was the gain?=20 >=20 > Doing it this way allows reusing a regexp engine, which is easier than > writing a lexer from scatch. I just implemented a parser for BB-code (a subset, anyway) -- lexing is ess= entially finding '[', the ']' after that occurrence, if '/' is the '['+1th = character. -- Even though that, in itself, isn't beyond the capabilities of= regex I wouldn't recommend using regex: the "simple" usually turns out to = be deceptive, esp. WRT regex.