gov.llnl.babel.symbols
Class Extendable

java.lang.Object
  extended by gov.llnl.babel.symbols.ASTNode
      extended by gov.llnl.babel.symbols.SymbolID
          extended by gov.llnl.babel.symbols.Symbol
              extended by gov.llnl.babel.symbols.Extendable
All Implemented Interfaces:
Attributes, IMetadata, java.lang.Comparable
Direct Known Subclasses:
Class, Interface

public abstract class Extendable
extends Symbol

Class Extendable is a base class for SIDL symbols of type class and interface. It brings together common methods and implementation for both final classes. Class and interfaces have a set of methods and interface inheritance in common. Classes have the additional property that they can be extended by another class; that functionality is not defined here. Many of the member functions take a boolean argument that selects whether the method refers to this particular extendable only or to this extendable and all of its parents in the SIDL inheritance system. Constraints on the validity of methods added to this object must be checked by the parser. Key design goals include providing mechanisms to: - ensure method lookups in O(1) by both long and short names; - ensure fast return of abstract, static, non-static, local, and both local and parent (or all) methods; - ensure original ordering of methods preserved when returning lists;


Field Summary
 
Fields inherited from class gov.llnl.babel.symbols.Symbol
CLASS, d_context, ENUM, INTERFACE, PACKAGE, s_type, SCOPE, STRUCT
 
Fields inherited from class gov.llnl.babel.symbols.ASTNode
d_frozen
 
Constructor Summary
Extendable(SymbolID id, int type, Comment comment, Context context)
          Create an empty Extendable object that will be constructed by calls to other member functions.
Extendable(SymbolID id, int type, Comment comment, Metadata m, Context context)
          Create an empty Extendable object that will be constructed by calls to other member functions.
 
Method Summary
 void addInvariant(Assertion assertion)
          Add the invariant to this object.
 void addMethod(Method method)
          Add the specified new method to this object.
protected  void addParentData(Extendable ext)
          Protected method called by parents to add their relevant information, such as methods, interfaces, references, and arrays to this object.
