• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package ANTLR::Runtime::MismatchedTokenException;
2
3use ANTLR::Runtime::Token;
4
5use Moose;
6
7use overload
8    '""' => \&to_string,
9    'bool' => sub { 1 },
10    fallback => 1
11    ;
12
13extends 'ANTLR::Runtime::RecognitionException';
14
15has 'expecting' => (
16    is  => 'ro',
17    isa => 'Int',
18    default => ANTLR::Runtime::Token->INVALID_TOKEN_TYPE,
19);
20
21sub get_expecting {
22    my ($self) = @_;
23    return $self->expecting;
24}
25
26sub to_string {
27    my ($self) = @_;
28    return "MismatchedTokenException(" . $self->get_unexpected_type() . "!=" . $self->expecting . ")";
29}
30
31no Moose;
32__PACKAGE__->meta->make_immutable();
331;
34