I am about to write a compiler for c, and by referencing google I found that the star character is in both the definitions of operator and punctuator. I think it should be decided at the step of parsing as we can not judge until we look around it.But I have to generate a token for that star character before parsing.
But I have to generate a token for that star character before parsing.
So do. Just generate a *
token when you see a *
. You don't need to know how the *
is going to be used in order to generate a token for it.