UnexpectedToken

UnexpectedToken

An exception that is raised by the parser, when the token it received doesn't match any valid step forward.

Parameters:
    token: The mismatched token
    expected: The set of expected tokens
    considered_rules: Which rules were considered, to deduce the expected tokens
    state: A value representing the parser state. Do not rely on its value or type.
    interactive_parser: An instance of ``InteractiveParser``, that is initialized to the point of failture,
                        and can be used for debugging and error handling.

Note: These parameters are available as attributes of the instance.

UnexpectedToken

An exception that is raised by the parser, when the token it received doesn't match any valid step forward.

Parameters:
    token: The mismatched token
    expected: The set of expected tokens
    considered_rules: Which rules were considered, to deduce the expected tokens
    state: A value representing the parser state. Do not rely on its value or type.
    interactive_parser: An instance of ``InteractiveParser``, that is initialized to the point of failture,
                        and can be used for debugging and error handling.

Note: These parameters are available as attributes of the instance.