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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,59ea45c31346f2c4 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Ada type (yacc)YYSTYPE is ? Date: 1999/01/18 Message-ID: <77vmri$sc3$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 434010881 References: <77qu4d$jt8@lotho.delphi.com> X-Http-Proxy: 1.0 x4.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Mon Jan 18 16:18:04 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-01-18T00:00:00+00:00 List-Id: In article <77qu4d$jt8@lotho.delphi.com>, tmoran@bix.com wrote: > YACC is designed with a C 'union' type as a typeless, semantic > token information holder variable. What's a good way in Ada to > handle that, hopefully with some help from Ada type checking? > One obvious one is a variant record. Any better ideas? > What I did for my token analysis packages is I created an abstract tagged "token" type. That way the tag acts as the variant, and you can put whatever you want in the child types. Plus this allows you to define routines that will work on all tokens, individual tokens, or subsets of individual tokens. BTW, For those of you interested in this: I have no response yet on "opening" the token packages from my boss here. The prognisis doesn't look good. However, it looks like I will be working on making open-source lexical analysis and parsing packages for Ada for my master's thesis. Assuming everyone at UCF signs off, I'd be officially starting work on it after this semester ends. My plan is to get a (mostly) working set of lexical analysis packages publicly available by the middle of June. The parsing packages would probably follow during the fall semester. T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own