SKIP "\n" only sometimes in javacc?

142 views Asked by At

I have a skip

SKIP :
{
  " "
| "\t"
| "\n"
| "\r"
| "\f"
}

But I would like to define

TOKEN :
{
  < END_EXP: (";"|"\n") >
}

I don't want to remove "\n" from SKIP as I want it to be ignored for everything except when I'm expecting an END_EXP. How do I get javacc to skip "\n" only some of the time?

0

There are 0 answers