comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Tentative design of markdown parser
Date: Mon, 30 May 2011 15:52:40 +0200
Date: 2011-05-30T15:52:41+02:00	[thread overview]
Message-ID: <4de3a128$0$7613$9b4e6d93@newsspool1.arcor-online.net> (raw)
In-Reply-To: <slrniu1to9.i18.lithiumcat@sigil.instinctive.eu>

On 28.05.11 15:22, Natasha Kerensikova wrote:

> This is actually the only point I don't like about the design: there
> should be a way to check at compile time that in a Span_Element the
> Renderer_Callback can actually handle what is produced by the
> Lexer_Callback. However I can't find any.

When I know all the types of objects that Lexer_Callback
can produce, I like to list them in an enumeration type,
type Token_Kind is (A, B, C, ...).
 Then, in every object of

type Renderer_Callback is access procedure (
   Token : Token_Root'Class);

I'd use case coverage to make sure that it will handle
Token: the enumeration value is a component of Token,
or else I call a function on Token that returns its
Token_Kind.





  parent reply	other threads:[~2011-05-30 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-28 13:22 Tentative design of markdown parser Natasha Kerensikova
2011-05-28 14:40 ` Yannick Duchêne (Hibou57)
2011-05-30  8:13   ` Natasha Kerensikova
2011-05-30 13:52 ` Georg Bauhaus [this message]
2011-05-30 18:07   ` Natasha Kerensikova
replies disabled

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