comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Parser interface design
Date: Wed, 06 Apr 2011 14:17:29 +0200
Date: 2011-04-06T14:17:30+02:00	[thread overview]
Message-ID: <4d9c59da$0$7664$9b4e6d93@newsspool1.arcor-online.net> (raw)
In-Reply-To: <slrnipof32.2fnq.lithiumcat@sigil.instinctive.eu>

On 06.04.11 12:11, Natasha Kerensikova wrote:

> I can see three kinds of interfaces:
>   * an "offline" interfacing, where the parser returns an in-memory
>     abstract representation of the input, which is then processed by the
> renderer to produce its output;
>   * an "event-based" interfacing, which is basically an "online"
>     renderer-driven interfacing: the parser is first fed the input text,
> and then various functions allows to query its state, the current
> "event" (an event being "that kind of element has been encountered", or
> "the input file is over"), the event parameters, etc.
>   * a "callback-based" interfacing, which is an "online" parser-driven
>     interfacing, where the parser is provided both the input text and a
> set of callback from the renderer.

Before offering an answer to the other questions, I'd like to
throw in a fourth option:

 * use a task that serves as an event queue. The task will collect
parsing events and forward them as necessary.  The parser is then
completely ignorant of any rendering.

As there are several input formats, one might either activate the
task matching the input format, or make a task exhibit different
behavior depending on the input format.




  reply	other threads:[~2011-04-06 12:17 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-06 10:11 Parser interface design Natasha Kerensikova
2011-04-06 12:17 ` Georg Bauhaus [this message]
2011-04-07 18:56   ` Natasha Kerensikova
2011-04-08 11:49     ` Stephen Leake
2011-04-06 12:20 ` Dmitry A. Kazakov
2011-04-07 19:14   ` Natasha Kerensikova
2011-04-07 20:31     ` Dmitry A. Kazakov
2011-04-08 13:51       ` Natasha Kerensikova
2011-04-08 14:21         ` Dmitry A. Kazakov
2011-04-12 15:58           ` Natasha Kerensikova
2011-04-12 17:14             ` Dmitry A. Kazakov
2011-04-06 15:51 ` Georg Bauhaus
2011-04-07 19:44   ` Natasha Kerensikova
2011-04-07 20:52     ` Dmitry A. Kazakov
2011-04-07 22:09     ` Simon Wright
2011-04-08 14:03       ` Natasha Kerensikova
2011-04-08 19:06         ` Jeffrey Carter
2011-04-08 19:59         ` Simon Wright
2011-04-12 16:13           ` Natasha Kerensikova
2011-04-12 17:22             ` Dmitry A. Kazakov
2011-04-12 19:02               ` Simon Wright
2011-04-13  8:20                 ` Natasha Kerensikova
2011-04-13  8:37                   ` Dmitry A. Kazakov
2011-04-13 11:06                     ` Georg Bauhaus
2011-04-13 12:46                       ` Dmitry A. Kazakov
2011-04-13 22:33                   ` Randy Brukardt
2011-04-14  6:55                     ` Natasha Kerensikova
2011-04-15  0:22                       ` Randy Brukardt
2011-04-12 21:54               ` Randy Brukardt
2011-04-07 22:13     ` Georg Bauhaus
2011-04-08 15:30       ` Natasha Kerensikova
2011-04-07  0:36 ` Randy Brukardt
2011-04-08 11:16 ` Brian Drummond
2011-04-19  9:08 ` Natasha Kerensikova
2011-04-19 12:35   ` Ludovic Brenta
2011-04-20 10:44     ` Brian Drummond
2011-04-19 17:28   ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox