PPIx::Regexp::Token::Unknown - Represent an unknown token


PPIx-Regexp documentation Contained in the PPIx-Regexp distribution.

Index


Code Index:

NAME

Top

PPIx::Regexp::Token::Unknown - Represent an unknown token

SYNOPSIS

Top

 use PPIx::Regexp::Dumper;
 PPIx::Regexp::Dumper->new( 'xyzzy' )
     ->print();

INHERITANCE

Top

PPIx::Regexp::Token::Unknown is a PPIx::Regexp::Token.

PPIx::Regexp::Token::Unknown has no descendants.

DESCRIPTION

Top

This token represents something that could not be identified by the tokenizer. Sometimes the lexer can fix these up, but the presence of one of these in a finished parse represents something in the regular expression that was not understood.

METHODS

Top

This class provides the following public methods. Methods not documented here are private, and unsupported in the sense that the author reserves the right to change or remove them without notice.

ordinal

This method returns the results of the ord built-in on the content (meaning, of course, the first character of the content). No attempt is made to interpret the content, since after all this is the unknown token.

SUPPORT

Top

Support is by the author. Please file bug reports at http://rt.cpan.org, or in electronic mail to the author.

AUTHOR

Top

Thomas R. Wyant, III wyant at cpan dot org

COPYRIGHT AND LICENSE

Top


PPIx-Regexp documentation Contained in the PPIx-Regexp distribution.
package PPIx::Regexp::Token::Unknown;

use strict;
use warnings;

use base qw{ PPIx::Regexp::Token };

our $VERSION = '0.020';

# Return true if the token can be quantified, and false otherwise
sub can_be_quantified { return };

sub ordinal {
    my ( $self ) = @_;
    return ord $self->content();
}

# Since the lexer does not count these on the way in (because it needs
# the liberty to rebless them into a known class if it figures out what
# is going on) we count them as failures at the finalization step.
sub __PPIX_LEXER__finalize {
    return 1;
}

1;

__END__

# ex: set textwidth=72 :