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/19 Message-ID: <78257d$vjp$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 434397358 References: <77qu4d$jt8@lotho.delphi.com> <77vmri$sc3$1@nnrp1.dejanews.com> <36a39cec.1456120@news.pacbell.net> X-Http-Proxy: 1.0 x14.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: Tue Jan 19 14:35:26 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-01-19T00:00:00+00:00 List-Id: In article <36a39cec.1456120@news.pacbell.net>, tmoran@bix.com (Tom Moran) wrote: > >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 > A BNF production like > name : simple_name > might have an action like > {$$ := $1;} > which would translate into something like > yyval := yy.value_stack(yy.tos); > where yyval is a YYStype and yy.value_stack is an array of YYStype. > Would you define > type YYStype is Root_Token'Class; ? > I don't quite understand just how you are using the tagged type. > Ahhh. I see have given a lex answer to what was really a yacc question (this shouldn't have been a suprise to me given the Subject...) The fact is I haven't taken it that far yet. My parsing needs when I generated the token packages were so simple that it wouldn't have been worth it to generate another set of packages to help with parsing (the "yacc" side). My plan is eventually to do this for my master's work. I'm thinking about using a set of constructions on token enumerations similar to what was done for the Gnat Snobol packages to specify the rules, and taking in user defined function pointers to specify the actions. But I suspect you would prefer the voice of experience here rather than theories. T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own