in reply to Re: Parsing a .h header file
in thread Parsing a .h header file
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 B3)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.....:(
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Parsing a .h header file
by clscott (Friar) on Oct 22, 2003 at 19:43 UTC | |
|
Re: Re: Re: Parsing a .h header file
by hehenoobhehe (Novice) on Oct 22, 2003 at 09:39 UTC | |
by tachyon (Chancellor) on Oct 22, 2003 at 10:05 UTC |