UTJML

edu.utep.cs.utjml.compiler
Class CParseClassContext

java.lang.Object
  extended by org.multijava.mjc.CParseClassContext
      extended by org.jmlspecs.checker.CParseClassContext
          extended by edu.utep.cs.utjml.compiler.CParseClassContext

public class CParseClassContext
extends CParseClassContext

This class is used by the parser to collect the members of a class declaration. For efficiency (and to avoid memory leaks caused by poor garbage collection in the JVM) a factory method is used to generate instances and old instances are store on a stack for reuse. It has the same name as its superclass since ANTLR's textual grammar inheritance will then refer to the right (package-local) class.


Method Summary
 void addCallSequence(JmlCallSequence cseq)
          Adds the given call sequence to the current context.
 JmlCallSequence[] callSequences()
          Returns the call sequences of the current context.
protected  void clear()
          Prepares this instance for recycling by clearing all the data stored in its ArrayLists.
static CParseClassContext getInstance()
          Factory method returns an instance of CParseClassContext.
static void release(CParseClassContext context)
          Erases the data stored in context and pushes the instance onto a stack for recycling.
 
Methods inherited from class org.jmlspecs.checker.CParseClassContext
addAxiom, addConstraint, addInvariant, addRepresentsDecl, addVarAssertion, axioms, constraints, invariants, release, representsDecls, varAssertions
 
Methods inherited from class org.multijava.mjc.CParseClassContext
addBlockInitializer, addFieldDeclaration, addInnerDeclaration, addMethodDeclaration, getFieldsAndInits, getInnerClasses, getMethods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CParseClassContext getInstance()
Factory method returns an instance of CParseClassContext. The instance is recycled from the stack of discarded instances or a new instance is minted if the stack is empty.

Returns:
a fresh CParseClassContext instance

release

public static void release(CParseClassContext context)
Erases the data stored in context and pushes the instance onto a stack for recycling.

Parameters:
context - a used instance to be recycled

clear

protected void clear()
Prepares this instance for recycling by clearing all the data stored in its ArrayLists.

Overrides:
clear in class CParseClassContext

addCallSequence

public void addCallSequence(JmlCallSequence cseq)
Adds the given call sequence to the current context.


callSequences

public JmlCallSequence[] callSequences()
Returns the call sequences of the current context.


UTJML

UTJML is Copyright (C) 2004-2006 by University of Texas at El Paso 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 JML project.