Dave Cross: Still Munging Data With Perl: Online event - Mar 17 Learn more

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.