Re: When to free RHS tokens?

2016-12-27 Thread William Brannon
Thanks all, that was very helpful. On Dec 27, 2016 10:06 AM, "John Levine" wrote: > >forvalues_cmd: > >FORVALUES IDENT "=" NUMBER "(" NUMBER ")" NUMBER "{" STRING_LITERAL "}" > >{ > >// do I need to free() or del tokens $3, $5, $7, $9 and $11? > > No. Bison tokens live in an array,

Re: When to free RHS tokens?

2016-12-27 Thread John Levine
>forvalues_cmd: >FORVALUES IDENT "=" NUMBER "(" NUMBER ")" NUMBER "{" STRING_LITERAL "}" >{ >// do I need to free() or del tokens $3, $5, $7, $9 and $11? No. Bison tokens live in an array, no allocation or deallocation needed. If the lexer or parser puts a pointer to an allocated thi

Re: When to free RHS tokens?

2016-12-27 Thread Hans Ã…berg
> On 27 Dec 2016, at 00:48, William Brannon wrote: > My question is: do the actions for these productions need to > explicitly deallocate memory associated with the unused tokens? I > believe not, because: > o) the tokens don't have types, so they're just #define'd to integers, > o) which is why