Re: Not able to use %union?

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
     Le 19 fA(c)vr. 2019 A  07:01, Peng Yu <[email protected]> a
     A(c)crit :

     I don't want to call "rs_init(&yylval->str)" in any action.

     You don't have to do that in every action, just the ones returning
     strings.

     I don't get the point.

   Because I misread, sorry.  I read "in every action".

     Is there a problem to not call "rs_init(&yylval->str)" in any action
     (this include the actions that return strings)?

   Well, I don't see how you would store several strings (say
   echo "foo" "bar", that's probably three strings) with just one
   allocation.  But then again, I don't know enough about your
   situation, and your parser.
   That's what this link is about.
   https://www.gnu.org/software/bison/manual/bison.html#Strings-are-Destro
   yed
_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.