I wrote a simple flex file:
%{
#include "question.tab.h"
%}
%%
COMMON(/[45]\.0)? return GOTCHA;
[a-z]+ return ETC;
%%
and tried to compile.(flex -d question.l
)
Then the output was as follows.
question.l:7: unrecognized rule
question.l:7: unrecognized rule
question.l:7: unrecognized rule
question.l:7: unrecognized rule
question.l:7: unrecognized rule
question.l:7: unrecognized rule
question.l:7: unrecognized rule
question.l:7: unrecognized rule
question.l:7: unrecognized rule
question.l:7: unrecognized rule
I wanted flex
to return GOTCHA
when it catches COMMON
, COMMON/4.0
, COMMON/5.0
.
What part of regexp should I fix?
Thank you for advance.