/* * Created on May 12, 2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package fr.lifl.stc.stan.tools.signatureAnalyser; import org.apache.bcel.classfile.Method; import fr.lifl.stc.stan.execution.stack.JvmType; import fr.lifl.stc.stan.link.Link; import fr.lifl.stc.stan.link.TableLink; /** * @author dorina * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class MethodSignatureAnalyser { /** * */ Method m; TableLink t; String className; public MethodSignatureAnalyser(Method m, String className, TableLink t) { super(); this.m = m; this.t = t; this.className = className; // TODO Auto-generated constructor stub } public void analyse(){ System.out.println("_______________analysing method "+m.getName()+m.getSignature()); //printTableLink(t); //int flag = m.getAccessFlags(); String mes; int j = 4; for(int i = 0; i < t.getSizeL(); i++) //for(int j = 0; j < t.getSizeC(); j++) { Link l = t.get(i, j); mes = className+"."+m.getName()+m.getSignature()+": secret "; if(l!=null && !l.isEmpty()){ if(l.isLinkToPart(JvmType.SECRET_PART)){ if(l.isLinkToPart(Link.REFERENCE_LINK)) mes += "reference"; else mes += "value"; mes += " linked to "; if(i==0) mes += " return"; else if(i==1) mes += " exception"; else if(i==2) mes += " static"; else if(i==3) mes += " flux"; else if(i==4) mes += " this"; else mes += " argument "+(j-5); System.err.println(mes); } //test } } } public static void printTableLink(TableLink t) { for(int i = 0; i < t.getSizeL(); i++) for(int j =0; j < t.getSizeC(); j++) if( t.get(i,j) !=null ) System.out.println(i+">"+j+":"+t.get(i,j)); } }