MarpaX::Languages::C::AST::Util - C Translation to AST - Class method utilities
version 0.37
use MarpaX::Languages::C::AST::Util qw/:all/; my $whoami = whoami(); my $whowasi = whowasi(); callIt(0, '1', [2], {3 => 4}); sub callIt { my $hash = traceAndUnpack(['var1', 'var2', 'array1p', 'hash1p'], @_); }
This modules implements some function utilities.
The methods whoami(), whowasi() and traceAndUnpack() are exported on demand.
Returns the name of the calling routine. Optional $base prefix is removed. Typical usage is whoami(__PACKAGE__).
Returns the name of the parent's calling routine. Optional $base prefix is removed. Typical usage is whowasi(__PACKAGE__).
Returns a hash mapping @{$nameOfArgumentsp} to @arguments and trace it. The tracing is done using a method quite similar to Log::Any. Tracing and hash mapping stops at the end of @nameOfArguments or @arguments.
Formats a string using Log::Any, issue a $log->fatal with it, and croak with it.
Returns a string showing the request line, followed by another string that shows what is the column of interest, in the form "------^".
Returns the output of Marpa's line_column at a given $g1 location. Default $g1 is Marpa's current_g1_location(). If $start is given, $g1 is ignored.
Returns the output of Marpa's g1_location_to_span at a given $g1 location. Default $g1 is Marpa's current_g1_location().
Returns the string corresponding the last completion of $symbol.
Returns an array of rules ordered by depth for optional sub grammar $subGrammar (default is 'G1'). Each array item is a hash reference with the following keys:
Rule Id
LHS id of this rule
LHS name of this rule
Rhs ids of this rule as an array reference
Rhs names of this rule as an array reference
Rule depth
Jean-Damien Durand <jeandamiendurand@free.fr>
This software is copyright (c) 2013 by Jean-Damien Durand.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
1 POD Error
The following errors were encountered while parsing the POD:
Unknown directive: =depth
To install MarpaX::Languages::C::AST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MarpaX::Languages::C::AST
CPAN shell
perl -MCPAN -e shell install MarpaX::Languages::C::AST
For more information on module installation, please visit the detailed CPAN module installation guide.