[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.ocl] Re: OCL Debugging ?

Hi, Andy,

That depends on what you mean by debugging.  :-)

If the error messages provided by the parser aren't sufficiently clear to
indicate what the cause of a parsing problem is, then please raise bugs.

If you have complex OCL expressions that parse but compute the wrong
results, and you need to find out why, then I'm afraid that there isn't any
debug support at the OCL level of abstraction.  You will have to debug the
Java code evaluating your expression (the evaluation visitor) to see:

  - what the AST looks like; this often can indicate what the problem is
    by seeing how the results of sub-expressions are incorporated into
    the larger expressions

  - what values are actually computed for each sub-expression

One tip that may help is to visualize your OCL expression in the tree-based
editor.  Generate an OCL editor from the OCL.ecore model, save your parsed
OCLExpression in an XMI document, then load it up in the editor.  You can
then browse the AST to see exactly what the parser thinks your expression
meant.

An OCL debug UI would, of course, be very cool.  Would you be interested in
contributing one?

HTH,

Christian


Andreas Maier wrote:

> Is there some way to debug OCL ?
> 
> Andy