public class TokenMismatchException
extends TokenException
Exception thrown when a parser encounters a token of an unexpected type. Contains information about both the unexpected token found and the expected token type. Extends TokenException to inherit token-based error reporting.
| Constructor and description |
|---|
TokenMismatchException(Token token, int expectedType)Constructs a TokenMismatchException. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public int |
getExpectedType()Returns the token type that was expected. |
|
public Token |
getUnexpectedToken()Returns the unexpected token that triggered this exception. |
| Methods inherited from class | Name |
|---|---|
class SyntaxException |
getEndColumn, getEndLine, getLine, getMessage, getOriginalMessage, getSourceLocator, getStartColumn, getStartLine, setSourceLocator |
class GroovyException |
isFatal, setFatal |
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.