PYX::Stack - Processing PYX data or file and process element stack.
use PYX::Stack; my $obj = PYX::Stack->new(%parameters); $obj->parse($pyx, $out); $obj->parse_file($input_file, $out); $obj->parse_handler($input_file_handler, $out);
new
my $obj = PYX::Stack->new(%parameters);
Constructor.
bad_end
Check bad end of element. If set, print error on unopened end of element.
Default value is 0.
output_handler
Output handler.
Default value is \*STDOUT.
verbose
Verbose flag. If set, each start element prints information to 'output_handler'.
Returns instance of object.
parse
$obj->parse($pyx, $out);
Parse PYX text or array of PYX text. If $out not present, use 'output_handler'.
$out
Returns undef.
parse_file
$obj->parse_file($input_file, $out);
Parse file with PYX data. If $out not present, use 'output_handler'.
parse_handler
$obj->parse_handler($input_file_handler, $out);
Parse PYX defined by handler. If $out not present, use 'output_handler'.
new(): From Class::Utils::set_params(): Unknown parameter '%s'. parse(): Bad end of element. Element: %s Stack has some elements. parse_file(): Bad end of element. Element: %s Stack has some elements. parse_handler(): Bad end of element. Element: %s Stack has some elements.
use strict; use warnings; use PYX::Stack; # Example data. my $pyx = <<'END'; (begin (middle (end -data )end )middle )begin END # PYX::Stack object. my $obj = PYX::Stack->new( 'verbose' => 1, ); # Parse. $obj->parse($pyx); # Output: # begin # begin/middle # begin/middle/end # begin/middle # begin
use strict; use warnings; use Error::Pure; use PYX::Stack; # Error output. $Error::Pure::TYPE = 'PrintVar'; # Example data. my $pyx = <<'END'; (begin (middle (end -data )middle )begin END # PYX::Stack object. my $obj = PYX::Stack->new; # Parse. $obj->parse($pyx); # Output: # PYX::Stack: Stack has some elements.
use strict; use warnings; use Error::Pure; use PYX::Stack; # Error output. $Error::Pure::TYPE = 'PrintVar'; # Example data. my $pyx = <<'END'; (begin (middle -data )end )middle )begin END # PYX::Stack object. my $obj = PYX::Stack->new( 'bad_end' => 1, ); # Parse. $obj->parse($pyx); # Output: # PYX::Stack: Bad end of element. # Element: end
Class::Utils, Error::Pure, PYX::Parser.
Install the PYX modules.
https://github.com/michal-josef-spacek/PYX-Stack
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2011-2023 Michal Josef Špaček
BSD 2-Clause License
0.06
To install PYX::Stack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PYX::Stack
CPAN shell
perl -MCPAN -e shell install PYX::Stack
For more information on module installation, please visit the detailed CPAN module installation guide.