abstract  void addParentInterface(Interface parent)
          Add a new parent interface to this object.
 void addRenamedMethod(Method newM, Method oldM, SymbolID old_sid)
          For From clauses:Add the specified "new" method to the normal method lists, and the "old" method to the d_renamed_parent_methods HashMap.
 void freeze()
           
 java.util.List getAbstractAndLocalMethods()
          Return all abstract methods and all local methods (both abstract and concreate).
 java.util.List getAbstractMethods()
          Return the abstract methods for this class or interface, which includes all parent classes and interfaces.
 java.util.List getAllInvariants()
          Return the list of all invariants associated with this object as an List, each element of which is in Assertion form.
 java.util.List getAllParentsInOrder()
          Return the parent interfaces and/or classes in hierarchical order from top-most down to direct parents in an List.
 java.util.List getAllPostconditions(java.lang.String longname)
          Return all postconditions associated with the method in this object, if there is one, in an List with each element in Assertion form.
 java.util.List getAllPreconditions(java.lang.String longname)
          Return all preconditions associated with the method in this object, if there is one, in a List with each entry being in Assertion form.
 java.util.Set getAllSymbolReferences()
          Return the Set of all symbol references for this object, each element of which is in SymbolID form.
 java.util.Set getBasicArrayRefs()
          Return the Set of basic array types for this object, each element of the set being in SymbolID form.
 java.util.List getInvariants()
          Return the invariants in this interface as an List, each element of which is in Assertion form.
 java.util.List getMethods(boolean all)
          Return the methods in this interface as a Collection.
 java.util.List getMethodsWithNonblocking(boolean all)
          Return the methods in this interface as a Collection.
 Method getNewMethod(java.lang.String oldM_name)
          For From clauses: Take the FQN of the renamed method and return the new Method.
 java.util.Set getNewMethods()
          For From clauses:Get all the new method objects of all the renamed methods
 java.util.List getNonstaticMethods(boolean all)
          Return the Collection non-static methods in this interface.
 int getNumberAssertions(java.lang.String longname)
          Return the number of assertions associated with the method in this object, if it is present.
 int getNumberInvariants(boolean all)
          Return the number of invariants in this interface.
 int getNumberOfMethods(boolean all)
          Return the number of methods associated with this extendable.
 int getNumberPostconditions(java.lang.String longname)
          Return the number of postconditions associated with the method in this object, if it is present.
 int getNumberPreconditions(java.lang.String longname)
          Return the number of preconditions associated with the method in this object, if it is present.
 java.util.Set getObjectDependencies()
          This function returns the set of symbols that this Extendable is dependent on.
 java.util.Collection getOverloadedMethodsByName(java.lang.String shortName)
          Get all methods with the same short name as the passed in method name.
 Interface getParentInterface(SymbolID id, boolean all)
          Return Interface if this class has the specified parent interface; otherwise, return FALSE.
 java.util.Collection getParentInterfaces(boolean all)
          Return the parent interfaces in a Collection.
 java.util.Collection getParents(boolean all)
          Return the parent interfaces and/or class in a Collection.
 Method getRenamedMethod(Method newM)
          For From clauses:Find the Parent Method Object for a renamed method.
 java.util.Set getRenamedMethods()
          For From clauses:Get all the orginal Method Objects of all the renamed methods
 SymbolID getRenamedMethodSymbolID(Method oldM)
          For From clauses: Get the old old method's enclosing symbolID.
 java.util.List getStaticMethods(boolean all)
          Return the static methods in this interface as a Collection.
 java.util.Set getSymbolReferences()
          Return the Set of symbol references for this object, each element of which is in SymbolID form.
 boolean hasAncestor(Extendable ext)
          Return TRUE if this object implements or extends the specified Extendable directly or indirectly.
 boolean hasAssertions()
          Return TRUE if the extendable has any assertions; otherwise, return FALSE.
 boolean hasExceptionThrowingMethod(boolean all)
          Return TRUE if any of the methods throws an exception; otherwise, return FALSE.
 boolean hasInvariants(boolean all)
          Return TRUE if the extendable has any invariants; otherwise, return FALSE.
 boolean hasMethodByLongName(java.lang.String name, boolean all)
          Return TRUE if the specified method exists by long name; otherwise, return FALSE.
 boolean hasMethodByShortName(java.lang.String name, boolean all)
          Return TRUE if the specified method exists by short name; otherwise, return FALSE.
 boolean hasParentInterface(SymbolID id, boolean all)
          Return TRUE if this class has the specified parent interface; otherwise, return FALSE.
 boolean hasParentInterfaces()
          Return true if this extendable inherts from interfaces.
 boolean hasReservedMethodAssertion(int type)
          Returns true if the specified reserved method call is present in any of the assertions; otherwise, returns false.
abstract  boolean hasStaticMethod(boolean all)
          Return TRUE if any of the methods are static methods; otherwise, return FALSE.
abstract  boolean isAbstract()
          Return TRUE if this object contains any abstract methods; otherwise, return FALSE.
