Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ppi::dumper(3) [osx man page]

PPI::Dumper(3)						User Contributed Perl Documentation					    PPI::Dumper(3)

NAME
PPI::Dumper - Dumping of PDOM trees SYNOPSIS
# Load a document my $Module = PPI::Document->new( 'MyModule.pm' ); # Create the dumper my $Dumper = PPI::Dumper->new( $Module ); # Dump the document $Dumper->print; DESCRIPTION
The PDOM trees in PPI are quite complex, and getting a dump of their structure for development and debugging purposes is important. This module provides that functionality. The process is relatively simple. Create a dumper object with a particular set of options, and then call one of the dump methods to generate the dump content itself. METHODS
new $Element, param => value, ... The "new" constructor creates a dumper, and takes as argument a single PPI::Element object of any type to serve as the root of the tree to be dumped, and a number of key->value parameters to control the output format of the Dumper. Details of the parameters are listed below. Returns a new "PPI::Dumper" object, or "undef" if the constructor is not passed a correct PPI::Element root object. memaddr Should the dumper print the memory addresses of each PDOM element. True/false value, off by default. indent Should the structures being dumped be indented. This value is numeric, with the number representing the number of spaces to use when indenting the dumper output. Set to '2' by default. class Should the dumper print the full class for each element. True/false value, on by default. content Should the dumper show the content of each element. True/false value, on by default. whitespace Should the dumper show whitespace tokens. By not showing the copious numbers of whitespace tokens the structure of the code can often be made much clearer. True/false value, on by default. comments Should the dumper show comment tokens. In situations where you have a lot of comments, the code can often be made clearer by ignoring comment tokens. True/value value, on by default. locations Should the dumper show the location of each token. The values shown are [ line, rowchar, column ]. See "location" in PPI::Element for a description of what these values really are. True/false value, off by default. print The "print" method generates the dump and prints it to STDOUT. Returns as for the internal print function. string The "string" method generates the dump and provides it as a single string. Returns a string or undef if there is an error while generating the dump. list The "list" method generates the dump and provides it as a raw list, without trailing newlines. Returns a list or the null list if there is an error while generation the dump. SUPPORT
See the support section in the main module. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.16.2 2011-02-25 PPI::Dumper(3)

Check Out this Related Man Page

PPIx::Regexp::Dumper(3) 				User Contributed Perl Documentation				   PPIx::Regexp::Dumper(3)

NAME
PPIx::Regexp::Dumper - Dump the results of parsing regular expressions SYNOPSIS
use PPIx::Regexp::Dumper; PPIx::Regexp::Dumper->new( 'qr{foo}smx' ) ->print(); INHERITANCE
"PPIx::Regexp::Dumper" is a PPIx::Regexp::Support. "PPIx::Regexp::Dumper" has no descendants. DESCRIPTION
This class generates a formatted dump of a PPIx::Regexp::Element object (or any subclass thereof), a PPIx::Regexp::Tokenizer object, or a string that can be made into one of these. METHODS
This class provides the following public methods. Methods not documented here are private, and unsupported in the sense that the author reserves the right to change or remove them without notice. new my $dumper = PPIx::Regexp::Dumper->new( '/foo/', ordinal => 1, ); This static method instantiates the dumper. It takes the string, PPI::Element, PPIx::Regexp::Element, or PPIx::Regexp::Tokenizer to be dumped as the first argument. Optional further arguments may be passed as name/value pairs. The following options are recognized: default_modifiers array_reference This argument is a reference to a list of default modifiers to be applied to the statement being parsed. See PPIx::Regexp new() for the details. encoding name This argument is the name of the encoding of the regular expression. If specified, it is passed through to PPIx::Regexp->new(). It also causes an "Encode::encode" to be done on any parse content dumped. indent number This argument is the number of additional spaces to indent each level of the parse hierarchy. This is ignored if either the "test" or "tokens" argument is true. The default is 2. margin number This is the number of spaces to indent the top level of the parse hierarchy. This is ignored if the "test" argument is true. The default is zero. ordinal boolean If true, this option causes the "ordinal" values of PPIx::Regexp::Token::Literal objects to be dumped. perl_version boolean If true, this option causes the "perl_version_introduced" and "perl_version_removed" values associated with each object dumped to be displayed. significant boolean If true, this option causes only significant elements to be dumped. The default is false. test boolean If true, this option causes the output to be formatted as a regression test rather than as a straight dump. The output produced by asserting this option is explicitly undocumented, in the sense that the author reserves the right to change the generated output without notice of any kind. The default is false. tokens boolean If true, this option causes a dump of tokenizer output rather than of a full parse of the regular expression. This is forced true if the dump is of a PPIx::Regexp::Tokenizer. The default is false. trace number If greater than zero, this option causes a trace of the parse. This option is unsupported in the sense that the author reserves the right to change it without notice. The default is zero. verbose number If greater than zero, this option causes additional information to be given about the elements found. This option is unsupported in the sense that the author reserves the right to change it without notice. The default is zero. If the thing to be dumped was a string, unrecognized arguments are passed to "PPIx::Regexp::Tokenizer->new()". Otherwise they are ignored. list print map { "$_ " } $dumper->list(); This method produces an array containing the dump output, one line per element. The output has no left margin applied, and no newlines. print $dumper->print(); This method simply prints the result of "string" to standard out. string print $dumper->string(); This method adds left margin and newlines to the output of "list", concatenates the result into a single string, and returns that string. SUPPORT
Support is by the author. Please file bug reports at <http://rt.cpan.org>, or in electronic mail to the author. AUTHOR
Thomas R. Wyant, III wyant at cpan dot org COPYRIGHT AND LICENSE
Copyright (C) 2009-2013 by Thomas R. Wyant, III This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. perl v5.16.3 2014-06-10 PPIx::Regexp::Dumper(3)
Man Page