Re: ‘void free(void*)’ called on un allocated object ‘yyssa’ [-Wfree-nonheap- object]
Akim Demaille <[email protected]> Tue, 19 Jan 2021 06:47:06 +0100
| Newsgroups | gmane.comp.parsers.bison.general |
|---|---|
| Message-ID | <[email protected]> |
Christoph,
FWIW, it appears that Bison is vastly underused in this grammar.
For instance, all these occurrences of $<str> should just read
$$ or $1. Who is in charge of maintaining the parsers in there?
Start:
GoalWithOptionalBackSlash {
$<str>$ = 0;
yyGetParser->SetResult($<str>1);
}
GoalWithOptionalBackSlash:
Goal {
$<str>$ = $<str>1;
}
| Goal cal_BSLASH {
$<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
}
Goal:
{
$<str>$ = 0;
}
| String Goal {
$<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
}
Not to below that here the actions are simply useless.
String:
OuterText {
$<str>$ = $<str>1;
}
| Variable {
$<str>$ = $<str>1;
}
it should be
String:
OuterText
| Variable
;
OuterText:
cal_NAME {
$<str>$ = $<str>1;
}
| cal_AT {
$<str>$ = $<str>1;
}
| cal_DOLLAR {
$<str>$ = $<str>1;
}
[and so on and so on...]