Search code examples
parsingjavaccparseexception

difference between ParseException and TokenManagerError (javaCC)


What is the difference between ParseException and TokenManagerError? Topic: javaCC, generate parser, error message An example to explain would be good.

Tries to read in literature or error message, googel, chat, found nothing at least


Solution

  • A TokenManagerError is thrown when the input sequences of characters can not be turned into a sequence of Tokens -- i.e., when lexical analysis fails.

    A ParseException occurs when the input sequence of tokens can't be matched -- i.e., when parsing fails.

    See the FAQ for advice on how and why to avoid TokenManagerErrors.