Greetings your worthiness(es):

I am trying to use the C::Scan module to extract function names, argument lists, and macros from C source file, but am having difficulty making it work. I am using the source supplied in the module review on perlmonks (here!) and it fails when I try to extract the fdecls -- it reports:
'cppstdin' is not recognized as an internal or external command, operable program or batch file."

I found a post burried here that reported the same problem, but there was no solution provided. I must assume that I have done something wrong, but don't know what.

The C code to be parsed was extremely trivial (and omitted).

Any help would be greatly appreciated. Of course, if there is a better way, I would like to know that as well.
My perl isn't good enough (yet) to know how to fix this --

You may contact me directly at: raz@poetworld.net Thanks you (all) very much!

use C::Scan; $c = new C::Scan(filename => 'test.c', filename_filter => 'test.c' ); # # Fetch and iterate through information about function declarations. # my $array_ref = $c->get('fdecls'); foreach my $func (@$array_ref) { my ($type, $name, $args, $full_text, undef) = @$func; foreach my $arg (@$args) { my ($atype, $aname, $aargs, $full_text, $array_modifiers) = @$a +rg; } } # # Fetch and iterate through information about #define macros w/args. # my $hash_ref = $c->get('defines_args'); foreach my $macro_name (keys %$hash_ref) { print "$macro_name \n"; my $array_ref = $macros_hash{$macro_name}; my ($arg_ref, $macro_text) = @$array_ref; my @macro_args = @$arg_ref; }
# right?

In reply to C::Scan help request by rz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.