|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.util.compiler.Phylum
org.multijava.mjc.JPhylum
org.multijava.mjc.JMemberDeclaration
org.multijava.mjc.JFieldDeclaration
This class represents a field declaration in the syntax tree.
| Field Summary | |
protected JVariableDefinition |
variable
|
| Fields inherited from class org.multijava.mjc.JMemberDeclaration |
|
| Fields inherited from class org.multijava.util.compiler.Phylum |
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
JFieldDeclaration(TokenReference where,
JVariableDefinition variable,
JavadocComment javadoc,
JavaStyleComment[] comments)
Construct a node in the parsing tree This method is directly called by the parser |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
CSourceField |
checkInterface(CClassContextType context)
Checks the basic interfaces to make sure things generally look OK. |
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
JExpression |
getInitializer()
|
CType |
getType()
Returns the type of this field |
boolean |
hasInitializer()
Returns true if this field declarator has initializer (should be initialized) |
String |
ident()
Returns the identifier of this field declaration |
protected CSourceField |
makeFieldSignature(CClass owner)
Generates the signature object for this class declaration. |
long |
modifiers()
Returns the modifiers of this field declaration |
boolean |
needInitialization()
Returns true if this field need to be initialized WARNING: this method returns true when initial value corresponds to a default value ====> a second check should be made after typecheck to ensure that an initialization is really needed |
void |
setInitializer(JExpression expr)
Sets the initialization expression for this field. |
void |
typecheck(CFlowControlContextType context)
Checks whether this field declaration includes a field initializer and mutates the context to store this information about the field. |
JVariableDefinition |
variable()
|
| Methods inherited from class org.multijava.mjc.JMemberDeclaration |
genComments, getCClass, getField, getMethod, isDeprecated, javadocComment, setInterface |
| Methods inherited from class org.multijava.mjc.JPhylum |
check, check, check, check, fail, fail, fail, warn, warn, warn, warn |
| Methods inherited from class org.multijava.util.compiler.Phylum |
getTokenReference, setTokenReference |
| 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.multijava.mjc.JMemberDeclarationType |
genComments, getCClass, getField, getMethod, isDeprecated |
| Methods inherited from interface org.multijava.util.compiler.PhylumType |
getTokenReference, setTokenReference |
| Methods inherited from interface org.multijava.javadoc.Annotatable |
javadocComment |
| Field Detail |
protected JVariableDefinition variable
| Constructor Detail |
public JFieldDeclaration(TokenReference where,
JVariableDefinition variable,
JavadocComment javadoc,
JavaStyleComment[] comments)
where - the line of this node in the source codevariable - the variable definitionjavadoc - is this field deprecatedcomments - non-javadoc comments for this field| Method Detail |
public boolean hasInitializer()
hasInitializer in interface JFieldDeclarationTypepublic JExpression getInitializer()
public void setInitializer(JExpression expr)
public CType getType()
getType in interface JFieldDeclarationTypepublic boolean needInitialization()
needInitialization in interface JFieldDeclarationTypepublic JVariableDefinition variable()
variable in interface JFieldDeclarationTypepublic long modifiers()
modifiers in interface JFieldDeclarationTypepublic String ident()
ident in interface JFieldDeclarationType
public CSourceField checkInterface(CClassContextType context)
throws PositionedError
checkInterface in interface JFieldDeclarationTypePositionedError - an error with reference to the source fileprotected CSourceField makeFieldSignature(CClass owner)
owner - the class signature singleton for the logical outer
class of this, or null if this is a top level
declaration
public void typecheck(CFlowControlContextType context)
throws PositionedError
typecheck in interface JFieldDeclarationTypecontext - the context in which this field is declared
PositionedError - if any checks fail public void accept(MjcVisitor p)
accept in interface JMemberDeclarationTypep - the visitorpublic void genCode(CodeSequence code)
genCode in interface JFieldDeclarationTypecode - the code list
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||