When dealing with strings (it has its own state like comments) i need to find out if the next letter is a " or not. If it is i dont end the string state. So what happens is i just dont end the string in my string state (i use <STRING_STATE>.
and process it letter by letter). So what happens is, i mark if the last string was " and if the current isnt i exit the state and unput the last letter.
This has a weird effect. When i get errors on lines with strings i see the letter (usually a ',' or ')') twice. and if it happens to be on the end of the line the side effect counts as two lines! (even if there isnt an error).
How can i solve this? is my only option to create a global var and mark it when i leave the string state and hack YY_USer to fix itself? i kind of want to avoid that. To be cleaner i could just look at the next letter or token, is that possible?