1package ANTLR::Runtime::MissingTokenException;
2
3use Moose;
4
5use overload
6    '""' => \&to_string;
7
8extends 'ANTLR::Runtime::MismatchedTokenException';
9
10has 'inserted' => (
11    is  => 'ro',
12    isa => 'Any',
13);
14
15sub get_missing_type {
16    my ($self) = @_;
17    return $self->expecting;
18}
19
20sub to_string {
21    my ($self) = @_;
22
23    if (defined (my $inserted = $self->inserted) && defined (my $token = $self->token)) {
24        return "MissingTokenException(inserted $inserted at " . $token->get_text() . ")";
25    }
26    if (defined $self->token) {
27        return "MissingTokenException(at " . $self->token->get_text() . ")";
28    }
29
30    return "MissingTokenException";
31}
32
33no Moose;
34__PACKAGE__->meta->make_immutable();
351;
36__END__
37