abc.weaving.aspectinfo
Class ArgPattern
java.lang.Object
abc.weaving.aspectinfo.Syntax
abc.weaving.aspectinfo.ArgPattern
- Direct Known Subclasses:
- ArgAny, ArgFill
public abstract class ArgPattern
- extends Syntax
A pattern for a single argument.
- Author:
- Aske Simon Christensen, Ganesh Sittampalam, Damien Sereni
Method Summary |
abstract void |
getFreeVars(java.util.Set result)
|
abstract Residue |
matchesAt(WeavingEnv we,
ContextValue cv)
For use when being used in an args pattern |
abstract Var |
substituteForPointcutFormal(java.util.Hashtable renameEnv,
java.util.Hashtable typeEnv,
Formal formal,
java.util.List newLocals,
java.util.List newCasts,
Position pos)
For use when this is being used as a pointcut formal |
abstract boolean |
unify(ArgPattern other,
Unification unification)
Attempts to unify two pointcuts, creating another pointcut that has enough variables
to encompass both if possible. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ArgPattern
public ArgPattern(Position pos)
matchesAt
public abstract Residue matchesAt(WeavingEnv we,
ContextValue cv)
- For use when being used in an args pattern
substituteForPointcutFormal
public abstract Var substituteForPointcutFormal(java.util.Hashtable renameEnv,
java.util.Hashtable typeEnv,
Formal formal,
java.util.List newLocals,
java.util.List newCasts,
Position pos)
- For use when this is being used as a pointcut formal
getFreeVars
public abstract void getFreeVars(java.util.Set result)
unify
public abstract boolean unify(ArgPattern other,
Unification unification)
- Attempts to unify two pointcuts, creating another pointcut that has enough variables
to encompass both if possible. Variables are only unified if they have the same type,
as stored in the unification typemaps. If unification.unifyWithFirst(), then restricted
unification is attempted, which succeeds only if both pointcuts can be unified with result
the first pointcut (ie the first pointcut has no less free variables than the second).
- Parameters:
other
- The other pointcut to unify withunification
- The unification. This should be initialized (determining
whether we attempt proper or restricted unification) and the typemaps should
be set.
- Returns:
- True iff the unification was successful. In this case, unification contains
the resulting pointcut and the substitutions taking it to THIS and OTHER. Otherwise,
unification is left in any old state.