PPI

 view release on metacpan or  search on metacpan

lib/PPI/Statement.pm  view on Meta::CPAN

package PPI::Statement;

=pod

=head1 NAME

PPI::Statement - The base class for Perl statements

=head1 INHERITANCE

  PPI::Statement
  isa PPI::Node
      isa PPI::Element

=head1 DESCRIPTION

PPI::Statement is the root class for all Perl statements. This includes (from
L<perlsyn>) "Declarations", "Simple Statements" and "Compound Statements".

The class PPI::Statement itself represents a "Simple Statement" as defined
in the L<perlsyn> manpage.

=head1 STATEMENT CLASSES

Please note that unless documented themselves, these classes are yet to be
frozen/finalised. Names may change slightly or be added or removed.

=head2 L<PPI::Statement::Scheduled>

This covers all "scheduled" blocks, chunks of code that are executed separately
from the main body of the code, at a particular time. This includes all
C<BEGIN>, C<CHECK>, C<UNITCHECK>, C<INIT> and C<END> blocks.

=head2 L<PPI::Statement::Package>

A package declaration, as defined in L<perlfunc|perlfunc/package>.

=head2 L<PPI::Statement::Include>

A statement that loads or unloads another module.

This includes 'use', 'no', and 'require' statements.

=head2 L<PPI::Statement::Sub>

A named subroutine declaration, or forward declaration

=head2 L<PPI::Statement::Variable>

A variable declaration statement. This could be either a straight
declaration or also be an expression.

This includes all 'my', 'state', 'local' and 'our' statements.

=head2 L<PPI::Statement::Compound>

This covers the whole family of 'compound' statements, as described in
L<perlsyn|perlsyn>.

This includes all statements starting with 'if', 'unless', 'for', 'foreach'
and 'while'. Note that this does NOT include 'do', as it is treated
differently.

All compound statements have implicit ends. That is, they do not end with
a ';' statement terminator.

=head2 L<PPI::Statement::Break>

A statement that breaks out of a structure.

This includes all of 'redo', 'goto', 'next', 'last' and 'return' statements.

=head2 L<PPI::Statement::Given>

The kind of statement introduced in Perl 5.10 that starts with 'given'.  This
has an implicit end.

=head2 L<PPI::Statement::When>

The kind of statement introduced in Perl 5.10 that starts with 'when' or
'default'.  This also has an implicit end.

=head2 L<PPI::Statement::Data>

A special statement which encompasses an entire C<__DATA__> block, including
the initial C<'__DATA__'> token itself and the entire contents.

=head2 L<PPI::Statement::End>

A special statement which encompasses an entire __END__ block, including
the initial '__END__' token itself and the entire contents, including any
parsed PPI::Token::POD that may occur in it.



( run in 1.997 second using v1.01-cache-2.11-cpan-39bf76dae61 )