NAME

PPIx::IndexOffsets - Index offsets for tokens in PPI

SYNOPSIS

my $document = PPI::Document->new( 'hello.pl' );
$document->index_offsets;

my @tokens = $document->tokens;
foreach my $token (  $document->tokens  ) {
    my $start_offset = $token->start_offset;
    my $stop_offset  = $token->stop_offset;
    print "$start_offset .. $stop_offset $token\n";
}

DESCRIPTION

PPIx::IndexOffsets is a module which indexes the start and stop offsets for all the tokens in a PPI document tree.

SEE ALSO

PPI.

AUTHOR

Leon Brocard, <acme@astray.com>

COPYRIGHT

Copyright (C) 2008, Leon Brocard

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.