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.
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:01:35 2004
This archive was generated by hypermail 2.1.8 : Fri Sep 24 2004 - 15:20:02 BST