Subject: Re: Merging include and basicop

From: Zheng Gengbing <[email-masked]>
Date: Wed, 10 Apr 1996 10:31:57 +0800 (EAT)

On Tue, 9 Apr 1996, Guansong Zhang wrote:

> Hope you have time to read previous things, now we come back to our merging
> work.
> 
> 1. What should be defined in src/include. To me, there are following:
> 
> tags for different language components.
> strucuture for intermediate representation
> lib header files for user and project self.
> 
> One more thing needed is due to our implementation method.
> structure for .dep file.
> 
> /* What I said is not something final, I hope you can add or remove and we
> improve it together. */
> 
> Check those files, are they meet our description? Which thing should be moved
> out?
> 
> After that we not only get same src/include, but also a meaningful one.
> 
> 2. src/basicop
> 
> This directory remains a problem to me. Because of the overall structure of the
> project, this dir is intent for two kind of functions:
> 
> a, r&w .dep file
> b, basic function a parser, ANY parser, needed to build up syntax tree.
> 
> The first class functions seems ok now, I don't know why PKU need to modify
> this, is it safe to 1.20 to use these function?
> 

    We changed the readnodes.c , writenodes.c for these reasons:

	1. since we add two new field to llnd : 
	   attr ,     // record the attributes of a llnd , used in expr 
	   const_val  // record the integer constant value .
	   this must be reflected in  .dep .
	2. record declared_name of a VARIABLE_NAME to .dep .
	3. record T_KIND , a new llnd .
	4. record the scope of a label .

	I noticed that someone changed some part of writenodes.c in line 402 
  about FIELD_NAME , but forgot to add the n from 3 to 5 !

	I am sure it is safe for HIT to use these functions ,provided the
readnode & writenode are strictly matched in basicop . Since what HIT need is
writenodes , this only dump the .dep when nearly finish the first parse, so
use a different writenodes  cannot effect their work . 

> Another thing I'd say, they are something concerned with our implementation
> method, if we do not generate a .dep file at all. they won't exist. At present
> time we still need the .dep file as an intermediate results between different
> modules.
>

	So , we must improve it to pass enough information from first parse
to next.

> The second class, is the thing I am not sure of. Since the original author need
> another month back to work, I want to know if any one can draw a circle to
> include only those language independent functions? Then we can merge those
> inside the circle first. (Just use pku's version to overwrite them, the idea is
> if they are really language independent, pku's change must be bug fixing,
> instead of fitting for another parser.) Those not in the circle, should be
> moved back to hpf2dep.
> 
> Any way, I noticed 1.25 have 4 more files different from 1.20. I don't know why
> you are changing these file. Could you explain them a little, so both I and HIT
> can understand?
> 

	makelabel.c :
		line 84: assign a label's scope instead of NULL .

	makellnd.c :
		line 51: initialze the newly added field attr & const_val 
				when a llnd is created .

	makesymb.c :
		line 205: search symbol without discrimnate the upper & 
			lower case .

	maktype.c :
		line 82:  search a derived type like   ( by HIT)
			strcmp(temp->name->ident,name->ident)      without 
			considering the scope ,
			will get the type which is defined in other scope in
			front of the current scope .

	That 's all the differnece I compared  between 2.0 & 2.5 .

	Since the basicop was modified only by PKU , so I think the merge is 
really simple .

> I also hope we not only simply make the src/basicop same, but improve during
> the process.
> 

	I think instead of creating a mixed library , we should divid the
lib into two different one . One for read & write of dep , another for
the creation of the AST . That make things clear .

> Looking forward to hearing from you about this.
> 
> 
> Regards,
> Guansong
> 

***************************************************************************
*     Zheng Gengbin                 *                                     *
*                                   *                                     *
*  Dept. of Computer Science        *  Phone:  86-10-2585088              *
*         & Technology              *  Email:                             *
*                                   *      [email-masked]   *
*  Peking University P.R.China      *  Mail:                              *
*                                   *      Room 1077 ,Building 47,        *
*                                   *      Peking University, P.R.China   *
***************************************************************************