I\'m trying to write a EPL parser,so I\'m learning flex and bison.I try using it with following rules(SQL):
SELECT { cout<<\"SELECT detected\"<
You must create a copy of the token string (yytext
) if you want to use it outside of the flex action. The string pointed to by yytext
is a temporary value, and will be modified as soon as the lexer is re-entered.
See the bison FAQ, the flex manual, or any number of SO questions (which are harder to search for because many of the questioners misdiagnose the problem).