|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--at.dms.util.Utils | +--at.dms.compiler.Phylum | +--at.dms.kjc.JPhylum | +--at.dms.kjc.JMemberDeclaration | +--at.dms.kjc.JTypeDeclaration
This class represents a java class or interface in the syntax tree
Fields inherited from class at.dms.kjc.JMemberDeclaration |
ACCESSOR_PREFIX |
Fields inherited from class at.dms.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
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_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VOID |
Constructor Summary | |
JTypeDeclaration(TokenReference where,
int modifiers,
java.lang.String ident,
CClassType[] interfaces,
JFieldDeclaration[] fields,
JMethodDeclaration[] methods,
JTypeDeclaration[] inners,
JPhylum[] initializers,
JavadocComment javadoc,
JavaStyleComment[] comments)
Constructs a type declaration in the parsing tree. |
Method Summary | |
void |
addGeneratedBodyPart(JPhylum bodyPart,
boolean keepSeperate)
|
void |
addGeneratedField(JFieldDeclaration field,
boolean keepSeperate)
|
void |
addGeneratedInner(JTypeDeclaration inner,
boolean keepSeperate)
Adds a generated inner method. |
void |
addGeneratedMethod(JMethodDeclaration method,
boolean keepSeperate)
|
void |
addOuterThis()
Any inner class (non-static member class) has an outer-this variable. |
void |
checkInitializers(CContext context)
Checks that same interface is not specified more than once. |
abstract void |
checkInterface(CContext context)
Second pass (quick), check interface looks good |
protected void |
checkInterface(CContext context,
CClassType superClass)
Second pass (quick), check interface looks good |
void |
checkTypeBody(CContext context)
Check expression and evaluate and alter context. |
abstract CClassContext |
createContext(CContext parent)
createContext. |
void |
generateInterface(Compiler compiler,
CClass owner,
java.lang.String prefix)
Defines an intermediate external representation of this class to use internally. |
JPhylum[] |
getBody()
Returns bodies as array. |
java.util.List |
getBodyList()
Returns bodies as list. |
JConstructorDeclaration |
getDefaultConstructor()
Returns the default constructor for this type. |
java.util.List |
getFieldList()
Returns source-declared fields as list. |
JFieldDeclaration[] |
getFields()
Returns fields as array. |
java.util.List |
getGeneratedFieldList()
Returns generated fields as list. |
java.util.List |
getGeneratedInnerList()
Returns generated inner classes as list. |
java.util.List |
getGeneratedMethodList()
Returns generated methods as list. |
java.lang.String |
getIdent()
Returns the identifier for the type (the name). |
java.util.List |
getInnerList()
Returns source-declared inner classes as list. |
JTypeDeclaration[] |
getInners()
Returns inner classes as array. |
JInitializerDeclaration |
getInstanceInitializer()
Returns instance initializer as syntax-subtree. |
CClassType[] |
getInterfaces()
Returns the interfaces implemented by this type. |
java.util.List |
getMethodList()
Returns source-declared methods as list. |
JMethodDeclaration[] |
getMethods()
|
int |
getModifiers()
Returns modifiers of type. |
CClass |
getOwner()
Returns owner of type. |
CSourceClass |
getSourceClass()
Returns export of type. |
JInitializerDeclaration |
getStaticInitializer()
Returns static initializer as syntax-subtree. |
boolean |
isAtTopLevel()
Returns true if this class is at top level, false if not. |
void |
setDefaultConstructor(JConstructorDeclaration constructor)
Sets the default constructor for this type. |
void |
setIdent(java.lang.String ident)
Sets the identifier for the type (the name). |
void |
setInstanceInitializer(JInitializerDeclaration initializer)
Sets the instance initializer. |
void |
setInterfaces(CClassType[] interfaces)
Sets the interfaces implemented by this type. |
void |
setModifiers(int modifiers)
Changes modifiers of type. |
void |
setStaticInitializer(JInitializerDeclaration initializer)
Sets the static initializer. |
abstract void |
transformType(CContext context)
Transforms this type before code generation. |
Methods inherited from class at.dms.kjc.JMemberDeclaration |
accept, checkOrder, genComments, getCClass, getField, getMethod, getModifierName, isDeprecated, isSynthetic, setInterface, setSynthetic |
Methods inherited from class at.dms.kjc.JPhylum |
check, check, check, check, fail |
Methods inherited from class at.dms.compiler.Phylum |
getTokenReference, setTokenReference |
Methods inherited from class at.dms.util.Utils |
assert, assert, fail, fail, hasFlag, hasMoreThanOneFlag, hasOtherFlags, splitQualifiedName, splitQualifiedName, vectorToArray, vectorToIntArray |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public JTypeDeclaration(TokenReference where, int modifiers, java.lang.String ident, CClassType[] interfaces, JFieldDeclaration[] fields, JMethodDeclaration[] methods, JTypeDeclaration[] inners, JPhylum[] initializers, JavadocComment javadoc, JavaStyleComment[] comments)
where
- the line of this node in the source codeparent
- the parent in which this class is definedmodifiers
- the list of modifiers of this classident
- the short name of this classinterfaces
- the names of this types's interfacesjavadoc
- is this type declaration deprecatedMethod Detail |
public void generateInterface(Compiler compiler, CClass owner, java.lang.String prefix)
public boolean isAtTopLevel()
public java.util.List getFieldList()
public java.util.List getGeneratedFieldList()
public JFieldDeclaration[] getFields()
public java.util.List getMethodList()
public java.util.List getGeneratedMethodList()
public JMethodDeclaration[] getMethods()
public java.util.List getBodyList()
public JPhylum[] getBody()
public java.util.List getInnerList()
public java.util.List getGeneratedInnerList()
public JTypeDeclaration[] getInners()
public void setInterfaces(CClassType[] interfaces)
public CClassType[] getInterfaces()
public JConstructorDeclaration getDefaultConstructor()
public void setDefaultConstructor(JConstructorDeclaration constructor)
public void setIdent(java.lang.String ident)
public java.lang.String getIdent()
public void setStaticInitializer(JInitializerDeclaration initializer)
public JInitializerDeclaration getStaticInitializer()
public void setInstanceInitializer(JInitializerDeclaration initializer)
public JInitializerDeclaration getInstanceInitializer()
public CSourceClass getSourceClass()
public int getModifiers()
public void setModifiers(int modifiers)
public CClass getOwner()
public abstract void transformType(CContext context) throws PositionedError
PositionedError
- an error with reference to the source filepublic abstract void checkInterface(CContext context) throws PositionedError
PositionedError
- an error with reference to the source fileprotected void checkInterface(CContext context, CClassType superClass) throws PositionedError
PositionedError
- an error with reference to the source filepublic void checkInitializers(CContext context) throws PositionedError
PositionedError
- Error catched as soon as possible.public void addOuterThis()
public abstract CClassContext createContext(CContext parent) throws UnpositionedError
parent
- The parent context or null.UnpositionedError
- Error catched as soon as possible.public void checkTypeBody(CContext context) throws PositionedError
context
- The actual context of analyse.PositionedError
- Error catched as soon as possible (for subclasses)public void addGeneratedInner(JTypeDeclaration inner, boolean keepSeperate)
public void addGeneratedField(JFieldDeclaration field, boolean keepSeperate)
public void addGeneratedMethod(JMethodDeclaration method, boolean keepSeperate)
public void addGeneratedBodyPart(JPhylum bodyPart, boolean keepSeperate)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |