[abc] draft to Adrian

From: Oege de Moor <Oege.de.Moor@comlab.ox.ac.uk>
Date: Tue Dec 07 2004 - 21:12:42 GMT

Hi Adrian!

Thanks for coming over; we all hugely enjoyed the discussion.

Ondrej immediately implemented the design that emerged from the
meeting in our parser - so we now have a proper grammar for it!
It all works fine, including meta-annotations and type pattern
expressions that range over annotations.

However, there is one glitch. This is valid AspectJ:
   call(Foo || Goo *.*(..))

and it is parsed as:

   call((Foo || Goo) *.*(..))

but those parentheses are optional as it stands. However,
if we put an annotation in front of the signature pattern,
the parentheses become obligatory:

   call(@Bar (Foo || Goo) *.*(..))

If you wrote

   call(@Bar Foo || Goo *.*(..))

that would imply the @Bar applies to the Foo - but it was
supposed to be an annotation on a signature.

We would therefore like to propose a change to the existing
AspectJ grammar, and insist that any non-trivial return
type expressions in a method signature pattern are
parenthesised. That would make

   call(Foo || Goo *.*(..))

illegal. The same would apply to field patterns where the
type is a non-trivial expression.

We believe this is unlikely to break "real" programs. Any
sane programmer would have put in those parentheses in the
first place, to make the program readable...

What do you think? Would you like to have a copy of the
grammar?

On behalf of the abc team,

-Oege
Received on Tue Dec 7 21:12:44 2004

This archive was generated by hypermail 2.1.8 : Tue Dec 07 2004 - 21:20:03 GMT