abstract  boolean isInterface()
          Return TRUE if this object represents an interface, FALSE if it is a class.
 boolean isLocal(Method m)
          Return true if and only if the method given is locally defined in this extendable.
 Method lookupMethodByLongName(java.lang.String name, boolean all)
          Return the Method with the specified long method name.
 java.util.Collection lookupMethodByShortName(java.lang.String name, boolean all)
          Return the Collection of methods, each in Method form, that are found to have the specified short method name, if any.
 boolean methodWasRenamed(Method newM)
          For From clauses:Check a parent has a different name for this method.
 void validateAssertions(boolean all, boolean skip)
          Validate assertions associated with this object.
 void validateInvariants(boolean all, boolean skip)
          Validate the invariants associated with this object.
 void validatePostconditions(boolean all, boolean skip)
          Validate postconditions associated with this object.
 void validatePostconditions(Method meth, boolean all, boolean skip)
          Validate the postconditions associated with this object and the specified method.
 void validatePostconditions(java.lang.String longname, boolean all, boolean skip)
          Validate the postconditions associated with this object and the specified method.
 void validatePreconditions(boolean all, boolean skip)
          Validate the preconditions associated with this object.
 void validatePreconditions(Method meth, boolean all, boolean skip)
          Validate the preconditions associated with this object and the specified method.
 void validatePreconditions(java.lang.String longname, boolean all, boolean skip)
          Validate the preconditions associated with this object and the specified method.
 
Methods inherited from class gov.llnl.babel.symbols.Symbol
addMetadata, getAttribute, getAttributes, getComment, getDepth, getMetadata, getSymbolID, getSymbolType, getSymbolTypeString, getUserSpecified, hasAttribute, isClass, isPackage, isStruct, minimumDepth, removeAttribute, setAttribute, setAttribute, setComment, setUserSpecified
 
Methods inherited from class gov.llnl.babel.symbols.SymbolID
compareTo, equals, fromXML, getFullName, getShortName, getShortName, getSymbolName, getVersion, hashCode, setFromXML
 
Methods inherited from class gov.llnl.babel.symbols.ASTNode
checkFrozen, clone, protectCollection, protectList, protectMap, protectSet
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

Extendable

public Extendable(SymbolID id,
                  int type,
                  Comment comment,
                  Context context)
Create an empty Extendable object that will be constructed by calls to other member functions.

Parameters:
id - The symbol id of the new object
type - The value of the type of the new object
comment - The comment associated with the object

Extendable

public Extendable(SymbolID id,
                  int type,
                  Comment comment,
                  Metadata m,
                  Context context)
Create an empty Extendable object that will be constructed by calls to other member functions.

Parameters:
id - The symbol id of the new object
type - The value of the type of the new object
comment - The comment associated with the object
m - Object metadata
Method Detail

isAbstract

public abstract boolean isAbstract()
Return TRUE if this object contains any abstract methods; otherwise, return FALSE. A class is abstract if and only if it has any abstract methods. An interface must always be abstract, even if it contains no methods.


isInterface

public abstract boolean isInterface()
Return TRUE if this object represents an interface, FALSE if it is a class.

Overrides:
isInterface in class Symbol

addMethod

public void addMethod(Method method)
Add the specified new method to this object. No checking is done whether this method is valid for this particular extendable. The new method will over-write any existing method unless the new method is abstract. The references and arrays will also be cached in this object.

Parameters:
method - The method to be added to this object

addRenamedMethod

public void addRenamedMethod(Method newM,
                             Method oldM,
                             SymbolID old_sid)
For From clauses:Add the specified "new" method to the normal method lists, and the "old" method to the d_renamed_parent_methods HashMap. newM and oldM are assumed to have the same signatures and only differ by name.


getRenamedMethod

public Method getRenamedMethod(Method newM)
For From clauses:Find the Parent Method Object for a renamed method.


getRenamedMethods

public java.util.Set getRenamedMethods()
For From clauses:Get all the orginal Method Objects of all the renamed methods


getNewMethods

public java.util.Set getNewMethods()
For From clauses:Get all the new method objects of all the renamed methods


methodWasRenamed

public boolean methodWasRenamed(Method newM)
For From clauses:Check a parent has a different name for this method.


getRenamedMethodSymbolID

public SymbolID getRenamedMethodSymbolID(Method oldM)
For From clauses: Get the old old method's enclosing symbolID.


getNewMethod

public Method getNewMethod(java.lang.String oldM_name)
For From clauses: Take the FQN of the renamed method and return the new Method.


getNumberOfMethods

