comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: Ada type (yacc)YYSTYPE is ?
Date: 1999/01/19
Date: 1999-01-19T00:00:00+00:00	[thread overview]
Message-ID: <78257d$vjp$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 36a39cec.1456120@news.pacbell.net

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    




  reply	other threads:[~1999-01-19  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-16  0:00 Ada type (yacc)YYSTYPE is ? tmoran
1999-01-17  0:00 ` Steven Hovater
1999-01-18  0:00 ` dennison
1999-01-18  0:00   ` Tom Moran
1999-01-19  0:00     ` dennison [this message]
1999-01-18  0:00 ` Tucker Taft
1999-01-18  0:00   ` Tom Moran
1999-01-19  0:00     ` Andrew W. Reynolds
1999-01-19  0:00       ` Tom Moran
1999-01-19  0:00         ` rdt
1999-01-19  0:00           ` Martin C. Carlisle
replies disabled

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