abc.aspectj.ast
Class IntertypeMethodDecl_c

java.lang.Object
  extended by MethodDecl_c
      extended by abc.aspectj.ast.IntertypeMethodDecl_c
All Implemented Interfaces:
IntertypeDecl, IntertypeMethodDecl, MakesAspectMethods, ContainsAspectInfo

public class IntertypeMethodDecl_c
extends MethodDecl_c
implements IntertypeMethodDecl, ContainsAspectInfo, MakesAspectMethods

Author:
Oege de Moor, Aske Simon Christensen

Field Summary
protected  java.util.List derivedMis
           
protected  TypeNode host
           
protected  java.lang.String identifier
           
 InterTypeMethodInstance itMethodInstance
           
protected  Flags origflags
           
protected  java.lang.String originalName
           
protected  LocalInstance thisParamInstance
           
 
Constructor Summary
IntertypeMethodDecl_c(Position pos, Flags flags, TypeNode returnType, TypeNode host, java.lang.String name, java.util.List formals, java.util.List throwTypes, Block body)
           
 
Method Summary
 IntertypeMethodDecl accessChange()
           
 void addDerived(MethodInstance mi)
           
 NodeVisitor addMembersEnter(AddMemberVisitor am)
           
 void aspectMethodsEnter(AspectMethods visitor)
           
 Node aspectMethodsLeave(AspectMethods visitor, AJNodeFactory nf, AJTypeSystem ts)
           
static void conflictWithParentCheck(InterTypeMethodInstance_c mi)
          Check whether an intertype declaration via an interface conflicts with a declaration in a parent.
 Context enterScope(Context c)
           
 TypeNode host()
          the target class of the intertype decl
static void intertypeMethodChecks(ClassType ct)
           
static void overrideITDmethod(ClassType pht, MethodInstance mi)
           
static void overrideMethodCheck(MethodInstance mi)
          Do the usual override check for newly declared methods.
 void prettyPrint(CodeWriter w, PrettyPrinter tr)
           
protected  IntertypeMethodDecl_c reconstruct(TypeNode returnType, java.util.List formals, java.util.List throwTypes, Block body, TypeNode host)
           
 IntertypeDecl thisParameter(AJNodeFactory nf, AJTypeSystem ts)
          introduce "this" as first parameter
 Expr thisReference(AJNodeFactory nf, AJTypeSystem ts)
          create a reference to the "this" parameter
 Node typeCheck(TypeChecker tc)
           
 void update(GlobalAspectInfo gai, Aspect current_aspect)
          Called by the AspectInfoHarvester to tell the node to put all relevant information into the GlobalAspectInfo.
 Node visitChildren(NodeVisitor v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

host

protected TypeNode host

itMethodInstance

public InterTypeMethodInstance itMethodInstance

thisParamInstance

protected LocalInstance thisParamInstance

origflags

protected Flags origflags

identifier

protected java.lang.String identifier

originalName

protected java.lang.String originalName

derivedMis

protected java.util.List derivedMis
Constructor Detail

IntertypeMethodDecl_c

public IntertypeMethodDecl_c(Position pos,
                             Flags flags,
                             TypeNode returnType,
                             TypeNode host,
                             java.lang.String name,
                             java.util.List formals,
                             java.util.List throwTypes,
                             Block body)
Method Detail

host

public TypeNode host()
Description copied from interface: IntertypeDecl
the target class of the intertype decl

Specified by:
host in interface IntertypeDecl

reconstruct

protected IntertypeMethodDecl_c reconstruct(TypeNode returnType,
                                            java.util.List formals,
                                            java.util.List throwTypes,
                                            Block body,
                                            TypeNode host)

visitChildren

public Node visitChildren(NodeVisitor v)

addDerived

public void addDerived(MethodInstance mi)

addMembersEnter

public NodeVisitor addMembersEnter(AddMemberVisitor am)

overrideITDmethod

public static void overrideITDmethod(ClassType pht,
                                     MethodInstance mi)

conflictWithParentCheck

public static void conflictWithParentCheck(InterTypeMethodInstance_c mi)
                                    throws SemanticException
Check whether an intertype declaration via an interface conflicts with a declaration in a parent. Not very pretty; should be simplified. ODM 09/07/04

Throws:
SemanticException

overrideMethodCheck

public static void overrideMethodCheck(MethodInstance mi)
                                throws SemanticException
Do the usual override check for newly declared methods. Probably better to more this to AJTypeSystem.

Throws:
SemanticException

intertypeMethodChecks

public static void intertypeMethodChecks(ClassType ct)
                                  throws SemanticException
Throws:
SemanticException

accessChange

public IntertypeMethodDecl accessChange()

thisParameter

public IntertypeDecl thisParameter(AJNodeFactory nf,
                                   AJTypeSystem ts)
introduce "this" as first parameter


thisReference

public Expr thisReference(AJNodeFactory nf,
                          AJTypeSystem ts)
create a reference to the "this" parameter

Specified by:
thisReference in interface IntertypeDecl

typeCheck

public Node typeCheck(TypeChecker tc)
               throws SemanticException
Throws:
SemanticException

enterScope

public Context enterScope(Context c)

prettyPrint

public void prettyPrint(CodeWriter w,
                        PrettyPrinter tr)

update

public void update(GlobalAspectInfo gai,
                   Aspect current_aspect)
Description copied from interface: ContainsAspectInfo
Called by the AspectInfoHarvester to tell the node to put all relevant information into the GlobalAspectInfo.

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

aspectMethodsEnter

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

aspectMethodsLeave

public Node aspectMethodsLeave(AspectMethods visitor,
                               AJNodeFactory nf,
                               AJTypeSystem ts)
Specified by:
aspectMethodsLeave in interface MakesAspectMethods