To: "Wupc@Ccs.Neu.Edu" Cc: "Lieber@Ccs.Neu.Edu" Subject: FW: statically executable advice Date: Sun, 29 Dec 2002 09:32:41 -0500 Hi Pengcheng: you seem to have omitted text from my message below. Where did you put the "key observation" and "finding all MethodCall" objects.?? -- Karl -----Original Message----- From: Karl Lieberherr [mailto:klieberherr@earthlink.net] Sent: Wednesday, December 25, 2002 6:32 AM To: Pengcheng Wu Cc: kojarski@ccs.neu.edu; lorenz@ccs.neu.edu Subject: RE: statically executable advice Hi Pengcheng: Here is a sketch of how to check SCF in polynomial time based on your program. This is missing from the paper and goes at end of section 3. Reason: understanding the design of the SCF checkers helps to understand the design of the other checkers. ============================== A key observation, relevant to all checkers discussed in this paper, is that the four rules of the LoD fall into two important categories: we need to keep track of information per class and per method. Data member information is per class and argument information, for example, is per method. The design of the SCF checker builds on this observation and uses the visitor design pattern []. We assume an ideal model of the Java programming language that consists of JavaProgram, ClassDefinition, MethodDefinition and MethodCall classes to sketch the program. To check SCF, we need to find all MethodCall-objects inside a JavaProgram-object and check whether the target class of the MethodCall-object is a potential preferred supplier class. On the way to the MethodCall-object we expect to encounter a ClassDefinition-object followed by a MethodDefinition-object. At the ClassDefinition object we keep track of the per-class information of the potential preferred supplier classes coming from data members. At the MethodDefinition-object we keep track of the per-method information of potential preferred supplier classes coming from argument classes etc. It can be noted that tools in the Demeter family, such as DJ [Reflection01], make it very easy to express the visitors and traversals. -- Karl >-----Original Message----- >From: Pengcheng Wu [mailto:wupc@ccs.neu.edu] >Sent: Tuesday, December 24, 2002 10:22 AM >To: Karl Lieberherr >Cc: dougo@ccs.neu.edu; kojarski@ccs.neu.edu; lorenz@ccs.neu.edu >Subject: Re: statically executable advice > > >Hi Karl, > > /home/wupc/space/DemeterCheck > >is the quick class form checker in DJ I mentioned in our meeting >yesterday. > >--Pengcheng > >On Mon, 23 Dec 2002, Karl Lieberherr wrote: > >> Hi Pengcheng: >> >> to demonstrate how to use statically executable advice with AspectJ, >> please use the following simplified Java grammar >> and write a simplified LoD checker that allows only >> data member and argument types. >> >> design: >> from JavaProgram to MethodCall >> before ClassDefinition >> set PPSperClass >> before MethodDefinition >> set PPSperMethod >> before MethodCall >> use PPSperClass, PPSperMethod >> >> code in: >> >> /proj/lieber/papers2/LoDChecker/revision/code >> >> Example: >> >> ( >> C >> // data members >> (X1 x1 Y1 y1) >> // function members >> ( >> f1 >> // formal arguments >> (Q1 q1 Q2 q2) >> //body >> // violates LoD: neither data member nor argument type >> (NotPreferred notpreferred.f3 (a1 a2)) >> ) >> ) >> >> Please can Sergei try this example in the new DAJ >> that Doug is working on. >> >> -- Karl >> >> // cd >> >> // class dictionary for a simplified Java language to >> // demonstrate how statically executable advice works >> >> JavaProgram = List(ClassDefinition) EOF. >> ClassDefinition = ClassName List(DataMember) >List(MethodDefinition). >> MethodDefinition = MethodName List(FormalArgument) MethodBody. >> MethodBody = List(MethodCall). >> >> // MethodCall = Variable "." MethodName >List(Variable). >> // to simplify processing: >> MethodCall = VariableDecl "." MethodName >List(Variable). >> >> DataMember = VariableDecl. >> FormalArgument = VariableDecl. >> VariableDecl = ClassName Variable. >> >> Variable = Ident. >> ClassName = Ident. >> MethodName = Ident. >> >> List(S) ~ "(" {S} ")". >> Main = . >> >