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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4a07e5fd38e94bef X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 30 May 2011 15:52:40 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Tentative design of markdown parser References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4de3a128$0$7613$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 30 May 2011 15:52:41 CEST NNTP-Posting-Host: c61f120c.newsspool1.arcor-online.net X-Trace: DXC=n]ckCS4b65D74okIm;?DS@ic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgBVlijeZK>]HAnc\616M64>JLh>_cHTX3jMj`h7g>j3XQG X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:19590 Date: 2011-05-30T15:52:41+02:00 List-Id: 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.