de.tuberlin.cs.cis.ocl.check
Class ContextChecker

java.lang.Object
  |
  +--de.tuberlin.cs.cis.ocl.check.ContextChecker

public class ContextChecker
extends java.lang.Object

Controls the use of OCL constructs represented by an abstract syntax tree produced by the parser. In contrary to the parser, this examination is not solely based on the syntax, but also on semantics of OCL constraints. Contextual tests of context dependent language features as well as a type check are performed.

Author:
fchabar
See Also:
Fadi Chabarek's diploma thesis, TypeFacade

Constructor Summary
ContextChecker(TypeFacade model)
          Constructs a context checker in the context of a model.
 
Method Summary
 Environment checkContext(de.tuberlin.cs.cis.ocl.parser.node.Start ast)
          Runs a context check on specified OCL constraints in the context of this context checker's model.
 TypeFacade getModel()
          Returns the model the context check is based on.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextChecker

public ContextChecker(TypeFacade model)
Constructs a context checker in the context of a model. Types used in the typecheck either relate to the types defined by the model or predefined in OCL.

Parameters:
model - a model providing types for typechecking purposes.
Method Detail

checkContext

public Environment checkContext(de.tuberlin.cs.cis.ocl.parser.node.Start ast)
                         throws OclContextException
Runs a context check on specified OCL constraints in the context of this context checker's model. Constraints must be parsed to an abstract syntax tree. Types and the use of context dependent language constructs are checked.

Parameters:
ast - the OCL Constraint AST to check.
Returns:
The environment used by the context checker.
Throws:
OclContextException - if the AST is contextual malformed.

getModel

public TypeFacade getModel()
Returns the model the context check is based on.

Returns:
the model the context check is based on.