abc.main
Class AbcExtension

java.lang.Object
  extended by abc.main.AbcExtension
Direct Known Subclasses:
AbcExtension, AbcExtension

public class AbcExtension
extends java.lang.Object

This class should be sub-classed to extend the behaviour of abc

A sub-class, with overriden methods to effect some new behaviour, can be loaded at runtime by using the "-ext" switch to abc.

Author:
Julian Tibble

Constructor Summary
AbcExtension()
           
 
Method Summary
 void addBasicClassesToSoot()
          Call Scene.v().addBasicClass for each runtime class that the backend might generate code for.
 void addJimplePacks()
          This method adds optimisation passes specificially required for abc.
protected  void collectVersions(java.lang.StringBuffer versions)
           
 SJPInfo createSJPInfo(java.lang.String kind, java.lang.String signatureTypeClass, java.lang.String signatureType, java.lang.String signature, Host host)
          Create a (compile-time) static join point information object that generates code to initialize static join point fields with reflective information about a join point.
 void findMethodShadows(GlobalAspectInfo info, MethodAdviceList mal, SootClass cls, SootMethod method)
          This method is responsible for taking a method and calling AdviceApplication.doShadows for each "position" in the method that might have a join point associated with it.
 void initLexerKeywords(AbcLexer lexer)
          Initialise the HashMaps that define how keywords are handled in the different lexer states.
protected  java.util.List listShadowTypes()
          Override this method to add new joinpoints to the abc.
 ExtensionInfo makeExtensionInfo(java.util.Collection jar_classes, java.util.Collection aspect_sources)
           
 java.lang.String runtimeSJPFactoryClass()
          Specify the class that will be used at runtime to generate StaticJoinPoint objects.
 java.util.Iterator shadowTypes()
          Get all the shadow joinpoints that are matched in this extension of AspectJ
 java.lang.String versions()
          Constructs a version string for all loaded extensions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbcExtension

public AbcExtension()
Method Detail

versions

public final java.lang.String versions()
Constructs a version string for all loaded extensions


collectVersions

protected void collectVersions(java.lang.StringBuffer versions)

makeExtensionInfo

public ExtensionInfo makeExtensionInfo(java.util.Collection jar_classes,
                                       java.util.Collection aspect_sources)

shadowTypes

public final java.util.Iterator shadowTypes()
Get all the shadow joinpoints that are matched in this extension of AspectJ


listShadowTypes

protected java.util.List listShadowTypes()
Override this method to add new joinpoints to the abc. Call the same method in the super-class to ensure the standard joinpoints needed are loaded too.


addJimplePacks

public void addJimplePacks()
This method adds optimisation passes specificially required for abc.


addBasicClassesToSoot

public void addBasicClassesToSoot()
Call Scene.v().addBasicClass for each runtime class that the backend might generate code for. Derived implementations should normally make sure to call the superclass implementation.


runtimeSJPFactoryClass

public java.lang.String runtimeSJPFactoryClass()
Specify the class that will be used at runtime to generate StaticJoinPoint objects.


createSJPInfo

public SJPInfo createSJPInfo(java.lang.String kind,
                             java.lang.String signatureTypeClass,
                             java.lang.String signatureType,
                             java.lang.String signature,
                             Host host)
Create a (compile-time) static join point information object that generates code to initialize static join point fields with reflective information about a join point.


initLexerKeywords

public void initLexerKeywords(AbcLexer lexer)
Initialise the HashMaps that define how keywords are handled in the different lexer states. Keywords are added by calling the methods addJavaKeyword(), addAspectJKeyword(), lexer.addPointcutKeyword() and addPointcutIfExprKeyword(), which are defined in the Lexer_c class. There are the utility methods lexer.addGlobalKeyword() (which adds its parameters to all four states) and lexer.addAspectJContextKeyword() (which adds its parameters to the AspectJ and PointcutIfExpr states). Each of these methods takes two arguments - a String (the keyword to be added) and a class implementing abc.aspectj.parse.LexerAction defining what to do when this keyword is encountered.


findMethodShadows

public void findMethodShadows(GlobalAspectInfo info,
                              MethodAdviceList mal,
                              SootClass cls,
                              SootMethod method)
                       throws polyglot.types.SemanticException
This method is responsible for taking a method and calling AdviceApplication.doShadows for each "position" in the method that might have a join point associated with it. The base list of positions consists of WholeMethodPosition, StmtMethodPosition, NewStmtMethodPosition and TrapMethodPosition; if a new join point requires something else then it will be necessary to override this method and add a new kind of method position.

Throws:
polyglot.types.SemanticException