public int getNumberOfMethods(boolean all)
Return the number of methods associated with this extendable.

Parameters:
all - If TRUE, then return the number of local and parent methods; otherwise, return the number of local methods only.

getMethods

public java.util.List getMethods(boolean all)
Return the methods in this interface as a Collection. Each element in the collection is of type Method.

Parameters:
all - If TRUE, then return local and parent methods; otherwise, return only local methods.

getMethodsWithNonblocking

public java.util.List getMethodsWithNonblocking(boolean all)
                                         throws CodeGenerationException
Return the methods in this interface as a Collection. Each element in the collection is of type Method. This list includes methods NONBLOCKING_SEND and NONBLOCKING_RECV methods spawned in response to NONBLOCKING methods.

Parameters:
all - If TRUE, then return local and parent methods; otherwise, return only local methods.
Throws:
CodeGenerationException

getNonstaticMethods

public java.util.List getNonstaticMethods(boolean all)
Return the Collection non-static methods in this interface. Each element in the collection is of type Method.

Parameters:
all - If TRUE, then return local and parent non-static methods; otherwise, return only local non-static methods.

getStaticMethods

public java.util.List getStaticMethods(boolean all)
Return the static methods in this interface as a Collection. Each element in the collection is of type Method.

Parameters:
all - If TRUE, then return local and parent static methods; otherwise, return only local static methods.

getAbstractMethods

public java.util.List getAbstractMethods()
Return the abstract methods for this class or interface, which includes all parent classes and interfaces. Each element in the collection is of type Method.


getAbstractAndLocalMethods

public java.util.List getAbstractAndLocalMethods()
Return all abstract methods and all local methods (both abstract and concreate). This is a special case for Java abstract classes, although maybe it will be useful elsewhere.


isLocal

public boolean isLocal(Method m)
Return true if and only if the method given is locally defined in this extendable.

Parameters:
m - The method of interest.
Returns:
true if m is locally defined in this Extendable.

lookupMethodByLongName

public Method lookupMethodByLongName(java.lang.String name,
                                     boolean all)
Return the Method with the specified long method name. If there is none, return null.

Parameters:
name - The short method name for the method to be located.
all - If TRUE then all local and parent methods are to be searched; otherwise, only local methods are to be searched.

lookupMethodByShortName

public java.util.Collection lookupMethodByShortName(java.lang.String name,
                                                    boolean all)
Return the Collection of methods, each in Method form, that are found to have the specified short method name, if any. If none are found, then return null.

Parameters:
name - The short method name for the method to be located.
all - If TRUE then all local and parent methods are to be searched; otherwise, only local methods are to be searched.

hasMethodByLongName

public boolean hasMethodByLongName(java.lang.String name,
                                   boolean all)
Return TRUE if the specified method exists by long name; otherwise, return FALSE.

Parameters:
name - The long method name for the method to be located.
all - If TRUE then all local and parent methods are to be searched; otherwise, only local methods are to be searched.

hasMethodByShortName

public boolean hasMethodByShortName(java.lang.String name,
                                    boolean all)
Return TRUE if the specified method exists by short name; otherwise, return FALSE. Recall there may be multiple methods with the same short name but here we only care if there is at least one.

Parameters:
name - The short method name to be located
all - If TRUE, then all local and parent methods are to be searched; otherwise, only local methods are to be searched

hasStaticMethod

public abstract boolean hasStaticMethod(boolean all)
Return TRUE if any of the methods are static methods; otherwise, return FALSE.

Parameters:
all - If TRUE, then local and parent methods are to be searched; otherwise, only local methods are to be searched.

hasExceptionThrowingMethod

public boolean hasExceptionThrowingMethod(boolean all)
Return TRUE if any of the methods throws an exception; otherwise, return FALSE.

Parameters:
all - If TRUE, then local and parent methods are to be searched; otherwise, only local methods are to be searched.

addParentInterface

