abc.tm.ast
Class TMDecl_c

java.lang.Object
  extended by MethodDecl_c
      extended by abc.aspectj.extension.AJMethodDecl_c
          extended by abc.aspectj.ast.AdviceBody_c
              extended by abc.tm.ast.TMDecl_c
All Implemented Interfaces:
AdviceDecl, MakesAspectMethods, ContainsAspectInfo, TransformsAspectReflection, TMDecl
Direct Known Subclasses:
RelTMDecl_c, TMFromRelTMDecl_c

public class TMDecl_c
extends AdviceBody_c
implements TMDecl

Author:
Julian Tibble, Eric Bodden

Field Summary
protected  Pointcut after_pc
           
protected  AdviceSpec after_spec
           
protected  Pointcut before_around_pc
           
protected  AdviceSpec before_around_spec
           
protected  java.util.List frequent_symbols
           
protected  boolean isAround
           
protected  boolean isPerThread
           
protected  Regex regex
           
protected  java.lang.String some_advice
           
protected  java.util.Map sym_to_advice_name
           
protected  java.util.Map sym_to_vars
           
protected  java.util.List symbols
           
protected  java.lang.String synch_advice
           
protected  java.lang.String tracematch_name
           
 
Fields inherited from class abc.aspectj.ast.AdviceBody_c
canRewriteThisJoinPoint, hasEnclosingJoinPointStaticPart, hasJoinPoint, hasJoinPointStaticPart, isAroundAdvice, methodsInAdvice, thisEnclosingJoinPointStaticPartInstance, thisJoinPointInstance, thisJoinPointStaticPartInstance
 
Constructor Summary
TMDecl_c(Position pos, Position body_pos, TMModsAndType mods_and_type, java.lang.String tracematch_name, java.util.List formals, java.util.List throwTypes, java.util.List symbols, java.util.List frequent_symbols, Regex regex, Block body)
           
 
Method Summary
 java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
          Visit this term in evaluation order.
 java.lang.String adviceSignature()
           
protected  java.util.List aroundTypes(Context c)
           
protected  java.util.List aroundVars()
           
 void aspectMethodsEnter(AspectMethods visitor)
           
protected  java.util.List bodyAdviceFormals()
           
protected  void checkAroundSymbols()
           
protected  void checkAroundVars(Context c)
           
protected  void checkBinding()
           
protected  void checkForEmptyTrace()
           
 NodeVisitor disambiguateEnter(AmbiguityRemover ar)
           
 Context enterScope(Node child, Context c)
           
protected  Formal formalFor(java.lang.String name)
           
 java.util.List generateImplementationAdvice(TMNodeFactory nf, TypeNode voidn, MoveTraceMatchMembers visitor)
           
protected  void makeEventAdvice(TMNodeFactory nf, java.util.List advice, Pointcut before, Pointcut after, TypeNode voidn, java.lang.String debug_msg, int kind)
           
protected  void makeSymbolAdvice(TMNodeFactory nf, java.util.List advice, SymbolDecl sd, TypeNode voidn)
           
protected  java.util.Collection mustBind()
           
protected  java.util.Map orderedSymToVars()
           
protected  Pointcut orPC(TMNodeFactory nf, Pointcut orig, Pointcut other)
           
 void prettyPrint(CodeWriter c, PrettyPrinter p)
           
 MethodDecl proceedDecl(AJNodeFactory nf, AJTypeSystem ts)
          generate a dummy MethodDecl for the proceed.
protected  Node reconstruct(Node n, java.util.List symbols, Pointcut before_around_pc, Pointcut after_pc)
           
protected  int thisJoinPointVariables()
           
 Node typeCheck(TypeChecker tc)
          Type check the advice: first the usual method checks, then whether the "throwing" result is actually throwable
 void update(GlobalAspectInfo gai, Aspect current_aspect)
          create a TraceMatch object in the GlobalAspectInfo structure
 Node visitChildren(NodeVisitor v)
           
protected  java.util.List weavingFormals(java.util.List formals, boolean remove_jp_vars)
          convert from polyglot formals to weaving formals
 
Methods inherited from class abc.aspectj.ast.AdviceBody_c
addExtraFormals, aspectMethodsLeave, buildTypes, dummyVal, enterAspectReflectionInspect, enterAspectReflectionRewrite, enterScope, entry, hasEnclosingJoinPointStaticPart, hasJoinPoint, hasJoinPointStaticPart, joinpointFormals, leaveAspectReflectionInspect, leaveAspectReflectionRewrite, localMethod, makeMethodInstance, methodDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface abc.aspectj.ast.AdviceDecl
hasJoinPoint, hasJoinPointStaticPart, joinpointFormals, localMethod, methodDecl
 
Methods inherited from interface abc.aspectj.ast.MakesAspectMethods
aspectMethodsLeave
 
Methods inherited from interface abc.aspectj.visit.TransformsAspectReflection
enterAspectReflectionInspect, enterAspectReflectionRewrite, leaveAspectReflectionInspect, leaveAspectReflectionRewrite
 

