From: Shark8 <onewingedshark@gmail.com>
Subject: Re: OpenToken: Parsing Ada (subset)?
Date: Wed, 17 Jun 2015 10:42:52 -0700 (PDT)
Date: 2015-06-17T10:42:52-07:00 [thread overview]
Message-ID: <345eeeff-4d59-4b42-8d11-b7567368ea8b@googlegroups.com> (raw)
In-Reply-To: <85twu68cqb.fsf@stephe-leake.org>
On Wednesday, June 17, 2015 at 11:29:51 AM UTC-6, Stephen Leake wrote:
>
> It's _not_ a "parser"; it's a "lexer".
>
> Define "right". The line between lexer and parser is a design decision,
> not set in stone.
>
> > and you have to
> > reparse the matched chunk of text once again. What was the gain?
>
> 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 essentially 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.
next prev parent reply other threads:[~2015-06-17 17:42 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-01 13:08 OpenToken: Parsing Ada (subset)? Jacob Sparre Andersen
2015-06-02 22:12 ` Stephen Leake
2015-06-03 1:43 ` Shark8
2015-06-03 7:36 ` Dmitry A. Kazakov
2015-06-05 9:03 ` Stephen Leake
2015-06-05 9:23 ` Georg Bauhaus
2015-06-05 20:49 ` Shark8
2015-06-05 23:52 ` Dennis Lee Bieber
2015-06-05 12:20 ` Dmitry A. Kazakov
2015-06-16 12:43 ` Stephen Leake
2015-06-16 13:24 ` Dmitry A. Kazakov
2015-06-16 14:13 ` G.B.
2015-06-17 17:38 ` Stephen Leake
2015-06-17 17:29 ` Stephen Leake
2015-06-17 17:42 ` Shark8 [this message]
2015-06-17 19:03 ` Dmitry A. Kazakov
2015-06-05 20:53 ` Shark8
2015-06-16 14:46 ` Stephen Leake
2015-06-16 15:31 ` G.B.
2015-06-17 17:44 ` Stephen Leake
2015-06-16 21:34 ` Randy Brukardt
2015-06-17 17:58 ` Stephen Leake
2015-06-17 20:44 ` Randy Brukardt
2015-06-18 7:51 ` AdaMagica
2015-06-18 9:12 ` Georg Bauhaus
2015-06-17 17:50 ` AdaMagica
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox