B-OCL Wrapper#

OCL Wrapper using the new grammar, visitor, and evaluator.

class bocl.OCLWrapper.OCLWrapper(dm, om)[source]#

Bases: object

Wrapper around the OCL evaluator.

Parameters:
  • dm – Domain model (BUML).

  • om – Object model (BUML).

evaluate(ocl)[source]#

Evaluate an OCL constraint.

Parameters:

ocl – Constraint object with .expression and .context attributes.

Returns:

Boolean result of the constraint evaluation.

Raises:

BOCLSyntaxError – If the OCL expression has syntax errors.