public abstract void addParentInterface(Interface parent)
Add a new parent interface to this object. This method will be implemented by the Class and Interface subclasses.

Parameters:
parent - The parent interface to be added to this object.

hasParentInterfaces

public boolean hasParentInterfaces()
Return true if this extendable inherts from interfaces. BaseInterface does not count for this test.


getParentInterfaces

public java.util.Collection getParentInterfaces(boolean all)
Return the parent interfaces in a Collection. Each member of the collection is an Interface.

Parameters:
all - If TRUE, then all parents are to be returned; otherwise, only direct parents are to be returned.

getAllParentsInOrder

public java.util.List getAllParentsInOrder()
                                    throws CodeGenerationException
Return the parent interfaces and/or classes in hierarchical order from top-most down to direct parents in an List. Each member of the list is an Extendable and there are NO duplicates. Does a DFS to return ancestors in "reverse" topolgical order. by Jim Leek

Throws:
CodeGenerationException

getParents

public java.util.Collection getParents(boolean all)
Return the parent interfaces and/or class in a Collection. Each member of the collection is an Extendable. No duplicate entries are returned in the collection.

Parameters:
all - If TRUE, all ancestors are to be returned; otherwise, only direct parents.

hasAncestor

public boolean hasAncestor(Extendable ext)
Return TRUE if this object implements or extends the specified Extendable directly or indirectly. Otherwise, return FALSE.

Parameters:
ext - The potential ancestor

hasParentInterface

public boolean hasParentInterface(SymbolID id,
                                  boolean all)
Return TRUE if this class has the specified parent interface; otherwise, return FALSE.

Parameters:
id - The parent interface to be located
all - Indicator of whether all parents (TRUE) or only direct parents (FALSE) are to be searched

getParentInterface

public Interface getParentInterface(SymbolID id,
                                    boolean all)
Return Interface if this class has the specified parent interface; otherwise, return FALSE.

Parameters:
id - The parent interface to be located
all - Indicator of whether all parents (TRUE) or only direct parents (FALSE) are to be searched

getSymbolReferences

public java.util.Set getSymbolReferences()
Return the Set of symbol references for this object, each element of which is in SymbolID form. These are defined as all references for this object as well as its parents. The set of references includes this symbol name.

Specified by:
getSymbolReferences in class Symbol

getAllSymbolReferences

public java.util.Set getAllSymbolReferences()
Return the Set of all symbol references for this object, each element of which is in SymbolID form. Note the references include those from this object's parents.

Specified by:
getAllSymbolReferences in class Symbol

getBasicArrayRefs

public java.util.Set getBasicArrayRefs()
Return the Set of basic array types for this object, each element of the set being in SymbolID form.

Specified by:
getBasicArrayRefs in class Symbol

addParentData

protected void addParentData(Extendable ext)
Protected method called by parents to add their relevant information, such as methods, interfaces, references, and arrays to this object.

Parameters:
ext - The parent whose methods and related information are to be added

getOverloadedMethodsByName

public java.util.Collection getOverloadedMethodsByName(java.lang.String shortName)
Get all methods with the same short name as the passed in method name. (This list includes the passed in method, so the collection has a minimum size of 1) This is necessary for F90 method overloading


addInvariant

public void addInvariant(Assertion assertion)
                  throws AssertionException
Add the invariant to this object. Assumptions: 1) The constraints on the assertion are being enforced elsewhere. 2) Only invariants local to this extendable are going to be added!

Parameters:
assertion - The invariant assertion to be added
Throws:
AssertionException - The exception raised if the assertion cannot be added.

hasInvariants

public boolean hasInvariants(boolean all)
                      throws CodeGenerationException
Return TRUE if the extendable has any invariants; otherwise, return FALSE.

Parameters:
all - If TRUE then check inherited and local; otherwise, check only local invariants.
Throws:
CodeGenerationException

getNumberInvariants

