Re: [abc-users] Determine a basic block

From: Eric Bodden <eric.bodden_at_mail.mcgill.ca>
Date: Tue, 22 Apr 2008 09:25:31 -0400

> How can I do this?
> I have seen that my ShadowMatch has the method getArgsContextValues().
> But different from the MethodCallShadowMatch I have no invoke
> statement, where i can get the args from. I have the info about the
> args in my frontend and can pass them into the ShadowMatch in a Tag
> (similar i do it with the start and end of block) but how do i create
> the List of Immediate?

getArgsContextValues() returns the context values that are exposed if
args(..) is matched against this shadowMatch. I.e. if your syntax
was...
block (aspectjtest.Testing) && args(arg1,arg2)
.. then you could use that. However if you want...
block (aspectjtest.Testing(arg1,arg2))
... or something similar then you cannot use this method.

In general you need to have a soot.Local variable for each value that
you want to expose from the context. This variable is then assigned a
value using the Bind residue (see implementation of this/target/args).
It depends entirely on you how you "get" these values. In your case
IMHO it may be easiest to bring the code into a certain structure when
your block-annotation gets compiled, i.e. at this point introduce
locals that point to the right values. Then in the matcher you can
match on these locals and bind pointcut variables to the locals using
the Bind residue. In general the implementation of this/target/args
but also the array access pointcuts in EAJ should be very helpful as a
guidance.

Eric

-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada
Received on Tue Apr 22 2008 - 14:25:42 BST

This archive was generated by hypermail 2.2.0 : Wed Apr 30 2008 - 07:20:11 BST