Field Detail

isPerThread

protected boolean isPerThread

isAround

protected boolean isAround

tracematch_name

protected java.lang.String tracematch_name

symbols

protected java.util.List symbols

frequent_symbols

protected java.util.List frequent_symbols

regex

protected Regex regex

sym_to_vars

protected java.util.Map sym_to_vars

sym_to_advice_name

protected java.util.Map sym_to_advice_name

synch_advice

protected java.lang.String synch_advice

some_advice

protected java.lang.String some_advice

before_around_spec

protected AdviceSpec before_around_spec

before_around_pc

protected Pointcut before_around_pc

after_spec

protected AdviceSpec after_spec

after_pc

protected Pointcut after_pc
Constructor Detail

TMDecl_c

public TMDecl_c(Position pos,
                Position body_pos,
                TMModsAndType mods_and_type,
                java.lang.String tracematch_name,
                java.util.List formals,
                java.util.List throwTypes,
                java.util.List symbols,
                java.util.List frequent_symbols,
                Regex regex,
                Block body)
Method Detail

reconstruct

protected Node reconstruct(Node n,
                           java.util.List symbols,
                           Pointcut before_around_pc,
                           Pointcut after_pc)

visitChildren

public Node visitChildren(NodeVisitor v)

disambiguateEnter

public NodeVisitor disambiguateEnter(AmbiguityRemover ar)
                              throws SemanticException
Overrides:
disambiguateEnter in class AdviceBody_c
Throws:
SemanticException

enterScope

public Context enterScope(Node child,
                          Context c)
Overrides:
enterScope in class AdviceBody_c

aspectMethodsEnter

public void aspectMethodsEnter(AspectMethods visitor)
Specified by:
aspectMethodsEnter in interface MakesAspectMethods
Overrides:
aspectMethodsEnter in class AdviceBody_c

proceedDecl

public MethodDecl proceedDecl(AJNodeFactory nf,
                              AJTypeSystem ts)
Description copied from interface: AdviceDecl
generate a dummy MethodDecl for the proceed. Only applies to around advice.

Specified by:
proceedDecl in interface AdviceDecl
Overrides:
proceedDecl in class AdviceBody_c

typeCheck

public Node typeCheck(TypeChecker tc)
               throws SemanticException
Description copied from class: AdviceBody_c
Type check the advice: first the usual method checks, then whether the "throwing" result is actually throwable

Overrides:
typeCheck in class AdviceBody_c
Throws:
SemanticException

checkForEmptyTrace

protected void checkForEmptyTrace()
                           throws SemanticException
Throws:
SemanticException

aroundVars

protected java.util.List aroundVars()

checkAroundVars

protected void checkAroundVars(Context c)
                        throws SemanticException
Throws:
SemanticException

aroundTypes

protected java.util.List aroundTypes(Context c)

checkAroundSymbols

protected void checkAroundSymbols()
                           throws SemanticException
Throws:
SemanticException

checkBinding

protected void checkBinding()
                     throws SemanticException
Throws:
SemanticException

mustBind

protected java.util.Collection mustBind()
                                 throws SemanticException
Throws:
SemanticException

orderedSymToVars

protected java.util.Map orderedSymToVars()

generateImplementationAdvice

public java.util.List generateImplementationAdvice(TMNodeFactory nf,
                                                   TypeNode voidn,
                                                   MoveTraceMatchMembers visitor)
Specified by:
generateImplementationAdvice in interface TMDecl

makeSymbolAdvice

protected void makeSymbolAdvice(TMNodeFactory nf,
                                java.util.List advice,
                                SymbolDecl sd,
                                TypeNode voidn)

orPC

protected Pointcut orPC(TMNodeFactory nf,
                        Pointcut orig,
                        Pointcut other)

makeEventAdvice

protected void makeEventAdvice(TMNodeFactory nf,
                               java.util.List advice,
                               Pointcut before,
                               Pointcut after,
                               TypeNode voidn,
                               java.lang.String debug_msg,
                               int kind)

formalFor

protected Formal formalFor(java.lang.String name)

bodyAdviceFormals

protected java.util.List bodyAdviceFormals()

thisJoinPointVariables

protected int thisJoinPointVariables()

weavingFormals

protected java.util.List weavingFormals(java.util.List formals,
                                        boolean remove_jp_vars)
convert from polyglot formals to weaving formals


update

public void update(GlobalAspectInfo gai,
                   Aspect current_aspect)
create a TraceMatch object in the GlobalAspectInfo structure

Specified by:
update in interface ContainsAspectInfo
Parameters:
gai - the target of the information.
current_aspect - the aspect currently being traversed.

adviceSignature

public java.lang.String adviceSignature()
Specified by:
adviceSignature in class AdviceBody_c

prettyPrint

public void prettyPrint(CodeWriter c,
                        PrettyPrinter p)
Specified by:
prettyPrint in class AdviceBody_c

acceptCFG

public java.util.List acceptCFG(CFGBuilder v,
                                java.util.List succs)
Visit this term in evaluation order.