Re: [abc-users] Tracematch matching semantics

From: Alan Teoh <alan.teoh07_at_imperial.ac.uk>
Date: Thu, 11 Sep 2008 10:04:25 +0100

Hi Jon,

I believe what happens after two subsequent save calls is that the
regular expression [save save] is matched, hence it will be reset.

Therefore when a third "save" is detected, the regular expression will
start over again at the first save symbol, waiting for the fourth one in
order for another match to occur.

Hope that helps,

Alan Teoh

Jon Oldevik wrote:
> Hi,
> I have a question about the matching semantics that tracematch supports.
>
> given a really a tracematch, e.g. the simple one given below, which is
> matching two subsequent calls to save: When two 'save' are detected,
> the tracematch gives a match. However, when a third 'save' is
> detected, a new match is given (rather than waiting for a fourth).
>
> Is this the intended semantics of tracematches?
>
> public aspect MatchTwoSaves {
> pointcut save(Editor e): target(e) && call (* Editor.save(..))
>
> tracematch (Editor e) {
> sym save after returning: save(e);
> save save {
> // we got a save+save match, now do something with it
> }
> }
> }
>
> Best regards,
> Jon Oldevik
>
Received on Thu Sep 11 2008 - 10:04:44 BST

This archive was generated by hypermail 2.2.0 : Thu Sep 11 2008 - 10:20:11 BST