abc.aspectj.ast
Class IntertypeFieldDecl_c

java.lang.Object
  extended by FieldDecl_c
      extended by abc.aspectj.ast.IntertypeFieldDecl_c
All Implemented Interfaces:
IntertypeDecl, IntertypeFieldDecl, MakesAspectMethods, ContainsAspectInfo

public class IntertypeFieldDecl_c
extends FieldDecl_c
implements IntertypeFieldDecl, ContainsAspectInfo, MakesAspectMethods

Author:
Oege de Moor, Aske Simon Christensen

Field Summary
protected  TypeNode host
           
protected  InterTypeFieldInstance hostInstance
           
protected  java.lang.String identifier
           
protected  MethodDecl initm
           
protected  MethodInstance initmi
           
protected  Flags originalFlags
           
protected  java.lang.String originalName
           
protected  LocalInstance thisParamInstance
           
 
Constructor Summary
IntertypeFieldDecl_c(Position pos, Flags flags, TypeNode type, TypeNode host, java.lang.String name, Expr init)
           
 
Method Summary
 IntertypeFieldDecl accessChange()
           
 NodeVisitor addMembersEnter(AddMemberVisitor am)
           
 void aspectMethodsEnter(AspectMethods visitor)
           
 Node aspectMethodsLeave(AspectMethods visitor, AJNodeFactory nf, AJTypeSystem ts)
           
 Context enterScope(Node n, Context c)
           
 TypeNode host()
          the target class of the intertype decl
 MethodDecl initMethod(AJNodeFactory nf, AJTypeSystem ts)
          create a new method for the initialiser, that has "this" of host type as a parameter.
 IntertypeFieldDecl liftInit(AJNodeFactory nf, AJTypeSystem ts)
          replace init by method call.
static void overrideITDField(ClassType pht, FieldInstance fi)
           
 void prettyPrint(CodeWriter w, PrettyPrinter tr)
           
protected  IntertypeFieldDecl_c reconstruct(TypeNode type, Expr init, TypeNode host)
           
 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

hostInstance

protected InterTypeFieldInstance hostInstance

thisParamInstance

protected LocalInstance thisParamInstance

identifier

protected java.lang.String identifier

originalName

protected java.lang.String originalName

originalFlags

protected Flags originalFlags

initm

protected MethodDecl initm

initmi

protected MethodInstance initmi
Constructor Detail

IntertypeFieldDecl_c

public IntertypeFieldDecl_c(Position pos,
                            Flags flags,
                            TypeNode type,
                            TypeNode host,
                            java.lang.String name,
                            Expr init)
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 IntertypeFieldDecl_c reconstruct(TypeNode type,
                                           Expr init,
                                           TypeNode host)

visitChildren

public Node visitChildren(NodeVisitor v)

typeCheck

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

addMembersEnter

public NodeVisitor addMembersEnter(AddMemberVisitor am)

overrideITDField

public static void overrideITDField(ClassType pht,
                                    FieldInstance fi)

thisReference

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

Specified by:
thisReference in interface IntertypeDecl

initMethod

public MethodDecl initMethod(AJNodeFactory nf,
                             AJTypeSystem ts)
create a new method for the initialiser, that has "this" of host type as a parameter. TODO: If it is static, however, it does not have any parameters.


liftInit

public IntertypeFieldDecl liftInit(AJNodeFactory nf,
                                   AJTypeSystem ts)
replace init by method call. Note: this methodcall occurs in the host, not in the originating aspect.


prettyPrint

public void prettyPrint(CodeWriter w,
                        PrettyPrinter tr)

accessChange

public IntertypeFieldDecl accessChange()

enterScope

public Context enterScope(Node n,
                          Context c)

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