JML

org.multijava.mjc
Interface JFieldDeclarationType

All Superinterfaces:
Annotatable, JMemberDeclarationType, PhylumType
All Known Implementing Classes:
JFieldDeclaration, JmlFieldDeclaration

public interface JFieldDeclarationType
extends JMemberDeclarationType

This type represents a field declaration in the syntax tree.


Method Summary
 CSourceField checkInterface(CClassContextType context)
          Checks the basic interfaces to make sure things generally look OK.
 void genCode(CodeSequence code)
          Generates a sequence of bytecodes
 CType getType()
          Returns the type of this field
 boolean hasInitializer()
          Returns true if this field declarator has an initializer (should be initialized)
 String ident()
          Returns the identifier of this field 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 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 interface org.multijava.mjc.JMemberDeclarationType
accept, 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
 

Method Detail

hasInitializer

public boolean hasInitializer()
Returns true if this field declarator has an initializer (should be initialized)


getType

public CType getType()
Returns the type of this field


needInitialization

public 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


variable

public JVariableDefinition variable()

modifiers

public long modifiers()
Returns the modifiers of this field declaration

Specified by:
modifiers in interface JMemberDeclarationType
Returns:
the modifiers of this declaration

ident

public String ident()
Returns the identifier of this field declaration

Specified by:
ident in interface JMemberDeclarationType
Returns:
the identifier of the object being declared

checkInterface

public CSourceField checkInterface(CClassContextType context)
                                     throws PositionedError
Checks the basic interfaces to make sure things generally look OK. This pass gathers information about the type signatures of everything (imported class files, classes being compiled, methods, fields, etc...) needed for the later passes. This information is stored in a context hierarchy that is bound to the AST.

Throws:
PositionedError - an error with reference to the source file

typecheck

public void typecheck(CFlowControlContextType context)
                        throws PositionedError
Checks whether this field declaration includes a field initializer and mutates the context to store this information about the field. Records the value of a compile-time constant initializer.

Parameters:
context - the context in which this field is declared
Throws:
PositionedError - if any checks fail

genCode

public void genCode(CodeSequence code)
Generates a sequence of bytecodes

Parameters:
code - the code list

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.