[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Not able to use %union?
From: |
Akim Demaille |
Subject: |
Re: Not able to use %union? |
Date: |
Tue, 19 Feb 2019 08:26:16 +0100 |
Le 19 fA(c)vr. 2019 A 07:01, Peng Yu <address@hidden> 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
- Re: Not able to use %union?, (continued)