Prof. Laurie HENDREN wrote:
>Let us back up and think about what needs to be a keyword.
>
>First, patterns need to match identifiers (class names, field names,
>method names and so on ....). So, a pattern doesn't need to be
>just "if" or "while" or "int" because there is no way there can be
>an identifier with that name. However, a pattern can be
> *if while* int*, so that is why, in pointcut state, we will suck
>those up as identifierPattern, and not ["*", "if"].
>
>Also, there is no reason why patterns shouldn't be able to refer to
>identifiers like "get", even though "get" is a keyword in the pointcut
>state.
>
>So I believe the way it always worked was:
>
>(1) all Java keywords are keywords everywhere
>
>(2) in aspect state, there is an additional set of keywords (before, after ...)
>
>(3) in pointcut state, there is a different new set of keywords (get,set ...)
> some of these new keywords look like old Java ones, like "if",
> but we give it a different token value in this state (PC_IF), mostly
> to make sure grammar rules in the Java part of the language won't
> interfere with grammar rules in the pointcut part of the language.
>
> in order to be able to accept the ADDITIONAL keywords (get, set, ...) as
> valid Identifiers in patterns, we explicitly add them as
> alternatives.
>
>
Errrm... do we? I don't think we do. It's just that we rely on the
lexer's greedy match to parse "get*" as a pattern rather than a 'get' +
'*'. Hmm... We should see if we deal with pointcuts on functions named
get() correctly.
The issue Oege was addressing was that (for example in the IBM slides on
the scanner/parser, page 6), we claim "Reserved words in [the POINTCUT]
state are only: adviceexecution, args, [..]". This does not correspond
to the implementation, and is also clearly incorrect - as we *need* at
least the primitive types and method modifiers to be POINTCUT keywords
as well.
As you say, the way it has always worked is that Java keywords are
keywords everywhere. We just seemingly create the wrong impression in
the docs.
I'll try a call(* get(..)) pointcut now.
- P
>
>Does that clarify anything?
>
>Laurie
>
>
>+-------------------------------------------------------------+
>| Laurie Hendren, Professor, School of Computer Science |
>| McGill University |
>| 318 McConnell Engineering Building tel: (514) 398-7391 |
>| 3480 University Street fax: (514) 398-3883 |
>| Montreal, Quebec H3A 2A7 hendren@cs.mcgill.ca |
>| CANADA http://www.sable.mcgill.ca/~hendren |
>+-------------------------------------------------------------+
>
>
>
>
>
>
Received on Fri Sep 24 15:14:30 2004
This archive was generated by hypermail 2.1.8 : Fri Sep 24 2004 - 15:30:01 BST