|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.mjc.CMember
org.multijava.mjc.CClass
org.multijava.mjc.CSourceClass
This class represents a class read from a *.java file. It is primarily just a data structure, apart from methods for generating the qualified name and for determining whether the member is accessible from some class.
CMember| Nested Class Summary |
| Nested classes inherited from class org.multijava.mjc.CClass |
CClass.NoDupStrategy, CClass.Observer |
| Field Summary | |
private RMJAnnotation |
_rmjInfo
|
private int |
countSyntheticsFields
|
private boolean |
initializerChecked
|
private boolean |
isAnonymous
Indicates whether this represents the signature of an anonymous class. |
private boolean |
isMember
Indicates whether the class represented by this is a member type. |
private int |
nextDispatcherNumber
Used to construct nested dispatcher class identifiers for methods of external generic functions. |
private Hashtable |
outers
|
| Fields inherited from class org.multijava.mjc.CClass |
CLS_UNDEFINED, dispClassTypes, methods |
| Fields inherited from class org.multijava.mjc.CMember |
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
CSourceClass(Main compiler,
MemberAccess access,
TokenReference where,
String ident,
String qualifiedName,
CTypeVariable[] typevariables,
boolean isAnonymous,
boolean isMember,
boolean deprecated)
Constructs a class export from source |
|
| Method Summary | |
void |
addRMJMethodAnnotation(RMJAnnotation.Method annote)
|
protected void |
appendCustomAttributes(AttributeList accum)
Appends any custom attributes for this class to the attribute list represented by accum. |
void |
genCode(Destination destination)
Generate a class file for the class represented by this. |
CType[] |
genConstructorArray(CType[] params)
Mutates the given array to add any synthetic parameters for outer local variables referenced within the class represented by this. |
private JLocalVariableExpression |
generatedLocalVarHelper(CMethod constructor,
CSourceField field,
JLocalVariable var,
TokenReference ref)
|
void |
genInit(CodeSequence code,
int countLocals)
Adds to the body of a constructor the storage of synthetic parameters (for outer local variables) into synthetic fields. |
void |
genSyntheticParams(CodeSequence code)
Adds synthetic parameters to the code sequence for a call to this class's constructor. |
void |
genSyntheticParamsForExplicitThis(CodeSequence code,
CMethod constructor)
Adds synthetic parameters to the code sequence for an explicit constructor invocation to this class's constructor. |
JExpression |
getOuterLocalAccess(TokenReference ref,
JLocalVariable var,
CMethod constructor)
Returns an expression that evaluates to the value of the outer local variable var. |
JExpression[] |
getSyntheticParamsForExplicitSuper(CSourceClass callerClass,
CMethod caller)
For an explicit super class constructor invocation, returns the expressions that must be evaluated in the body of the constructor caller of the class
callerClass to add the outer local variable values
required by this to the stack. |
String |
getUniverseVersion()
Return the version of the encoding used to encode the universe type modifiers. |
boolean |
hasUniverseRuntimeSupport()
Return true if the class is being compiled with run-time support enabled. |
boolean |
initializerChecked()
Returns true if initialization pass is finished for this class |
boolean |
isAnonymous()
|
boolean |
isMember()
Indicates whether the class represented by this is a member type. |
CClass |
lookupClass(String name,
CContextType context)
Searches for a class with the given simple name according the procedure in JLS2 6.5.5. |
CMethodSet |
lookupMethodOrSet(String name,
CType[] params,
CClassType[] args,
CContextType context)
Searches for the generic function applicable to the given identifier and argument type tuple, in the given context, looking in parent hierarchy and augmentation map as needed. |
protected int |
nextDispatcherNumber()
Returns a unique number for a nested dispatcher class of this. |
protected void |
rmjAnnotate()
Provide an annotation for any dispatcher classes (RMJ only) |
void |
setCheckedMembers(Hashtable fields_H,
CMethod[] protoMethods_A)
Stores information on member signatures gathered during checkInterface pass prior to closing in the translateMJ pass. |
void |
setInitializerChecked()
Sets initialization pass to be finished |
| Methods inherited from class org.multijava.mjc.CMember |
access, addModifiers, deprecated, getCCompilationUnit, getField, getIdent, getJavaName, getMethod, getOwnerName, getQualNameWithSeparator, hasDefaultAccess, host, ident, isAccessibleFrom, isDeclaredNonNull, isDeprecated, isFinal, isLocalTo, isPrivate, isProtected, isPublic, isStatic, modifiers, owner, setModifiers |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.multijava.mjc.CMemberHost |
host, ident, isAccessibleFrom |
| Field Detail |
private Hashtable outers
private int countSyntheticsFields
private boolean initializerChecked
private int nextDispatcherNumber
private RMJAnnotation _rmjInfo
private final boolean isAnonymous
private final boolean isMember
| Constructor Detail |
public CSourceClass(Main compiler,
MemberAccess access,
TokenReference where,
String ident,
String qualifiedName,
CTypeVariable[] typevariables,
boolean isAnonymous,
boolean isMember,
boolean deprecated)
| Method Detail |
public void setCheckedMembers(Hashtable fields_H,
CMethod[] protoMethods_A)
close method has been called.
public boolean initializerChecked()
public void setInitializerChecked()
public boolean isAnonymous()
public boolean isMember()
public String getUniverseVersion()
getUniverseVersion in class CClasspublic boolean hasUniverseRuntimeSupport()
public CType[] genConstructorArray(CType[] params)
also requires (* this represents an anonymous class or a local class declaration *); requires (* params is the parameter array for a constructor of this, already including any synthetic outer this parameter *); ensures (* params includes the types of any outer local variables required to instantiate this *);
genConstructorArray in class CClassouterspublic void genSyntheticParams(CodeSequence code)
genSyntheticParams in class CClasscode - the code sequence being generated
public void genSyntheticParamsForExplicitThis(CodeSequence code,
CMethod constructor)
genSyntheticParamsForExplicitThis in class CClasscode - the code sequence being generated constructor - the signature of the calling constructor
public JExpression[] getSyntheticParamsForExplicitSuper(CSourceClass callerClass,
CMethod caller)
caller of the class
callerClass to add the outer local variable values
required by this to the stack.
also requires callerClass.descendsFrom(this); requires caller.isConstructor(); ensures \result != null;
getSyntheticParamsForExplicitSuper in class CClass
public JExpression getOuterLocalAccess(TokenReference ref,
JLocalVariable var,
CMethod constructor)
var. The constructor
parameter is used to generate a reference to a synthetic outer
variable parameter rather than a synthetic field when the original
reference appears in a constructor.
ref - a token reference to be added to the returned exprvar - the variable to be referencedconstructor - the constructor in which this reference appears,
or null if the reference is not in a constructor
private JLocalVariableExpression generatedLocalVarHelper(CMethod constructor,
CSourceField field,
JLocalVariable var,
TokenReference ref)
public void genInit(CodeSequence code,
int countLocals)
requires isNestedType(); requires (* code represents the body of a constructor of the class represented by this *); requires (* countLocals == the stack space consumed by the actual parameters of the constructor along with any synthetic outer this parameter *);
public CMethodSet lookupMethodOrSet(String name,
CType[] params,
CClassType[] args,
CContextType context)
throws UnpositionedError
CClass
lookupMethodOrSet in class CClassUnpositionedError
public CClass lookupClass(String name,
CContextType context)
throws UnpositionedError
CClass
lookupClass in class CClassUnpositionedErrorprotected int nextDispatcherNumber()
public void genCode(Destination destination)
throws IOException,
ClassFileFormatException
IOException
ClassFileFormatExceptionprotected void rmjAnnotate()
protected void appendCustomAttributes(AttributeList accum)
accum.
appendCustomAttributes in class CClasspublic void addRMJMethodAnnotation(RMJAnnotation.Method annote)
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||