Appendix B. OCL Grammar Rules

This appendix describes the grammar for OCL context declarations and expressions. This section is taken from [OCL03], which is the part of the UML 2.0 OMG standard that defines OCL. A free version of the Octopus tool, which implements this grammar, is available from the Klasse Objecten Web site: www.klasse.nl/ocl.

The grammar description uses the EBNF syntax, in which | means a choice, ? means optionality, * means zero or more times, and + means one or more times. In the description, the syntax for lexical tokens is not made explicit. Instead, it is indicated by <String>. This enables developers to use the grammar together with different natural language alphabets.

EBNF Rules for Context Declaration

 _________________________________________________________________ ...

Get Object Constraint Language, The: Getting Your Models Ready for MDA, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.