Pretty much. Part of what the single_identifier action does is copy
yytext into a std::string, and then it's that std::string that I use
from then on.
Actually, just now I changed that IDENTIFIER inside the
field_declaration section to single_identifier, and now it works! Why
would that make
Are you strcpy'ing off the value of yytext before getting it from $3?
-Chris
On Mon, Mar 8, 2010 at 6:10 PM, Brad wrote:
> Doh, sorry about that. The extra single_identifier was left over from when
> I was trying to debug the problem. The original grammar that has the yytext
> issue didn't hav
Doh, sorry about that. The extra single_identifier was left over from
when I was trying to debug the problem. The original grammar that has
the yytext issue didn't have the extra single_identifier. Ignore it.
-Brad
Chris verBurg wrote:
Hey Brad,
Do you mean to have "single_identifier" listed
Here is a snippet from my grammer that parses a C++-like language.
field_declaration:
modifiers_opt type IDENTIFIER SEMICOLON
{
/* stuff */
}
;
method_header:
modifiers_opt type single_identifier single_identifier LPAREN RPAREN
{
/* stuff */
}
| modifiers_op