I am trying to use JFlex to build a parser but encounter a very basic issue. I want to have this token
[A-Za-z]+_N$ { System.out.println("Noun"); }
and have it recognize "car_N" as a "Noun" and NOT recognize "car_NN". but it does not work, if I use
[A-Za-z]+_N { System.out.println("Noun"); }
"car_N" get recognize but "car_NN" returns "car_N" as well, this is not what I want.
I wonder anyone here knows how to help?
JFlex and Flex lookahead symbol '$' does not seem to be working