java - How to make custom JavaCC Exception messages? -
i want start of saying know similar question exists here: how create specific error messages based on parse exceptions in javacc
but don't have required 50 rep comment on ask question.
i'm trying make if token not uppercase "input must uppercase.". there's bit more code, that's want do.
i tried answer suggests , have or @ end contain code throw custom message exception, doesn't seem every reach it, , prints out normal exception message.
<upper: (["a"-"z"])+>
token.
void start(): {} { <upper> | {throw new parseexception("custom message");} }
i feel may fact token number of uppercase characters, i'm not sure.
thanks in advance help.
i've since looked @ answer, after few days, , realised problem mis-matches brackets let final | not being contained in correct place.
need make sure in future brackets match right place...
Comments
Post a Comment