|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.dms.util.Utils
at.dms.kjc.CContext
at.dms.kjc.CClassContext
public class CClassContext
This class represents a class context during check
CCompilationUnitContext,
CClassContext,
CMethodContext,
CContext,
Serialized Form| Field Summary | |
|---|---|
protected CSourceClass |
self
|
| Fields inherited from class at.dms.kjc.CContext |
|---|
parent |
| Fields inherited from class at.dms.util.Utils |
|---|
EMPTY_LIST, getForLoopCallers |
| Fields inherited from interface at.dms.kjc.Constants |
|---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
| Constructor Summary | |
|---|---|
protected |
CClassContext()
|
| Method Summary | |
|---|---|
void |
addInitializer()
Add an initializer to this context |
void |
close(JTypeDeclaration decl,
CVariableInfo staticC,
CVariableInfo instanceC,
CVariableInfo[] constructorsC)
Verify all final fields are initialized |
Object |
deepClone()
Returns a deep clone of this object. |
protected void |
deepCloneInto(CClassContext other)
Clones all fields of this into |
int |
getAnonymousIndex()
getNextSyntheticIndex |
CClass |
getCClass()
getCClass |
CClassContext |
getClassContext()
getClassContext |
CVariableInfo |
getFieldInfo()
Returns the field definition state. |
int |
getFieldInfo(int index)
|
CVariableInfo |
getInitializerInfo()
Gets the field state after execution of the instance initializer. |
CMethodContext |
getMethodContext()
getMethod |
int |
getNextSyntheticIndex()
getNextSyntheticIndex |
JTypeDeclaration |
getTypeDeclaration()
getTypeDeclaration |
boolean |
hasInitializer()
Returns true if this class need initializers |
CClassType |
lookupClass(CClass caller,
String name)
lookupClass search for a class with the provided type parameters |
CField |
lookupField(CClass caller,
String ident)
Searches the class or interface to locate declarations of fields that are accessible. |
JLocalVariable |
lookupLocalVariable(String ident)
lookupLocalVariable |
CMethod |
lookupMethod(CClass caller,
String ident,
CType[] actuals)
JLS 15.12.2 : Searches the class or interface to locate method declarations that are both applicable and accessible, that is, declarations that can be correctly invoked on the given arguments. |
CField |
lookupOuterField(CClass caller,
String ident)
Searches the class or interface to locate declarations of fields that are accessible. |
JExpression |
lookupOuterLocalVariable(TokenReference ref,
String ident)
lookupOuterLocalVariable |
void |
markAllFieldToInitialized(boolean isStatic)
Marks all class or instance fields of this class initialized. |
void |
setFieldInfo(int index,
int info)
|
void |
setInitializerInfo(CVariableInfo initializerInfo)
Sets the field state after execution of the instance initializer. |
void |
setVariableInfo(CVariableInfo info)
|
| Methods inherited from class at.dms.kjc.CContext |
|---|
addSourceClass, check, check, check, check, deepCloneInto, dumpContext, dumpContext, dumpIndent, fail, fail, getBlockContext, getCompilationUnitContext, getParentContext, isStaticContext, reportTrouble |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CSourceClass self
| Constructor Detail |
|---|
protected CClassContext()
| Method Detail |
|---|
public void close(JTypeDeclaration decl,
CVariableInfo staticC,
CVariableInfo instanceC,
CVariableInfo[] constructorsC)
throws UnpositionedError
UnpositionedError - this error will be positioned soonpublic void addInitializer()
public boolean hasInitializer()
public int getNextSyntheticIndex()
public int getAnonymousIndex()
public CVariableInfo getFieldInfo()
getFieldInfo in class CContextpublic int getFieldInfo(int index)
getFieldInfo in class CContextindex - the definition of a field
public void setFieldInfo(int index,
int info)
setFieldInfo in class CContextindex - The field position in method array of local varsinfo - The information to add
We make it a local copy of this information and at the end of this context
we will transfert it to the parent context according to controlFlowpublic void markAllFieldToInitialized(boolean isStatic)
public void setVariableInfo(CVariableInfo info)
public void setInitializerInfo(CVariableInfo initializerInfo)
public CVariableInfo getInitializerInfo()
public CClassType lookupClass(CClass caller,
String name)
throws UnpositionedError
lookupClass in class CContextcaller - the class of the callername - method name
UnpositionedError - this error will be positioned soon
public CMethod lookupMethod(CClass caller,
String ident,
CType[] actuals)
throws UnpositionedError
lookupMethod in class CContextcaller - the class of the callerident - method nameactuals - method parameters
UnpositionedError - this error will be positioned soon
public CField lookupOuterField(CClass caller,
String ident)
throws UnpositionedError
caller - the class of the callerident - the simple name of the field
UnpositionedError - this error will be positioned soon
public CField lookupField(CClass caller,
String ident)
throws UnpositionedError
lookupField in class CContextcaller - the class of the callerident - the simple name of the field
UnpositionedError - this error will be positioned soon
public JExpression lookupOuterLocalVariable(TokenReference ref,
String ident)
ident - the name of the outer variable
public JLocalVariable lookupLocalVariable(String ident)
lookupLocalVariable in class CContextident - the name of the local variable
public CClassContext getClassContext()
getClassContext in class CContextpublic CClass getCClass()
public CMethodContext getMethodContext()
getMethodContext in class CContextpublic JTypeDeclaration getTypeDeclaration()
public Object deepClone()
deepClone in interface DeepCloneabledeepClone in class CContextprotected void deepCloneInto(CClassContext other)
other
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||