Subject: About include statement

From: Zheng Gengbin <[email-masked]>
Date: Tue, 3 Dec 1996 10:29:53 +0800 (EAT)

I think it is time to solve the include statement problem now ,since
it is frequenently used in the programs in kernels .

	I have done some experiments in my spare time . First I tried
to use the C preprocesser like /lib/cpp or gcc -E , but this is not a good
way . Since c preprocessor did not recorgnize the fortran's comments format
, it will see the // as the comments also and donot recognized some
illegal character after ! which should be taken as comments .

	So the next method I thought is to write a separate c program to deal 
with this include statement . But I heard that the code of the c 
preprocessor summed up to about 4000 lines , it is beyond me .

	Then I decided to try shell script . This time the work is relatively
easy , I used only about 55 lines to fulfill the task . Now I call it
as fpp against cpp .  

	Like cpp , fpp will recursively include the file specified by source 
program and do some neccessary checking , finally it create some line number 
information to synchronize the parser . This include a little change I 
have done in lexer to recorgnize this directive like:
#  10   "adi.inc"
	This version I did not deal with the case when dead lock happened
for example when a file include itself .

	Also problem of efficiency remains for the using of  shell script .

Zheng

---

From: Zheng Gengbin <[email-masked]>
Date: Wed, 4 Dec 1996 13:53:00 +0800 (EAT)

On Tue, 3 Dec 1996, Guansong Zhang wrote:

> On Dec 3, 10:29am, Zheng Gengbin wrote:
> > Subject: About include statement
> >
> >
> >-- End of excerpt from Zheng Gengbin
> 
> Be careful, I am working on those header files.
>

	What do you mean you are working on those header files ? Have you
already solved the include statement ?

> And those line synchronizing directives are important to further work like
> profiler and debuger. If you decide to deal include file in this way, it is
> better not cause problem in the future.
> 

	The directives are somewhat like the result preprocessed by c compiler.
I think it will be ok.

Zheng