With reference to my problem that I have described : here:

A possible solution to the problem *could* be :

1) I use the same method I use now to create a tokenzied sorta intermediate file from the header file complete with all the information that I need to be able to furnish a class declaration and a class definition.Call this File A

Use File A as an input file to further process the tokens etc and produce another file that has tags/tokens whatever else that I need for stuff like:

-function names

-function params

return values

and so on WITHOUT any formatting.CAll it File B

3)Use File B and parse each token to get File C. While priting out File C, I check for the length of the line being printed (to the file) and if the length exceeds 78 characters, I insert a newline to move to the next line.

Possible problems that I encounter or envisage I will encouter are:

1) Within functions etc, one normally indents the code, so also in if/for code blocks, so when Im processing a string of tokens that I know is ised for a function definition, after I move to a newline, i SHOULD also print out a tab to preserve the formatting

This is all I can think of at the moment and I am rather confused by all this. I thought it was an easy problem to begin with , but.....:(


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.