public int getNumberInvariants(boolean all)
                        throws CodeGenerationException
Return the number of invariants in this interface.

Parameters:
all - If TRUE then return the number of inherited and local invariants; otherwise, return only the number of local ones.
Throws:
CodeGenerationException

getInvariants

public java.util.List getInvariants()
Return the invariants in this interface as an List, each element of which is in Assertion form.


getAllInvariants

public java.util.List getAllInvariants()
                                throws CodeGenerationException
Return the list of all invariants associated with this object as an List, each element of which is in Assertion form.

Throws:
CodeGenerationException

validateInvariants

public void validateInvariants(boolean all,
                               boolean skip)
                        throws AssertionException,
                               CodeGenerationException
Validate the invariants associated with this object.

Parameters:
all - If TRUE then all invariants are to be validated; otherwise, will only validate the local invariants.
skip - If TRUE then will skip the validation process if the expression has already been marked as valid.
Throws:
AssertionException - The exception raised if errors are detected.
CodeGenerationException

hasAssertions

public boolean hasAssertions()
                      throws CodeGenerationException
Return TRUE if the extendable has any assertions; otherwise, return FALSE.

Throws:
CodeGenerationException

getNumberAssertions

public int getNumberAssertions(java.lang.String longname)
                        throws CodeGenerationException
Return the number of assertions associated with the method in this object, if it is present. Will return an 0 if there is no such method in this object's hierarchy or if there are no assertions. Since the invariants are invoked along with the preconditions and again with the postconditions, their number counts twice.

Parameters:
longname - The long name of the method the number of whose assertions is to be returned.
Throws:
CodeGenerationException

getNumberPreconditions

public int getNumberPreconditions(java.lang.String longname)
                           throws CodeGenerationException
Return the number of preconditions associated with the method in this object, if it is present. Will return an 0 if there is no such method in this object's hierarchy or if there are no preconditions.

Parameters:
longname - The long name of the method the number of whose preconditions is to be returned.
Throws:
CodeGenerationException

getAllPreconditions

public java.util.List getAllPreconditions(java.lang.String longname)
                                   throws CodeGenerationException
Return all preconditions associated with the method in this object, if there is one, in a List with each entry being in Assertion form. Will return an empty list if no such method is in this object's hierarchy. WARNING: There is no attempt at this point to optimize the preconditions. That is, duplicate preconditions are NOT removed.

Parameters:
longname - The long name of the method whose preconditions are to be returnede
Throws:
CodeGenerationException

validatePreconditions

public void validatePreconditions(Method meth,
                                  boolean all,
                                  boolean skip)
                           throws AssertionException,
                                  CodeGenerationException
Validate the preconditions associated with this object and the specified method. By virtue of using getAllPreconditions(), it starts with the top-most inherited preconditions and proceeds "down" the inheritance hierarchy to the level of this class.

Parameters:
meth - The method whose preconditions are to be validated.
all - If TRUE then will validate all preconditions; otherwise, will validate only the locally defined preconditions.
skip - If TRUE then will skip the validation process if the expression has already been marked as valid.
Throws:
AssertionException - The exception raised if errors are detected.
CodeGenerationException

validatePreconditions

public void validatePreconditions(java.lang.String longname,
                                  boolean all,
                                  boolean skip)
                           throws AssertionException,
                                  CodeGenerationException
Validate the preconditions associated with this object and the specified method.

Parameters:
longname - The long name of the method whose preconditions are to be validated.
all - If TRUE then will validate all preconditions; otherwise, will validate only the locally defined preconditions.
skip - If TRUE then will skip the validation process if the expression has already been marked as valid.
Throws:
AssertionException - The exception raised if errors are detected.
CodeGenerationException

validatePreconditions

public void validatePreconditions(boolean all,
                                  boolean skip)
                           throws AssertionException,
                                  CodeGenerationException
Validate the preconditions associated with this object.

