Subject: about Forall

From: Zheng Gengbin <[email-masked]>
Date: Tue, 24 Sep 1996 08:45:32 +0800 (EAT)

Hi,
	Have you add a new class about forall statement ? then how you 
implemented forall statement ?

Zheng

---

From: Zheng Gengbin <[email-masked]>
Date: Tue, 24 Sep 1996 10:07:10 +0800 (EAT)

On Mon, 23 Sep 1996, Guansong Zhang wrote:

> On Sep 24,  8:45am, Zheng Gengbin wrote:
> > Subject: about Forall
> > Hi,
> >-- End of excerpt from Zheng Gengbin
> 
> 
> Well, I don't add new class for Forall. The reason is that when I first began
> the work on this. I know too little about the Sage, while I need to get
> results, no matter how simple they are, as soon as possible.
> 
> So I do something of my own.
> 
> But when I look back now, maybe it is a better idea to define a clear forall
> class. But 5,000 lines of code already there. I have no intention to change
> them completely at present time. Maybe in the future. When we have more time.
> 
> Laterly, I do begin to build up some class, such as inherit statement, and
> array triplet. It is not difficult. You can see them from the code I sent to
> you.
> 
> Next month, as dad version improve, we may support more complicated alignment
> and distribution. I may add alignstmt, and distributestmt too.
> 
> Guansong
> 

	Then I will add Forall class . And please info me the class you already
added .

	I will give you a list of our work also .

	I hope our list is like this:

	variant : class ,

	for example :

	FORALL_STMT : SgForallStmt
	INDEX_OP    : SgIndexOp   

Zheng

---

From: Zheng Gengbin <[email-masked]>
Date: Tue, 24 Sep 1996 10:49:52 +0800 (EAT)

On Mon, 23 Sep 1996, Guansong Zhang wrote:

> On Sep 24, 10:07am, Zheng Gengbin wrote:
> > Subject: Re: about Forall
> I don't understand this quite well.
> 
> > 	variant : class ,
> 
> What do you mean by variant? And forall should be derived class for
> SgStatement, right?
>

	It means that the class is correspond to  the node of that 
variant . 
	In fact in fromsage++.h , you will see the defintion of each derived
class as following :

class  SgVarRefExp: public SgExpression{
  // variant == VAR_REF
                ^^^^^^^

each derived class descibe one or more nodes .

> INDEX_OP, an derived class of SgExpression?
>

	Yes .
	SgIndexOp is the class name, INDEX_OP is the kind of node that the class 
descibes .

        What I really concern is that each variant should be correspond to
a certain class to descibe them .(although base class can do so in 
general )

Zheng

---

From: Zheng Gengbin <[email-masked]>
Date: Thu, 26 Sep 1996 09:23:56 +0800 (EAT)

On Tue, 24 Sep 1996, Guansong Zhang wrote:

> I may give you a bad example just now.
> 
> I found the following in Sage:
> 
> class SgSubscriptExp: public SgExpression{
>   // Fortran 90 vector subscript expression
>   // variant == DDOT
> public:
>    SgSubscriptExp(PTR_LLND ll);
>    SgSubscriptExp(SgExpression &lbound, SgExpression &ubound, SgExpression
> &step);
>    SgSubscriptExp(SgExpression &lbound, SgExpression &ubound);
>    ~SgSubscriptExp();
>   // perhaps this function can use LlndMapping
>   SgExpression *lbound();
>   SgExpression *ubound();
>   SgExpression *step();
> };
> 
> It must be my careless ignoring the existing class to build a new one!
> 
> Guansong
> 

	I have modified this class to fit our AST . You need not build 
another one , I think.

Zheng

---

From: Yan Mi <[email-masked]>
Date: Thu, 26 Sep 1996 23:12:48 +0800 (EAT)

On Thu, 26 Sep 1996, Guansong Zhang wrote:

> On Sep 26, 10:08am, Yan Mi wrote:
> > > Can we design the new derived class in the C++ form? And once finished we
> can
> > > put them in .h file! C++ suppose to support this kind of work.
> > >
> > > We can describe each member function a little and then implement them one
> by
> > > one later on. I will use my work as an example:
> > >
> > > class SgArrayTripletExp : public SgExpression {
> > > // variant==DDOT;
> > >
> > > public:
> > >    SgArrayTripletExp(SgExpression * item0, SgExpression * item1,
> > SgExpression > *item2);
> > >    int numberOfItems();
> > >    SgExpression * item(int i);
> > > };
> > >
> > > The above derived class was used to analyse array section. Yan Mi may found
> it
> > > useful. The member function is quite easy, return the number of items in
> the
> > > DDOT.
> > 	I have used SgSubscriptExp,and zheng modified it to accord with
> > out AST. And I write some code to look up the lbound ,ubound ,step of
> > array_section and assumed_array.
> >  	And I now need SgArrayType::SgArrayType(Sgtype &basetype,SgExpression
> > &lbound,sgexpreesion &ubound) to introduce temprary array variable. I
> > also write some code to implement in my trnasformation,but because It is
> > not a better idea to modify low_level node in my program. so now I asked
> > zheng to finish it.
> 
> I am glad our work have more common parts now. As to forall class, though I
> don't add a new class, I do have several procedure ready to become a method in
> a new class. But I am afraid those function may not suitable for you. You may
> want things like constructor much more. Am I right? I will work with Zheng
> Gengbin more on this.
>
	When I introduce temprary for array constructor, I have to modify 
low_level node. Although when I run my program ,some warning messge appear,
but the result of transformaiton is ok. i'm glad you and zheng to enrich 
the library, so  I needn't modify the low level node myself. when i need 
some new function , I will tell you and zheng.
	I need  method SgSymbol::makeVarDeclStmtWithParamList() in libsage++.h
but it hasn't been implemneted, so I wrote code for it in my program.
regards
Yan mi