The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Compiler::Parser::Node::ForeachStmt

INHERITANCE

    Compiler::Parser::Node::ForeachStmt
    isa Compiler::Parser::Node

DESCRIPTION

    This node is created to represent foreach statement.
    ForeachStmt node has three pointers of 'cond', 'itr' and 'true_stmt'.
    Also, this node has 'next' pointer to access next statement's node.

LAYOUT

     _____________________________________        _____________
    |                                     | next |             |
    |             ForeachStmt             |----->|             |
    |_____________________________________|      |_____________|
           |          |             |
     cond  |      itr |   true_stmt |
           v          v             v

Example

e.g.) foreach my $itr (@array) { $itr++ }

                            |
     _______________________|________________________        _____________
    |                                                | next |             |
    |               ForeachStmt(foreach)             |----->|             |
    |________________________________________________|      |_____________|
               |            |            |
          cond |        itr |  true_stmt |
           ____v____    ____v____    ____v____
          |         |  |         |  |         |
          |   ++    |  |  $itr   |  |   ++    |
          |_________|  |_________|  |_________|
               |                          |
          expr |                     expr |
           ____v____                  ____v____
          |         |                |         |
          | @array  |                |  $itr   |
          |_________|                |_________|

SEE ALSO

[Compiler::Parser::Node](http://search.cpan.org/perldoc?Compiler::Parser::Node)

AUTHOR

Masaaki Goshima (goccy) <goccy54@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) Masaaki Goshima (goccy).

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