MarpaX::Languages::C::AST::Util::Data::Find - Find data in C AST
version 0.37
use strict; use warnings FATAL => 'all'; use MarpaX::Languages::C::AST::Util::Data::Find; my $data = bless [], 'C::AST::Something'; MarpaX::Languages::C::AST::Util::Data::Find->new( wanted => sub { my $o = shift; my $class = blessed($o) || ''; return ($class eq 'C::AST::directDeclaratorIdentifier'); }, callback => sub { my ($datap, $o) = @_; # # This object has matched. # }, callbackArgs => [ $data ], )->process($data);
This modules is a minimalist Data::Find designed for the parse tree values of Marpa on a C source file.
Instance a new object. Takes as optional argument a hash that may contain the following key/values:
Match callback (CODE ref).
Match callback arguments (ARRAY ref). The matched callback is called like: &$wanted(@{$wantedArgs}, $object). Any true value means that $object has matched and will be a candidate to the processing callback.
Process callback (CODE ref).
Process callback arguments (ARRAY ref). The process callback is called like: &$callback(@{$callbackArgs}, $object) on every object that matched.
Process search on the object $value. Returns a true value is something wanted was found.
L<Data::Find>, L<Marpa::R2>
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.
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.