Hi, Thomas. This won't work.
Jimple has a notion very different of blocks very different from
blocks in source code (the former actually being basic blocks). The
only way you can get around this is modifying the Java to Jimple
converrion to add tags to Jimple statements which are contained in a
block. Those tags you can then match on within the matcher.
Eric
On 16/04/2008, Thomas Pawlitzki <mailinglist_at_pawlitzki.name> wrote:
> Hello again,
>
> i tried a little bit with a new ShadowType and a new ShadowMatch.
>
> But i can not figure out how to implement the
> BlockShadowMatch.matchesAt() method.
>
> I compile the following mini example and log the infos i have for the
> matching test.
>
> Source Code:
> ------------------------------------
> public static void main(String[] args) {
> {
> int i = 0;
> System.out.println("Hello World");
> }
>
> Test t = new Test();
> t.foo();
> }
> ------------------------------------
>
> This infos i reveive at the matching test:
> ------------------------------------
> public static void main(java.lang.String[])
> {
> java.lang.String[] args;
> int i;
> java.io.PrintStream temp$0;
> aspectjtest.Test t, temp$1;
>
> args := @parameter0: java.lang.String[];
> i = 0;
> temp$0 = <java.lang.System: java.io.PrintStream out>;
> virtualinvoke temp$0.<java.io.PrintStream: void
> println(java.lang.String)>("Hello World");
> temp$1 = new aspectjtest.Test;
> specialinvoke temp$1.<aspectjtest.Test: void <init>()>();
> t = temp$1;
> virtualinvoke t.<aspectjtest.Test: void foo()>();
> return;
> }
> ------------------------------------
>
> As you can see the blocks are not recognisable any more. So how can i
> decide when a block is entered?
>
> Greetings,
>
> Thomas
>
>
-- Eric Bodden Sable Research Group McGill University, Montréal, CanadaReceived on Wed Apr 16 2008 - 14:03:59 BST
This archive was generated by hypermail 2.2.0 : Wed Apr 16 2008 - 15:00:12 BST