All I want to do is to use a header file to generate some C++ code from it namely a class declaration and function definitions complete with arguments etc and some defunct code that I could then use to generate more code, namely, this

1) Have a header file blah.h that contains the interface

2) Generate a .cpp file from it that has the class declaration and function definitions with defunct/default code and some placeholders/tags(layman language used here owing to lack of specuialized knowldge of PERL or scripting in general) that are to be replaced in Step 3

3) Use the file from Step 2 and replace the placeholders with some information that is provided (by means of an input config file/command line/whatever other means) and must be replaced uniformally in the entire file(from Step 2)

Requirements that MUST be met from the FINAL PROCESSED OUTPUT FILE from Step 3 are:

1) The length of each line of code (that can be compiled by a standard C++ compiler) must NOT exceed 78 characters

2) Indentation and other standard formatting features must be retained and no user intervention must be needed in order to beautify or standardize the code to something that is normally acceptable as code that can be accpeted in a code repository.

3) Last, stating the obvious of course: the code SHOULD be capable of being compiled by a C++ compiler. :)

I hope I have come up with a better description of the problem at hand.

Thanks very much for the response.:) Much appreciated.

In reply to Re: Re: Parsing a .h header file by hehenoobhehe
in thread Parsing a .h header file by hehenoobhehe

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.