Parameters:
skip - If TRUE then will skip the validation process if the expression has already been marked as valid.
all - If TRUE then will validate all preconditions; otherwise, will validate only the locally defined preconditions.
Throws:
AssertionException - The exception raised if errors are detected.
CodeGenerationException

getNumberPostconditions

public int getNumberPostconditions(java.lang.String longname)
                            throws CodeGenerationException
Return the number of postconditions associated with the method in this object, if it is present. Will return an 0 if there is no such method in this object's hierarchy or if there are no postconditions.

Parameters:
longname - The long name of the method the number of whose postconditions is to be returned.
Throws:
CodeGenerationException

getAllPostconditions

public java.util.List getAllPostconditions(java.lang.String longname)
                                    throws CodeGenerationException
Return all postconditions associated with the method in this object, if there is one, in an List with each element in Assertion form. Will return an empty list if no such method in this object's hierarchy. WARNING: There is no attempt at this point to optimize the postconditions. That is, duplicate postconditions are NOT removed.

Parameters:
longname - The long name of the method whose postconditions are to be returned.
Throws:
CodeGenerationException

validatePostconditions

public void validatePostconditions(Method meth,
                                   boolean all,
                                   boolean skip)
                            throws AssertionException,
                                   CodeGenerationException
Validate the postconditions associated with this object and the specified method. By virtue of using getAllPostconditions(), it starts with the top-most inherited postconditions and proceeds "down" the inheritance hierarchy to the level of this class.

Parameters:
meth - The method whose postconditions are to be validated.
all - If TRUE then all postconditions of the method will be validated; otherwise, only the locally defined ones will.
skip - If TRUE then will skip the validation process if the expression has already been marked as valid.
Throws:
AssertionException - The exception raised if errors are detected.
CodeGenerationException

getObjectDependencies

public java.util.Set getObjectDependencies()
                                    throws CodeGenerationException
This function returns the set of symbols that this Extendable is dependent on. It should include any classes or interfaces that are passed by any method in the Extendable, but no enums, and no self.

Throws:
CodeGenerationException

validatePostconditions

public void validatePostconditions(java.lang.String longname,
                                   boolean all,
                                   boolean skip)
                            throws AssertionException,
                                   CodeGenerationException
Validate the postconditions associated with this object and the specified method.

Parameters:
longname - The long name of the method whose postconditions are to be validated.
all - If TRUE then all postconditions of the method will be validated; otherwise, only the locally defined ones will.
skip - If TRUE then will skip the validation process if the expression has already been marked as valid.
Throws:
AssertionException - The exception raised if errors are detected.
CodeGenerationException

validatePostconditions

public void validatePostconditions(boolean all,
                                   boolean skip)
                            throws AssertionException,
                                   CodeGenerationException
Validate postconditions associated with this object.

Parameters:
skip - If TRUE then will skip the validation process if the expression has already been marked as valid.
all - If TRUE then all postconditions of the method will be validated; otherwise, only the locally defined ones will.
Throws:
AssertionException - The exception raised if errors are detected.
CodeGenerationException

validateAssertions

public void validateAssertions(boolean all,
                               boolean skip)
                        throws AssertionException,
                               CodeGenerationException
Validate assertions associated with this object. That is, validate all invariants as well as any pre- and post- conditions associated with any methods.

Parameters:
skip - If TRUE then will skip the validation process if the expression has already been marked as valid.
all - If TRUE then all assertions including those for all associated methods will be validated; otherwise, only validate the locally defined ones.
Throws:
AssertionException - The exception raised if errors are detected.
CodeGenerationException

hasReservedMethodAssertion

public boolean hasReservedMethodAssertion(int type)
                                   throws CodeGenerationException
Returns true if the specified reserved method call is present in any of the assertions; otherwise, returns false.

Throws:
CodeGenerationException

freeze

public void freeze()
Overrides:
freeze in class Symbol