Skip to content
Book Open access

B-OCL: An Object Constraint Language Parser and Interpreter

Oct 2026 · Proceedings of the ACM/IEEE 29th International Conference on Model Driven Engineering Languages and Systems · 0 citations · 12 references

Abstract

The Object Constraint Language (OCL) has been widely used in the modeling community to complement software models with precisely defining constraints and business rules for the modeled systems. However, there is a limited number of tools supporting the definition and interpretation of OCL constraints. In this paper, we introduce B-OCL, a fully open source OCL interpreter integrated into BESSER, a low-code software modeling platform. B-OCL interpreter has two main components: a parser and an interpreter. The parser is built using the state-of-the-art ANTLR parser generator and produces a abstract syntax tree (AST) populated with constructs from OCL metamodel. The interpreter traverses this AST to create one or more logical expressions depending upon the constraint, populate them with values from the object model and executes the final expression to determine whether the constraint passes or fails. Beyond interpretation, B-OCL support automated code generation: constraints defined at the model level are translated into executable validation logic for target frameworks. Code generation currently supports only the single-property constraints expressed as binary comparisons; multi-constraint code generation support is planned for roadmap. The interpreter provides syntactic validation through a dedicated “Quality Check” button in the BESSER web modeling editor and programmatically via the Python API. BESSER Web Modeling Editor: https://editor.besser-pearl.org/ GitHub: https://github.com/BESSER-PEARL/B-OCL-Interpreter

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.