Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I throw a ParseException instead of a TokenMgrError?

parseexception throw
0
Posted

How do I throw a ParseException instead of a TokenMgrError?

0

If you don’t want any TokenMgrErrors being thrown, try putting a regular expression production at the very end of your .jj file that will match any character: < * > TOKEN : { < UNEXPECTED_CHAR : ~[] > } However, this may not do the trick. In particular, if you use MORE, it may be hard to avoid TokenMgrErrors altogether. It is best to make a policy of catching TokenMgrErrors as well as ParseExceptions, whenever you call an entry point to the parser.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123